Although the mapping was prompted by Vim usage, it's surprisingly useful for general computing as well.
Although the mapping was prompted by Vim usage, it's surprisingly useful for general computing as well.
On Windows, I use the Uncap [ https://github.com/susam/uncap ] tool because it does not require install or restart. The tool has good documentation to map CapsLock to Escape for Linux and MacOS too.
On the flip side, I struggle to use Vim when I need to do so someone else's computer. :-D
I had a tool on a mac that would make caps lock equivalent to escape if it was pressed and released alone, and control if it was chorded. Sounded great on paper but I underestimated how often i press control before realizing I don't want to perform a chord.
https://pqrs.org/osx/karabiner/
The equivalent for Windows would probably be AutoHotkey
Of course Karabiner can do quite a bit more than that. But if you can't or don't want to install more software it's a choice available to you.
xcape -e 'Caps_Lock=Escape;Control_L=Escape;Control_R=Escape'noremap! kj <esc>
https://github.com/patrickdavey/dotfiles/blob/058950c2f470a1...
Jk for the win!!! (Also jj works well to).
I also set my mapleader to <Space> you would be surprised how useful that is. Not to mention , (comma) is a valid and useful vi movement key.
I have literally never found myself needing to pause to wait for a k and then a j. What are these words with "kj" in them that you're wary of? I'm genuinely curious :)
However my vim set up maps jk, kj, jj, and kk to Esc to in reality it is safe to just mash those two keys and one of the maps will work.