Hacker News new | past | comments | ask | show | jobs | submit login

The article mentions that you can set custom mappings to escape and uses this as an example:

    imap jj <Esc>
If you're interested in doing that, I'd strongly recommend you never do a plain `imap` and instead always do `inoremap` (this advice applies to `nmap`, `vmap`, and the like as well). The difference is that the noremap variant is non-recursive [0].

Also, since we're on the subject of escape alternatives, I may as well mention mine. It really bothers me that exiting insert mode moves your cursor back a space. To remedy that, I've got a custom mapping that escapes and them jumps to the mark at which insert mode last was [1]. The mapping is:

    inoremap jj <Esc>`^
[0]: http://learnvimscriptthehardway.stevelosh.com/chapters/05.ht...

[1]: http://vimdoc.sourceforge.net/htmldoc/motion.html#`^




I'll go ahead and update it. Thanks for the info!




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

Search: