ste*_*cho 4 vim autocomplete vim-plugin
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?
TLDR:试试这个Ctrl+@
我在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
Run Code Online (Sandbox Code Playgroud)
这里奇怪的是,尽管使用neovim NOT vim,但不起作用。Ctrl+Space
但是有一个很好的技巧可以让您获得所需的键绑定,就像从终端仿真器的角度来看的那样:
insert模式行动!我的案例中没有插入任何内容。看来我的终端无法识别使用 Ctrl 和 Space,或者以不同的方式理解此键绑定并拦截它。所以这才是真正的问题!
我尝试解决问题的事情:
inoremap <silent><expr> <c-space> coc#refresh()
inoremap <silent><expr> <c-@> coc#refresh()
Run Code Online (Sandbox Code Playgroud)
小智 6
是的,答案在 CoC 的github 项目首页。您需要将某些内容映射到 coc#refresh()。例如,要使用Ctrl+Space触发完成,您需要在 vimrc 中放入以下内容:
inoremap <silent><expr> <c-space> coc#refresh()
Run Code Online (Sandbox Code Playgroud)
项目页面上有更多示例。
我在https://github.com/neoclide/coc.nvim/issues/2299#issuecomment-686293001发表评论
图像中的建议框是signatureHelp。如果你想重新打开它,你需要
triggerCharacters在你的函数中触发,通常是(和,。触发器字符由 LS 定义。