ziglang / zig.vim

Vim configuration for Zig
MIT License
450 stars 57 forks source link

Filetype plugin should not affect other buffers #12

Closed Taeril closed 4 years ago

Taeril commented 5 years ago

In ftplugin/zig.vim expandtab, tabstop and shiftwidth are set globally which affects all buffers while it should only be relevant for zig files.

From :help ftplugin - http://vimdoc.sourceforge.net/htmldoc/usr_41.html#41.12

To make sure the filetype plugin only affects the current buffer use the :setlocal command to set options. And only set options which are local to a buffer (see the help for the option to check that). When using :setlocal for global options or options local to a window, the value will change for many buffers, and that is not what a filetype plugin should do.