6 ms·
inoremap jj <Esc>
by mdonahoe 7y ago
inoremap jj <Esc>
- timvisee 7y agoRemap CapsLock instead.
- Elidrake24 7y agoI did, it's my ctrl like anyone else that doesn't hate their pinky.
- hnzix 7y agoThe next level is using Karabiner-Elements to map <caps> to <ctrl> when held and <esc> when tapped.
- andromeduck 7y agoThis is what I have :) also right command + esdf for arrow keys
- mateuszf 7y agoI usually do that but it stopped working for me on new macbook :/
- foo101 7y agoI do this. But then I find that whenever I have to help someone out at work in their Macbook, I have to go through the hassle of first mapping Caps Lock to Escape on their Mac, do the work, then remember to unmap it again after the helping session is over. Is there any good way to automate this workflow for helping other people on others' Mac?
- adtac 7y agojk is better (TM) because it is a noop when already in normal mode :) Also, pressing two different keys is faster than pressing the same key twice
- foo101 7y ago> inoremap jj <Esc> That takes care of returning from insert mode to normal mode. What do you do for returning from other modes (operator pending mode, visual mode, etc.) to normal mode? I don't think it is possible to reliably reproduce all of the <Escape> in all the modes with remaps.
- mhink 7y agoI think operator-pending is much less of a big deal when you can just finish the command and then hit "u" to undo it. As for visual mode... I just noticed something odd: in Neovim, <Esc> doesn't drop me back into Normal mode from Visual or Block-visual; I have to hit "v" again. The behavior doesn't happen in Vim itself (that is, <Esc> works as expected.) I wonder why that is. Either way, I'd hazard to say that exiting Insert mode is by far the most common use case for <Esc>... to the point where I really wouldn't even call it "escaping" in the sense of "bailing out of a mode early". For everything else, I'd just remap Escape to Caps Lock at the system level and call it a day. But that's just me, and even though I think the Touch Bar is nifty, I definitely get where some folks' annoyance is coming from.
- mdonahoe 7y agoI didn't know "operator pending mode" was a thing, so I definitely don't use Esc to leave it. For visual mode, apparently I just press v again. (I had to try it and see if I was subconsciously triggering Esc). I had already weened myself off the Esc key, so the touchbar isn't that big a deal for me (though, i dont really ever use it). The terrible keyboard reliability is much worse, ugh.
- foo101 7y agoThanks for the reply.I have a follow up question about the "operator pending mode". I understand you didn't know it was a thing. But say, you press 'd' in normal mode because you want to delete a line and then you change your mind, what do you do it cancel the pressed 'd'? I know I just rephrased the "operator pending mode" in a more elaborate manner but I am curious how you handle this case? Do you press Esc? Or do you go ahead with the delete anyway and then press 'u' to undo the delete? Or do you have some other technique to cancel the delete operator pending?