HN2new | past | comments | ask | show | jobs | submitlogin

One thing that can be a negative irritant for new users is how far the esc key is and how often they have to reach for it. Vi wasn't designed that way. It was designed for keyboards that had esc where the caps lock key is on modern keyboards. One solution is to map caps lock to the esc key. Another solution, the one I prefer, is to map ii instead. This can be done with the following in the .vimrc file:

imap <silent> ii <Esc>:let &insermode=0<CR>

This doesn't work so well if you are frequently editing files on multiple servers you can't edit the .vimrc file on. But for your local environment it'll make going in and out of insert mode a lot more efficient.

I'm dead used to using ii now so I'm probably not going to switch, but others have pointed out kk may be a better choice, due to greater distance between keystrokes/mode. Indeed, about one in ten times I hit ii when I don't need to.



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

Search: