TLDR: try this Ctrl+@
I found this in README of neoclide/coc.nvim:
" Use <c-space> to trigger completion.
if has('nvim')
inoremap <silent><expr> <c-space> coc#refresh()
else
inoremap <silent><expr> <c-@> coc#refresh()
endif
The weirdness here is that, Ctrl+Space is not working, despite using neovim NOT vim.
But there is a good trick to get your desired key binding as it appears from your terminal emulator point of view:
- Enter
insert
mode
- Press Ctrl+v
- Then press your keys you want to bind, Ctrl+Space
Ops! nothing is inserted in my case. It seems that my terminal doesn't recognize using Ctrl and Space or understands this keybinding differently and intercepts it. So this is the real problem!
Things I tried to solve the problem:
- I changed the default coc config a little bit:
inoremap <silent><expr> <c-space> coc#refresh()
inoremap <silent><expr> <c-@> coc#refresh()
- I tried bash as I was using zsh as a shell, but the problem is still there.
- Then I tried another terminal emulator and the problem is solved, alhamdulillah.