Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I map Ctrl-TAB to something in Vim?

Tags:

vim

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?

like image 824
Ethan Avatar asked Oct 29 '09 21:10

Ethan


People also ask

How do I navigate tabs in Vim?

vimrc provides for a very convenient way to move between tabs. When in insert mode, press [Esc] to get to command mode, then use [Ctrl]+T plus a directional arrow to go to the tab you want: up to go to the first tab, down to the last, and left or right to go to the previous or next tab.

How do you Ctrl Shift in Vim?

Xresources for xterm to send <Esc>[65;5u for Ctrl Shift A . You can then map that in Vim to <C-S-a> . (65 is the decimal Unicode value for shift-a and 5 is the bit for the ctrl modifier. The u in this case stands for "unicode".)

How do I create a new tab in Vim?

to open a file in a new tab. From the terminal, you can do vim -p filename1 filename2 to open the two files in tabs.

How do I Unmap a key in Vim?

On vim , command-mode keys can be mapped through the ex command :map <key> <macro> and insert-mode keys can be mapped through :map! <key> <macro> . After mapped, the commands to remove the mapping from the command-mode keys and insert-mode keys are unmap <key> and unmap!


2 Answers

It can be mapped in gvim, but terminals don't see a difference between <Tab> and <C-Tab>.

like image 147
jamessan Avatar answered Sep 20 '22 19:09

jamessan


You can't. Tab is already a control key, <C-i>.

like image 31
a paid nerd Avatar answered Sep 17 '22 19:09

a paid nerd