fix(nvim): Fix lua_ls + selene for vim and Snacks globals

This commit is contained in:
demenik
2025-12-16 18:52:47 +01:00
parent 26799a989e
commit 5a8057ac09
4 changed files with 26 additions and 36 deletions

View File

@@ -1,5 +1,10 @@
{ {
imports = [./servers.nix ./lint.nix ./otter.nix]; imports = [
./servers.nix
./lint.nix
./otter.nix
./lazydev.nix
];
programs.nixvim = { programs.nixvim = {
plugins = { plugins = {

View File

@@ -0,0 +1,13 @@
{pkgs, ...}: {
programs.nixvim.plugins.lazydev = {
enable = true;
settings = {
library = [
{
path = "${pkgs.vimPlugins.snacks-nvim}";
words = ["Snacks"];
}
];
};
};
}

View File

@@ -24,39 +24,7 @@
bashls.enable = true; bashls.enable = true;
nixd.enable = true; nixd.enable = true;
lua_ls = { lua_ls.enable = true;
enable = true;
config.on_init.__raw =
# lua
''
function(client)
if client.workspace_folders then
local path = client.workspace_folders[1].name
if
path ~= vim.fn.stdpath('config')
and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc'))
then
return
end
end
client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {
runtime = {
version = 'LuaJIT',
path = {
'lua/?.lua',
'lua/?/init.lua',
},
},
workspace = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME
}
}
})
end
'';
};
ltex_plus = { ltex_plus = {
enable = true; enable = true;
@@ -84,7 +52,7 @@
jsonls = { jsonls = {
enable = true; enable = true;
config.json = { config.json = {
schemas.__raw = "require('schemastore').json.schemas()"; schemas.__raw = ''require("schemastore").json.schemas()'';
validate.enable = true; validate.enable = true;
}; };
}; };
@@ -95,7 +63,7 @@
enable = false; enable = false;
url = ""; url = "";
}; };
schemas.__raw = "require('schemastore').yaml.schemas()"; schemas.__raw = ''require("schemastore").yaml.schemas()'';
}; };
}; };

4
selene.toml Normal file
View File

@@ -0,0 +1,4 @@
std = "vim"
[lints]
mixed_table="allow"