Welcome to Vifm Q&A, where you can ask questions about Vifm usage. Registration is optional, anonymous posts are moderated. GitHub or Google logins are enabled.
0 votes
in vifm by

Using this

command! quitMenu
 \ :quit

terminates vifm which is not exactly what I want (I want to run the command in the context of shown menu). As a workaround I am using

command! quitMenu
 \ :quitMenu

Which produces an error message about loop in commands but otherwise does the job. I am aware of a way to cancel that menu via key binding but in my use case I don't have such option.

1 Answer

0 votes
by

You can't define :commands for menu mode. How are you even running quitMenu, via --remote +quitMenu? Maybe explain the setup in more detail.

by

This is what I have in vimrc now:

nnoremap <f2> :command<cr>

command! CMD1
 \ :! ~/bin/command1 %c
command! CMD2
 \ :! ~/bin/command2 %c
command! quitMenu
 \ :quitMenu

Hitting F2 brings up menu and selecting the last item returns back to vifm.

by

Then this should do (just don't run any command):

command! quitMenu :
by

Then this should do

Thank you, that is a neat trick.

If you would like to make a bug report or feature request consider using GitHub, SourceForge or e-mail. Posting such things here is acceptable, but this is not a perfect place for them.
...