TheBlackzone Logo

Remap CAPS LOCK key to become ESCAPE in Ubuntu

Posted on Tuesday, June 23 2015

This is just a quick tip on how to remap your CAPS LOCK key to ESCAPE. I use this setting for my Vim sessions in order to have comfortable access to ESCAPE while my fingers rest on the keyboard's home row.

There are several ways to remap keys in a desktop session. I use the command setxkbmap for this purpose (see man setxkbmap for more information).

The command

setxkbmap -option caps:escape

makes your CAPS LOCK key function as ESCAPE key. To turn the mapping off again just issue the command

setxkbmap -option

And in order to make the mapping permanent, run it as a session startup command which can be configured as follows:

If you use Vim a lot you will rapidly get used to this very comfortable setup.

Tags: vim