diff options
| author | Robert Günzler <r@gnzler.io> | 2022-09-28 18:48:38 +0200 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2022-09-28 18:48:38 +0200 |
| commit | 188ebccd6278a05571aee756841ea0f337ea7179 (patch) | |
| tree | 0855d2cfcf5761ca42fdd3a9094c2ae4dea52d88 /.vim/lua/plugins.lua | |
| parent | f200a263a356ed96181a1ccba56dbbded322c2a3 (diff) | |
vim: adjust cmp keybinds
make jumping through snippets more intuitive add doc scrolling
Diffstat (limited to '.vim/lua/plugins.lua')
| -rw-r--r-- | .vim/lua/plugins.lua | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/.vim/lua/plugins.lua b/.vim/lua/plugins.lua index c15d6fb..d3c9646 100644 --- a/.vim/lua/plugins.lua +++ b/.vim/lua/plugins.lua @@ -500,8 +500,8 @@ require('packer').startup({function() ['<c-n>'] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() + elseif luasnip.jumpable(1) then + luasnip.jump(1) else fallback() end @@ -543,9 +543,20 @@ require('packer').startup({function() end, }), ['<s-tab>'] = cmp.mapping({ + i = function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, s = function(fallback) if cmp.visible() then cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) else fallback() end @@ -573,6 +584,8 @@ require('packer').startup({function() fallback() end end, { 'i', 's'}), + ['<s-pagedown>'] = cmp.mapping.scroll_docs(-4), + ['<s-pageup>'] = cmp.mapping.scroll_docs(4), }, snippet = { expand = function(args) |