diff --git a/dotfiles/neovim/lua/completion-config.lua b/dotfiles/neovim/lua/completion-config.lua index 7be447e..1eb2bdb 100644 --- a/dotfiles/neovim/lua/completion-config.lua +++ b/dotfiles/neovim/lua/completion-config.lua @@ -14,9 +14,10 @@ cmp.setup({ mapping = cmp.mapping.preset.insert({ [''] = cmp.mapping.abort(), [''] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping.complete(), [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() + if vim.snippet.active({ direction = 1 }) then + vim.snippet.jump(1) elseif luasnip.locally_jumpable(1) then luasnip.jump(1) else @@ -25,10 +26,10 @@ cmp.setup({ end, { "i", "s" }), [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.locally_jumpable(-1) then + if luasnip.locally_jumpable(-1) then luasnip.jump(-1) + elseif vim.snippet.active({ direction = -1 }) then + vim.snippet.jump(-1) else fallback() end