local capabilities = vim.lsp.protocol.make_client_capabilities() vim.lsp.config["*"] = { capabilities = capabilities, enable = true } vim.lsp.enable({ "bash-ls", "lua-language-server", "nil", }) vim.diagnostic.config({ ["signs"] = true, ["underline"] = true, ["update_in_insert"] = false, ["virtual_lines"] = false, ["virtual_text"] = true, }) vim.lsp.config["bash-ls"] = { enable = true, cmd = { "bash-language-server", "start" }, filetypes = { "bash", "sh" }, root_markers = { ".git" }, settings = { basheIde = { globPattern = vim.env.GLOB_PATTERN or "*@(.sh|.inc|.bash|.command)" } }, } vim.lsp.enable("elmls") vim.lsp.config["lua-language-server"] = { enable = true, cmd = { "lua-language-server" }, filetypes = { "lua" }, root_markers = { ".luarc.json", ".luarc.jsonc", ".luacheckrc", ".stylua.toml", "stylua.toml", "selene.toml", "selene.yml", ".git", }, } vim.lsp.config["nil"] = { enable = true, cmd = { "nil" }, filetypes = { "nix" }, root_markers = { ".git", "flake.nix" }, settings = { ["nil"] = { formatting = { command = { "nixfmt" } }, }, }, } vim.lsp.enable("typos_lsp") vim.lsp.config["typos-lsp"] = { enable = true, cmd = { "typos-lsp" }, cmd_env = { RUST_LOG = "error" }, init_options = { -- Custom config. Used together with a config file found in the workspace or its parents, -- taking precedence for settings declared in both. -- Equivalent to the typos `--config` cli argument. config = "~/.config/typos-lsp/typos.toml", -- How typos are rendered in the editor, can be one of an Error, Warning, Info or Hint. -- Defaults to Info. diagnosticSeverity = "Info", }, }