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.

Exclude commands from chistory

0 votes
asked Jul 21 in vifm by durcheinandr

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
answered Jul 21 by xaizek

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.

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.
...