From ef5b2911bf2f14b21642413882690c49b0781444 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Wed, 17 Sep 2025 21:55:00 +0200 Subject: [PATCH] vim:coc: Select first item before confirming I believe I had the problem in the past that the completion wouldn't automatically select the first entry but simply display the menu. Thus it would simply insert a new line when pressing return to accept it. Unfortunately I didn't commit it back then and I can't reproduce it now. But it doesn't not hurt so I commit it to be safe. --- .config/vim/vimrc.d/25-coc.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/vim/vimrc.d/25-coc.vim b/.config/vim/vimrc.d/25-coc.vim index 24e53a3..e410994 100644 --- a/.config/vim/vimrc.d/25-coc.vim +++ b/.config/vim/vimrc.d/25-coc.vim @@ -64,7 +64,7 @@ endif " Make to accept selected completion item or notify coc.nvim to format " u starts a new undo break, please make your own choice. -inoremap coc#pum#visible() ? coc#pum#confirm() +inoremap coc#pum#visible() ? coc#_select_confirm() \: "\u\\=coc#on_enter()\" " Use `[g` and `]g` to navigate diagnostics