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.
[ Parent
| on HN ]
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.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.
Don't hit C-s when you're using vim in a terminal though. (But if you do, hit C-q)