summary refs log tree commit diff
path: root/.vim/lua
diff options
context:
space:
mode:
authorRobert Günzler <r@gnzler.io>2022-10-12 17:07:58 +0200
committerRobert Günzler <r@gnzler.io>2022-10-12 17:08:34 +0200
commit0c160b43bc57e1055a14d6c6cbb7af4cfaf19242 (patch)
treebc84b8508d77fed2d718c08931b35b2999125ca2 /.vim/lua
parentf039c4b71548eaf233d3fac8cde3953d98777e54 (diff)
vim: make luasnip binds only work inside active snippets
Diffstat (limited to '.vim/lua')
-rw-r--r--.vim/lua/plugins.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/.vim/lua/plugins.lua b/.vim/lua/plugins.lua
index c2a471d..de7a984 100644
--- a/.vim/lua/plugins.lua
+++ b/.vim/lua/plugins.lua
@@ -500,26 +500,26 @@ require('packer').startup({function()
           ['<c-n>'] = cmp.mapping(function(fallback)
               if cmp.visible() then
                 cmp.select_next_item()
-              elseif luasnip.jumpable(1) then
+              elseif luasnip.locally_jumpable(1) then
                 luasnip.jump(1)
               else
                 fallback()
               end
-            end, { 'c', 'i', 's'}),
+            end, { 'c', 'i', 's', 'n' }),
           ['<c-p>'] = cmp.mapping(function(fallback)
               if cmp.visible() then
                 cmp.select_prev_item()
-              elseif luasnip.jumpable(-1) then
+              elseif luasnip.locally_jumpable(-1) then
                 luasnip.jump(-1)
               else
                 fallback()
               end
-            end, { 'c', 'i', 's'}),
+            end, { 'c', 'i', 's', 'n' }),
           ['<tab>'] = cmp.mapping({
               i = function(fallback)
                 if cmp.visible() then
                   cmp.confirm({ select = true })
-                elseif luasnip.expand_or_jumpable() then
+                elseif luasnip.expand_or_locally_jumpable() then
                   luasnip.expand_or_jump()
                 else
                   fallback()
@@ -528,7 +528,7 @@ require('packer').startup({function()
               s = function(fallback)
                 if cmp.visible() then
                   cmp.select_next_item()
-                elseif luasnip.expand_or_jumpable() then
+                elseif luasnip.expand_or_locally_jumpable() then
                   luasnip.expand_or_jump()
                 else
                   fallback()
@@ -546,7 +546,7 @@ require('packer').startup({function()
               i = function(fallback)
                 if cmp.visible() then
                   cmp.select_prev_item()
-                elseif luasnip.jumpable(-1) then
+                elseif luasnip.locally_jumpable(-1) then
                   luasnip.jump(-1)
                 else
                   fallback()
@@ -555,7 +555,7 @@ require('packer').startup({function()
               s = function(fallback)
                 if cmp.visible() then
                   cmp.select_prev_item()
-                elseif luasnip.jumpable(-1) then
+                elseif luasnip.locally_jumpable(-1) then
                   luasnip.jump(-1)
                 else
                   fallback()