feat: migrate old config
This commit is contained in:
1 parent
1a2ce09da2
commit
a593a5aae3
31 files changed
+886
-32
No files matched your search
@@ -16,6 +16,7 @@ M.servers = {
|
||||
"basedpyright",
|
||||
"ruff",
|
||||
"intelephense",
|
||||
"tinymist",
|
||||
}
|
||||
|
||||
local function restart()
|
||||
@@ -39,6 +40,11 @@ function M.setup()
|
||||
if client.name == "ruff" then
|
||||
client.server_capabilities.hoverProvider = false -- basedpyright owns hover
|
||||
end
|
||||
if client.name == "vtsls" then
|
||||
-- prettierd formats TypeScript
|
||||
client.server_capabilities.documentFormattingProvider = false
|
||||
client.server_capabilities.documentRangeFormattingProvider = false
|
||||
end
|
||||
|
||||
local function map(lhs, rhs, desc)
|
||||
vim.keymap.set("n", lhs, rhs, { buffer = ev.buf, desc = desc })
|
||||
@@ -48,6 +54,24 @@ function M.setup()
|
||||
end,
|
||||
})
|
||||
|
||||
-- No inline text; the diagnostic under the cursor opens in a float on CursorHold.
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
signs = true,
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
severity_sort = true,
|
||||
float = { border = "rounded", source = true },
|
||||
})
|
||||
vim.api.nvim_create_autocmd("CursorHold", {
|
||||
group = vim.api.nvim_create_augroup("core.lsp.float", { clear = true }),
|
||||
callback = function()
|
||||
vim.diagnostic.open_float(nil, { focusable = false, scope = "cursor", prefix = " " })
|
||||
end,
|
||||
})
|
||||
|
||||
vim.lsp.inlay_hint.enable(true) -- gopls and lua_ls hints; <leader>ui toggles
|
||||
|
||||
vim.lsp.enable(M.servers)
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user