When I open a C file in vim, it seems to think I want 8 spaces worth of indentation, even though I specify my indentation preferences in .vimrc with the below:
set expandtab
set softtabstop=4
set shiftwidth=4
set autoindent
I also have:
filetype indent plugin on
The only fix I've come across so far is :set sw=4 in the buffer of the C file. I don't know why this works because I'm already setting that value in the .vimrc, so I can only guess that it's getting overwritten when the file-specific indentation settings are loaded. Unfortunately, deleting the filetype ... line from my .vimrc doesn't seem to help.
:verbose set ts sts sw(tsbeing the short name fortabstop,stsforsofttabstop, andswforshiftwidth). – Martin Tournoij Feb 21 '21 at 00:01:verbose set shiftwidthwill point a ftplugin that you'll want to override – statox Feb 22 '21 at 09:14