From 18a85dd23959f140f67bb213780e82dc547187de Mon Sep 17 00:00:00 2001 From: Oliver Hartmann Date: Thu, 3 Apr 2025 22:38:30 +0200 Subject: [PATCH] border for cmp and float windows --- lua/config/options.lua | 2 +- lua/plugins/cmp.lua | 5 +++-- lua/plugins/lspconfig.lua | 11 +++++++++-- lua/themes/bamboo.lua | 1 + 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/lua/config/options.lua b/lua/config/options.lua index 9de33a5..94d2c0e 100644 --- a/lua/config/options.lua +++ b/lua/config/options.lua @@ -23,7 +23,7 @@ opt.showmatch = true -- Show matching braces opt.wrap = true -- When on, lines longer than the width of the window will wrap and displaying continues on the next line opt.list = true opt.hidden = true -opt.winborder = 'rounded' +opt.winborder = 'none' opt.scrolloff = 4 opt.shiftround = true opt.relativenumber = false diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index abaf30c..88a8b18 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -98,8 +98,9 @@ return { }), window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), + documentation = { + winhighlight = 'Normal:CmpDocumentation' + }, }, formatting = { format = lspkind.cmp_format({ diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index efb9f0b..9f894f6 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -5,7 +5,11 @@ local lspKeys = function(client, bufnr) vim.keymap.set({ 'n', 'x' }, 'a', vim.lsp.buf.code_action, vim.tbl_extend('error', options, { desc = 'Code action' })) vim.keymap.set('n', 'e', vim.lsp.buf.declaration, vim.tbl_extend('error', options, { desc = 'Declaration' })) - vim.keymap.set('n', 'h', vim.lsp.buf.hover, vim.tbl_extend('error', options, { desc = 'Hover' })) + vim.keymap.set('n', 'h', + function() + vim.lsp.buf.hover({ border = 'rounded' }) + end, + vim.tbl_extend('error', options, { desc = 'Hover' })) vim.keymap.set('n', 'c', vim.lsp.buf.outgoing_calls, vim.tbl_extend('error', options, { desc = 'Outgoing calls' })) vim.keymap.set('n', 'C', vim.lsp.buf.incoming_calls, @@ -15,7 +19,10 @@ local lspKeys = function(client, bufnr) vim.tbl_extend('error', options, { desc = 'Type definition' })) vim.keymap.set({ 'n', 'i', 'x' }, '', vim.lsp.buf.signature_help, vim.tbl_extend('error', options, { desc = 'Signature help' })) - vim.keymap.set('n', 'v', vim.diagnostic.open_float, + vim.keymap.set('n', 'v', + function() + vim.diagnostic.open_float({ border = 'rounded' }) + end, vim.tbl_extend('error', options, { desc = 'Diagnostics Float' })) vim.keymap.set('n', '', 'ClangdSwitchSourceHeader', vim.tbl_extend('error', options, { desc = 'Switch Source/Header' })) diff --git a/lua/themes/bamboo.lua b/lua/themes/bamboo.lua index d11428e..f5d23d2 100644 --- a/lua/themes/bamboo.lua +++ b/lua/themes/bamboo.lua @@ -33,6 +33,7 @@ return { ['NonText'] = { fg = colors.vulgaris.blue }, ['BlinkCmpMenu'] = { bg = colors.vulgaris.bg2 }, ['BlinkCmpDoc'] = { bg = colors.vulgaris.bg2 }, + ['CmpDocumentation'] = { bg = colors.vulgaris.bg2 }, ['BlinkCmpMenuSelection'] = { bg = colors.vulgaris.grey } }, })