summary refs log tree commit diff
path: root/.vim/lua/internal/plugins/blink.lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.config/nvim/lua/plugins/blink.lua (renamed from .vim/lua/internal/plugins/blink.lua)31
1 files changed, 20 insertions, 11 deletions
diff --git a/.vim/lua/internal/plugins/blink.lua b/.config/nvim/lua/plugins/blink.lua
index 1d0e0ae..1122bcc 100644
--- a/.vim/lua/internal/plugins/blink.lua
+++ b/.config/nvim/lua/plugins/blink.lua
@@ -6,14 +6,7 @@ return {
     lazy = false,
 
     dependencies = {
-      {
-        'L3MON4D3/LuaSnip',
-        version = 'v2.*',
-        build = 'make install_jsregexp',
-        config = function()
-          require('internal.snippets')
-        end,
-      },
+      { 'L3MON4D3/LuaSnip' },
     },
 
     init = function()
@@ -26,11 +19,29 @@ return {
       hl(0, 'BlinkCmpLabelDescription', { link = 'Comment', force = true })
     end,
 
+    opts_extend = { 'sources.default' },
+
     opts = {
       -- TODO:
       -- 'prefer_rust_with_warning', requires nightly rust, due to:
       -- https://github.com/rust-lang/rust/issues/86656
-      fuzzy = { implementation = 'lua' },
+      fuzzy = { 
+        implementation = 'lua',
+        sorts = {
+          function(a, b)
+            local prio = {
+              snippets = 99,
+              -- everyting else 0
+            }
+            local a_priority = prio[a.source_id] or 0
+            local b_priority = prio[b.source_id] or 0
+            if a_priority ~= b_priority then return a_priority > b_priority end
+          end,
+          -- defaults
+          'score',
+          'sort_text'
+        },
+      },
 
       appearance = {
         -- fallback to cmp highlight names
@@ -42,7 +53,6 @@ return {
       sources = {
         providers = {
           buffer = { min_keyword_length = 3 },
-          snippets = { min_keyword_length = 3 },
         },
       },
 
@@ -80,6 +90,5 @@ return {
 
       snippets = { preset = 'luasnip' },
     },
-    opts_extend = { 'sources.default' },
   },
 }