4 ms·
Remap single tap CAPS to ESC and when used in combination with another key or long-pressed - CTRL. This has changed the way I use my keyboard in vim and tmux.
by nsomaru 9y ago
Remap single tap CAPS to ESC and when used in combination with another key or long-pressed - CTRL. This has changed the way I use my keyboard in vim and tmux.
I'm doing this on Ubuntu, but there are ways to get it done on OSX too.
- messe 9y agoI have `jk` mapped to ESC in spacemacs, zsh and anything else I can set up to use vi keybindings. `jk` is essentially a no-op in vi, so rebinding it doesn't cause any issues while carrying the advantage that my fingers never have to leave the home row.
- fred256 9y agoOut of curiosity, how do you type "Dijkstra" in that case?
- njarboe 9y agoCopy and paste from another window? If your use of the word "Dijkstra" is frequent enough for this method to bother you, there must be other mappings that would work.
- rspeer 9y agoI have a similar key binding set up. One option is to press a key that doesn't do anything in between.
- eridius 9y agoI've never typed Dijkstra in Vim, but if I had to, there are two reasonable options: 1. Wait a half-second after typing the "j". That causes the mapping to time out and you can type the "k" without a problem. 2. Type something like Dijj<del>kstra.
- burnte 9y agoI loved his solution until this. This is a deal breaker. Time to go back to the abbacus. ;)
- geerlingguy 9y agoIt’s even easier now; the keyboard prefs in settings allows caps to esc reassignment through the UI.
- ithkuil 9y agoCtrl-c can be used as esc in vim
- narkee 9y agoDo you have any hints on how one might implement this on mac OS? I'd love to have my keyboard configured like this...
- AlphaSite 9y agoIt’s in keyboard modifier keys.
- dilap 9y agothat'll get you caps-as-control, but not caps-as-control-AND-escape (unless they've added that in high sierra, but I don't think so).
- dilap 9y agoyou can do it with the app karabiner elements. once installed, open the app, and go to the "complex modifications" tab. then click "add rule". then click "import more rules from the internet". on the web site that opens, expand "Modifier Keys". import "Change caps_lock key". that'll give you a rule to do what you want in karabiner. (the rule is "Change caps_lock to control if pressed with other keys, to escape if pressed alone".)