While Vim's relativenumber option is great, you probably don't want to use it all the time. numbertoggle allows you to quickly toggle between relative and absolute line numbers and cleverly switches when when focus is lost or gained or when switching between normal and insert mode.
If you don't have a preferred installation method, I recommend installing pathogen.vim, and then simply copy and paste:
cd ~/.vim/bundle
git clone git://github.com/jeffkreeftmeijer/vim-numbertoggle.git
Once help tags have been generated, you can view the manual with
:help numbertoggle
.
Copyright (c) Jeff Kreeftmeijer. Distributed under the same terms as Vim itself. See :help license.