I am trying to configure my vimrc so that tabs are 2 spaces when editing tex documents.
In my vimrc file, I have
au BufNewFile,BufRead *.py:
\ set tabstop=4
\ set softtabstop=4
\ set shiftwidth=4
\ set textwidth=79
\ set expandtab
\ set autoindent
\ set fileformat=unix
au BufNewFile,BufRead *.js, *.html, *.css, *.tex:
\ set tabstop=2
\ set softtabstop=2
\ set shiftwidth=2
However, when I edit a document in vim, it ignores the tabstop. Tabs are much longer than 2 spaces. Vim does not throw out any errors. I do not understand why it ignores the tabstop=2 line when I am editing a tex document. I have to run :set tabstop=2 while editing.
Can anyone see how my configuration file is wrong?
In case this is relevant, I am using the vimtex plugin.
Thank you.
:verbose set tabstop?. It'll show where the relevant option was last set, which will help debugging. - Michail