Learn To Speak Vim

Friday, 30 December 2011

I'm a relatively new convert to Vim having only made the switch from TextMate about six months ago. This post by Yan Pritzker would have likely saved me some trouble in those first frustrating weeks:

Using vim is like talking to your editor in ‘verb modifier object’ sentences, turned into acronyms

  • learn some verbs: v (visual), c (change), d (delete), y (yank/copy). these are the most important. there are others
  • learn some modifiers: i (inside), a (around), t (till..finds a character), f (find..like till except including the char), / (search..find a string/regex)
  • learn some text objects: w (word), s (sentence) p (paragraph) b (block/parentheses), t (tag, works for html/xml) there are others

It's a great primer if you're considering making the switch.

Also, be sure to check out Janus if you're looking to smooth the transition to Vim from another editor (like TextMate). Janus is a Vim distribution that includes some sensible default plugins and key bindings so Vim won't drive you crazy while you're trying to get your bearings.