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:Foo barthe second time you could autocomplete:Foo b<tab> -> Foo baras an example my this is what my plugin look like in my ~/.config/nvim/rplugin/python3/my_plugin.py:import neovim@neovim.pluginclass 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[0] not in self.current_args:            self.current_args.append(args[0])And I guess I would need to write a function for the completion forthe command?@neovim.function(MyCompletionFunction)def MyCompletionFunction(self, args):    ...and set my function as completion function for my command.any help appreciated
neovim: autocompletion on user defined command plugin
autocompletion;neovim;plugin system;vimscript python
First of all, when you define a new command in the way I do, a user-command, you can specify in which way the command  will be autocompleted (command-completion) and there's a lot of choices.So the way I did it is with a customlist function as follow:@neovim.pluginclass MyPlugin(object):    def __init__(self, vim):        self.vim = vim        self.values = []    @neovim.command(Cmd, complete='customlist,MyFunc', range=, nargs=1, sync=True)    def Cmd(self, args, range):        new_value = args[0]        self.values.append(new_value)    @neovim.function(MyFunc, sync=True)    def MyFunc(self, *args, **kwargs):        return self.valuesso each time I exec the command:Cmd value1next time, I can:Cmd va<Tab>  -> :Cmd value1