1

Per default I have the relative numbers and actual numbers active on my vim sessions. However I find myself switching quite often to the actual line numbers as I like to copy elements from a certain line below my current e.g: :34t.

My first idea was to have the full numbers left and the relative numbers right, but if nothing has changed in this regards in the last 4 years this post already gives a negative answer on this. How to show line numbers in vim on the right side of the buffer?

So my question would be: is there any way to have just both the actual and the relative line numbers displayed in two columns?

4 26
3 27
2 28
1 29
0 30 I
1 31
2 32
3 33
4 34
  • The closest option seems to be :set number relativenumber: vimhelp.org/options.txt.html#number_relativenumber There might be a plugin: stackoverflow.com/a/16624418/2072269 – muru Dec 2 '19 at 7:19
  • Doesn't hybrid line number work for you ? set number relativenumber should show both relative numbers of other lines and actual number of current line – amisax Dec 2 '19 at 7:22
  • The hybrid line numbers is what I am currently use. But on a quick glance on the screen I can not tell what actual line number a line is on without navigating to it. – Eike Dec 2 '19 at 7:49
  • @muru Plugin looks like the solution. I'll give that a shot – Eike Dec 2 '19 at 7:53
  • You don't really need the actual line number, though. You can do, say :.+8t. to copy the 8th line from the current. – muru Dec 2 '19 at 7:54
2

Thanks to muru's suggestion the RltvNmber Plugin is achieving what I initially was looking for however using the suggested :+8t. syntax might be the leaner solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.