Closed giftig closed 6 years ago
Running :verbose set softtabstop
and verbose set shiftwidth
both tell me "last set from modeline". I don't set a modeline in my vimrc, but I don't see one mentioned in vim-scala either.
I tracked down the problem to a file called plugin/31-create-scala.vim
. I have no idea where I got this file from, how it appeared on 3 different machines which have all had this problem, or why a create-scala file would set tabstop to 4, but it doesn't seem to be anything to do with vim-scala... so I'll close this as it's nothing to do with you.
:D
I've been experiencing this problem for years but finally got around to figuring out how to reproduce / mitigate it reliably.
If you open a new scala file and start writing a class, object, or whatever else, indentation seems to be set to 4 spaces:
This seems to happen at every indentation level, so it continues to bug me as I continue to code and manually fix it, each time I write methods, etc., and it even applies when I select a block in visual mode and use << or >> to try to correct it; it'll still use 4-space indents so I have to dedent manually.
At first I assumed it was based on file contents and I was missing some key which would fix it when I write new files, but I've just tried copying a buffer where it's working fine to a new buffer where it's not, and it seems it's something set by the process of creating the new file, and only goes away when I use
:bw
to wipe the buffer, or else close vim and reopen the file.Echoing tabstop reveals that
shiftwidth=4
andtabstop=4
in the new buffer. It seems like the plugin is setting tabstop to 4 for some reason when a new file is created, and forgetting to unset it?