I tried the above and some js still weirdly default to 4 spaces in some cases. It's not consistent... Are there any other values modifying this?
rm ~/.vimswap/* should do ya right.
What is the reason for this behaviour?
I'm still new to vim, but I think .vimrc sets shiftwidth with the old vi style "sw" variable in the indent_guides plugin section. When I commented that out, I could change the setting in the Formatting section and have them take effect after restarting vim.
Same here. Still doesn't work for me.
Works for me rm ~/.vimswap/* does the trick
Deleting the files did not work for me, I am working with ruby files. I will let you know if I find a solution.
I've added this to my ~/.vimrc.local file
However, after opening a ruby file, and doing :set shiftwidth, vim responds with:
@droope @webmaven if rm ~/.vimswap/* didn't worked for you, then try clean your vimviews folder, it probably cached the files you we're editing before. Use rm ~/.vimviews/* that should pick up your new settings.
It's probably a ruby specific plugin that is setting it upon opening a ruby file which would happen after the .local file is read. That's a pretty common thing for language specific plugins to do.
Not sure what changed (rm ~/.vimviews/* didn't have any effect for at least a few days), but JS files eventually did start picking up the 2-space indentation as intended.
@webmaven so I'm hopeful my JS files will, as well...