I added :set numberwidth=2 in my vimrc, but this value is always returned to 4 inside my windows.

It seems I need to use some autocommand to always force this value back to 2.

In fact, even more alarming: when I force a short file to :set numberwidth=2 manually (to regain two columns of space), once I do ANYTHING at this point, it reverts. Switch window/tab/buffer, enter insert mode (!), you name it. I can move the cursor without it reverting, however. The same behavior is seen with other window-local settings I've tried such as relativenumber. So I suspect perhaps some plugin might be culpable. But how to debug this?

  1. I would like to not use an autocommand to do this if necessary
  2. I would like to know what are the various things triggering this to reset to the default
  3. If I really do must use an autocommand to do this, which autocommand should I use?
  • Thanks, not sure if i should delete. Clearly this behavior is not intended behavior so I just need to debug it now. – Steven Lu Apr 3 '16 at 6:21
  • 2
    Don't delete. Debug and find out, and if you do find something, please post an answer. – muru Apr 3 '16 at 6:26
  • I am doing it now. Its caused by one of my 40 or so plugins, I am just having trouble keeping track of my manual binary searching. – Steven Lu Apr 3 '16 at 6:30
  • 2
    Forty freaking plugins… – romainl Apr 3 '16 at 8:49
  • 1
    When I think that I found my 15 plug-ins were too much and I should remove some... – statox Apr 3 '16 at 10:04

The offending plugin is jeffkreeftmeijer/vim-numbertoggle.

I'll go drop a note on the Github now, and try to debug it.

Update: It's plain to see that the autocommands are being set very promiscuously. I never use this plugin anyway. I'm ditching the plugin obviously, and going to drop a note on the issues.

  • 1
    I have seen your issue on github. Probably that plugin should have used augroups to set the triggers etc. Let's see if it gets fixed. – mbilyanov Apr 3 '16 at 10:46

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