Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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.



I 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.


Thanks 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?


I 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: