-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Beta-testing 'mini.deps' #689
Comments
Hello! Thank you for developing another great plugin. Here's a few things I noticed:
|
Thanks for the feedback!
Yeah, it was the late addition in example 'init.lua' after I the release, so forgot to add it in other places. Should be fixed on latest
All helptags should be generated during installation in |
Tried this on new config and now I can see them too. Sorry. |
Great module! Right on time for my desire to stray away from lazy.nvim. :)
As we are in Git territory, something that would be helpful is a patch field to leverage Git apply and git-send-email functionality, among others. The general idea would be to |
That sounds both interesting and not too minimal. Right now I think that there are at least way to try and achieve similar workflow:
The first one looks more appropriate, but the second one looks more doable. |
To add to the discussion, I believe it's out-of-scope for a plugin manager to checkout, that is, it should apply a patch locally, so ideally what we really want is something like: vim.fn.system('git restore ~/.local/data/site/pack/deps/opt/foobar')
vim.notify('applying 000-foobar.patch for foobar')
vim.fn.system('git am ~/patches/000-foobar.patch') |
If I understood correctly and it is about how plugin manager internally should utilize Git, then to me it looks more complicated then actually checking out which allows for a manageable way to compute log of changes between commits. 'mini.deps' uses detached HEAD so using checkout is basically: get target hash and checkout. No merge conflicts. |
From the README/help file:
Would it be possible to get an option for individual or all packages to have them be set up in the "start" directory instead of having to manually move plugin directories there from "opt"? |
I noticed another thing: functions scheduled with |
I use neovim |
It was a deliberate choice as (currently) I think that adding this will only bring confusion. The main issue being that "start" plugins will still be added to session even if Would you mind elaborating on the importance of having this as a possible field in plugin specification? To me intentional usage of "start" will lead to a one time manual directory move for "permanent" plugins after their initial install. Which doesn't look like much of a hurdle. |
The The main help explanation is at I am not sure why using I have 'nvim-lspconfig' set up in |
I'm not sure if this is related to what @AlexKurisu explained but I can't get -- mini.deps setup
later(function()
add({source = "hrsh7th/nvim-cmp", depends = {"hrsh7th/cmp-buffer"}})
local cmp = require("cmp")
cmp.setup({
sources = cmp.config.sources({
{ name = 'buffer' },
})
})
end) Change the |
If added in |
Doesn't the default configuration put |
You can put it in "opt" and then manually call I moved it to "start" because if put in "opt" it would require another Together with possible confusion from two calls adding 'mini.nvim', I decided to put it to "start". If anything, it is a somewhat special plugin in this case. |
I did some investigating. The problem here is that Now, for some reason, In the meantime, adding For what it's worth, it is a known issue in 'nvim-cmp' (there are couple similar issues out there). |
@Ernest1338, so this indeed proved to be kind of both: simple-ish mistake and a known issue in Vim. In fact, it is a vim/vim#1994.
It should now work on latest For what it is worth, I think it would simplify life for plugin managers if plugins stopped using 'after/plugin/' in favor of 'plugin/'. I don't see a valid reason for preferring former over latter. I'd suggest opening an issue in 'nvim-cmp' (and/or its sources) suggesting to not use 'after/plugin/'. |
@AlexKurisu, that can only happen if Would you mind providing a reproducible example with the issue description you are thinking about? |
Code-- Bootstrap mini.nvim
local path_package = vim.fn.stdpath("data") .. "/site/"
local mini_path = path_package .. "pack/deps/start/mini.nvim"
if not vim.loop.fs_stat(mini_path) then
vim.cmd([[echo 'Installing `mini.nvim`' | redraw]])
local clone_cmd = {
"git",
"clone",
"--filter=blob:none",
"https://github.com/echasnovski/mini.nvim",
mini_path,
}
vim.fn.system(clone_cmd)
vim.cmd([[packadd mini.nvim | helptags ALL]])
end
-- Setup mini.deps
require("mini.deps").setup({ path = { package = path_package } })
local now = MiniDeps.now
local later = MiniDeps.later
now(function()
vim.api.nvim_create_autocmd("BufEnter", {
callback = function()
vim.print("Handler 1 (added in now()) fired!")
end,
})
end)
later(function()
vim.api.nvim_create_autocmd("BufEnter", {
callback = function()
vim.print("Handler 2 (added in later()) fired!")
end,
})
end)
later(function()
MiniDeps.add("neovim/nvim-lspconfig")
require("lspconfig").lua_ls.setup({})
end) This will print just |
If this is how it should work, then please mention this in documentation |
Yes, this works as intended. Precisely for the reason described earlier: function in
I'll think about an appropriate description (if any). |
My git doesn't have a
❯ git --version |
Thanks for the feedback. That's exactly what beta-testing is about. As for this particular case, the So I am afraid the suggestion here would be to ask to update Git to at least 2.36.0 or better yet the latest release 2.43.0. |
@echasnovski yeah that's totally fair, I thought it's worth pointing out since my git was installed from Ubuntu 22.04.3 LTS repo and was not recent enough (current version is 2.34.1). I've added a git PPA and installed the latest version. Perhaps a note in the readme/help file would be useful. Great work btw, I was looking forward to using mini.deps! |
Ow, that's a more than a valid reason to make 'mini.deps' work on 2.34.1. Thanks for mentioning that, I was not aware! I'll make it work with 2.34.1 by dropping that option there. |
Yet another note here: what do you think about passing path to plugin's directory to hooks? Currently it's kinda painful to run hooks that execute system commands (generally |
As far as I can see. it is not in the example |
I also ported from lazy and all works great. One thing I noticed is that the confirmation report of I would prefer a more compact output, maybe with a fold to reveal the extra information currently displayed? This is just a cosmetic change. Overall, I'm very happy with this and other mini modules and port more and more plugins to it. The quality is great, and I also appreciate the work and care you put into the documentation. Thank you! |
🚀
I feel you here. Initially during development the confirmation buffer always had order as in session. Very quickly it started to feel too verbose and now plugins with errors and pending updates are listed first.
vim.wo.foldmethod = 'expr'
vim.wo.foldexpr = 'match(getline(v:lnum), "^+++\\\\|^---\\\\|^!!!") < 0'
But make sure to update to latest |
Having an issue with mini.clue... setup code worked fine with lazy.nvim, but with mini.deps I get:
Config section in question is (if I comment out the "clues" section all is happy):
Probably just me not understanding how to do something, but... Thanks! |
Well, the error message is quite informative here and probably the result of not full copy-paste. At line 434 there is a |
@eglimi, after spending some time thinking and tinkering, I did find having folds a good user experience. Thanks again for bringing this up! Unfortunately, too few people actually use them, so I opted out for a unfolded initial view with an extra help line describing that folds can be used. So they should now be usable on |
Thanks, you nailed it :-) |
For --- your lsp setup code
vim.cmd("LspStart") -- Command |
Hello @echasnovski, I was beta testing At the time, there was a use-case I had to implemenent myself. There are clusters of plugins I only want to load on demand using keys. For example, test and dap. later(function()
local sources = {
"mason-nvim-dap.nvim",
"nvim-dap-ui",
"nvim-dap-virtual-text",
"nvim-dap-python",
"nvim-dap",
}
Util.defer.on_keys(function()
for _, source in ipairs(sources) do
add(source)
end
require("ak.config.lang.debugging")
end, "<leader>dL", "Load dap")
end)
function M.on_keys(cb, keys, desc)
keys = type(keys) == "string" and { keys } or keys
for _, key in ipairs(keys) do
vim.keymap.set("n", key, function()
vim.keymap.del("n", key)
cb()
vim.api.nvim_input(vim.api.nvim_replace_termcodes(key, true, true, true))
end, { desc = desc, silent = true })
end
end I also used a similar pattern for the The problem: By doing so, on startup, those plugins are unknown to Perhaps, it is possible to have a You wrote:
I can say |
Thanks for the feedback and early adoption!
I don't think 'mini.deps' will gain support (direct or indirect) for any other type of lazy-loading besides it current has. Personally I don't really want to encourage any complex lazy loading (i.e. anything other than the documented two-stage one). What I can suggest trying is to use |
That makes perfect sense. |
That seems reasonable and this update works well for me. Thank you for considering and implementing this!
I like it 😄
It didn't conflict with manual foldexpr from the advice for me. But after the update, I removed the ftplugin entry. |
Ah, yes. This is because filetype was set before I would suggest achieving this (showing folds initially) with
Well, with latest |
Hello @echasnovski, I gathered some extra feedback and questions Very minor: In the browser, enter Hooks In the docs:
Does this mean that the local function make_fzf_native(path)
vim.cmd("lcd " .. path)
vim.cmd("!make -s")
vim.cmd("lcd -")
end
add({
source = "nvim-telescope/telescope.nvim",
depends = {
{
source = "nvim-telescope/telescope-fzf-native.nvim",
hooks = {
post_install = function(params) make_fzf_native(params.path) end,
post_checkout = function(params) make_fzf_native(params.path) end,
},
},
},
})
require("ak.config.editor.telescope") Installation EDIT |
Ah, indeed, that is an issue with dual distribution script. I'll look into the best way to solve this.
Yes, And yes, if you need to
If 'mini.nvim' is put in the "deps/start" part of the package (as it is in example 'init.lua'), then it will (unless done some tricky startup stuff) automatically:
Unfortunately, there is not much to be done here, as default |
Hello @echasnovski,
I was mainly confused because of the naming, wondering if *_checkout also runs on an initial install, as an initial install does a checkout as well. Would it be an idea to mention that on an initial install the *_checkout hooks don't run?
Thanks! My bad. I somehow skipped that line when reading the docs. Your suggestion, using My config runs mini.deps a tiny bit faster than lazy.nvim. As lazy.nvim has a dedicated A |
Yeah, agree. I'll think of something.
Yes, this was the big question for me when designing the whole module. I ended up making
This results into each plugin to be installed in sequence, not in parallel. But since it is the issue only on the first run, I think this is OK. To make
So TL;DR: yes, |
I think the
The idea I propose would not involve a change to Disclaimer: I scanned the code, I do not have in-depth knowledge. The core concept would be: If
An additional benefit: Mini.deps would have a reproducible install out of the box, similar to |
Reading snapshot for that purpose is an interesting idea which did not occur to me initially. However, right now it contradicts the design of snapshots themselves (which was also the target of many hours of contemplating): snapshots are there mostly for tracking per-plugin information and not as a mandatory reproduction steps to follow. That is, users are encouraged to always checkout whatever they set in This is concurred with the fact that |
I hope you'll allow me an extra comment...) Firstly:
Indeed, this is not a major issue. I agree. I used I imagined the usage of the snap file in this particular case as an optional optimization, after which the config of the user would kick in with precedence. I do understand that it's a matter of workflow. I always perform a |
Yeah, me too. But not everybody has smooth experience after updating plugins, so having an information about previously working setup is useful for rollbacks. |
Good morning @echasnovski, I am aware that more complicated lazy loading and a reproducible first install is out of scope for mini.deps. Still, I hope you are interested in the remarks below. Unfortunately, the
File So, I decided to change the approach and administer optional plugins in my own code. It was suprisingly easy, thanks to the feedback you provided in earlier conversations. The idea: Patch some of the methods of mini.deps, using the decorator pattern. Expanding on that same idea, I realized that a reproducible first install is also easily achievable. To me, this is an important feature, as I always check the commit message of each update. As a consequence, I only want updates when I explicitly update, not on a clean install. The relevant parts in the config: I noticed the updates to the |
I am glad that you found a solution that works for you! And indeed all these look a bit complicated for the overall 'mini.deps' design, but they are necessary to accommodate all types of lazy loading (one more argument to not supporting it out of the box). My honest suggestion would be not not do it and instead use I am thinking about the idea of adding some kind of |
Thanks @echasnovski!
It's not a matter of time though when using the It's a matter of a
I think you are right. I would say that it's very nice that motivated people still can achieve the more complicated lazy loading behavior. Thanks for the plugin! I hope it gains traction. |
Would it be possible to add a warning line at the top of the |
That would require special parsing of commit log for when a breaking change occur. The fact that log can contain commits that are reverted (instead of added) makes it harder. So the answer is "Probably no". I am thinking about adding special syntax highlighting for conventional commit style of commit message. Not sure if this is easily and robustly done, though. |
With the release of 0.12.0, 'mini.deps' is now out of beta-testing. Thanks to brave early adopters who tried/switched to a fresh new plugin manger! I really appreciate it! |
Please leave your feedback about new mini.deps module here. Feel free to either add new comment or positively upvote existing one.
Some things I am interested to find out (obviously, besides bugs):
Thanks!
The text was updated successfully, but these errors were encountered: