-if [[ ! -x /usr/bin/fzf ]]; then
+if ! hash fzf 2>/dev/null; then
echo '`fzf` is not installed.'
return
fi
# ALT-C - cd into the selected directory
fzf-cd-widget() {
- cd "${$(command find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
+ cd "${$(command find -L . -xdev \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
-o -type d -print 2> /dev/null | sed 1d | cut -b3- | fzf +m):-.}"
zle reset-prompt
}