Something went wrong. Try again.
Vim/Neovim configurations just for me
neovim
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889require("rc.mise").override_language_servers()
local M = {}
vim.lsp.config("denols", { root_dir = function(bufnr, on_dir) local root = vim.fs.root(bufnr, { { "deno.json", "deno.jsonc" } }) if root then on_dir(root) end root = vim.fs.root(bufnr, { "tsconfig.json", "package.json" }) if not root then on_dir(vim.fs.root(bufnr, { ".git" }) or vim.uv.cwd()) end end,})
vim.lsp.config("vtsls", { workspace_required = true, root_dir = function(bufnr, on_dir) local root = vim.fs.root(bufnr, { "tsconfig.json", "package.json" }) if root then on_dir(root) end end,})
vim.lsp.config("lua_ls", { settings = { Lua = { completion = { callSnippet = "Replace", postfix = ":", }, diagnostics = { globals = {}, }, hover = { expandAlias = false }, hint = { enable = true }, }, },})
if not vim.uv.fs_stat(".luarc.json") then vim.lsp.config("lua_ls", { settings = { Lua = { runtime = { version = "LuaJIT", pathStrict = true, }, workspace = { library = { "./lua", vim.env.VIMRUNTIME .. "/lua", }, }, }, }, })end
vim.lsp.config("rust_analyzer", { settings = { ["rust-analyzer"] = { lru = { capacity = 64 }, check = { command = "clippy" }, }, },})
for _, ls_name in ipairs({ "denols", "html", "jsonls", "lua_ls", "rust_analyzer", "ty", "vtsls", "zls",}) do local cmd = (vim.lsp.config[ls_name] or {}).cmd if type(cmd) == "table" and vim.fn.executable(cmd[1]) == 1 then vim.lsp.enable(ls_name) endend
return M