From 0bfd392b204327e02b69fbafdfb769b80936c2c4 Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Mon, 1 Apr 2024 19:04:26 +0100 Subject: [PATCH] Add rounded borders to LSP/Diagnostics float windows --- lua/plugins/completions.lua | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/lua/plugins/completions.lua b/lua/plugins/completions.lua index 4006dab..b4f9ff8 100644 --- a/lua/plugins/completions.lua +++ b/lua/plugins/completions.lua @@ -118,10 +118,34 @@ return { { name = 'path' }, -- { name = 'cmdline' }, }, + + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, }) - -- Disable displaying diagnostics as virtual text - vim.diagnostic.config({ virtual_text = false }) + -- Customise LSP UI + vim.lsp.handlers['textDocument/hover'] = vim.lsp.with( + vim.lsp.handlers.hover, { + border = 'rounded', + title = 'Hover', + } + ) + vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( + vim.lsp.handlers.signature_help, { + border = 'rounded', + title = 'Signature Help' + } + ) + + -- Customise diagnostics UI + vim.diagnostic.config({ + float = { + border = 'rounded', -- Enable rounded border on floats + }, + virtual_text = false, -- Disable trailing virtual text + }) -- Diagnostic mappings -- TODO: trouble.nvim mappings instead? https://youtu.be/MuUrCcvE-Yw?t=631