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

= shortcut filters out everything but matching files
How do I negate the filtering, that is NOT show matching files?

1 Answer

+1 vote
by
selected by
 
Best answer

You can't. The plan is to make local filter accept matches and allow writing =!{pattern} or something analogous, but it hasn't been done yet.

by
edited by

My workaround for this:
( limited, for temporary panels only where zd is applicable )

  1. :select //pattern// to select path matching entries
  2. zd to hide the selection

this efficiently means //pattern// negation, doesn't it?

by

this efficiently means //pattern// negation, doesn't it?

Yes.

If you don't care specifically about local filter, you could do :filter !{pattern}. You'll just have to clear the filter with :filter manually later.

by

Citation xaizek You can't. The plan is to make local filter accept matches and allow writing =!{pattern} or something analogous, but it hasn't been done yet.

would be great to have this function

At the moment I have files starting with AAA_ for example:

AAA_aviation AAA_cvr AAA_fdr AAA_metar AAA_morse

What is the best way to hide them, only in this view, without permanent filter ?

I can select these files with

:select /aaa_/

but not able to hide them with zd

other question, what is the purpose of the slash in

:select /aaa_/

because

:filter aaa_

doesn't need any slash and works very well for permanent filter

Merci

by

would be great to have this function

Yes, it's just that integrating it is not backwards compatible with existing filtering. I guess I should just add a new flag to 'cpoptions' instead of hoping to find a better solution.

but not able to hide them with zd

zd is for custom views. zf works everywhere but involves permanent filter, so I don't think it can be avoided here.

other question, what is the purpose of the slash in

Because :filter and :select treat undecorated patterns differently, as a regular expression and a glob respectively (see the docs).

by

great I understand everything you said, guess


I should just add a new flag to 'cpoptions' instead of 
 hoping to find a better solution.

about cpoptions take your time to think about an another solution, don't bother at all


for hide items I can make:

:select /aaa_/

then

zd

to add the selection to the filter

OR alternativ

:filter aaa_

for the patterns I have to practice with examples because there is a wide variety of cases...
I will share my results if anyone wishes


at the moment I have in VIFMRC

nnoremap <esc> zr<esc>

to clear the local filter

My idea is to clear the local filter with one click on ESC

and two quick clicks on ESC to clear the local filter AND the permanent filter

Does nnoremap accept such two quick clicks?

by

Does nnoremap accept such two quick clicks?

Not really, such a case will be processed as two independent Esc presses. You could map <esc><esc> but that will add a delay for single <esc>.

by

Ended up with this mapping for clean the permanent filter:

nnoremap ff zO<esc>

from doc zO

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