Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display relative and absolute line numbers simultaneously in Vim

Tags:

vim

Is there any way to display both relative and absolute line numbers simultaneously in Vim? Either side-by-side, or some other interesting presentation are fine.

like image 574
mt3 Avatar asked Nov 30 '11 10:11

mt3


People also ask

How do I toggle relative numbers in vim?

Relative Numbering is not turned on by default in vim, which means that you are probably turning it on through your ~/. vimrc file or one of your plugins. Look for set relativenumber or set rnu . To turn it off for the current vim session you would simply run set norelativenumber or set nornu for short.

What is relative number in vim?

When you display relative numbers in Vim, each line is numbered by its distance from the cursor. Take a look at the position of the cursor in the image above. This position is marked as 0. Accordingly, lines above and under the cursor are labeled as 1, the next ones 2 and so on.


1 Answers

Yes, you can. Use RltvNmbr.vim to display the relative numbers, and use Vim to display the absolute ones:

enter image description here

like image 189
Orangenhain Avatar answered Sep 18 '22 15:09

Orangenhain