I want to prevent the default ftplugin/syntax/indent files from running for tex files.

I have a tex.vim in the $XDG_CONFIG_HOME/nvim/ftplugin directory, i confirmed it runs before the default ftplugin/syntax/indent files through :scriptnames, but the default ftplugin/syntax/indent files are still allowed to run unguarded, so for some reason the variables aren't actually being set.

the tex.vim file is as follows:

let b:did_ftplugin = 1
let b:current_syntax = "tex"
let b:did_indent = 1

I have also set vim.g.tex_flavor = "latex" in my init.lua, so it is defaulting to tex and not plaintex.

1 Answer 1


I assume the buffer is being reloaded after ftplugin, indent, syntax. So the buffer local variables aren't persistent. Splitting the files into the correct ftplugin/syntax/indent dirs fixes the issues, but is somewhat verbose for just wanting to disable the defaults.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.