I can :set number from within a file I\'m editing but how can I have them always be on by default?
:set number
To change the default setting to display line numbers in vi/vim:
vi ~/.vimrc
then add the following line to the file:
set number
Either we can source ~/.vimrc or save and quit by :wq, now future vi/vim sessions will have numbering :)
source ~/.vimrc
:wq