added conform

This commit is contained in:
Oliver Hartmann
2025-04-04 13:36:50 +00:00
parent e1ade38e04
commit 8966af7289
3 changed files with 27 additions and 50 deletions

View File

@@ -27,17 +27,6 @@ local lspKeys = function(client, bufnr)
vim.keymap.set('n', '<A-o>', '<cmd>ClangdSwitchSourceHeader<CR>',
vim.tbl_extend('error', options, { desc = 'Switch Source/Header' }))
-- Set some keybinds conditional on server capabilities
if client.server_capabilities.documentFormattingProvider then
vim.keymap.set('n', '<space>f', function()
vim.lsp.buf.format({ timeout_ms = 10000 })
end, { noremap = true, silent = false, desc = 'Format file', buffer = bufnr })
end
if client.server_capabilities.documentRangeFormattingProvider then
vim.keymap.set('x', '<space>f', function()
vim.lsp.buf.format({ timeout_ms = 10000 })
end, { noremap = true, silent = false, desc = 'Format visual', buffer = bufnr })
end
if client.supports_method('inlayHintProvider') then
vim.keymap.set('n', '<space>i', function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = bufnr }), { bufnr = bufnr })