5

I recently installed Neovim and SpaceVim. My line number order is broken:

Broken line numbers

This occurs when working on any file, with both Vim and Neovim.

How do I solve this? I'm a newbie to Vim and don't know how to go about troubleshooting it.

5
  • Looks like I have relativenumber turned on. I haven't specified this in any configuration files. I'm figuring out the issue ATM.
    – Daniel
    Mar 24, 2018 at 6:32
  • 4
    :set norelativenumber, see also :h number_relativenumber Mar 24, 2018 at 7:30
  • 1
    relativenumber comes in handy if you’re going to be jumping around with commands like 7k, 18j, etc. I’m much more likely to jump around to absolute numbers, but that seems to be why people like it, if you were curious why this is a thing.
    – brhfl
    Mar 24, 2018 at 17:20
  • 2
    To see where it was set, you can use :verbose set relativenumber
    – tommcdo
    Mar 25, 2018 at 0:23
  • Thanks all. I ended up just using Neovim anyway instead of SpaceVim, which fixed the issue. SpaceVim (or one of its plugins) must have been setting relativenumber somewhere.
    – Daniel
    Mar 25, 2018 at 0:52

2 Answers 2

4

In SpaceVim, we use g:spacevim_relativenumber to config relativenumber. if by default it is 1, if you want to disable this feature. just add let g:spacevim_relativenumber = 0 to your custom config. the config can be opened via SPC f v d.

why we make this option enabled by default?

because relativenumber is very useful for line move, you can use 7j to move down 7 line, and you can see the 7 before moving.

3

Custom config didn't work for me. So I did this:

$ find ~/.SpaceVim/ -type f | xargs grep spacevim_relativenumber

And found the line in .SpaceVim//autoload/SpaceVim.vim:

let g:spacevim_relativenumber          = 1

Then I changed this setting to 0. It looks like little bit more generic way that can also be applied to other settings.

1
  • Thank you for this answer, this helped me to fix it.
    – Sysad85
    Nov 13, 2023 at 4:17

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.