Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
ivy-occur for counsel-find-file doesn't work on BSDs (including OSX) #1686
The commit 0d2823e uses the
The change applied only to
Just add this to your config:
(setq counsel-find-file-occur-cmd "ls -a | grep -i -E '%s' | xargs ???")
I would also appreciate a PR like this:
(defvar counsel-find-file-occur-cmd (if (eq system-type 'darwin) "???" "ls -a | grep -i -E '%s' | xargs -d '\\n' ls -d --group-directories-first") "Format string for `counsel-find-file-occur'.")
This would initialize the variable to a value suitable for OSX. Unfortunately, I don't have OSX so I can't make the change myself.
One thing I should clarify, the problem is not exclusive to OSX (darwin) but basically all OSs that don't ship gnu coreutils or GNU xargs. So the fix would be (eq system-type 'linux) most likely. For example OpenBSD's
Thanks for ivy btw
So looking into counsel it already has a posix compliant alternative in its codebase U_U'. But it is disabled by default. To make ivy-occur work for
(defvar counsel-find-file-occur-use-find (when (eq system-type 'gnu/linux) t) "When non-nil, `counsel-find-file-occur' will use \"find\" as the base cmd.")
What do you think?