diff --git a/CHANGELOG.md b/CHANGELOG.md index 8496f0b..223a72c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 26th February 2024 + +### Changed + +* Update keybindings for snippet completion. + ## 25th February 2024 * Remove `colorcolumn` and `cursorline`. diff --git a/after/plugin/completion.lua b/after/plugin/completion.lua index 5104fda..af8564b 100644 --- a/after/plugin/completion.lua +++ b/after/plugin/completion.lua @@ -18,9 +18,20 @@ cmp.setup { }, mapping = cmp.mapping.preset.insert { - [""] = cmp.mapping.scroll_docs(-4), [""] = cmp.mapping.close(), - [""] = cmp.mapping.scroll_docs(4), + + [""] = cmp.mapping(function() + if luasnip.locally_jumpable(-1) then + luasnip.jump(-1) + end + end, { "i", "s" }), + + [""] = cmp.mapping(function() + if luasnip.expand_or_locally_jumpable() then + luasnip.expand_or_jump() + end + end, { "i", "s" }), + [""] = cmp.mapping.confirm { select = true }, [""] = cmp.config.disable, },