diff --git a/homeConfig/dotfiles/nvim/lua/config/autocmds.lua b/homeConfig/dotfiles/nvim/lua/config/autocmds.lua index 8939cb1..a65251c 100644 --- a/homeConfig/dotfiles/nvim/lua/config/autocmds.lua +++ b/homeConfig/dotfiles/nvim/lua/config/autocmds.lua @@ -69,27 +69,7 @@ cmp.setup({ return not context.in_treesitter_capture("comment") and not context.in_syntax_group("Comment") end end, - mapping = { - -- [""] = cmp.mapping(function(fallback) - -- if vim.fn.pumvisible() == 1 then - -- vim.fn.feedkeys(vim.api.nvim_replace_termcodes("", true, true, true), "n") - -- elseif luasnip.expand_or_jumpable() then - -- vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-expand-or-jump", true, true, true), "") - -- else - -- fallback() - -- end - -- end, { "i", "s" }), - - -- [""] = cmp.mapping(function(fallback) - -- if vim.fn.pumvisible() == 1 then - -- vim.fn.feedkeys(vim.api.nvim_replace_termcodes("", true, true, true), "n") - -- elseif luasnip.jumpable(-1) then - -- vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-jump-prev", true, true, true), "") - -- else - -- fallback() - -- end - -- end, { "i", "s" }), [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() @@ -113,6 +93,7 @@ cmp.setup({ fallback() end end, { "i", "s" }), + [""] = cmp.mapping({ i = function(fallback) if cmp.visible() and cmp.get_active_entry() then @@ -124,6 +105,26 @@ cmp.setup({ s = cmp.mapping.confirm({ select = true }), c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }), }), + -- Lazyvim default + -- [""] = cmp.mapping(function(fallback) + -- if vim.fn.pumvisible() == 1 then + -- vim.fn.feedkeys(vim.api.nvim_replace_termcodes("", true, true, true), "n") + -- elseif luasnip.expand_or_jumpable() then + -- vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-expand-or-jump", true, true, true), "") + -- else + -- fallback() + -- end + -- end, { "i", "s" }), + + -- [""] = cmp.mapping(function(fallback) + -- if vim.fn.pumvisible() == 1 then + -- vim.fn.feedkeys(vim.api.nvim_replace_termcodes("", true, true, true), "n") + -- elseif luasnip.jumpable(-1) then + -- vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-jump-prev", true, true, true), "") + -- else + -- fallback() + -- end + -- end, { "i", "s" }), }, })