This sounds like something is setting
expandtab on you. Various filetype plugins do this, including
/usr/share/vim/vim91/ftplugin/meson.vim, which seems like a likely culprit, given the initial report. As I read that vim file, this is because someone considers
expandtab to be "Meson recommended style." Fortunately, the author included a hook you can use to override this:
Code: Select all
if get(g:, "meson_recommended_style", 1)
setlocal expandtab
setlocal shiftwidth=2
setlocal softtabstop=2
let b:undo_ftplugin .= " | setl et< sts< sw<"
endif
Therefore, set that variable to 0, and this plugin should stop applying these settings. Beware that if this is Meson recommended style, then deviating from it may cause other Meson users to complain when reading content you wrote under the override, or even cause syntax errors if the parser reacts badly to mixing tabs and spaces in a single file, and you edit a "recommended style" file while using this override.