diff --git a/data/nvim/init.lua b/data/nvim/init.lua index 389dc7e..ca04358 100644 --- a/data/nvim/init.lua +++ b/data/nvim/init.lua @@ -316,9 +316,6 @@ require("lazy").setup({ }, config = function() local cmp = require("cmp") - local feedkeys = require("cmp.utils.feedkeys") - local keymap = require("cmp.utils.keymap") - cmp.setup({ performance = { max_view_entries = 8, @@ -331,29 +328,7 @@ require("lazy").setup({ mapping = cmp.mapping.preset.insert({ [""] = cmp.mapping.complete(), [""] = cmp.mapping.abort(), - - -- https://github.com/hrsh7th/nvim-cmp/issues/1326 - -- https://github.com/vim/vim/issues/12230 - -- https://github.com/neovim/neovim/issues/22892 - [""] = function(fallback) - if vim.fn.pumvisible() == 1 then - if vim.fn.complete_info({ "selected" }).selected == -1 then - -- Nothing selected, insert newline - -- feedkeys.call(keymap.t(""), "in") - return - end - - -- Something selected, confirm selection by stopping Ctrl-X mode - -- :h i_CTRL-X_CTRL-Z* - feedkeys.call(keymap.t(""), "in") - return - end - - -- `nvim-cmp` default confirm action - -- Accept currently selected item - -- Set `select` to `false` to only confirm explicitly selected items - cmp.mapping.confirm({ select = false })(fallback) - end, + [""] = cmp.mapping.confirm({ select = true }), }), completion = { autocomplete = false,