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.

How to configure 'find' to ignore specific directories

+1 vote
asked Oct 29 in vifm by Alik

Is it possible to permanently exclude certain folders from 'find' command?

For example, if I never want to 'find' inside .git directories, can I put something into the vifmrc to ignore them (even if current filter shows dotfiles)?

1 Answer

0 votes
answered Oct 29 by xaizek
 
Best answer

You can adjust 'findprg' option like this:

set findprg='find %s %a -print , -type d \( ! -readable -o ! -executable -o -path "*/.git" \) -prune'

Compared to default value only -o -path "*/.git" is added, which makes find do -prune for paths that match that pattern (the subtree is skipped entirely without descending into it).

See man find for details about the syntax.

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