There is no direct way. It's possible to do by dumping current state to vifminfo
file, running the command and restoring previous state:
" trigger the mapping to enter command-line mode
nnoremap ,s :write | sensitive-command | restart<left><left><left><left><left><left><left><left><left>
" OR
" write "sensitive" on the command line and press space to surround
" the command with :write and :restart
cabbrev sensitive <c-a>write \| <c-e>\| restart<left><left><left><left><left><left><left><left><left><left>
I don't think there is a nicer way at the moment, adding corresponding attribute (argument like -sensitive
) to :command
command could be an option. You can also quit vifm using :quit!
or ZQ to avoid vifminfo
being written.