如何让我的 vim 在不手动重新加载的情况下应用 autocmd ~/.vimrc
?为什么根本... Filetype tsv ...
没有应用?
我的~/.vimrc
set ts=10
autocmd BufWrite * :echom "Writing buffer!"
autocmd Filetype tsv set ts=20 sts=20 sw=20
~/.vimrc
已加载,但 autocmd 仅在 a 之后应用:so
:
$ vim /tmp/test.tsv
:verbose set ts
tabstop=10
Last set by ~/.vimrc
:w
"test.tsv" 2L, 37C written
:so ~/.vimrc
:w
Writing buffer!
"test.tsv" 2L, 37C written
另外,为什么即使我编辑了一个.tsv
文件,tabstop 也没有设置为 20?
vim --version
: VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jul 11 2015 08:43:46)
:scriptnames
:
1: /etc/vimrc
2: /usr/share/vim/vimfiles/archlinux.vim
3: ~/.vimrc
4: ~/.vim/plugin/InsertXSDDateTimeLiteral.vim
5: ~/.vim/plugin/RdfNamespaceComplete.vim
6: /usr/share/vim/vimfiles/plugin/SyntaxFolds.vim
7: /usr/share/vim/vimfiles/plugin/filebrowser.vim
8: /usr/share/vim/vimfiles/plugin/imaps.vim
9: /usr/share/vim/vimfiles/plugin/libList.vim
10: /usr/share/vim/vimfiles/plugin/remoteOpen.vim
11: /usr/share/vim/vim74/plugin/getscriptPlugin.vim
12: /usr/share/vim/vim74/plugin/gzip.vim
13: /usr/share/vim/vim74/plugin/logiPat.vim
14: /usr/share/vim/vim74/plugin/matchparen.vim
15: /usr/share/vim/vim74/plugin/netrwPlugin.vim
16: /usr/share/vim/vim74/plugin/rrhelper.vim
17: /usr/share/vim/vim74/plugin/spellfile.vim
18: /usr/share/vim/vim74/plugin/tarPlugin.vim
19: /usr/share/vim/vim74/plugin/tohtml.vim
20: /usr/share/vim/vim74/plugin/vimballPlugin.vim
21: /usr/share/vim/vim74/plugin/zipPlugin.vim