Hello Vimmers,

when multiple plugins are placed inside the opt directory of a package,
all this plugins will be shown as completions for the :packadd command.

E.g. I have created a package called LSP. Inside this package, there are
three optional plugins (vim-lsp, asyncomplete-lsp and asyncomplete).

.../pack/langserver/opt/vim-lsp 
.../pack/langserver/opt/asyncomplete-lsp
.../pack/langserver/opt/asyncomplete

Considering I need the plugins. Then I would have to invoke :packadd for
each one of these and hope, that I won't forget any. 
I think it would be of great use to group these plugins under a common
name and reduce the multiple :packadd calls to one, for this given name. 
E.g. ":packadd lsp".


My current solution
-------------------

I group the plugins inside another directory named lsp. Then only this
directory (lsp) will be listed as a completion for :packadd.
Next I'll create under the lsp directory another directory called plugin
with a loadPlugins.vim file. These file has the following content:

packadd lsp/vim-lsp
packadd lsp/asyncomplete-lsp
packadd lsp/asyncomplete

This is required, as Vim will only look for *.vim files to be sourced by
:packadd, inside a plugin directory under the plugin-root-directory lsp.
(See first Note for packadd help.)


The previous directory structure will now look like this.
 
.../pack/langserver/opt/lsp/vim-lsp
.../pack/langserver/opt/lsp/asyncomplete-lsp
.../pack/langserver/opt/lsp/asyncomplete
.../pack/langserver/opt/lsp/plugin/loadPlugins.vim

When I invoke :packadd lsp<C-R>, Vim will source the loadPlugins.vim
file, which then start the sourcing of the grouped plugins.


With this workaround, I can load all three grouped plugins via one
:packadd call of the artifical enclosing plugin.

I'm considering to make use of it in some package manager. 

My only question(s) left are:
-----------------------------

- Is the behaviour of calling 
    :packadd {ArtificialWrapPluginName}/{RealChildPluginName} 
  intention or a bug? As everything after / won't have completion 
  entries.  
- Can I rely on this behaviour in the future? 


Best wishes and stay healthy!

Sascha San Juan

-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/DB7PR04MB530731B41B5D7C4F684851D8F5CF0%40DB7PR04MB5307.eurprd04.prod.outlook.com.

Reply via email to