I have the following snippet in my config for autocomplete navigation:
function! CheckBackspace() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
inoremap <silent><expr> <Tab>
\ coc#pum#visible() ? coc#pum#next(1) :
\ CheckBackspace() ? "\<Tab>" :
\ coc#refresh()
Now, when the popup menu opens I can press <CR>
to complete the first entry or <Tab>
to walk through all other entries. How can I make <Tab>
start at the first entry (as in accept completion, not close the window and on more presses walk through the list)?