How to avoid pressing enter twice to create a new line

It seems like I have to create some special config on my nvim-cmp so I can create a new line just by pressing enter (avoiding suggestions)

It seems like changing complettopt solved the problem:

--vim.opt.completeopt = "menu,menuone,noselect"
vim.opt.completeopt = { "menuone", "noselect"},

I have also updated this line:

["<CR>"] = cmp.mapping.confirm { select = false },

you can set a keymap like vim-unimpaired does: [<space> inserts a newline above and ]<space> inserts it below. There’s a plugin I’m working on that adds this kind of mappings, but it’s still unpublished as I’m figuring out a better way to decode/encode visual selections without resorting to awful vimregex or '</'>, the insert newline feature is done though.

1 Like