Today I had some obscure behavior. I have
set autoindent
in my vimrc, but for some reason, this gets turned off, whenever i open a PHP file.
I've fixed it now by adding a line like
autocmd FileType php set autoindent
But I'm still trying to figure out, where this setting is disabled. So is there some way to find out, where in the vim config a setting gets changed?
For reference here's my full vimrc.local
that I'm using on Ubuntu:
https://gist.github.com/mikehaertl/1612035/5fa149468006577d193858bbc8cefcd3a413e017
EDIT:
The problem was caused by a filetype indent on
that I added some time ago to my config. No idea, why that affects autoindent, though.
The :verbose
command will tell you where an option was last changed:
:verbose set autoindent?
If that alone doesn't help, you can inspect all executed commands, preferably with the output redirected into a logfile:
:set verbosefile=vim.log
:20verbose edit foo.php
Also note that there are several options controlling indentation, e.g. 'cindent'
, 'smartindent'
, 'indentexpr'
, etc.
PS: To avoid that the changed option value spills into other buffers, it's recommended to use :setlocal
instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With