vim line numbers - how to have them on by default?

Michael Durrant picture Michael Durrant · Apr 23, 2012 · Viewed 173.1k times · Source

I can :set number from within a file I'm editing but how can I have them always be on by default?

Answer

Tim Pote picture Tim Pote · Apr 23, 2012

Add set number to your .vimrc file in your home directory.
If the .vimrc file is not in your home directory create one with vim .vimrc and add the commands you want at open.

Here's a site that explains the vimrc and how to use it.