FAQ
Announcement
Minimal reproducible full config
if has('vim_starting')
set encoding=utf-8
endif
scriptencoding utf-8
if &compatible
set nocompatible
endif
let s:plug_dir = expand('/tmp/plugged/vim-plug')
if !filereadable(s:plug_dir .. '/plug.vim')
execute printf('!curl -fLo %s/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim', s:plug_dir)
end
execute 'set runtimepath+=' . s:plug_dir
call plug#begin(s:plug_dir)
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-cmdline'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/vim-vsnip'
call plug#end()
PlugInstall | quit
""""""""""""" RELEVANT PART STARTS HERE """""""""""""
set winborder=single
lua << EOF
local cmp = require "cmp"
cmp.setup({
snippet = {
expand = function(args)
vim.fn["vsnip#anonymous"](args.body)
end,
},
sources = cmp.config.sources({
{ name = 'buffer' },
{ name = 'path' },
{ name = 'cmdline' },
}),
----------------- THIS WORKS -----------------
window = { completion = { border = "none", }, documentation = { border = "none", } },
})
cmp.setup.cmdline({ ':' }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' },
{ name = 'path' },
{ name = 'cmdline' },
},
view = { entries = { name = 'wildmenu', separator = ' | ' } },
----------------- THIS IS IGNORED (because of wildmenu) -----------------
window = { completion = { border = "none", }, documentation = { border = "none", } },
})
EOF
Description
Setting window borders view.entries.name = "wildmenu" causes window border settings to be ignored using vim.opt.winborder instead. This is especially frustrating for cmdline completions, where any border you set on your global vim options will cover what you're typing.
Steps to reproduce
Load the above config, which sets vim.opt.winborder to "single" and start typing some : command. Then execute :set winborder=none and try again.
Expected behavior
Actual behavior
Additional context
No response
FAQ
Announcement
Minimal reproducible full config
Description
Setting window borders
view.entries.name = "wildmenu"causes window border settings to be ignored usingvim.opt.winborderinstead. This is especially frustrating for cmdline completions, where any border you set on your global vim options will cover what you're typing.Steps to reproduce
Load the above config, which sets
vim.opt.winborderto"single"and start typing some:command. Then execute:set winborder=noneand try again.Expected behavior
Actual behavior
Additional context
No response