I'm using coc.nvim for autocomplete and when the popup menu appears, I'd like Tab to select the first item and close the menu. At the moment I've keybinded Tab to <C-n><CR>
, but the <CR>
actually puts in a line return which is not what I want.
inoremap <expr> <Tab> pumvisible() ? "\<C-n><Space>" : "<Tab>"