How to show line numbers in Vim for use with terminal and servers

June 10, 2012    vim vim show line numbers

Why it's taken me quite this long to decide I actually really want to just see line numbers in VIM on one or all of my live servers I have no idea.

I think it's mainly because out of lazyness when an apps in development I have got into the habit of using "mate" (Textmate's CLI) instead.

Needless to say to enable line numbers in vim, for use with any installation of vim be it server or local machine is really easy.

Open up a terminal (connect to your server if your doing it to remote) once ready type:-

vim ~/.vimrc

Hit "i" for insert mode and enter "set number".

Now esc - :wq to save and quit and that's it.

Line numbers will now show in your next document opened by vim.

blog comments powered by Disqus