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

My biggest problem with Vim is the muscle memory I have developed where I hit [esc] after writing text. The problem is that in most programs outside of vim, [esc] means to cancel the operation. Try renaming a file and set it with [esc].


This is avoidable if you use Ctrl-C instead of escape. It works identical to [esc] in all ways except one (the InsertLeave autocommand will not be triggered). If you remap Caps lock to Ctrl, you even get a more ergonomic way of escape, since you don't need to move your hand the way you would to press [esc].


Actually, ESC is also available as CTRL-[ If you have CTRL remapped to CAPS LOCK, then it's very simple to use.


Another difference: ctrl-c will cancel the count on an insert command.


Another common remaping is <ESC> -> jj:

" remap Esc to jj in Insert mode: inoremap jj <ESC>

I've been using this for a while, much better.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

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

Search: