[Lua] Load luarocks modules directory

This commit is contained in:
2026-03-25 10:24:31 +01:00
parent 792cd2f051
commit 35a331f827
2 changed files with 7 additions and 2 deletions

View File

@@ -6,6 +6,10 @@ It uses Lazy.nvim as the plugin manager, lspconfig for the language server confi
## Linter configs
You may find the linter configs and setup-scripts for some linters that require some extra setup [here](https://git.janishutz.com/janishutz/dotfiles/)
# Lua notes
To get your luarocks packages to be picked up by the language server, it is currently configured to only look at the `cwd` that nvim is open in.
I may expand that in the future to do a proper search for all open buffers, but that would require a language server restart to apply on every buffer add
# Issues with jdtls
Ensure you have jdk21-opnejdk or newer installed. On Arch (and derivatives) you can switch the preferred java version using `archlinux-java set <version name>`

View File

@@ -20,12 +20,13 @@ lsp.config("lua_ls", {
library = {
vim.fn.expand("$VIMRUNTIME/lua"),
vim.fn.stdpath("config") .. "/lua",
vim.fn.expand("~/.luarocks/share/lua/5.3"),
vim.fn.expand("~/.luarocks/share/lua/5.4"),
-- To use LÖVR, follow https://lovr.org/docs/dev/VS_Code_Setup#manual-installation
-- TL;DR run lovr api cats in the lovr-docs repo and update the path below
-- Then update the blow path (if you have not used the script in this repo)
vim.fn.expand("~/.local/share/lovr-docs/api/cats"),
"/usr/share/lua/5.3",
vim.fn.expand(vim.fn.getcwd() .. "/lua_modules/share/lua/5.4"),
"/usr/share/lua/5.4",
},
},
},