Welcome to mrk's website!

[Linux] Making Caps Lock another Escape on TTY.

Notes

This is only for the Linux TTY. Tested on Gentoo.

Vim auto-decompresses the .gz file used by the TTY to convert keycode into key, so there's no need to gunzip, vim, and gzip.

Editing the map file

nvim /usr/share/keymaps/i386/qwerty/us.map.gz - this path may be different for non-Gentoo distributions.

Now replace all "Caps_Lock" occurrences with "Escape". There should be just one for keycode 58 near the bottom of the file. That finishes editing. :x to write and exit vim.

Hot-reload current TTY

Now on reboot/creating a new TTY Caps Lock will behave like Escape. However, to reload immediately, do loadkeys us.

Sources

https://unix.stackexchange.com/questions/266817/how-to-reverse-esc-and-caps-lock-on-tty