"Matt Wozniski" <m...@drexel.edu> wrote :

> Of course, autoload functions aren't a silver bullet, either.  If you
> have a function that you use every time vim starts (either because
> it's called by a plugin, or your vimrc, or a statusline, etc), then
> it's almost certainly slower to put it in an autoload script, even if
> that's nicer for organization.  

Except when the function is required by two or more plugins.

Copy-pasting the function is not a good idea for obvious (at least, IMO) 
maintenance reasons.

And cluttering all plugins, but one, with ":runtime 
plugin/theonethatgotthefunction.vim" is not better than relying on autoload 
plugin mechanism which at least caches when a function has already being loaded 
-- the :runtime is required as there no useful guaranty regarding the order in 
which plugins within a same directory are loaded.

> Personally, I tend to put all the functions for my scripts into
> plugins/ and then, once the scripts become too large, or I notice
> that a lot of overhead goes into interpreting code that's rarely 
> used, etc,
> I start pushing things out to autoload functions.  I try to keep my
> vimrc free of functions that aren't directly used by it, though.

I have a lot of plugins installed, and its extremely rare I need to run all of 
them during a same vim session. Hence I'm slowly refactoring my plugins to 
extract their functions into autoload plugins, and call them from the :command, 
mappings, abbreviation defined in the plugins.

-- 
Luc Hermitte
http://lh-vim.googlecode.com/
http://hermitte.free.fr/vim/

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to