From 711d82fc2b6fe6769f3bc41f84a8c526793bdac1 Mon Sep 17 00:00:00 2001 From: Rob Watson Date: Thu, 21 Sep 2023 16:00:41 +0200 Subject: [PATCH] fix(nvim): update nvim_cmp config --- vim/lua/nvim_cmp_config.lua | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/vim/lua/nvim_cmp_config.lua b/vim/lua/nvim_cmp_config.lua index a7db697..3cb963c 100644 --- a/vim/lua/nvim_cmp_config.lua +++ b/vim/lua/nvim_cmp_config.lua @@ -1,15 +1,20 @@ local cmp = require("cmp") -local cmp_buffer = require("cmp_buffer") +-- local cmp_buffer = require("cmp_buffer") cmp.setup({ completion = { - completeopt = "menu,menuone,noinsert", + completeopt = "menu,menuone,noinsert,noselect", }, snippet = { expand = function(args) vim.fn["vsnip#anonymous"](args.body) end, }, + preselect = cmp.PreselectMode.None, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, mapping = cmp.mapping.preset.insert({ [""] = cmp.mapping.scroll_docs(-4), [""] = cmp.mapping.scroll_docs(4), @@ -34,13 +39,16 @@ cmp.setup({ }), sorting = { comparators = { - function(...) - return cmp_buffer:compare_locality(...) - end, + cmp.config.compare.offset, + cmp.config.compare.exact, + cmp.config.compare.score, + cmp.config.compare.recently_used, + -- require("cmp-under-comparator").under, + cmp.config.compare.kind, }, }, - view = { - entries = "native", + formatting = { + fields = { "kind", "abbr", "menu" }, }, experimental = { ghost_text = true,