Vim Tips Wiki
Advertisement

With the introduction of the autoload directory, plugins were often split into several separate files. The downside is that it isn't always that obvious which files are actually loaded on startup.

In order to get a list of files loaded during startup, temporarily add the following lines to the top of your :help vimrc file:

 set verbosefile=~/vimfiles/startup_log.txt
 augroup StartupLog
   autocmd!
   autocmd SourcePre * silent echom expand('<afile>')
   autocmd VimEnter * set verbosefile& | autocmd! StartupLog
 augroup END

This will create the file ~/vimfiles/startup_log.txt (adapt the path to your needs), that contains a list of all files being loaded. Unfortunately, the file will also include all other messages generated during startup including those messages captured by plugins with :help :redir.

A slightly more elaborated version that will create a CSV file is published as script#2915.

The list can serve as a starting point for optimizing your startup time, e.g. by delaying certain calls to functions in autoload files or by making use of the AsNeeded plugin


Related Plugins

Advertisement