From 0c160b43bc57e1055a14d6c6cbb7af4cfaf19242 Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Wed, 12 Oct 2022 17:07:58 +0200 Subject: vim: make luasnip binds only work inside active snippets --- .vim/lua/plugins.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to '.vim/lua') 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() [''] = 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' }), [''] = 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' }), [''] = 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() -- cgit 1.4.1