From 70b43e497b078fad294f128c83b46a7c1d700ba9 Mon Sep 17 00:00:00 2001 From: Christian Nieves Date: Thu, 23 Nov 2023 15:30:58 -0600 Subject: [PATCH] cmp sorting woot --- .../.config/nvim/after/ftplugin/gdscript.vim | 2 +- config/.config/nvim/spell/en.utf-8.add | 1 + config/.config/nvim/spell/en.utf-8.add.spl | Bin 324 -> 337 bytes vim/.vim/lua/plugins/cmp.lua | 24 ++++++++++-------- vim/.vim/lua/plugins/nvim-treesitter.lua | 1 + 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/config/.config/nvim/after/ftplugin/gdscript.vim b/config/.config/nvim/after/ftplugin/gdscript.vim index 9c17c55..602a459 100644 --- a/config/.config/nvim/after/ftplugin/gdscript.vim +++ b/config/.config/nvim/after/ftplugin/gdscript.vim @@ -3,4 +3,4 @@ set nowrap set tabstop=4 set softtabstop=4 set shiftwidth=4 -set expandtab +set noexpandtab diff --git a/config/.config/nvim/spell/en.utf-8.add b/config/.config/nvim/spell/en.utf-8.add index f43e979..3999aba 100644 --- a/config/.config/nvim/spell/en.utf-8.add +++ b/config/.config/nvim/spell/en.utf-8.add @@ -6,3 +6,4 @@ createApkDescriptor setInstance collsion_body shake_decay +index diff --git a/config/.config/nvim/spell/en.utf-8.add.spl b/config/.config/nvim/spell/en.utf-8.add.spl index 1f025113c4aed710957a2cb37fa76368ef876add..cddfd718eb3a23efd8d11327344cf7e349c96e6f 100644 GIT binary patch delta 121 zcmX@YbdgCo%+t5HAT=k)=syDk!#4Khw2aJ&LIqK-C5(BDDU7L%j0_Bl6^uoUnT%zO ziHs#+ekxOH29TKvR8kD26M=LxNWwK0$j%08iU(^2i^(T4<^y34ST#_M_rwb&05i%P AV*mgE delta 88 zcmcb}bc9JL%+t5HAT=k)=syDk!&$e0g=IY7mEAimecyCnc50~MwK diff --git a/vim/.vim/lua/plugins/cmp.lua b/vim/.vim/lua/plugins/cmp.lua index b8bd953..f8bacae 100644 --- a/vim/.vim/lua/plugins/cmp.lua +++ b/vim/.vim/lua/plugins/cmp.lua @@ -88,29 +88,31 @@ return { cmp.setup({ preselect = cmp.PreselectMode.None, sources = cmp.config.sources(require("utils").TableConcat({ + { name = "luasnip", priority = 8 }, + { name = "nvim_lsp", priority = 7 }, { name = "async_path" }, + { name = "treesitter" }, + { name = "buffer" }, { name = "calc" }, { name = "crates" }, { name = "emoji" }, - { name = "luasnip", priority = 8 }, - { name = "nvim_lsp", priority = 7 }, - { name = "spell" }, - { name = "treesitter" }, - { name = "buffer" }, }, conditionalSources)), sorting = { comparators = { + -- compare.score_offset, -- not good at all + compare.locality, + compare.recently_used, compare.score, -- based on : score = score + ((#sources - (source_index - 1)) * sorting.priority_weight) compare.offset, - --compare.order, - --compare.sort_text, + compare.order, + -- compare.scopes, -- what? + -- compare.sort_text, -- compare.exact, -- compare.kind, - -- compare.length, + -- compare.length, -- useless }, }, - formatting = { format = lspkind.cmp_format({ menu = { @@ -148,8 +150,8 @@ return { [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() - -- elseif has_words_before() then - -- cmp.complete() + -- elseif has_words_before() then + -- cmp.complete() else fallback() -- The fallback function sends a already mapped key. In this case, it's probably ``. end diff --git a/vim/.vim/lua/plugins/nvim-treesitter.lua b/vim/.vim/lua/plugins/nvim-treesitter.lua index f032715..ae66960 100644 --- a/vim/.vim/lua/plugins/nvim-treesitter.lua +++ b/vim/.vim/lua/plugins/nvim-treesitter.lua @@ -13,6 +13,7 @@ return { -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally auto_install = false, + indent = { enable = true }, -- List of parsers to ignore installing (or "all") -- ignore_install = { "" },