Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find out, in which plugin a Vim setting gets changed?

Tags:

vim

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.

like image 577
Michael Härtl Avatar asked Oct 25 '13 08:10

Michael Härtl


1 Answers

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.

like image 87
Ingo Karkat Avatar answered Sep 28 '22 05:09

Ingo Karkat