deoplete.nvim
deoplete.nvim copied to clipboard
Is it possible to trigger popup on shortcut?
Hello. Thanks for this great plugin!
My question is if I can somehow trigger the popup on shortcut (say, <C-Space>
) only. Here's what I did so far is disabled the automatic popup:
vim.cmd[[
call deoplete#custom#option({
\ 'auto_complete_popup': 'manual'
\})
]]
I read the docs multiple times but still couldn't figure it out.
Please use deoplete#manual_complete.
Thanks, I was trying to figure out how to use it too. It doesn't seem to get triggered in normal mode (I binded <C-Space> to <ESC>:lua vim.g.trigger_deoplete()i
, where vim.g.trigger_deoplete
uses deoplete#manual_complete()
). Any idea?
It is really want to execute in normal mode??
I have checked the source code and it cannot...
If you have set auto_complete_popup
is manual
, deoplete uses cached results.
But the cache is cleared when you have leave insert mode.
So call deoplete#complete()
in insert mode
is best.
You need to read the documentation.
I think you have not read the documentation.
*deoplete-options-auto_complete_popup*
auto_complete_popup
Change auto completion popup behavior.
"auto": popup is displayed automatically.
"manual": popup is displayed by |deoplete#complete()|.
Default value: "auto"
Hm.. This is undocumented way but it works for me.
set runtimepath+=~/src/deoplete.nvim/
let g:deoplete#enable_at_startup = 1
call deoplete#custom#option({
\ 'auto_complete': v:false,
\})
nnoremap <Tab> i<Cmd>call deoplete#mapping#_rpcrequest_wrapper([])<CR>
inoremap <Tab><expr> deoplete#manual_complete()
or
set runtimepath+=~/src/deoplete.nvim/
let g:deoplete#enable_at_startup = 1
call deoplete#custom#option({
\ 'auto_complete_popup': 'manual'
\})
inoremap <Tab><expr> deoplete#complete()
It is really want to execute in normal mode??
No but idk how to run a command in insert mode :flushed: .
You need to read the documentation.
I did read it. I just perhaps lack the knowledge of vim
Hm.. This is undocumented way but it works for me.
Thanks, I'll try it out
No but idk how to run a command in insert mode flushed .
<Cmd>call foobar()<CR>
Thank you so much, with slight modifications it works for me:
vim.cmd[[
let g:deoplete#enable_at_startup = 1
call deoplete#custom#option({
\ 'auto_complete': v:false,
\})
inoremap <C-Space> <Cmd>call deoplete#mapping#_rpcrequest_wrapper([])<CR>
]]
I think it is better. Because it is documented function.
inoremap <C-space><expr> deoplete#manual_complete()
I may be doing something wrong, but yours doesn't work for me. It freezes for half a second with 80>ü^D<20>
in the right bottom corner and then gets into normal mode without any suggestions :((.
OK. I have reproduced it. Please update to the latest version. I have fixed it.
Still the same behavior... here's my repro:
watermelon<CR>water<C-Space>
Doesn't show the popup for me. I updated with :PlugUpdate deoplete.nvim
. nvim 0.7.
Both
inoremap <C-space><expr> deoplete#manual_complete()
inoremap <C-space> <Cmd>call deoplete#manual_complete()<CR>
Don't work for me (the second one doesn't do anything at all). :shrug:
inoremap <C-space> <Cmd>call deoplete#manual_complete()<CR>
It does not work. Because you must use deoplete#manual_complete()
in map-<expr>
.
It works for me.
Please check your deoplete.nvim is the latest version. You should check sha1.
set runtimepath+=~/src/deoplete.nvim/
let g:deoplete#enable_at_startup = 1
call deoplete#custom#option({
\ 'auto_complete': v:false,
\})
nnoremap <Tab> i<Cmd>call deoplete#mapping#_rpcrequest_wrapper([])<CR>
inoremap <expr><Tab> deoplete#manual_complete()
And please test the minimal init.vim. I think you have tested non minimal init.vim.
The latest commit is cc0f6116fa4abd4a6b4c1234f220d00ad4fe3c58
so it's supposed to be the correct version. Alright, if I find time I'll try to test minimal nvim. Thanks for your help anyway, for now it works