Searching for menu item
Opening the Venu and typing / could initiate a search functionality. Upon pressing ESC the user is put back to the original menu from where / was initiated.
Example menu:
- Markdown Preview
- Table of Contents (ToC)
- Github Flavor
- Redcarpet Flavor
Typing git toc should display matching items and give/select the item Github Flavor as the first result. Pressing enter executes that item.
Have you evaluated the possibility of hooking into https://github.com/junegunn/fzf.vim ? If you offload the listing/filtering tasks to it you can focus on the core business of your plugin. I'm not in any way associated with FZF, just using it and being able to just hook your plugin into it would seem to be a nice and clean solution.
A good example is the https://github.com/autozimu/LanguageClient-neovim plugin that fires up FZF to list the symbols in the document. https://github.com/autozimu/LanguageClient-neovim/blob/f9a9123582abfd0f0433e7f8813daf7e615a18b6/autoload/LanguageClient.vim#L139
Thanks for the suggestion!
The underlying structure of the menu is composed of lists of dictionaries (menus), and each dictionary can contain another list of submenus. See here: https://github.com/Timoses/vim-venu/blob/master/autoload/venu.vim#L15 (cmd is the action called when the menu item is selected. However, if cmd stores a dictionary resembling a menu it will display that "submenu").
As stated in the initial issue comment, searching for "git toc" would have to match entries from several lists which have a parent-child relationship.
I haven't thought of how to implement it. I'm not sure how fzf would fit in. As far as I understand fzf offers searching/matching patterns from a list and also offers a terminal UI to make a selection. The part I see that could be useful is the pattern matching.
I think you would have to resort to indentation to represent submenus (that's just my guess though). If that's an acceptable tradeoff is up to you ;)