For instance, the Caps Lock key is sometimes useless for many people. This is a pity, since the key is conveniently located on the home row.
On the other hand, the Esc key is quite useful especially for Vim (Editor)users, but it is sooo far away.
Remap the Caps Lock key to behave as a 2nd Esc key.
This must be done at the OS level.
- Create a .reg file with the following content:
Windows Registry Editor Version 5.00
- Execute the file to update the registry
- Log out and log in again
- Create a .Xmodmap file in your home directory, with the following content:
! Make Caps lock behave as Escape
keycode 69 = Escape
remove Lock = Caps_Lock
keysym Caps_Lock = Escape
- Run xmodmap ~/.Xmodmap
- You can remap the key using PCKeyboardHack: https://pqrs.org/macosx/keyremap4macbook/pckeyboardhack.html.en