Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mapping a default key binding in vim

I want to remap Ctrl-] which is used for jumping to the tags to another key binding.

These mappings work:

:map <F2> <C-]>
:map <A-1> <C-]>

But this mapping doesn't work:

:map <C-1> <C-]>

What might be the reason for this?

like image 868
Mert Nuhoglu Avatar asked Dec 08 '25 10:12

Mert Nuhoglu


1 Answers

I believe the problem is that Ctrl+1 is not a valid ASCII character. From this list

(search for "^^" or "^@" to see the table )

you will see that there are several keybindings such as ctrl+@ Ctrl+^ and Ctrl+]

so you are not actually calling Ctrl+2 or Ctrl+6 but their ASCII equivalents.

VIM is designed to be lightweight and fairly platform independent. so if it isn't in the list of ASCII characters you cannot make a binding to it.

like image 140
gruntled Avatar answered Dec 10 '25 09:12

gruntled



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!