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

When a custom view is displayed on a panel as a, say, result of grep:

Is it possible to filter using regexp that matches the full path ?

Now it seems like filter command only respects the base name

1 Answer

0 votes
by

Now it seems like filter command only respects the base name

That's its default behaviour, but it accepts patters as those used in :filetype command. You can do

:filter {{full-path-glob}}

and

:filter //full-path-regex//
by

Thanks for your reply!

Unfortunately, this does not seem to work. Steps I tried:

  1. :grep for some string, got the list

  2. press b to get the matching files on a panel

  :filter //^.*path_pattern.*$//

Step 3 does not change anything, path_pattern is there in the path, I tried several regex
against the real path, as well as against the visible (displayed) path.

PS.
any difference between //regexp// and /regexp/ notation?
(I tried both)

my vifm Version: 0.10.1

by

I managed to workaround that with

  1. :select //mypattern// command, that selects the matching files
  2. use zd shortcut which hides the selection
by

Add ! to negate the pattern if you want to hide the files:

:filter !//^.*path_pattern.*$//

Also see docs on 'cpoptions' if you want to change how :filter works by default.

...