Tuesday, March 29, 2016

Re: Packages and plugin's subdirectories

On 2016-03-29 19:53:07 +0000, Bram Moolenaar said:

> Nicola wrote:
>
>> Neocomplete's plugin folder is organized as follows:
>>
>> plugin/
>> neocomplete.vim
>> neocomplete/
>> buffer.vim
>> dictionary.vim
>> tag.vim
>>
>> No matter whether neocomplete is in pack/*/start/ or in pack/*/opt/,
>> only plugin/neocomplete.vim is loaded (at startup or with :packadd,
>> respectively). Is that a bug?
>>
>> Using Vim 7.4.1655.
>
> The reason neocomplete does it this way, AFAIK, is to avoid having too
> many files in the top plugin directory. It's shared with all other
> plugins.
>
> For a package this problem does not exist. You can simply put all files
> in the plugin directory:
> pack/start/neo/plugin/
> neocomplete.vim
> buffer.vim
> dictionary.vim
> tag.vim
>
> It saves a bit of time searching directories.
>
> If someone sees a good reason to also search in subdirectories, let's
> hear it.

If that is the intended behaviour, maybe it should be noted more explicitly
in the help files. In `:h packages`, it is written that Vim:

[...] scans all directories in 'packpath' for plugins [...] and loads them.
The directory is added to 'runtimepath'. In the example Vim will find [...]
and adds "~/.vim/pack/foo/start/foobar to 'runtimepath'.

And in `:h packadd`:

If the "{name}/plugin" directory contains more than one file they are all
sourced.

One is brought to think that things works as if having put the paths in
runtimepath to begin with (at least, that is what I thought).

Nicola


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