Is there a way to profile Vim plugins?
My MacVim becomes slower and slower when I open a large .py
. I know I could deselect all plugins and reselect one by one to check which plugin is the culprit, but is there a faster way?
My dotvim is here: https://github.com/charlax/dotvim
Some plugins may load fast, but will significantly slow down your vim when they are running: ale.
First, get a feel for how fast Vim can be: run with vim -u NONE and comment out everything in your . vimrc - then do the single thing that seems slow. Run without the -u NONE and compare. It should be just as fast, or some plugin is autoloaded and is causing problems.
You can use built-in profiling support: after launching vim do
:profile start profile.log :profile func * :profile file * " At this point do slow actions :profile pause :noautocmd qall!
(unlike quitting noautocmd
is not really required, it just makes vim quit faster).
Note: you won’t get information about functions there were deleted before vim quit.
I found another very helpful vim buildin method to show the exactly timing messages while loading your .vimrc.
vim --startuptime timeCost.txt timeCost.txt
Please run:
:help --startuptime
in VIM to get more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With