I've been configuring my Neovim for quite a while now. This command menu seems a little ugly with the transparent background. I'd be great if I could add a border for this menu. How can I do that ?
I'll accept both lua
and vim-lang
answers.
I would propose you to use the wilder plugin
With the following settings:
call wilder#set_option('renderer', wilder#popupmenu_renderer(wilder#popupmenu_border_theme({
\ 'highlights': {
\ 'border': 'Normal',
\ },
\ 'border': 'single',
\ })))
Here's the Lua implementation of what @Vivian De Smedt mentioned.
local status_ok, wilder = pcall(require, "wilder")
if not status_ok then
print("wilder plugin not found")
return
end
wilder.set_option('renderer', wilder.popupmenu_renderer(
wilder.popupmenu_border_theme({
highlights = { border = 'Normal' },
border = 'single',
})
))
wilder.setup({modes = {':', '/', '?'}})
Another way:
If you use nvim-cmp
for auto-completion like me, you can apply cmp popup menu borders to the command-line using cmp-cmdline plugin. This plugin will also let you fuzzy find the options.
local cmp_status_ok, cmp = pcall(require, "cmp")
if not cmp_status_ok then
return
end
cmp.setup({
-- .... (other setups)
-- Add borders around the popup window
window = {
completion = cmp.config.window.bordered(),
},
})
-- Enable command-line completion
cmp.setup.cmdline(':', {
sources = {
{ name = 'cmdline' },
},
formatting = {
fields = { "abbr" },
}
})
:set pumblend =0
. In Vim, it shouldn't be transparent as there is no option to make it transparent, so you should remove the mention of vim from your question title.vim.cmd[[:highlight Pmenu guibg=NONE cterm=NONE term=NONE]]
to make mycmp
completion menus transparent. Can I have different highlights for the cmp completion menu and this completion menu ?