I am write a plugin for neovim in python using this client and I looking for a way to offer completion when executing a command. I have look at the following example to structure my plugin. As an example, I could have a command Foo and when you call it the first time:
the second time you could autocomplete:
Foo b<tab> -> Foo bar
as an example my this is what my plugin look like in my ~/.config/nvim/rplugin/python3/my_plugin.py:
import neovim @neovim.plugin class MyPlugin(object): def __init__(self, vim): self.vim = vim self.current_args =  @neovim.command("Cmd", range="", nargs="*", sync=True) def CmdHandler(self, args, range): if args not in self.current_args: self.current_args.append(args)
And I guess I would need to write a function for the completion for the command?
@neovim.function("MyCompletionFunction") def MyCompletionFunction(self, args): ...
and set my function as completion function for my command. any help appreciated