The :verbose command will tell you where the option has been changed:
:verbose set autoindent?
If this alone does not help, you can check all executed commands, it is advisable that the output be redirected to the log file:
:set verbosefile=vim.log :20verbose edit foo.php
Also note that there are several indentation control options, for example. 'cindent' , 'smartindent' , 'indentexpr' etc.
PS: To avoid changing the parameter value in other buffers, it is recommended that you use :setlocal instead.
Ingo karkat
source share