Monday, August 6, 2012

vi / vim show line number command



To display line numbers along the left side of a window, type any one of the following:
:set number
or
:set nu

(Fig.01: Vi / Vim line numbers in action - click to enlarge image)
To turn off line number again enter the same command:
:set nu!
If you need number every time you start vi/vim, append following line to your ~/.vimrc file:
set number


No comments:

Post a Comment