about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2024-03-21 17:20:44 +0900
committersefidel <contact@sefidel.net>2024-03-21 17:20:44 +0900
commit504ee3009df78cfb7e225c8882e7826920c4fdca (patch)
tree9562484c7d0ed36529f9ab534560dce473eb812d
parent476441a0e45f032d43458572b3913ddde2969035 (diff)
downloadnvimrc-504ee3009df78cfb7e225c8882e7826920c4fdca.tar.gz
nvimrc-504ee3009df78cfb7e225c8882e7826920c4fdca.zip
feat(cmp)!: replace luasnip with native snippets
-rw-r--r--fnl/nvrc/pack.fnl3
-rw-r--r--fnl/nvrc/packs/cmp.fnl7
-rw-r--r--lazy-lock.json1
3 files changed, 4 insertions, 7 deletions
diff --git a/fnl/nvrc/pack.fnl b/fnl/nvrc/pack.fnl
index 7504cf5..2cb7087 100644
--- a/fnl/nvrc/pack.fnl
+++ b/fnl/nvrc/pack.fnl
@@ -36,8 +36,7 @@
 
 (pack! :hrsh7th/nvim-cmp {:req :cmp
                           :event [:InsertEnter :CmdlineEnter]
-                          :dependencies [(pack :L3MON4D3/LuaSnip)
-                                         (pack :lukas-reineke/cmp-under-comparator)
+                          :dependencies [(pack :lukas-reineke/cmp-under-comparator)
                                          (pack :hrsh7th/cmp-nvim-lsp {:after :nvim-cmp})
                                          (pack :hrsh7th/cmp-nvim-lsp-signature-help)]})
 (pack! :numToStr/Comment.nvim {:init :Comment :lazy true})
diff --git a/fnl/nvrc/packs/cmp.fnl b/fnl/nvrc/packs/cmp.fnl
index b49a1c8..11595d1 100644
--- a/fnl/nvrc/packs/cmp.fnl
+++ b/fnl/nvrc/packs/cmp.fnl
@@ -8,7 +8,6 @@
         : select_prev_item} (require :cmp))
 (local under-compare (require :cmp-under-comparator))
 (local clangd-score (require :clangd_extensions.cmp_scores))
-(local luasnip (require :luasnip))
 
 (set! completeopt "menuone,noselect")
 
@@ -39,7 +38,7 @@
               :TypeParameter "(tp)"})
 
 (setup {:snippet {:expand (fn [args]
-                                ((. (require :luasnip) :lsp_expand) args.body))}
+                                (vim.snippet.expand args.body))}
             :formatting {:format (fn [entry vim-item]
                                    (set vim-item.kind
                                         (string.format "%s %s"
@@ -61,11 +60,11 @@
                                                                :select false}) [:i :c])
                       :<Tab> (mapping {:i (fn [fallback]
                                               (if (visible) (select_next_item)
-                                              (luasnip.expand_or_jumpable) (luasnip.expand_or_jump)
+                                              (vim.snippet.jumpable 1) (vim.snippet.jump 1)
                                               (fallback)))})
                       :<S-Tab> (mapping {:i (fn [fallback]
                                                   (if (visible) (select_next_item)
-                                                  (luasnip.jumpable -1) (luasnip.jump -1)
+                                                  (vim.snippet.jumpable -1) (vim.snippet.jump -1)
                                                   (fallback)))})}
             :sources [{:name :nvim_lsp}
                       {:name :nvim_lsp_signature_help}]
diff --git a/lazy-lock.json b/lazy-lock.json
index a609443..fbf145b 100644
--- a/lazy-lock.json
+++ b/lazy-lock.json
@@ -1,6 +1,5 @@
 {
   "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
-  "LuaSnip": { "branch": "master", "commit": "a7a4b4682c4b3e2ba82b82a4e6e5f5a0e79dec32" },
   "clangd_extensions.nvim": { "branch": "main", "commit": "34c8eaa12be192e83cd4865ce2375e9f53e728f2" },
   "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
   "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" },