feat(nvim): setup lua_ls
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-05-11 19:45:04 -04:00
parent 39fb08bc48
commit b0323e5fe1

View file

@ -6,12 +6,39 @@
}: let }: let
inherit (config.vars) neovimIde; inherit (config.vars) neovimIde;
inherit (pkgs) vimPlugins; inherit (pkgs) vimPlugins;
flakeEnv = config.programs.bash.sessionVariables.FLAKE;
in in
lib.mkIf neovimIde { lib.mkIf neovimIde {
programs = { programs = {
neovim = { neovim = {
extraPackages = [
pkgs.lua-language-server
];
plugins = [ plugins = [
vimPlugins.neodev-nvim {
plugin = vimPlugins.neodev-nvim;
type = "lua";
config =
/*
lua
*/
''
-- IMPORTANT: make sure to setup neodev BEFORE lspconfig
require("neodev").setup({
override = function(root_dir, library)
if root_dir:find('${flakeEnv}', 1, true) == 1 then
library.enabled = true
library.plugins = true
end
end,
});
require('lspconfig').lua_ls.setup(
require('coq').lsp_ensure_capabilities({}));
'';
}
]; ];
}; };
}; };