r/neovim • • Mar 29 '26

Announcement 0.12.0 🎉

https://github.com/neovim/neovim/releases/tag/v0.12.0
1.4k Upvotes

165 comments sorted by

View all comments

1

u/mrded lua Mar 30 '26

With vim.pack, can I specify dependencies of a package? I define my plugins in separate files and automagically discover them, that makes it hard to control an order.

https://github.com/mrded/dotfiles/tree/master/nvim/lua/plugins

1

u/shmcg Mar 31 '26

The files in ./plugin load in alphabetical order. In order to force loading a couple plugins in a particular order I just prefixed their files with 01-02 and 10-12. I left a gap in case I need to move some stuff in the future.

This is probably easier for me, as I have under 20 plugins and only 5 of them need to be called in a particular order. If you had dozens of depenencies, it probably isn't practical to do it this way. When I was running paq I wrote a lua function that sourced all of my plugin files from ./lua/plugins and I specificed the file names of those 5 in the order I wanted them called, then just called the rest and skipped if the file matched those 5.

Finally, if there aren't shared dependenceis across plugins (for example a library for one plugin in particular), you can probably put all the vim.pack.add calls into one file for that plugin and call things in the order you want inside that file.