3

I know how to show absolute as well as cursor-relative line numbers but I do not need to see each line number and they look too crowded. I would like to just see line numbers at an interval, say every 5 lines eg. 5, 10, 15, and so on. Is there a way to achieve this in vim?

4
  • 2
    I don't think this is possible without hacking vim c source.
    – Maxim Kim
    Commented Oct 25, 2021 at 11:49
  • 1
    Does this answer your question? Show only every n relative line number
    – cigien
    Commented Oct 30, 2021 at 4:48
  • It is not working for me. Seeing errors. Error detected while processing function Refresh..AddLine
    – Ketan
    Commented Oct 31, 2021 at 14:52
  • You can use my DynamicSigns Vim plugin Commented Sep 30, 2023 at 19:22

1 Answer 1

2

For Neovim, there is a line-number-interval.nvim plugin that can provide the functionality. Screenshot below demonstrates the default look of the plugin (which is on par with what vscode can do), after following commands. Just note that the screenshots on Github repo are outdated.

:set number
:LineNumberIntervalEnable

Neovim line-number-interval plugin

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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