Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to execute commands that we can only use them in normal mode? #6

Closed
LinArcX opened this issue Jan 17, 2020 · 3 comments
Closed

Comments

@LinArcX
Copy link

LinArcX commented Jan 17, 2020

I'm using coc.nvim as Intellisense engine for neovim. I want to use vim-quickui to remap it's functionalities:
https://github.com/neoclide/coc.nvim#example-vim-configuration

But most of it's command only execute in normal mode:
https://github.com/neoclide/coc.nvim/blob/master/doc/coc.txt#L663

My question is how configure vim-quickui to execute coc.nvim commands. Imagin i have this menu:

call quickui#menu#install('C&oc', [
            \ [ "&config", 'CocConfig' ],
            \ [ "code-&action", '<Plug>(coc-codeaction)' ],
            \ [ "codeaction-&selected", '<Plug>(coc-codeaction-selected)' ],
            \ [ "co&mmand", '<Plug>(coc-command)' ],
            \ [ "dia&gnostics", '<Plug>(coc-diagnostics)' ],
 \ ])

But it won't works and gives me this error:

Error detected while processing function quickui#menu#open[8]..quickui#menu#nvim_open_menu:
line 94:
E488: Trailing characters: (coc-command)
Press ENTER or type command to continue

@skywind3000
Copy link
Owner

skywind3000 commented Jan 17, 2020

I don't use coc, try:

[ "code-&action", 'call feedkeys("\<Plug>(coc-codeaction)")' ],

@LinArcX
Copy link
Author

LinArcX commented Jan 17, 2020

It works! thank you.
Edit: This one works too:

[ "code-&action", 'exec "normal \<Plug>(coc-codeaction)"' ],

@LinArcX LinArcX closed this as completed Jan 17, 2020
@skywind3000
Copy link
Owner

Great, good for you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants