Skip to content
Discussion options

You must be logged in to vote

I like to have the first item selected by default so that as soon as I press it's accepted.
I achieve that with vim.o.completeopt = 'noinsert'
However, I really dislike Enter to accept.

Can you please clarify what would you like to happen when pressing <CR> when there is a pmenu visible? Is it basically "hide pmenu and start new line"? If yes, then this can be achieved with custom <CR> mapping in Insert mode. Something like this:

vim.keymap.set('i', '<CR>', [[pumvisible() ? "\<C-e>\<CR>" : "\<CR>"]], { expr = true })

You can also utilize MiniKeymap.map_multistep() to make it work with other uses of <CR>. Something like this:

local pmenu_dismiss = {
  condition = function() return vim.fn.p…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@TuTiuTe
Comment options

@TuTiuTe
Comment options

@echasnovski
Comment options

@TuTiuTe
Comment options

Answer selected by echasnovski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested mini.completion mini.keymap
2 participants