Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to map <C-;> to : in vim?

Tags:

vim

I use capslock as control so it is more natural to use as : but noremap <C-;> : does not work. Is it possible to do such mapping in vim?

like image 856
Sławosz Avatar asked Oct 04 '11 18:10

Sławosz


People also ask

What does C mean vim?

In Vim (and Emacs) documentation, C- and M- stand for Ctrl and Meta (i.e. Alt ) respectively.

What is C left in Vim?

In vim, control-left and control-right are back and forward whitespace-separated word (i.e. synonyms for B and W), the same as web textareas and bash . But when running screen , these keys stop working. When pressed, vim instead switches to its command line and enters 5C or 5D there.


1 Answers

From Vim FAQ (also available through this nice plugin):

20.4. I am not able to create a mapping for the <xxx> key. What is wrong?

1) First make sure, the key is passed correctly to Vim. To determine if
   this is the case, put Vim in Insert mode and then hit Ctrl-V (or
   Ctrl-Q if your Ctrl-V is remapped to the paste operation (e.g. on
   Windows if you are using the mswin.vim script file) followed by your
   key.

   If nothing appears in the buffer (and assuming that you have
   'showcmd' on, ^V remains displayed near the bottom right of the Vim
   screen), then Vim doesn't get your key correctly and there is nothing
   to be done, other than selecting a different key for your mapping or
   using GVim, which should recognise the key correctly.

Trying the above with <C-;> shows that it is not captured by vim/gvim...

like image 149
mMontu Avatar answered Oct 19 '22 16:10

mMontu