Reputation: 2930
I'm Neovim user
and I use Plugin neoclide/coc.vim for autocompletion
but when my cursor focus out, I can not get suggestion box again
(How can I call this box? suggest box or hint box? I want to know this box name)
I want to trigger it and see again, Is there any command or variable for this?
Upvotes: 12
Views: 37358
Reputation: 416
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:
insert
modeOps! 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:
inoremap <silent><expr> <c-space> coc#refresh()
inoremap <silent><expr> <c-@> coc#refresh()
Upvotes: 9
Reputation: 364
To Browse from suggestion box:
- <Tab >
- <Ctrl - x> <Ctrl -f>
- <Ctrl - p ><Ctrl -n>
- <Ctrl - n ><Ctrl -n>
To Confirm selection
- <Ctrl - y>
Upvotes: 7
Reputation: 19277
I've commented in https://github.com/neoclide/coc.nvim/issues/2299#issuecomment-686293001
The suggestion box in your image is signatureHelp. If you want to reopen it, you need to trigger
triggerCharacters
in your function, usually is(
and,
. The triggerCharacters is defined by LS.
Upvotes: 3
Reputation: 705
Yes, the answer is on the front page of CoC's github project. You need to map something to coc#refresh(). For instance, to use Ctrl + Space to trigger completion, you need to put the following in your vimrc:
inoremap <silent><expr> <c-space> coc#refresh()
There are more examples on the project's page.
Upvotes: 15