Better line numbers for Vim
21–30 of 46 posts
Re: Better line numbers for Vim
#22If it's useful to other people--and obviously it is--it was worth writing, so congratulations on shipping. That said, put me in the category of crotchety old Vim users (even though I'm only 20) who really don't have a use for this. Potential use cases: Scrolling: If it's a few lines, I tap j a few times--or guesstimate a number prefix. It's just scrolling--no precision needed. If it's more than a few lines, I use C-d…
Re: Better line numbers for Vim
#23Re: Better line numbers for Vim
#24"relative number switches - show numbers in insert mode, relative in normal
autocmd InsertEnter * :set number
autocmd InsertLeave * :set relativenumber
Re: Better line numbers for Vim
#25Re: Better line numbers for Vim
#26Does anyone know why Debian seems to move so slowly? Should I change to a different distro?
Re: Better line numbers for Vim
#27If it's useful to other people--and obviously it is--it was worth writing, so congratulations on shipping. That said, put me in the category of crotchety old Vim users (even though I'm only 20) who really don't have a use for this. Potential use cases: Scrolling: If it's a few lines, I tap j a few times--or guesstimate a number prefix. It's just scrolling--no precision needed. If it's more than a few lines, I use C-d…
Absolute line numbers are really annoying to use in huge files with thousands of lines (because it takes a noticeable amount of time just to type the number).
Re: Better line numbers for Vim
#28I was going to complain this didn't work then I realised my server (Latest Debian stable) only has Vim 7.2 and this requires 7.3. I'm not surprised to find my Mac, which I bought last year, has 7.3 but my server, which I installed last month, has older software. Does anyone know why Debian seems to move so slowly? Should I change to a different distro?
Re: Better line numbers for Vim
#29What is the rationale behind "relative in normal mode and absolute in insert mode"?
relativenumber is useful for quick navigation with 6j or 10k or defining a target for operators with c6j or d10k. Relative numbers are a tool for better text editing.
number is slightly less useful for navigation when in a large buffer: 6j or v6j are obviously a little better than 4321G or v4321. But I'd argue that the purpose of absolute numbers is more to provide information than to be used as a tool.
I've observed that using one or the other is mostly a matter of taste, though, and needs.
But the "relative in normal mode and absolute in insert mode" part sounds strange.
How are line numbers any useful in insert mode when there's traditionally no editing or cursor movement beyond the same line or maybe a couple of lines above/below?
I recently came across a slightly better take on the rnu vs nu "problem",
https://github.com/vim-scripts/RelOps
that switches to relativenumber when you hit an operator like c or y and puts you back to number when you are done. This sounds a lot more sensible and less arbitrary to me: you get rnu when it's useful (for defining a target for your operator) and nu elsewhere. Still you get to do 4321G, though.
Too bad the author doesn't get as much coverage as this one.
Re: Better line numbers for Vim
#30I was going to complain this didn't work then I realised my server (Latest Debian stable) only has Vim 7.2 and this requires 7.3. I'm not surprised to find my Mac, which I bought last year, has 7.3 but my server, which I installed last month, has older software. Does anyone know why Debian seems to move so slowly? Should I change to a different distro?
Debian does move slowly (that's why it is good for servers; you don't have to update often) but you probably need to update your server. On Debian Wheezy, I have got Vim 7.3.547.
I believe due to a mistake it ended up on Debian 6 (Squeeze). Still, shouldn't 7.3 be available via apt-get?