]> Git — Sourcephile - julm/julm-nix.git/blob - home-manager/profiles/nvim/lua/config/lsp.lua
+user/op(nvim)(typos): install typos-lsp
[julm/julm-nix.git] / home-manager / profiles / nvim / lua / config / lsp.lua
1 local capabilities = vim.lsp.protocol.make_client_capabilities()
2 vim.lsp.config["*"] = { capabilities = capabilities, enable = true }
3 vim.lsp.enable({
4 "bash-ls",
5 "lua-language-server",
6 "nil",
7 })
8 vim.diagnostic.config({
9 ["signs"] = true,
10 ["underline"] = true,
11 ["update_in_insert"] = false,
12 ["virtual_lines"] = false,
13 ["virtual_text"] = true,
14 })
15
16 vim.lsp.config["bash-ls"] = {
17 enable = true,
18 cmd = { "bash-language-server", "start" },
19 filetypes = { "bash", "sh" },
20 root_markers = { ".git" },
21 settings = { basheIde = { globPattern = vim.env.GLOB_PATTERN or "*@(.sh|.inc|.bash|.command)" } },
22 }
23 vim.lsp.enable("elmls")
24 vim.lsp.config["lua-language-server"] = {
25 enable = true,
26 cmd = { "lua-language-server" },
27 filetypes = { "lua" },
28 root_markers = {
29 ".luarc.json",
30 ".luarc.jsonc",
31 ".luacheckrc",
32 ".stylua.toml",
33 "stylua.toml",
34 "selene.toml",
35 "selene.yml",
36 ".git",
37 },
38 }
39 vim.lsp.config["nil"] = {
40 enable = true,
41 cmd = { "nil" },
42 filetypes = { "nix" },
43 root_markers = { ".git", "flake.nix" },
44 settings = {
45 ["nil"] = {
46 formatting = { command = { "nixfmt" } },
47 },
48 },
49 }
50 vim.lsp.enable("typos_lsp")
51 vim.lsp.config["typos-lsp"] = {
52 enable = true,
53 cmd = { "typos-lsp" },
54 cmd_env = { RUST_LOG = "error" },
55 init_options = {
56 -- Custom config. Used together with a config file found in the workspace or its parents,
57 -- taking precedence for settings declared in both.
58 -- Equivalent to the typos `--config` cli argument.
59 config = "~/.config/typos-lsp/typos.toml",
60 -- How typos are rendered in the editor, can be one of an Error, Warning, Info or Hint.
61 -- Defaults to Info.
62 diagnosticSeverity = "Info",
63 },
64 }