faerryn / user.nvim

Since the advent of vim and neovim, countless package managers have appeared and dissappeared. Well, here's another to the list.
MIT License
32 stars 2 forks source link

How to differenciate the start plugins and optional plugins? #6

Closed tristone13th closed 2 years ago

faerryn commented 2 years ago

Everything is an opt/ plugin in order to be declarative.

tristone13th commented 2 years ago

Everything is an opt/ plugin in order to be declarative.

How about locate each plugin directly under the opt/ folder rather than under the author name folder, so that we can easily use packadd to add these optional plugins?

faerryn commented 2 years ago

That would lead to two different forks of the same plugin clashing.

tristone13th commented 2 years ago

Oh, I see, thanks for your great work! If it can manage and resolve the dependencies of different plugins, that would be better! If it can show the install progress of each plugin at startup, that would be better too!

faerryn commented 2 years ago

Sadly I don't think that there is a dependency database for Vim/Neovim plugins, unlike the Emacs package ecosystem.

Currently one must declare dependencies manually.

I have no clue where to begin to implement visual feedback :shrug:.

tristone13th commented 2 years ago

I think declaring dependencies manually is OK, but from your example:

use {
        "package_author/package_name",
        repo = nil, -- if non-nil, then clone from this repo instead
        branch = nil, -- if non-nil, then clone from this branch instead of default branch
        pin = nil, -- if non-nil, then checkout this commit instead of HEAD
        subdir = nil, -- if non-nil, then will add that subdirectory to rtp
        init = function()
                -- will run immediately unless disabled = true.
        end,
        config = function()
                -- will run after the package is loaded. not very useful if you don't have `parallel` enabled.
        end,
}

I can't find out the place where I can put these dependencies in.

I think the visual part is optional, that's not important, keep the functions minimal is also a good choice.

faerryn commented 2 years ago
use 'author1/dependency1'
use 'author2/dependency2'
use 'author3/package'

Looks dumb but it works. If you repeat a 'use' statement, only the first one has an effect.

tristone13th commented 2 years ago
use 'author1/dependency1'
use 'author2/dependency2'
use 'author3/package'

Looks dumb but it works. If you repeat a 'use' statement, only the first one has an effect.

Thanks for the reply. I'm still wondering will the option "parallel" breaks the load order defined by the manually inserted "use" terms?

faerryn commented 2 years ago

It should run all config()s in order, after the packages were downloaded/upgraded in parallel.