How to map CAPS LOCK key in VIM?

Evgenyt picture Evgenyt · Feb 1, 2010 · Viewed 69.5k times · Source

I'm using GVIM under Windows. And want to map CAPSLOCK to Ctrl+^

Any way to do this?

Btw, I see tons of samples over the web how to swap CAPS and Esc using registry hack, but none of them use VIM map command, instead external tools and registry changes.

Answer

Dan Andreatta picture Dan Andreatta · Feb 1, 2010

Linux? With X, use xmodmap to alter the key mapping, e.g.

xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape'

Will map Esc to the CapsLock key. Google for more examples.