Configure lua-language-server and nixd
This commit is contained in:
parent
6e4c690e5d
commit
cb5a6aa05c
2 changed files with 64 additions and 1 deletions
62
.nvim.lua
62
.nvim.lua
|
@ -3,3 +3,65 @@ vim.keymap.set("n", "<leader>fn", function()
|
||||||
cwd = "modules/home-manager/coding/neovim/config"
|
cwd = "modules/home-manager/coding/neovim/config"
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
require("conform").setup {
|
||||||
|
formatters_by_ft = {
|
||||||
|
lua = { "stylua" },
|
||||||
|
nix = { "nixfmt" },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
require("lint").linters_by_ft = {
|
||||||
|
lua = { "luacheck" },
|
||||||
|
nix = { "nix" },
|
||||||
|
}
|
||||||
|
|
||||||
|
local lspconfig = require "lspconfig"
|
||||||
|
|
||||||
|
local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||||
|
|
||||||
|
lspconfig.lua_ls.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
completion = {
|
||||||
|
callSnippet = "Replace",
|
||||||
|
},
|
||||||
|
|
||||||
|
diagnostics = {
|
||||||
|
globals = { "vim" },
|
||||||
|
},
|
||||||
|
|
||||||
|
runtime = {
|
||||||
|
version = "LuaJIT",
|
||||||
|
},
|
||||||
|
|
||||||
|
telemetry = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
|
||||||
|
workspace = {
|
||||||
|
library = vim.api.nvim_get_runtime_file("", true),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
lspconfig.nixd.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
|
||||||
|
cmd = { "nixd" },
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
nixd = {
|
||||||
|
nixpkgs = {
|
||||||
|
expr = "import <nixpkgs> { }",
|
||||||
|
},
|
||||||
|
|
||||||
|
formatting = {
|
||||||
|
command = "nix fmt",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
|
@ -54,8 +54,9 @@
|
||||||
{
|
{
|
||||||
devShells.${system}.default = pkgs.mkShell {
|
devShells.${system}.default = pkgs.mkShell {
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
lua54Packages.luacheck
|
|
||||||
just
|
just
|
||||||
|
lua-language-server
|
||||||
|
lua54Packages.luacheck
|
||||||
nixd
|
nixd
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue