Welcome to Vifm Q&A, where you can ask questions about using Vifm. Registration is optional, anonymous posts are moderated. E-mail and GitHub logins are enabled.
0 votes
in vifm by

I'll describe the situation better. The archive has been downloaded. Extracted a file from the archive (using vifm). Now you need to move the file to the /usr/local/bin directory. A warning message appears when you try to move the file. Question: how to do this without leaving vifm?

2 Answers

0 votes
by

There is no special support for doing anything with elevated privileges, but you can run any command using :!, for example:

:!sudo mv %c %D
by

Thank you for your help

+1 vote
by

I like to use the following command and key binding for situations like this:

command! RootRelaunchVifm :!sudo vifm %d %D
nnoremap <Space>R :RootRelaunchVifm<CR>

You hit the key binding to relaunch Vifm as root, enter your password, move the file to /usr/local/bin, and finally run :quit (or a corresponding key binding) to return to your regular Vifm instance.

...