This question has already been asked here. The accepted answer says it is not possible. Other answers provide a way to do it on linux but I have not check if it worked. I am most interested in knowing if there is a way to do it for mac (although you can post answers for linux as well).
I am only reposting this question here because the other question on SOF is more than five years old. Ideally, I would like to remap to <ESC>
key to CAPS LOCK
.
X11
? I tried putting those commands in my.vimrc
but it does not recognize it – solalito Nov 10 '15 at 18:38.vimrc
but in~/.Xmodmap
. Besides, you don't write the whole command anymore, just what's inside the quotes. For example, instead of puttingxmodmap -e 'clear lock'
in.Xmodmap
, you just writeclear lock
. Then you restart the computer or you just log out and log in back so that xmodmap reads the file and executes each line it contains. – saginaw Nov 10 '15 at 21:54vi
commands, butX11
environment ones. They won't work withinvi
orTerminal
, because they directly talk to the `X`` server and more precisely to the part which deal with the keyboard managment. – dan Nov 11 '15 at 11:05Karabiner
: https://pqrs.org/osx/karabiner/ seems to be a correct solution to your problem. If you test it successfully, I suggest you to make here an answer to your question. – dan Nov 11 '15 at 11:22