Show line numbers in vim editor

December 21st, 2011 § 1 comment § permalink

I found Many of my friends are not aware of “how to show line numbers in vim editor”. So I thought of helping them by googling and share my finding here. So here is how we can show up line numbers in vim editor.

  • Show Line numbers
    Get into command mode in vim and run

    :set number

    or

    :set nu
  • Hide Line Numbers
    Get into command mode in vim and run

    :set number!

    or

    :set nu!
  • Always show line numbers while opening the file
    Open the file “~/.vimrc”. create it,if doesn’t exists
    Append “set number” to¬†~/.vimrc

Hope it helped you. Thanks