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

is ESC really the only way to get back out of insertion mode? that feels like CTS waiting to happen


<Ctrl-c> should also work.

However, I also recommend mapping ESC to Caps Lock. Once you have vimified your whole computing experience, it starts paying back big time.. ;-)


As well as <Ctrl-{>.


I have jj mapped to exit from insert mode and save the file. This trick was found in a long SO thread, plus I never had the need to type something with a double j ;)


I have the even faster jk mapped to ESC. And if you want to type jk in your text you just have to

- type j - wait 1 second - type k.


Very nice!

For those wondering how to do this, you can try it out with

:imap jk <esc>

(imap means "use this mapping when I'm in insert mode".)

If you like it, add everything but the : to your .vimrc


I find kj easier to type, since it's an outward muscle movement.

Warning: If you do this you will wind up typing those characters by memory nearly everywhere.kj


I don't even think about it, but apparent pivot on my wrist to hit the 'Esc' key (top left of my keyboard) with my middle finger, rather than my pinkie as would be prescribed by a strict "home row" typing style.

I find emacs's ctrl-meta-foo-bang key combinations to be far more stressful (you have to hit multiple keys in one swell foop) than vi/vim's modal just-one-key-at-a-time standard keystrokes.


I know lots of folks remap the Caps Lock to key as ESC, since it's easier to hit than ESC.


But my CapsLock is already mapped to Control ....


Control-[ is also escape (writing that in vim style <C-[> ).


Control-[ is the best way to move into command mode. It fits the vi philosophy better than ESC. When hitting ESC you have to lift your hand off the home row. After years of using vim, using ESC feels as inefficient as using arrow keys instead of hjkl.


Ctrl-C is what I prefer.


…which is particularly easy to press if you remap Caps Lock to be another Ctrl.


I map the right command key to escape.

http://pqrs.org/macosx/keyremap4macbook/


Vi was developed on a system that had Ctrl and Esc where Caps and Tab are now.

One now about using Ctrl-c: that bypasses InsertLeave autocmd's.


C-[




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

Search: