return { "mini.completion", enabled = true, lazy = true, event = "InsertEnter", after = function() require("mini.completion").setup { window = { info = { border = "rounded", }, signature = { border = "rounded", }, }, } local imap_expr = function(lhs, rhs) vim.keymap.set('i', lhs, rhs, { expr = true }) end imap_expr('', [[pumvisible() ? "\" : "\"]]) imap_expr('', [[pumvisible() ? "\" : "\"]]) -- Disable arrow keys from navigating completion window. -- I like to navigate inside insert mode and the window prevents that. vim.keymap.set('i', '', function() -- cancel completion popup vim.fn.complete(vim.fn.col('.'), {}) vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('', true, false, true), 'n', true) end, { noremap = true, desc = 'Cancel completion and move cursor up' }) vim.keymap.set('i', '', function() vim.fn.complete(vim.fn.col('.'), {}) vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('', true, false, true), 'n', true) end, { noremap = true, desc = 'Cancel completion and move cursor down' }) end }