If you want relative numbers to appear when in normal mode, and absolute line numbers to appear otherwise (e.g., when the window has lost focus), just throw this in your .vimrc:
set rnu
au InsertEnter * :set nu
au InsertLeave * :set rnu
au FocusLost * :set nu
au FocusGained * :set rnu
Here's a gist for posterity. Feel free to fork it, leave comments on what should be changed, etc. The above has worked for me on Mac OS X for years, but there's a chance I didn't set it up the "right way". Leave comments on this gist and I'll update as necessary:
I just have this in my .vimrc which lets you toggle it whatever way you want in edit mode and it stays however you leave it when you toggle modes
" use Ctrl+L to toggle the line number counting method
function! g:ToggleNuMode()
if(&rnu == 1)
set nu
else
set rnu
endif
endfunc
nnoremap <C-L> :call g:ToggleNuMode()<cr>
One benefit of the plugin approach is that it will get forked and improved and other cool and useful things added to it. It's a central repository for all of that goodness, and keeping it up to date just requires pulling the repo (assuming you're using Pathogen or Vundle), instead of remembering to dig through vim.org/scripts periodically.
TLDR - the plugin approach gains the benefits of software evolution.
You don't need one. It's a cost/benefit thing - is it worth having one? Do you really need to use Vim or Emacs or Eclipse, etc? You don't need to.
I can imagine some reasons why it might be useful to have it as a plugin. Making a plugin means giving it a name and a URL (and if it's on vim.org, a place in a well-known directory), and that makes discovery and communication of its existence easier. The fact that it's useful to have a gist for it bears this out, I think. I can't think of why it's that bad a thing to have a plugin for it.
If you want relative numbers to appear when in normal mode, and absolute line numbers to appear otherwise (e.g., when the window has lost focus), just throw this in your .vimrc:
Here's a gist for posterity. Feel free to fork it, leave comments on what should be changed, etc. The above has worked for me on Mac OS X for years, but there's a chance I didn't set it up the "right way". Leave comments on this gist and I'll update as necessary:https://gist.github.com/3012145