3

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.

  • Looks like I have relativenumber turned on. I haven't specified this in any configuration files. I'm figuring out the issue ATM. – dspacejs Mar 24 '18 at 6:32
  • 4
    :set norelativenumber, see also :h number_relativenumber – Christian Brabandt Mar 24 '18 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 '18 at 17:20
  • 2
    To see where it was set, you can use :verbose set relativenumber – tommcdo Mar 25 '18 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. – dspacejs Mar 25 '18 at 0:52
3

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.

1

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.

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.