tags:

views:

190

answers:

2
+1  Q: 

vim mapping ctrl-;

In my case the move-right button is ;
I want ctrl-; to move the cursor 7 characters to the right.

the below .vimrc mapping doesn't work:
nmap <c-;> 7;

what's wrong?

+3  A: 

I am not sure, but it might be because <C-;> does not map to an ASCII character. Only @, A-Z, [, \, ], ^ and _ map to ASCII characters (0 through 31 respectively) when combined with CTRL.

EDIT

I did some searching and found this thread. In it, it is said that gvim.exe works the way I suggest: only use valid control characters, no other. Interestingly vim.exe works differently and you can do the mapping you want.

Peter van der Heijden
+2  A: 

Like previous comment says, it seems that ";" cannot be in the form <C-;>.

You can test typing Ctrl-V then a key sequence.

Ctrl-V + ";" gives only ; whereas Ctrl-V + "L" give ^L.

So I suppose that vim cannot recognize <C-;>.

You have some more informations on key codes help pages :

:help keycodes
:help <C-
Drasill

related questions