vimtricks.wiki Concise Vim tricks, one at a time.

How do I find out what is making Vim slow to start up?

Answer

vim --startuptime /tmp/vim-startup.log

Explanation

When Vim takes too long to start, the --startuptime flag writes a detailed timing log showing exactly how long each plugin, script, and initialization step takes. This is the fastest way to identify which plugin or configuration is causing the slowdown, without guessing or manually disabling plugins one by one.

How it works

  • --startuptime {file} — Tells Vim to record timing information for every step of its startup sequence into the specified file.
  • Each line in the log shows the elapsed time, the time spent on that step, and what was being loaded or executed.
  • The file is plain text and can be reviewed with Vim itself or any text editor.

Example

Profile your startup and review the results:

vim --startuptime /tmp/vim-startup.log
:e /tmp/vim-startup.log

Sample output:

000.009  000.009: --- VIM STARTING ---
001.542  001.533: sourcing /usr/share/vim/vimrc
045.230  043.688: sourcing ~/.vim/plugged/heavy-plugin/plugin/main.vim
046.012  000.782: sourcing ~/.vim/plugged/lightline/plugin/lightline.vim
050.001  003.989: loading plugins
052.340  052.340: --- VIM STARTED ---

In this example, heavy-plugin takes 43ms — a clear bottleneck.

Tips

  • Sort the log by the second column to find the slowest items: :sort! /\d\+\.\d\+:/ r.
  • Use :profile start /tmp/profile.log | profile func * to profile function calls during a running session.
  • For Neovim, the same --startuptime flag works identically.
  • Combine with vim --noplugin to compare startup with and without plugins.

Next

How do I return to normal mode from absolutely any mode in Vim?