updated functions for the key-bindings.zsh fzf plugin. Will only use fd with a depth of 1, by default, in $HOME, but uses a depth of 2 everywhere else.
# CTRL-D - Paste the selected file path(s) into the command line
__fzf_dir_select() {
setopt localoptions pipefail no_aliases 2> /dev/null
local item
export FZF_CTRL_D_COMMAND=$(
if [[ "$(realpath .)" == "${HOME}" ]]; then
printf '%s' "fd . --color=always -HL -t d -d1 -E .git -E .gitignore"
else
printf '%s' "fd . --color=always -HL -t d -d2 -E .git -E .gitignore"
fi
)
FZF_DEFAULT_COMMAND=${FZF_CTRL_D_COMMAND:-} \
FZF_DEFAULT_OPTS=$(__fzf_defaults "-d / --preview='fzf_preview_wrapper {}' --walker=file,dir,follow,hidden")\
FZF_DEFAULT_OPTS_FILE='' $(__fzfcmd) "$@" < /dev/tty | while read -r item; do
Comment too long. Click here to view the full text.