Numbers.vim - better line numbers for vim
myusuf3.github.com
Numbers.vim - better line numbers for vim
1–10 of 47 posts
Re: Numbers.vim - better line numbers for vim
#2If 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:Re: Numbers.vim - better line numbers for vim
#3Re: Numbers.vim - better line numbers for vim
#4Do you really need a plugin for this? 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…
Re: Numbers.vim - better line numbers for vim
#5What's with the funky status bar?
Re: Numbers.vim - better line numbers for vim
#6What's with the funky status bar?
Re: Numbers.vim - better line numbers for vim
#7Re: Numbers.vim - better line numbers for vim
#8I'm still pondering the "how is this useful?" part... why are absolute numbers useful for you in insert mode?
Re: Numbers.vim - better line numbers for vim
#9Do you really need a plugin for this? 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…
Re: Numbers.vim - better line numbers for vim
#10I'm still pondering the "how is this useful?" part... why are absolute numbers useful for you in insert mode?
while in insert mode you would simply want to see what line you are one and for collaboration with others. In cases where you might want jump to a line like :15.
There is also a NumberToggle function if you ever need to switch on the go.