vim.lsp.inlay_hint.enable(true) vim.lsp.enable({ "clangd", "lua_ls", "nixd", "nil_ls", "zls", "pyrefly", "marksman", "harper", "tinymist", "gopls", "tombi", }) vim.lsp.config("nil_ls", { settings = { formatting = { command = { "nixfmt" }, }, }, }) vim.lsp.config("lua_ls", { settings = { Lua = { codeLens = { enable = true }, hint = { enable = true, semicolon = "Disable", }, workspace = { checkThirdParty = false, -- IMPORTANT: Leave library empty here. -- lazydev will inject the correct Nix store paths dynamically. library = {}, }, runtime = { version = "LuaJIT", -- Setting this to false allows lazydev to find files -- outside your immediate workspace (like Nix store plugins) pathStrict = false, }, }, }, }) vim.lsp.config("*", { capabilities = { textDocument = { semanticTokens = { multilineTokenSupport = true } } }, root_markers = { ".git", ".editorconfig", "flake.nix", "shell.nix" }, }) vim.diagnostic.config({ severity_sort = true, severity_sort_priority = { Error = 100, Warn = 90, Hint = 50, Info = 10, }, }) local RustLsp = function(mode, keymap, action, bufnr) vim.keymap.set(mode, keymap, function() vim.cmd.RustLsp(action) end, { silent = true, buffer = bufnr }) end vim.g.rustaceanvim = { tools = {}, server = { on_attach = function(client, bufnr) RustLsp({ "n", "x" }, "gra", "codeAction", bufnr) RustLsp("n", "ee", "explainError", bufnr) RustLsp("n", "K", { "hover", "actions" }, bufnr) RustLsp("n", "L", { "hover", "range" }, bufnr) end, default_settings = { ["rust-analyzer"] = { checkOnSave = { enable = false, command = "clippy", }, procMacro = { enable = true, }, }, }, }, dap = {}, }