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:
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