Vim Tip of the Day: Introducing the Nouns

Just as English and Japanese are languages to describe the rich world we live in, so is Vim a language to describe the comparatively sparse world of text. With normal languages, words need to be long to be unambiguous since there’s so much stuff to describe in the real world. In Vim, words can be much shorter and still remain unambiguous. How much shorter? Well, it turns out, Vim words are usually just a single letter long.

Nouns are the stars of any language. They refer to the objects of the world, and are the subjects of every sentence. And in Vim, the basic nouns are:

  • characters — h l
  • words — w W b B e E
  • lines — j k 0 $
  • sentences — ( )
  • paragraphs — { }

Remember, each of these keystrokes represents a whole word in the Vim language. Try opening a file in Vim and navigate it by typing these commands to get a feel for them, while keeping the meanings of the words in mind.

2 comments

  1. Frank

    Hi, I wonder how j and k are considered as characters when they actually operate on lines instead!

    By the way, thanks for this series. As an emacs user (I found your blog from planet.emacslife.com:)) who started using evil mode recently, this series has been very helpful.

    1. sid

      I have thought about putting them under “lines” before but never got around to it. But you know, I should, because I think you’re right that they are more properly thought of as line-based motions. I’m glad to hear you’re finding the series helpful. Thanks for stopping by 🙂

      [Update: made the change, thanks!]

Leave a Reply

Your email address will not be published. Required fields are marked *