From 75b133727414955cd4dcbc106d4210bb703055c6 Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Tue, 5 Mar 2024 23:56:42 -0500 Subject: [PATCH] Configure the nvim-cmp plugin priority and max item count --- vim/config/plugins/nvim-cmp.lua | 40 ++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/vim/config/plugins/nvim-cmp.lua b/vim/config/plugins/nvim-cmp.lua index b7bc3df..b0a7aa7 100644 --- a/vim/config/plugins/nvim-cmp.lua +++ b/vim/config/plugins/nvim-cmp.lua @@ -48,12 +48,40 @@ if (vim.g.enablecompletion == 1) then }), sources = cmp.config.sources({ - { name = "buffer" }, - { name = "treesitter" }, - { name = "omni" }, - { name = "async_path" }, - { name = "tags", option = { current_buffer_only = true } }, - { name = "snippy" }, + { + name = "snippy", + priority = 4 + }, + + { + name = "async_path", + priority = 3 + }, + + { + name = "buffer", + priority = 3, + max_item_count = 5 + }, + + { + name = "treesitter", + priority = 2, + max_item_count = 5 + }, + + { + name = "omni", + priority = 2, + max_item_count = 5 + }, + + { + name = "tags", + priority = 1, + max_item_count = 5, + option = { current_buffer_only = true }, + }, }), enabled = function()