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.
+1 vote
in vifm by
edited by

Referred to https://github.com/vifm/vifm/issues/402#issuecomment-460092642

I don't want to compute the size for my network-folder neither the fuse mounted folders

autocmd DirEnter * %select | exe 'normal ga' | %unselect

So I tried the next approach but it is not working and I've failed to find the good one after many combinations

autocmd DirEnter !**/network-folder/**,!**/fuse/** %select | exe 'normal ga' | %unselect 

Thanks so much in advance

1 Answer

+1 vote

So I tried the next approach but it is not working

Comma is like an OR operator. It makes the command to be executed when either of the patterns match, not when all of them match.

And there isn't really an AND operator for :autocmd.

So you might have to use something like this:

autocmd DirEnter !**/network-folder/** if expand('%d') != '/home/my/fuse' | %select | exe 'normal ga' | %unselect | endif

Thanks to your answer I think I've finally got it with the next

autocmd DirEnter * if system("grep -iP 'fuse|network-folder' <<<" . expand("%d")) == "" | %select | exe 'normal ga' | %unselect | endif

I did the question anonymous sorry

Thanks so much again for your awesome support!

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.

Support Ukraine