Why "loadplugin" when there's already "loadplugins"?

132 views
Skip to first unread message

Manuel Ortega

unread,
Feb 21, 2016, 9:08:34 PM2/21/16
to vim...@googlegroups.com
I know that loadplugins in an option while loadplugin is a command, but surely there is a better name for the new command.  This is just gratuitously confusing.

What's wrong with "loadpack" or something like that?

-Manny

Nikolay Aleksandrovich Pavlov

unread,
Feb 21, 2016, 10:34:40 PM2/21/16
to vim_dev
I would say that `:loadpack` name cannot be used because “pack” is a
shorthand for “package” and “package” is defined as something that may
contain more then one plugin. Problem is that in `:h plugin` by
“plugin” means “file placed into {runtimepath}/[ft]plugin” while
modern plugins tend to have far more then one file, with most
functionality in autoload. Most people though use “plugin”, “addon”
and “extension” as a synonims (when Vim plugin/addon/extension is
meant, other applications may have different terminology) meaning “a
connected set of files with single purpose, distributed as a whole”.

Thus `:loadplugin` is not the best name, but it matches some
expectations while `:loadpack` does not fit at all.

>
> -Manny
>
> --
> --
> You received this message from the "vim_dev" 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_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vim_dev+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Bram Moolenaar

unread,
Feb 22, 2016, 4:05:27 AM2/22/16
to Nikolay Aleksandrovich Pavlov, vim_dev

Nikolay Pavlov wrote:

> 2016-02-22 5:08 GMT+03:00 Manuel Ortega <manny...@gmail.com>:
> > I know that loadplugins in an option while loadplugin is a command, but
> > surely there is a better name for the new command. This is just
> > gratuitously confusing.
> >
> > What's wrong with "loadpack" or something like that?
>
> I would say that `:loadpack` name cannot be used because “pack” is a
> shorthand for “package” and “package” is defined as something that may
> contain more then one plugin. Problem is that in `:h plugin` by
> “plugin” means “file placed into {runtimepath}/[ft]plugin” while
> modern plugins tend to have far more then one file, with most
> functionality in autoload. Most people though use “plugin”, “addon”
> and “extension” as a synonims (when Vim plugin/addon/extension is
> meant, other applications may have different terminology) meaning “a
> connected set of files with single purpose, distributed as a whole”.
>
> Thus `:loadplugin` is not the best name, but it matches some
> expectations while `:loadpack` does not fit at all.

Right, the name is not ideal, but I could not think of a better one.
I would also use "bundle" instead of package or pack, but plugin
managers already use it and there could be a conflict.

I hope that the new mechanism doesn't break existing behavior. Nikolay,
you had quite a few comments on other solutions, let us know if you see
something wrong with how packages and :loadplugin work.

I hope the new mechanism can be used by plugin managers and make their
work a bit easier. But they will also want to work with older Vim
versions, might take a while.

--
ARTHUR: Be quiet!
DENNIS: --but by a two-thirds majority in the case of more--
ARTHUR: Be quiet! I order you to be quiet!
WOMAN: Order, eh -- who does he think he is?
ARTHUR: I am your king!
The Quest for the Holy Grail (Monty Python)

/// Bram Moolenaar -- Br...@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 ///

Nikolay Aleksandrovich Pavlov

unread,
Feb 22, 2016, 1:10:15 PM2/22/16
to Bram Moolenaar, vim_dev
I do not think current plugin managers will use it in a few years
because of older Vim versions support, but it addresses most problems
raised in that thread and can replace pathogen right now.

Though loading plugin at runtime is more work then just :runtime …,
additional work can also be integrated into :loadplugin. Some of this
work is actually easier to do from C code: I speak about running
autocmd events without which some plugins will not work and which were
missed because `:loadplugin` was called after VimEnter and various
other events run at startup. VAM is doing this based on parsing
`:autocmd` output, but this solution has a known corner cases and is
rather slow. C code can simply save new events right in
do_autocmd_event and run them if they match. If this is OK I will
probably create a patch.

Charles Campbell

unread,
Feb 22, 2016, 2:18:01 PM2/22/16
to vim...@googlegroups.com
Bram Moolenaar wrote:
> Right, the name is not ideal, but I could not think of a better one. I
> would also use "bundle" instead of package or pack, but plugin
> managers already use it and there could be a conflict. I hope that the
> new mechanism doesn't break existing behavior. Nikolay, you had quite
> a few comments on other solutions, let us know if you see something
> wrong with how packages and :loadplugin work. I hope the new mechanism
> can be used by plugin managers and make their work a bit easier. But
> they will also want to work with older Vim versions, might take a while.
Alternate name: loadtrove

A trove is a collection of objects (ex. I found a trove of old baseball
cards).

I'm not sure its a better one or not -- I'll let y'all ruminate on it.

Chip

Justin M. Keyes

unread,
Feb 22, 2016, 5:21:39 PM2/22/16
to vim...@googlegroups.com
It's not.

---
Justin M. Keyes

Nikolay Aleksandrovich Pavlov

unread,
Feb 22, 2016, 6:21:12 PM2/22/16
to vim_dev
It is the first time I mentioned this word, I think it is quite rare.

>
> Chip
Reply all
Reply to author
Forward
0 new messages