Skip to content

Commit 0fcd3d9

Browse files
nvim: add clangd and fix hover border
1 parent 0e9f8cb commit 0fcd3d9

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

modules/nvim/lua/minizilla/lsp.lua

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ vim.api.nvim_create_autocmd('LspAttach', {
1717
nmap('gD', telescope_builtin.lsp_type_definitions, '[g]oto type [D]efinitions')
1818
nmap('gi', telescope_builtin.lsp_implementations, '[g]oto [i]mplementations')
1919
nmap('gr', telescope_builtin.lsp_references, '[g]oto [r]eferences')
20-
nmap('K', vim.lsp.buf.hover)
20+
nmap('K', function()
21+
vim.lsp.buf.hover({ border = 'rounded' })
22+
end)
2123
nmap('<Leader>ds', telescope_builtin.lsp_document_symbols, '[d]ocument [s]ymbols')
2224
nmap('<Leader>ws', telescope_builtin.lsp_workspace_symbols, '[w]orkspace [s]ymbols')
2325
nmap('<Leader>rn', vim.lsp.buf.rename, '[r]e[n]ame')
@@ -32,11 +34,6 @@ vim.api.nvim_create_autocmd('LspAttach', {
3234
})
3335

3436
vim.api.nvim_set_hl(0, 'FloatBorder', {})
35-
vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(
36-
vim.lsp.handlers.hover, {
37-
border = 'rounded',
38-
}
39-
)
4037
vim.diagnostic.config {
4138
float = { border = 'rounded' },
4239
}
@@ -116,6 +113,10 @@ lspconfig.gopls.setup {
116113
},
117114
}
118115

116+
lspconfig.clangd.setup {
117+
capabilities = capabilities,
118+
}
119+
119120
lspconfig.zls.setup {
120121
capabilities = capabilities,
121122
}

0 commit comments

Comments
 (0)