Hacker News new | ask | show | jobs
by johncoltrane 4721 days ago
I'll ask it again:

What 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.