Line numbers in VIM

Temporarily display line numbers in VIM:

  1. Press ESC to enter command mode
  2. Type :set number
  3. Press Enter key

Always display line numbers in VIM:

  1. Navigate to ~/.vimrc
    If you don’t have one, create one.
  2. Press i to enter insert mode
  3. Add set number as a separate line to this file
  4. Press ESC to enter command mode
  5. Type :wq
  6. Press Enter key to save and quit VIM

Leave a Reply

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