0 votes
in VIM by
Explain the differences between “relative”, “absolute” and “hybrid” line numbers in Vim. How would you set each of them?

1 Answer

0 votes
by
In Vim, “absolute” line numbers display the actual line number from the start of the file. To set this, use ‘:set number’.

“Relative” line numbers show the distance in lines from the current cursor position. This is useful for executing commands that operate on a range of lines. Set it with ‘:set relativenumber’.

“Hybrid” mode combines both; it shows absolute line number for the current line and relative for others. It’s beneficial when needing context of your location within the file while also requiring relative numbers for operations. Enable it by using both ‘:set number’ and ‘:set relativenumber’.
...