Map Capslock to Escape on Linux

If you do VIM you may want to remap your escape key to capslock. I personally never use capslock but it is easier to reach than ESC.

X Keyboard Extension

If you use X11/Xorg you should have XKeyboard installed. This gives you access to the setxkbmap program.


setxkbmap -option caps:escape

Note: setxkbmap only sets the current xorg session.

If you want it to set on starting xorg (startx) then you should put it in your startup scripts for xorg.

# Map capslock key to escape
setxkbmap -option caps:escape