nvim-cmp is a cool modular completion engine for Neovim. For a long time, it has been annoying me that certain language servers (I’m looking at you gopls and rust_analyzer) would always select the first entry irrespective of the completeopt settings

-- Completion
vim.opt.completeopt = {'menu', 'menuone', 'noinsert', 'noselect'}

Run :h completeopt for more info.

Well I finally figured out the magic encantation to get it working!!!

local cmp = require'cmp'
cmp.setup{
  ...
  preselect = cmp.PreselectMode.None
}

This will disable the preselect logic and we can continue on our merry way.