Thursday, May 10, 2012

Re: Plugin manager with dependencies and selective bundle load

2012/4/27 Marc Weber <marco-oweber@gmx.de>
Excerpts from Pablo Giménez's message of Thu Apr 26 20:00:23 +0200 2012:
> I dont know exactly how it works but this is what it is doing ans is great.
> AFAIK in vam you have to activate the plugins manually using
> ActivateAddons, then the plugin rather than being waiting to be called it
> is loaded.

There is a 'func not defined' hook which can be used. Maybe that is
used.
You're right, VAM does not support such yet.
Feel free to use VAM to :InstallAddons only and use tplugin for
activating them.
Finally I follow your indications I am using only VAM.
The difference using tplugin is minimal, and tplugin at the end looks like a hack, like the AsNeeded plugin.
All loading on demand should be done using te autoload feature ans you and Campbell pointed.
So is more a responsability of the plugin developer.
Luckely most plugins nowdays use have the private interface in autoload.

I am also using the experimental activation of add ons using filetype, seems to be working fine.
One thing related to this feature is that if you want to make a plugin depend on another, but only load when a certain filetype is set, is impossible I think.
For instance if pluginB depends on pluginA. And you want to pluginA  only for certain filetypes.
As soon as you put pluginA in the addon-info.json for pluginB as a dependency it will be activated when pluginB is activated.
Is there any way to set the dependency, mainly for installing pourposes, but only get it activated when a certain filetype is set?

Thanks

My understanding of pludins is:

plugin/*.vim: everything the user can customize (settings, interface,
mappings, commansds)

autoload/*: everything else

VAM has an experimental function to "merge" all plugin/* files so that
only one file is sources - but this still assumes that plugins only put
minimal configuration into the plugin files - and the if .. finish line
may be causing trouble easily and such.

Due to commands I personally assume that plugin files should always be
read - you're right, you can replace commansds/ mappings by "fake"
implementations activating a plugin first.
Before you make me spend time on such do profiling and tell me what's
causing most trouble to you.

> Yep sorry my bad I got this working.
You're welcome. Its easy to miss a detail if there is so much new stuff.

plugin2 depending on plugin1 and auto activation:
Retry again. This would be a serious bug.

If can't make it work I can invite you to a SSH session so that you can
proof me that its behaving wrong easily.

Marc Weber

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php



--
Un saludo
Best Regards
Pablo Giménez

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: