Closed jgregoire closed 1 month ago
Ok weird. This might be coincidence, but I just installed rocks-edit and suddenly my keybinds (legendary.nvim) are being loaded. But not my colorscheme.
:checkhealth rocks
rocks: require("rocks.health").check()
Checking external dependencies ~
- OK luarocks: found /home/james/.local/share/nvim/rocks/bin/luarocks 3.11.1
- OK lua: found Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
Checking rocks.nvim config ~
- OK No errors found in config.
Checking rocks.toml ~
- OK No errors found in rocks.toml.
:checkhealth rocks-config
rocks-config: require("rocks-config.health").check()
Checking for errors while loading configs ~
- OK No configuration errors.
Checking for duplicate configuration files ~
- OK No duplicate configurations found.
I added
require('rocks-config').configure('onedarkpro.nvim')
to rocks_config.lua (called from init.lua)
rocks-config: require("rocks-config.health").check()
Checking for errors while loading configs ~
- ERROR Error while loading config 'onedarkpro.lua' for plugin 'onedarkpro.nvim'.
- ADVICE:
- Error was: /home/james/.config/nvim/lua/plugins//onedarkpro.lua:27: Vim:E919: Directory not found in 'packpath': "pack/*/opt/onedarkpro"
Checking for duplicate configuration files ~
- OK No duplicate configurations found.
"plugins//" eh?
I changed plugins_dir = 'plugins/'
to plugins_dir = 'plugins'
, ran :Rocks sync
, no change in behavior.
Finally I fixed packadd('onedarkpro')
to packadd('onedarkpro.nvim')
and things are working.
Hey :wave:
Finally I fixed packadd('onedarkpro') to packadd('onedarkpro.nvim') and things are working.
packadd
takes the package name, not the plugin's main Lua module name.
I added
require('rocks-config').configure('onedarkpro.nvim')
to rocks_config.lua (called from init.lua)
Since version 2, rocks-config.nvim no longer eagerly loads configs for opt
plugins.
This allows for interoperability with rocks-lazy.nvim.
Now there are two ways you can load the config for opt
plugins:
require('rocks-config').configure(<rock>)
, as you have discovered :smile: config.load_opt_plugins = true
in your rocks.toml[config]
plugins_dir = "plugins/"
load_opt_plugins = true
packadd takes the package name, not the plugin's main Lua module name.
Yeah, that was an error on my part.
I pushed my latest config. Colorscheme config is loading, but only if I call require('rocks-config').configure('onedarkpro.nvim')
legendary.nvim config is no longer being loaded. I haven't even touched that one. opt
is not set.
legendary.nvim config is no longer being loaded. I haven't even touched that one. opt is not set.
Have you confirmed that the config file is not being sourced with some debug prints?
I'm asking, because I just had a look at legendary.nvim, and found this in the readme:
-- since legendary.nvim handles all your keymaps/commands,
-- its recommended to load legendary.nvim before other plugins
priority = 10000,
And looking at the source code, it appears that the setup
function does more than just configuration.
I don't think supporting such manual initialisation logic with prioritisation should be within the scope of rocks(-config).nvim.
If I understand this correctly, the legendary.setup()
call would need to be invoked before you set any autocommands, keymaps, etc. in your init.lua.
And in other cases, depending on other plugins being loaded before/after is simply a terrible anti pattern.
I added a vim.notify() to the beginning of each config file. I also :Rocks install lualine.nvim
'd and added a config file for that.
The only config file that runs (and calls vim.notify) is onedarkpro.lua, which I have manually invoked with require('rocks-config').configure('onedarkpro.nvim')
I can call configure() on the other two plugins and then they work fine.
This is probably not what's causing this problem for you, but I found an error in your config.
You have
vim.opt.runtimepath:append(vim.fs.joinpath(rocks_config.rocks_path, "lib", "luarocks", "rocks-5.1", "*", "*"))
in lua/rocks-config.lua
(probably left over from the rocks.nvim version 1 installer).
It should be
vim.opt.runtimepath:append(vim.fs.joinpath(rocks_config.rocks_path, "lib", "luarocks", "rocks-5.1", "rocks.nvim", "*"))
I'll try and reproduce your issue later.
Just reproduced it. Your rocks.nvim is out of date. And I guess rocks-config.nvim's rocks.nvim version constraint isn't correct (I'll fix that).
If you update rocks.nvim (:Rocks install rocks.nvim
or :Rocks update
to update all plugins), it should work.
Just reproduced it. Your rocks.nvim is out of date. And I guess rocks-config.nvim's rocks.nvim version constraint isn't correct (I'll fix that).
If you update rocks.nvim (
:Rocks install rocks.nvim
or:Rocks update
to update all plugins), it should work.
Fixed the issue. Thanks!
@vhyrro we talked about this on Discord last week. Figured I would make an issue.
rocks-config is not loading files in
lua/plugins/
Minimal config is here: https://github.com/jgregoire/dotfiles/tree/rocks.nvim/nvim
rocks.nvim itself is working fine, and I ran
:Rocks sync
before testing this latest config.