Remap CAPS LOCK key to become ESCAPE in Ubuntu
Posted on Tuesday, June 23, 2015 by TheBlackzone
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:
- Open a Terminal or press ALT+F2 and type
gnome-session-properties
- The "Startup Applications Preference" dialog opens, there, click "Add"
- An empty "Add Startup Program" dialog opens
- In the "Name" field enter "Remap CAPSLOCK to ESCAPE"
- In the "Command" field enter
setxkbmap -option caps:escape
- Click "Add" and closed the dialog window.
If you use Vim a lot you will rapidly get used to this very comfortable setup.
Tags: vim