如何找出 Vim 设置在哪个插件中被更改? [英] How to find out, in which plugin a Vim setting gets changed?
问题描述
今天我有一些不为人知的行为.我有
设置自动缩进
在我的 vimrc 中,但由于某种原因,每当我打开一个 PHP 文件时,它都会被关闭.
我现在通过添加像
这样的行来修复它autocmd FileType php set autoindent
但我仍在尝试找出禁用此设置的位置.那么有什么方法可以找出 vim 配置中的某个设置被更改的位置?
这里是我在 Ubuntu 上使用的完整 vimrc.local
供参考:
https://gist.github.com/mikehaertl/1612035/5fa1006577d193857 问题是由 如果单独这样做没有帮助,您可以检查所有已执行的命令,最好将输出重定向到日志文件中: 另请注意,有几个控制缩进的选项,例如 PS:为避免修改后的选项值溢出到其他缓冲区,建议改用 Today I had some obscure behavior. I have 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 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 https://gist.github.com/mikehaertl/1612035/5fa149468006577d193858bbc8cefcd3a413e017 EDIT:
The problem was caused by a The If that alone doesn't help, you can inspect all executed commands, preferably with the output redirected into a logfile: Also note that there are several options controlling indentation, e.g. PS: To avoid that the changed option value spills into other buffers, it's recommended to use 这篇关于如何找出 Vim 设置在哪个插件中被更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!filetype indent on
引起的,我前段时间添加到我的配置中.不知道,为什么这会影响自动缩进.:verbose
命令将告诉您选项最后更改的位置::verbose 设置自动缩进?
:set verbosefile=vim.log:20verbose 编辑 foo.php
'cindent'
、'smartindent'
、'indentexpr'
等:setlocal
.set autoindent
autocmd FileType php set autoindent
vimrc.local
that I'm using on Ubuntu:filetype indent on
that I added some time ago to my config. No idea, why that affects autoindent, though.:verbose
command will tell you where an option was last changed::verbose set autoindent?
:set verbosefile=vim.log
:20verbose edit foo.php
'cindent'
, 'smartindent'
, 'indentexpr'
, etc.:setlocal
instead.