3

In my vimrc I use :setg tabstop=4 shiftwidth=4. Why aren't unnamed buffers set correctly with these values? Using VIM 8.2.460 (2019 Dec 12)

I opened vim with some piped output and noticed tab width was 8. So I typed:

:setglobal tabstop?
  tabstop=4
        Last set from /etc/vim/vimrc.local line 36

:setlocal tabstop?
  tabstop=8

If I use :setlocal, some options are shown but tabstop is not in the list. This means it's picking the vim default (8).

Anyone have any ideas about this? Aren't global options supposed to be used for new buffers?

1 Answer 1

1

This is the first buffer only.

While vimrc is being sourced the buffer #1 already exists (but unloaded), and so it has its local option values (default ones). Now when you setglobal tabstop you don't change it, so it's still eight.

1
  • Thanks for your response. That came to my mind but I wasn't sure. I guess I'll just save and then reload the file from now on, with :e! Apr 15, 2020 at 14:27

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.