diff options
| author | Robert Günzler <r@gnzler.io> | 2022-10-12 17:07:58 +0200 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2022-10-12 17:08:34 +0200 |
| commit | 0c160b43bc57e1055a14d6c6cbb7af4cfaf19242 (patch) | |
| tree | bc84b8508d77fed2d718c08931b35b2999125ca2 /.vim/lua/plugins.lua | |
| parent | f039c4b71548eaf233d3fac8cde3953d98777e54 (diff) | |
vim: make luasnip binds only work inside active snippets
Diffstat (limited to '.vim/lua/plugins.lua')
| -rw-r--r-- | .vim/lua/plugins.lua | 16 |
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() |