DEV Community

Cover image for Change Caps Lock to Ctrl
Talles L
Talles L

Posted on

Change Caps Lock to Ctrl

One of the companies that I've worked at in the past had their development environment based on Emacs (due an esoteric language).

To avoid Emacs pinky, I've learned to set the Caps Lock key as Ctrl. Even though I don't have to use Emacs anymore, using Caps Lock as Ctrl still a must to me.

On Linux, edit:

sudo vi /etc/default/keyboard
Enter fullscreen mode Exit fullscreen mode

For swapping the Caps Lock with Ctrl, change to:

XKBOPTIONS="ctrl:swapcaps"
Enter fullscreen mode Exit fullscreen mode

For just changing Caps Lock (and not the Ctrl key):

XKBOPTIONS="ctrl:nocaps"
Enter fullscreen mode Exit fullscreen mode

To apply the new configuration:

sudo dpkg-reconfigure keyboard-configuration
Enter fullscreen mode Exit fullscreen mode

You may have to logout and login again depending on your distribution.

Top comments (0)