Skip to content

Commit

Permalink
refactor(installer): only add rocks.nvim to rtp in install script (#88)
Browse files Browse the repository at this point in the history
This is in preparation for #86.
For now, no behaviour has changed. `rocks.nvim` still adds all
plugins to the rtp on startup.
  • Loading branch information
mrcjkb authored Dec 17, 2023
1 parent 05d54dd commit c1ef187
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion installer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ local function install()
" }",
' package.cpath = package.cpath .. ";" .. table.concat(luarocks_cpath, ";")',
" ",
' vim.opt.runtimepath:append(vim.fs.joinpath(rocks_config.rocks_path, "lib", "luarocks", "rocks-5.1", "*", "*"))',
' vim.opt.runtimepath:append(vim.fs.joinpath(rocks_config.rocks_path, "lib", "luarocks", "rocks-5.1", "rocks.nvim", "*"))',
"<",
"Thank you for installing rocks.nvim!",
"",
Expand Down
4 changes: 2 additions & 2 deletions lua/rocks/config/internal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
---@field rocks_path string Local path in your filesystem to install rocks
---@field config_path string Rocks declaration file path
---@field luarocks_binary string Luarocks binary path
---@field lazy boolean Whether to query luarocks.org lazily.
---@field dynamic_rtp boolean Whether to automatically add freshly installed plugins to the 'runtimepath'.
---@field lazy boolean Whether to query luarocks.org lazily
---@field dynamic_rtp boolean Whether to automatically add freshly installed plugins to the 'runtimepath'
---@field debug_info RocksConfigDebugInfo

---@class (exact) RocksConfigDebugInfo
Expand Down
2 changes: 1 addition & 1 deletion nix/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ local luarocks_cpath = {
}
package.cpath = package.cpath .. ";" .. table.concat(luarocks_cpath, ";")

vim.opt.runtimepath:append(vim.fs.joinpath(rocks_config.rocks_path, "lib", "luarocks", "rocks-5.1", "*", "*"))
vim.opt.runtimepath:append(vim.fs.joinpath(rocks_config.rocks_path, "lib", "luarocks", "rocks-5.1", "rocks.nvim", "*"))
3 changes: 3 additions & 0 deletions plugin/rocks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ if not config.lazy then
})
end)
end

-- TODO: Add support for `opt`
vim.opt.runtimepath:append(vim.fs.joinpath(config.rocks_path, "lib", "luarocks", "rocks-5.1", "*", "*"))

0 comments on commit c1ef187

Please sign in to comment.