DEV Community

loading...
Cover image for Change Caps Lock to Ctrl

Change Caps Lock to Ctrl

Talles L
A Brazilian software developer 🇧🇷 that loves to play video-games 🎮, tries it best to be active on GitHub 💻, and sometimes writes here on DEV 📄
・1 min read

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.

Discussion (0)