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

I have some commands which make use of %a for sensible things. I don't want them to be included in set vifminfo chistory.

Is there any way to prevent some commands added to the command-history?

1 Answer

0 votes

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.