How to map a menu key ("application key") to an Escape key in vim?

I think using a menu key to exit vim insert mode would be great. It would be nice to also use Super key for this, but I'm not sure if this is possible, since Super key is a modifier.

In any case, I could not find anything like it. Seek your help and thanks in advance!

+3
vim escaping map key menu
Nov 24 '10 at 20:55
source share
2 answers

I don’t think you can configure Vim to pay attention to the Menu key as such, but depending on your system there are various ways to turn the Menu key into an Escape key.

If you are using X11 on Linux:

  • The xmodmap -e 'keycode 135 = Escape' command will turn your menu key into an Escape key for the current session, but is not constant. To make it permanent in Gnome, you can try adding it to System β†’ Preferences β†’ Launch Applications.
  • xkeycaps will provide you with a graphical interface for similar remapping.

For more information:

http://46dogs.blogspot.com/2008/05/remap-keys-in-ubuntu-804-hardy-heron.html

http://ubuntuforums.org/archive/index.php/t-106209.html

+3
Nov 24 '10 at
source share

Try using ctrl + [ instead of binding another key. This combination is standard in vim, btw.

This is even easier when bouncing capslock into an additional ctrl .

0
Jul 10 '12 at 10:50
source share



All Articles