Caps Lock key serves mainly as a source of annoyance, and receives far too much real estate relative to its use.
Esc key is quite useful (I’m primarily a Vim user), but is far too hard to reach.
Currently, Éowyn has altered key settings to make life a bit easier.
Caps Lock key now acts like the
Stuff that didn’t work
On Ubuntu (running GNOME desktop) I first tried to change the keybindings using the command
clear Lock' -e keycode 0x42 = Escape'
but for some reason, it stopped working for one of my TeX files.
I installed the
sudo apt-get install dconf-tools
I started the editor, and went to org -> gnome -> desktop input-sources
At the bottom of the page, I saw two square braces with nothing in them. These braces are required.
Within these braces, I added
to add the Caps Lock key as another
Esc. The command you want to use needs to be enclosed in single quotes. If you want multiple options, they need to be comma separated. A full list of commands can be found by typing
man 7 xkeyboard-config
Exit out, and you’re good to go!
On Debian with Cinnamon
On Debian, the solution was a bit different, and I must say I liked it less.
Edit the file
/etc/default/keyboard as superuser.
There’ll be a line with
<blah> represents your current settings, most likely nothing.
Just put the string
caps:escape inside of those quotes and restart. That’s it!
Update on XKB Stuff
Yeehaw. On i3, things, uh, work a bit differently, since the normal tools I use are not easily available to me. Here’s the entirety of the previous file:
XKBMODEL="pc105 XKBLAYOUT="us" XKBVARIANT="" XKBOPTIONS="compose:ralt,caps:escape" BACKSPACE="guess"
Update #2, with Arch Linux
Right, so here’s an even easier solution! Just add the following line to your config:
setxkbmap -option compose:ralt,caps:escape
The only way I could get this to work is by adding it to my i3 config;
I preceded it with
This solution’s a lot better since you don’t have to edit those sensitive files yourself.
I really felt the need to add this at a later date. Why, you might ask? Sheer fear (which is also what I felt writing half the content on this website).
To be kinda vulnerable on the internet: like a lot of folks, when I’m stressed, I like to change things, often a bit impulsively. This could be a haircut, reflashing my computer with a new distro, clean up/decorate my work space, etc. And these actions all have their own consequences.
This time, I disabled my arrow keys, using
xmodmap, which I talked about earlier on this page.
I guess I thought I needed to learn Vim and Emacs (since the default for terminals is Emacs) keybindings.
Based on what another user said on StackExchange, I ran the command
xmodmap -e 'keycode 116='; xmodmap -e 'keycode 113='; xmodmap -e 'keycode 114='
Initially, I panicked, since I couldn’t reverse it, and there are unanswered comments below the accepted answer (this entry is dated 10/18/20) asking how to undo the action. However, somehow, it, um, undid itself? I’m not entirely sure what’s up with that. But we’ll see, I guess.