Context

Vim autocomplete using coc.nvim plugin.

Get a behavior similar to VS Code where the first item in the suggestion drop down menu is auto-selected:

Before

Pressing the Enter key results in a new line:

After

Pressing the Enter key results in the selection of the item:

The solution

  1. Open vim and type: :CocConfig, this will open coc-settings.json
  2. Enter this line:

    {
    "suggest.noselect": false
    }
    

Enjoy!

#vim #coc.nvim #autocomplete