Faster Vim Start Up Time by Lazy Loading Plugins
Contents
Let’s get down on it assuming you’re using vim-plug as the plugin manager.
Identify the Plugins Taking Long to Load
|
|
Focus on the second column of the output, which is the time spent for loading the plugin sorted in descending order. vim-plug
installed plugins should be highlighted, see which one is sucking time.
Lazy Loading the Slow Plugins
Depending on the type of the plugin, do one of the following:
1. File Type Specific Plugins
Stop loading it unless the file you’re editing is what it’s targeted by adding {'for': '<file type>'}
.
e.g.
|
|
2. Command Triggered Plugins
For example ones for commenting out the lines or file explorer kind. If so, get them ignored until executing the command with {'on': '<command>'}
.
e.g.
|
|
3. Otherwise
Consider if it’s worth the accumulation of micro delay everytime you open up vim, then disable or let go.
That’s it, if you’re using other vim plugin manager or operating system (Mine’s MacOSX), you might have to tweak commands above a bit.