使用vim
选项调查--startup
启动时间时,我发现有很多文件来源多次。
任何人都可以解释我原因。
在vim --startuptime vim-startup
然后sort -k 4 vim-startup
之后,滚动到输出结束。有许多行sourcing /usr/local/share/vim/vim74/syntax/syncolor.vim
重复
717.204 000.149 000.149: sourcing /usr/local/share/vim/vim74/plugin/getscriptPlugin.vim
717.635 000.394 000.394: sourcing /usr/local/share/vim/vim74/plugin/gzip.vim
718.072 000.400 000.400: sourcing /usr/local/share/vim/vim74/plugin/logiPat.vim
718.416 000.305 000.305: sourcing /usr/local/share/vim/vim74/plugin/matchparen.vim
719.372 000.917 000.917: sourcing /usr/local/share/vim/vim74/plugin/netrwPlugin.vim
719.480 000.058 000.058: sourcing /usr/local/share/vim/vim74/plugin/rrhelper.vim
719.596 000.074 000.074: sourcing /usr/local/share/vim/vim74/plugin/spellfile.vim
719.883 000.248 000.248: sourcing /usr/local/share/vim/vim74/plugin/tarPlugin.vim
720.119 000.192 000.192: sourcing /usr/local/share/vim/vim74/plugin/tohtml.vim
720.451 000.290 000.290: sourcing /usr/local/share/vim/vim74/plugin/vimballPlugin.vim
720.828 000.325 000.325: sourcing /usr/local/share/vim/vim74/plugin/zipPlugin.vim
288.036 000.351 000.351: sourcing /usr/local/share/vim/vim74/syntax/syncolor.vim
355.569 000.211 000.211: sourcing /usr/local/share/vim/vim74/syntax/syncolor.vim
358.687 000.412 000.412: sourcing /usr/local/share/vim/vim74/syntax/syncolor.vim
403.346 000.541 000.541: sourcing /usr/local/share/vim/vim74/syntax/syncolor.vim
406.806 000.277 000.277: sourcing /usr/local/share/vim/vim74/syntax/syncolor.vim
416.571 000.370 000.370: sourcing /usr/local/share/vim/vim74/syntax/syncolor.vim
419.967 000.456 000.456: sourcing /usr/local/share/vim/vim74/syntax/syncolor.vim
429.839 000.280 000.280: sourcing /usr/local/share/vim/vim74/syntax/syncolor.vim
433.602 000.382 000.382: sourcing /usr/local/share/vim/vim74/syntax/syncolor.vim
289.756 004.047 003.696: sourcing /usr/local/share/vim/vim74/syntax/synload.vim
413.308 013.091 001.653: sourcing /usr/local/share/vim/vim74/syntax/synload.vim
289.809 005.994 001.947: sourcing /usr/local/share/vim/vim74/syntax/syntax.vim
413.370 015.529 001.789: sourcing /usr/local/share/vim/vim74/syntax/syntax.vim
1240.101 000.004: before starting main loop
737.049 000.020: start termcap
736.993 000.202: reading viminfo
442.780 000.558: sourcing vimrc file(s)
有人可以解释为什么vim
需要多次获取一个文件,或者如何强制它加载一次。
以下是vim --startup
的完整输出:before和after排序,nvim --startuptime
:before和after排序
答案 0 :(得分:1)
查看您的vim --startup
输出,看起来好像许多其他脚本多次加载。例如,下面的脚本来源四次次:
/Users/nissassin17/.vim/bundle/xptemplate/plugin/classes/FiletypeScope.vim
并且很多其他人。
您似乎也在加载原始曝光的colorscheme 三次次和" base-16"之后的变体完全没有意义,可能会被视为/usr/local/share/vim/vim74/syntax/syntax.vim
的多重采购的原因。
我无法看到你的vimrc
,但我建议删除~/.vim/bundle/
的内容并重新开始。
可能插件少吗?
答案 1 :(得分:1)
vim/neovim 两次加载颜色方案的另一个原因是如果您的 vimrc 中有 def digital_root(n):
n=sum([int(i) for i in str(n)])
if len(str(n))==1:
print(n)
else:
digital_root(n)
after syntax on
。解决方案:切换它们。