Friday, March 4, 2016

Re: Packages

On 4 March 2016, Nikolay Aleksandrovich Pavlov <zyx.vim@gmail.com> wrote:
> 2016-03-04 14:25 GMT+03:00 LCD 47 <lcd047@gmail.com>:
> > On 3 March 2016, Bram Moolenaar <Bram@moolenaar.net> wrote:
> > [...]
> >> I realize several people who have previously been using Pathogen
> >> are confused. Perhaps we can just put every directory under
> >> "pack/*/ever" in 'runtimepath'?
> >
> > A tangentially related question. Assume I need to check that
> > a plugin named "foo" is installed and enabled. Assume also "foo"
> > contains
>
> If you need to check that it is installed and *enabled* then you
> should not do anything you are not already doing.

So if

globpath(&runtimepath, "autoload/foo.vim", 1) != ""

returns true, I can assume "foo" is installed and enabled?

> Problem is that with "just put every directory under pack/*/ever"
> you probably will not be able to do this from the vimrc: rationale is
> that
>
> 1. Putting should be automatic.
> 2. Yet user settings regarding where "pack" is should be respected.
>
> So "just put" should be done somewhere between "load vimrc" and "load
> plugins" initialization stages.

I'm trying to write a plugin that happens to need "foo", not a
plugin manager. I don't want to install "foo" if it's missing, I just
want to know if I can call "foo#bar()". Checking for the function
itself is not reliable:

exists("*foo#bar")

returns false if the corresponding autoload file is not already loaded.
I also don't want to load the file just to make sure I can use the
function at some later point in time.

/lcd

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

Post a Comment