News for hackers. Stuff that matters.
Re:Staying the hell out of insert mode (vi) by willwagner on Monday April 26, 2010 @04:08PM (#1295828)
The "kj" remapping seems like a nifty trick; I've spent a while getting accustomed to ctrl-[ instead of the <ESC> key (I can't reach the <ESC> key without moving my left hand), but it's still hard for me to do quickly and reliably.
Re:Staying the hell out of insert mode (vi) by latortuga on Monday April 26, 2010 @04:25PM (#1295886)
The author of the article suggests using Caps lock as control but I've found it's a stellar place to have an escape key. After a few days it felt completely natural for my left pinkie to hit escape. For those on windows, there are a number of batch files that will help edit your registry to remap the keys although I found it to be a problem on Windows 7 until I tried Sharp Keys which worked great.

Another trick that is useful for people who compulsively hit the Ctrl+s keybind from other editors; the following is from my vimrc:

  " Map Control+s to save a file
  nmap <C-s> :w<CR>
  imap <C-s> <ESC>:w<CR>
This leaves you in normal mode which is usually what I want when I hit ctrl+s.
Re:Staying the hell out of insert mode (vi) by zieski on Tuesday April 27, 2010 @03:25PM (#1299371)
For insert mode I switched to using <C-O> instead of <Esc> after reading that it only enters normal mode for 1 command. That way I stay in whatever mode I was in when I saved.
Re:Staying the hell out of insert mode (vi) by pyre on Monday April 26, 2010 @09:59PM (#1296908)
Don't hit C-s when you're using vim in a terminal though. (But if you do, hit C-q)
Re:Staying the hell out of insert mode (vi) by latortuga on Tuesday April 27, 2010 @02:53PM (#1299221)
I actually almost put this in my original post but I didn't know if this was just our server's vim install or if it applied generally. Thanks for the heads up!