How to swap the Escape key with Capslock in Ubuntu

Make a powerful key more accessible.



vim ubuntu

Jump to the way of doing this

But why?

If you’ve started or have been using VIM for some while now, you know that the Escape key has significant value.

Staying in the home row, also has significant value, so swapping the Escape key with Capslock is the natural thing to do.

The Capslock key is more accessible, so you don’t have to move your whole hand just to press Escape. You can simply use your pinky finger.

Swapping vs remapping

We’re swapping the Escape and Capslock key, meaning that if you want to press Escape, you’ll now have to press Caps and vice-versa. I’ve seen tutorials that remap the Escape key, leaving you with no Caps key, so this method just seemed easier.

The way

We’re going to use the dconf command to swap the two keys.

Simply run this command in your terminal:

dconf write /org/gnome/desktop/input-sources/xkb-options "['caps:swapescape']"

Special note: I found the way of doing this in this comment on this tutorial on how to remap Capslock to Escape.

Meta Photo by Charles Deluvio on Unsplash

Published by

comments powered by Disqus