Updated config

This commit is contained in:
2025-08-26 11:46:42 +02:00
parent fcb40a52e9
commit 35d6c20abd
17 changed files with 88 additions and 67 deletions

View File

@@ -1,10 +1,14 @@
--- @param client vim.lsp.Client
--- @param bufnr number
local on_attach = function(client, bufnr)
--- @param desc string?
--- @return vim.keymap.set.Opts?
local function opts(desc)
if desc then
---@diagnostic disable-next-line: return-type-mismatch
return { silent = true, buffer = bufnr, desc = desc }
else
---@diagnostic disable-next-line: return-type-mismatch
return { silent = true, buffer = bufnr }
end
end
@@ -31,6 +35,7 @@ local on_attach = function(client, bufnr)
end, opts("Get code actions"))
vim.keymap.set("n", "<leader>vr", function()
return ":IncRename " .. vim.fn.expand("<cword>")
---@diagnostic disable-next-line: param-type-not-match
end, { expr = true, silent = true, buffer = bufnr, desc = "Rename symbol" })
vim.keymap.set("n", "<leader>vn", function()
vim.lsp.buf.rename()
@@ -41,6 +46,10 @@ local on_attach = function(client, bufnr)
return
end
if client.server_capabilities == nil then
return
end
if client.server_capabilities.inlayHintProvider then
local current_state = vim.lsp.inlay_hint.is_enabled({ bufnr = bufnr })
vim.lsp.inlay_hint.enable(not current_state, { bufnr = bufnr })