Compatibility with tplugin / autoload
blueyed opened this issue · comments
I am testing out tplugin, which allows to lazily load Vim plugins.
From the issue I reported:
Please consider to move the Complete function to autoload/ag.vim as ag#Complete, which would facilitate the use with tplugin.
I would be happy to create a PR for this - just let me know.
Done.
Out of curiosity, does tplugin's lazy loading actually improve startup time for you? I have a fair number of plugins in my rtp (eclim, all my other plugins, + a few others), and I've never noticed any slowdown when opening vim:
$ vim --startuptime /dev/stdout +qall
times in msec
clock self+sourced self: sourced script
clock elapsed: other lines
000.011 000.011: --- VIM STARTING ---
000.207 000.196: Allocated generic buffers
000.371 000.164: locale set
000.402 000.031: GUI prepared
000.406 000.004: clipboard setup
000.418 000.012: window checked
001.265 000.847: inits 1
001.280 000.015: parsing arguments
001.281 000.001: expanding arguments
001.304 000.023: shell init
001.825 000.521: Termcap init
001.911 000.086: inits 2
002.196 000.285: init highlight
002.686 000.237 000.237: sourcing /usr/share/vim/vimfiles/archlinux.vim
002.749 000.476 000.239: sourcing /etc/vimrc
...
093.843 091.020 001.729: sourcing $HOME/.vimrc
093.847 000.155: sourcing vimrc file(s)
...
144.109 001.862: loading plugins
144.956 000.847: inits 3
145.210 000.254: reading viminfo
147.231 002.021: setup clipboard
147.255 000.024: setting raw mode
147.263 000.008: start termcap
147.303 000.040: clearing screen
148.737 001.104: opening buffers
149.110 000.373: BufEnter autocommands
149.114 000.004: editing files in windows
149.205 000.091: VimEnter autocommands
149.208 000.003: before starting main loop
150.172 000.964: first screen update
150.175 000.003: --- VIM STARTED ---
Out of curiosity, does tplugin's lazy loading actually improve startup time for you?
Yes.
I am currently using NeoBundle though, which has a less sophisticated method of autoloading (it does not setup command wrappers by default etc). Therefore I am experimenting currently with combining tplugin (its TPluginScan
mechanism) and NeoBundle.
I have a larger set of plugins probably though.