Sunday, October 7, 2012

Map Windows (aka Super) key to Escape

Did you know I have mapped Caps Lock on my computer to open a new browser tab?  Only today I figured my Vim sessions can be a lot better if I mapped ‘Windows’ key (aka Super key) to Escape.  It can be done by adding a single line to your ~/.Xmodmap file:
! Map left Windows key to Escape.
keysym Super_L = Escape
(Okay, that was two lines, but a little comment in obscure configuration files can be very helpful.)

Also, if you don’t feel like logging out and logging back in after these changes (or if you want to try the change before touching your config file), you can run this on a terminal to have the keybinding take effect immediately:
xmodmap -e 'keysym Super_L = Escape'

No comments:

Post a Comment