startuptime
vim
安装大量插件之后导致启动变慢,可以通过以下命令来排查各个插件的启动时间:
vim --startuptime vim.log
vim.log
中保存了启动时间信息:
000.003 000.003: --- VIM STARTING ---
000.068 000.065: Allocated generic buffers
000.092 000.024: locale set
000.102 000.010: GUI prepared
000.105 000.003: clipboard setup
000.109 000.004: window checked
000.584 000.475: inits 1
000.588 000.004: parsing arguments
000.589 000.001: expanding arguments
000.595 000.006: shell init
000.779 000.184: Termcap init
000.810 000.031: inits 2
000.903 000.093: init highlight
Profiling
help cmd
--cmd {command} *--cmd*
{command} will be executed before processing any vimrc file.
Otherwise it acts like -c {command}. You can use up to 10 of
these commands, independently from "-c" commands.
{not in Vi}
-c {command} {command} will be executed after the first file has been
read (and after autocommands and modelines for that file have
been processed). "command" is interpreted as an Ex command.
If the "command" contains spaces, it must be enclosed in
double quotes (this depends on the shell that is used).