Tuesday, March 29, 2016

Re: Packages and plugin's subdirectories

2016-03-29 22:53 GMT+03:00 Bram Moolenaar <Bram@moolenaar.net>:
>
> 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.

This variant is not usable for the following reasons:

1. Keeping compatibility with Vim versions that do not have packages.
No, creating distributions is not an option here: users want to just
`git clone` to a right location.
2. Force loading using :runtime of files that have "generic" names
does not work well.
3. This destroys the hierarchy. Initial variant has clear "main" file
neocomplete.vim and "secondary" files buffer.vim, etc. They do not
depend on each other, but their total contents is really just enough
for one file, not four.
4. Keeping compatibility with *package managers* (not Vim-specific
plugin managers, I talk about systems ones) which are rather
conservative and would not thank you if you will force to rewrite
build scripts because new plugin distribution expects to be installed
*only* as a package (and nobody wants to maintain multiple
distributions).

One can, of course, use neocomplete_buffer.vim, etc, but this is a
hack with necessity emerged out of thin air, nobody likes this. Also
do not forget that "just git clone" also applies to plugins that are
no longer maintained.

>
> --
> You're as much use as a condom machine at the Vatican.
> -- Rimmer to Holly in Red Dwarf 'Queeg'
>
> /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
> /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
> \\\ an exciting new programming language -- http://www.Zimbu.org ///
> \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
>
> --
> --
> 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.

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