Skip to content

Commit 9bece83

Browse files
committed
nvim: add nil_ls language server for nix files
1 parent 76e909f commit 9bece83

File tree

3 files changed

+32
-15
lines changed

3 files changed

+32
-15
lines changed

.aerospace.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ inner.horizontal = 0
7373
inner.vertical = 0
7474
outer.left = 3
7575
outer.bottom = 3
76-
outer.top = [{ monitor.main = 8 }, { monitor.secondary = 42 }, 8]
76+
outer.top = [{ monitor.main = 42 }, { monitor.secondary = 42 }, 8]
7777
outer.right = 3
7878

7979
[workspace-to-monitor-force-assignment]

nvim/lsp/nil_ls.lua

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---@brief
2+
---
3+
--- https://github.com/oxalica/nil
4+
---
5+
--- A new language server for Nix Expression Language.
6+
---
7+
--- If you are using Nix with Flakes support, run `nix profile install github:oxalica/nil` to install.
8+
--- Check the repository README for more information.
9+
---
10+
--- _See an example config at https://github.com/oxalica/nil/blob/main/dev/nvim-lsp.nix._
11+
12+
---@type vim.lsp.Config
13+
return {
14+
cmd = { "nil" },
15+
filetypes = { "nix" },
16+
root_markers = { "flake.nix", ".git" },
17+
}

nvim/lua/plugins/lsp.lua

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,22 +72,22 @@ return {
7272
vim.diagnostic.config({
7373
virtual_text = true,
7474
})
75+
76+
-- Enable LSP servers
77+
vim.lsp.enable("nil_ls")
78+
vim.lsp.enable("clangd")
79+
vim.lsp.enable("yamlls")
80+
vim.lsp.enable("lua_ls")
81+
vim.lsp.enable("pyright")
82+
vim.lsp.enable("ruff")
83+
vim.lsp.enable("starpls")
84+
vim.lsp.enable("beancount")
85+
vim.lsp.enable("ts_ls")
86+
vim.lsp.enable("jsonls")
87+
vim.lsp.enable("ltex")
88+
vim.lsp.enable("bashls")
7589
end,
7690
})
77-
78-
-- this is named cameron_clangd to avoid conflicts with the existing
79-
-- clangd definition, which is taking precedence, something to fix later!
80-
vim.lsp.enable("clangd")
81-
vim.lsp.enable("yamlls")
82-
vim.lsp.enable("lua_ls")
83-
vim.lsp.enable("pyright")
84-
vim.lsp.enable("ruff")
85-
vim.lsp.enable("starpls")
86-
vim.lsp.enable("beancount")
87-
vim.lsp.enable("ts_ls")
88-
vim.lsp.enable("jsonls")
89-
vim.lsp.enable("ltex")
90-
vim.lsp.enable("bashls")
9191
end,
9292
},
9393
{

0 commit comments

Comments
 (0)