Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
不知何故vim记得我在某些文件上做过,并一直在模式下vimdiff打开它们。vimdiff这意味着当我再次打开同一个文件时,我会在左侧显示一个灰色条foldcolumn(:sp anotherfile.txt如等等
vim
vimdiff
foldcolumn
:sp anotherfile.txt
就好像我打开了第一个文件vimdiff somefile.txt一样,但我没有。我用它打开它,vim somefile.txt它仍然表现得像vimdiff,只是因为过去我用它打开它vimdiff。这很烦人。
vimdiff somefile.txt
vim somefile.txt
为什么会发生?
好的,找到了。/.vimrc几周前我将这些添加到我的:
/.vimrc
autocmd BufWinLeave *.* mkview autocmd BufWinEnter *.* silent loadview
现在,每当我使用vimdiff它时,它都会为特定文件创建一个vimdiff 视图,然后在下次打开文件时重新加载它。
这对vimdiff. 我将不得不看看如何mkview仅为普通 vim 而不是为 vimdiff 激活。
mkview