From 5b7fa7c09abe92a40bd69696f237027b7b836063 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sun, 6 Mar 2022 11:53:48 +0100 Subject: [PATCH] home: vim: completion: use better order --- home/vim/plugin/settings/completion.vim | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/home/vim/plugin/settings/completion.vim b/home/vim/plugin/settings/completion.vim index 448ea53..fce33ea 100644 --- a/home/vim/plugin/settings/completion.vim +++ b/home/vim/plugin/settings/completion.vim @@ -9,10 +9,21 @@ cmp.setup({ entries = "native", }, sources = { - { name = "buffer" }, - { name = "nvim_lsp" }, - { name = "nvim_lua" }, - { name = "path" }, + { name = "path", priority_weight = 110 }, + { name = "nvim_lsp", priority_weight = 100 }, + { name = "nvim_lua", priority_weight = 90 }, + { name = "buffer", 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