Sunday, July 30, 2017

Re: standard way include plugin as a dependency of another plugin

On 30/07/2017 04:40, sashang@gmail.com wrote:
> Hi
>
> I'm writing a plugin and want it to depend on another plugin installed. At the moment I just have a line
>
> source <path to plugin>
>
> in my plugin that pulls in that plugin. Is there a standard way of doing this or do plugin authors just invent their own way? Could I use Vundle here instead?

I think that the usual solution is just to document the dependencies.
Then, it is the user's responsibility to get them, manually or
using a plugin manager.

The "modern" way (aka, Vim 8) is to use packages. From `:h packages`:

"A package can contain multiple plugins that depend on each other."

If you do not have control over one or more of your dependencies
(because they are plugins written by other people), and if you
distribute your package as a Git repo, a possibility is to include
the dependencies you need as Git submodules.

Mind that using submodules might result in users having multiple
copies of the same plugin (i.e., one from your package and one
installed by the user elsewhere, or even by another package).
Typically, it shouldn't do any harm, but it is something to keep
in mind, at least until packages become a mature feature of Vim,
and widely adopted by plugin developers (which has not been the
case, so far), so that best practices will emerge.

Life.

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: