How to remap CAPSLOCK to ESC in Linux Mint 12

I would like to remap the CAPSLOCK key to ESC as this is easier to use in Vim. I can make it in Ubuntu 11.04 as there's an option for this in Keyborad configuration. But recently I switched to use Linux Mint and found that there's no such option.

I don't know whether it is the gnome3 that makes this happen, as there are only some basic features to customize.

Hoping someone can help me remap the key, thanks in advance.

found this article, but the options are not found in Mint 12


Solution 1:

  1. Open the menu
  2. Open System ToolsSystem Settings
  3. Select Keyboard Layouts
  4. Select Options
  5. Select Caps Lock key behavior
  6. Select Make Caps Lock an additional ESC
  7. Close all of the windows and have yourself a nice cuppa, you are done!

Solution 2:

Put this in your ~/.Xmodmap file:

remove Lock = Caps_Lock
remove Control = Escape
keysym Escape = Caps_Lock
keysym Caps_Lock = Escape
add Lock = Caps_Lock
add Control = Escape

and then run xmodmap ~/.Xmodmap to make the changes effective immediately. Otherwise the next time you log in the changes will be effective.

Solution 3:

You can use xmodmap for this. Instructions are for example on the Vim Wiki.