Today I Learned

hashrocket A Hashrocket project

Vim startup time profiling

If you want to see why vim is taking so long, you can get a breakdown of how long each plugin took to load:

vim --startuptime startup.log

To make things a little easier, I created the following bash command, which will create the startup log, open it in vim and delete it when done.

vim --startuptime startup.log +qall && vim startup.log && rm startup.log

Graphing the data

You can use vim-plugins-profile shell script to get a better sense of which plugins are causing the biggest slowdown: https://github.com/hyiltiz/vim-plugins-profile

It will create a graph resembling the DevTools network tab: graph

and provide a summary similar to this one:

Generating vim startup profile...    
Parsing vim startup profile...     
Crunching data and generating profile plot ...    

Your plugins startup profile graph is saved     
as `profile.png` under current directory.    

==========================================    
Top 10 Plugins That Slows Down Vim Startup    
==========================================    
   1    105.13  "vim-colorschemes"    
   2    42.661  "vim-easytags"    
   3    31.173  "vim-vendetta"    
   4    22.02   "syntastic"    
   5    13.362  "vim-online-thesaurus"    
   6    7.888   "vim-easymotion"    
   7    6.931   "vim-airline"    
   8    6.608   "YankRing.vim"    
   9    5.266   "nerdcommenter"    
  10    5.017   "delimitMate"    
==========================================    
Done!
See More #vim TILs
Every developer at Hashrocket is a Vim expert. Check out our development environment, Dotmatrix, and if you are in Chicago, come to the Vim Chicago Meetup hosted at our Chicago office.