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

How can I select files/folders in the current directory that match a patern, e.g. jpg extension or partial filename.

thanks

1 Answer

0 votes
by
selected by
 
Best answer

Use :select command:

select *.jpg
select *part* " or select /part/
" jpg or png files that don't contain "to" substring
select {*.jpg,*.png}!/to/

The patterns are like in :filetype.

by

Great, thank you

by

I just created a folder named jpg and tested with other files123.jpg and abc.jpg- I am not able to select the folder AND the other files - only the dot files are selected. I tried the regex :select {^jpg$|*.jpg} but still not successful.

by

The correct regexp is :select /^jpg$|.*\.jpg$/ or use globs as :select {jpg,*.jpg}.

by

Both are working well.

Why the first one :select /^jpg$|.*\.jpg$/ doesn't accept curly bracket ?:select {/^jpg$|.*\.jpg$/}

and why the second one :select {jpg,*.jpg} is working whithout curly bracket? :select jpg,*.jpg

thank you

by

Why the first one :select /^jpg$|.*\.jpg$/ doesn't accept curly bracket ?:select {/^jpg$|.*\.jpg$/}

Because those signify globs. Vifm needs to know how to interpret a pattern.

and why the second one :select {jpg,*.jpg} is working whithout curly bracket? :select jpg,*.jpg

Because :select interprets its pattern as a glob by default.

You can read about patterns in the documentation for more details.

by

@xaizek Thank you for this clarification

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