Question

I want to remap the ^ key to <Esc> in VIM since it is easier to reach on a german keyboard. As far as I understand there is no keycode for the ^ key and I have to use the termcap notation:

inoremap <t_*> <Esc>     " remap ^ to ESC
inoremap <C-t_*> <t_*>   " map CTRL-^ to the plain ^ (insert a '^' char)

But I could not find the termcap code for the circumlflex ^. Does anybody know a complete list of termcap codes for typical terminals. I want this solution to work for gvim in Ubuntu and Windows.

Edit: inoremap ^ <Esc> in Linux works partially. You have to press ^^. It only works perfectly if you use a non-dead-key layout. inoremap <C-^> ^ also does work fine with a non-dead-key layout but does not work at all with the default layout.

Solution: Use a keyboard layout that does not mute the ^ key and use the ^ (aka. circumflex or caret) as a std. ASCII character in your ~/.vimrc.

See superuser.com/questions/280005, how to disable dead keys in Windows. Thx Jens for the link.

Thx, Juve

Was it helpful?

Solution

The caret ^ is a regular ASCII character; it stands for itself and does not produce any termcap/terminfo sequence, so what you attempt with <t_*> is futile. Try to find out how to turn off dead keys on windows and you're done with ib's solution.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top