今天我有一些不起眼的行为.我有
set autoindent
Run Code Online (Sandbox Code Playgroud)
在我的vimrc中,但由于某种原因,每当我打开PHP文件时,这都会被关闭.
我现在通过添加一行来修复它
autocmd FileType php set autoindent
Run Code Online (Sandbox Code Playgroud)
但我仍然想弄清楚,这个设置被禁用了.那么有什么方法可以找到,vim配置中的设置会发生变化吗?
这里是我vimrc.local在Ubuntu上使用的全部内容:
https://gist.github.com/mikehaertl/1612035/5fa149468006577d193858bbc8cefcd3a413e017
编辑:问题是由filetype indent on我前一段时间添加到我的配置引起的.不知道,为什么这会影响autoindent.
Ing*_*kat 14
该:verbose命令将告诉您上次更改选项的位置:
:verbose set autoindent?
Run Code Online (Sandbox Code Playgroud)
如果单独没有帮助,您可以检查所有已执行的命令,最好将输出重定向到日志文件中:
:set verbosefile=vim.log
:20verbose edit foo.php
Run Code Online (Sandbox Code Playgroud)
另请注意,有几个选项控制压痕,例如'cindent','smartindent','indentexpr'等
PS:为避免更改的选项值溢出到其他缓冲区,建议改为使用:setlocal.