From 5d4e1547c563b8125365c59f0347fad489a54758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Wed, 9 Jul 2025 11:34:03 +0200 Subject: [PATCH] nvim/cmp: precedence --- .config/nvim/plugin/cmp.lua | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.config/nvim/plugin/cmp.lua b/.config/nvim/plugin/cmp.lua index e50e7780..efb0ccb0 100644 --- a/.config/nvim/plugin/cmp.lua +++ b/.config/nvim/plugin/cmp.lua @@ -29,18 +29,13 @@ cmp.setup { expand = function(args) luasnip.lsp_expand(args.body) end, }, mapping = cmp.mapping.preset.insert(), - -- TODO: how can I make some take precedence of others? - sources = { - { name = "luasnip" }, - { name = "nvim_lsp" }, - { name = "path" }, - { name = "buffer" }, - { - name = "spell", - keyword_length = 10, -- PERF: - option = { - keep_all_entries = true, - }, + sources = cmp.config.sources({ + { name = "luasnip" }, + { name = "nvim_lsp" }, + { name = "path" }, }, - }, + { + { name = "buffer" }, + { name = "spell", }, + }), }