Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve startup time by organizing into ftplugin and autoload folders #82

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

fent
Copy link

@fent fent commented Apr 23, 2018

Hi, I was profiling my vim startup time and noticed that vim-markdown-preview is taking unusually long compared to other plugins

146.843  019.587  019.587: sourcing /Users/fent/.vim/plugged/vim-markdown-preview/plugin/vim-markdown-preview.vim

This is from using the --startuptime flag. I then realized I hadn't opened a markdown file, and so the plugin shouldn't be sourced. That's the first part of this PR.

The 2nd part is organizing the main functionality into the autoload folder. When we open a markdown file, we don't wanna fully load the plugin until we use it.

After that optimization, the startup time for the script looks like

133.973  000.129  000.129: sourcing /Users/fent/code/vim/vim-markdown-preview/ftplugin/markdown.vim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant