vifm/vifm

:find returning error on mac os

jose1711 opened this issue · 3 comments

vifm 0.13 installed using homebrew.

$ vim --no-configs
:cd /etc
:find hosts

Results in

Loading menu
find: ,: unknown primary or operator

Press Return to continue

macOS: Sonoma 14.0

Sounds like it's not GNU find, default value of 'findprg' is

find %s %a -print , -type d \( ! -readable -o ! -executable \) -prune

You can set it to

find %s %a

The rest is needed to suppress errors about directories being not readable or executable (2> /dev/null has the same effect but for all errors).

Thank you, that worked. Osx's default find program indeed isn't GNU. What would be the best to do in order to get the seamless experience? Should this be looked at by homebrew formulae maintainers (https://formulae.brew.sh/formula/vifm)?

I guess sample vifmrc could contain something like this as there is no guarantee that GNU find is used on other systems as well (this can be done by homebrew as well):

if system("find --version | grep -c 'GNU findutils'") != 1
    set findprg='find %s %a'
endif

Alternatively, default value can be updated and a reverse conditional added to sample vifmrc. It's more of a usability rather than a functional change.