-
Notifications
You must be signed in to change notification settings - Fork 17
Installing rocks.nvim manually, without the installation script
We recommend using our installation script to install rocks.nvim, but that may not be possible on every system.
If are having issues with our installer, you can also install rocks.nvim manually.
Tip
By default, our installer installs luarocks for you, but you can also tell it to use an existing installation.
- An up-to-date Neovim nightly installation.
- A luarocks and a Lua 5.1 installation.
- A C++17 and Rust toolchain, if you are not on one of the following architectures:
linux-x86_64
macos-x86_64
macos-aarch64
win32-x86_64
Important
It may be possible to install luarocks with your distribution's package manager, but it may be outdated and may be bundled with the wrong Lua version. Make sure to install Lua 5.1 libraries.
Tip
For Windows, we provide a scoop bucket, which unlike the main bucket, provides luarocks with Lua 5.1 libraries.
In Neovim, in cmd mode, confirm that your luarocks installation can be found on the PATH
:
:lua =vim.fn.executable("luarocks")
-- should output 1
Copy the following to the beginning of your init.lua
:
-- Copied from installer.lua
local rocks_config = {
rocks_path = vim.fn.stdpath("data") .. "/rocks",
luarocks_binary = "luarocks",
}
vim.g.rocks_nvim = rocks_config
local luarocks_path = {
vim.fs.joinpath(rocks_config.rocks_path, "share", "lua", "5.1", "?.lua"),
vim.fs.joinpath(rocks_config.rocks_path, "share", "lua", "5.1", "?", "init.lua"),
}
package.path = package.path .. ";" .. table.concat(luarocks_path, ";")
local luarocks_cpath = {
vim.fs.joinpath(rocks_config.rocks_path, "lib", "lua", "5.1", "?.so"),
vim.fs.joinpath(rocks_config.rocks_path, "lib64", "lua", "5.1", "?.so"),
-- add these on Windows
vim.fs.joinpath(rocks_config.rocks_path, "lib", "lua", "5.1", "?.dll"),
vim.fs.joinpath(rocks_config.rocks_path, "lib64", "lua", "5.1", "?.dll"),
}
package.cpath = package.cpath .. ";" .. table.concat(luarocks_cpath, ";")
vim.opt.runtimepath:append(vim.fs.joinpath(rocks_config.rocks_path, "lib", "luarocks", "rocks-5.1", "rocks.nvim", "*"))
Start Neovim and, in cmd mode, enter:
:lua =vim.g.rocks_nvim.rocks_path
-- On Linux, this should output something like '/home/<user>/.local/share/nvim/rocks'
Note down the path.
Install rocks.nvim, substituting <rocks_path>
for the path that was output in the previous step.
luarocks --lua-version=5.1 --tree <rocks_path> --server='https://nvim-neorocks.github.io/rocks-binaries/' install rocks.nvim