nix-config/home/vim/plugin/settings/completion.vim
Bruno BELANYI 9ef35f06df home: vim: completion: limit 'buffer' suggestions
Otherwise it gets overwhelming, and most are useless.
2022-03-08 10:41:35 +01:00

30 lines
788 B
VimL

" Show completion menu in all cases, and don't select anything
set completeopt=menu,menuone,noselect
lua << EOF
local cmp = require("cmp")
cmp.setup({
view = {
entries = "native",
},
sources = {
{ name = "path", priority_weight = 110 },
{ name = "nvim_lsp", priority_weight = 100 },
{ name = "nvim_lua", priority_weight = 90 },
{ name = "buffer", max_item_count = 5, priority_weight = 50 },
},
sorting = {
comparators = {
cmp.config.compare.offset,
cmp.config.compare.exact,
cmp.config.compare.score,
cmp.config.compare.kind,
cmp.config.compare.sort_text,
cmp.config.compare.length,
cmp.config.compare.order,
},
},
})
EOF