I'd like to map Ctrl-TAB to gt in Vim so that I can switch tabs with one keystroke.
I tried...
nmap <C-T> gt
nmap <C-Tab> gt
nmap <C-TAB> gt
That didn't work. How do you say "the tab key" in Vimese?
I'd like to map Ctrl-TAB to gt in Vim so that I can switch tabs with one keystroke.
I tried...
nmap <C-T> gt
nmap <C-Tab> gt
nmap <C-TAB> gt
That didn't work. How do you say "the tab key" in Vimese?
I use the mintty terminal in cygwin. This terminal has an option of using ctrl-tab to cycle between the various instances of cygwing or alternatively, you can use to go to the next or previous screen window (so ctrl-tab does the same as ctrl-a+n and s-ctrl-tab does the same as ctrl-a+p. This last behavior is very convenient in my opinion.
Check
First, disable the Switch window option in Options > Keys. Then you can use the following maps.
Note: you cannot simply copy and paste these into your .vimrc. Instead, where ^[[1;6I is, you need to press Ctrl-V while in insert mode and then type Ctrl-Shift-Tab. The same goes for ^[[1;5I and Ctrl-Tab.
nnoremap ^[[1;6I :tabprevious<CR>
nnoremap ^[[1;5I :tabnext<CR>
inoremap ^[[1;6I <Esc>:tabprevious<CR>
inoremap ^[[1;5I <Esc>:tabnext<CR>
I got this working with Konsole 19.12.3. Here's how:
Backtab+Ctrl+Ansi (or probably just Backtab+Ctrl-Ansi if you have a non-ANSI keyboard) to \E[27;6;9~. Use the test area to confirm that the binding is working; it should echo the sequence above. Delete any binding that conflicts with it.Tab+Ctrl+Ansi (or non-ANSI equivalent) to \E[27;5;9~.nnoremap <C-Tab> :tabn<CR> and nnoremap <C-S-Tab> :tabp<CR>