use fd with fzf, usd fzf for fasd

Alpha Chen 2 years ago
parent 7149e8fffd
commit 61c94d5148

@ -52,9 +52,9 @@ fi
if [ $commands[fzf] ]; then if [ $commands[fzf] ]; then
export FZF_DEFAULT_OPTS='--height 40% --layout=reverse --border' export FZF_DEFAULT_OPTS='--height 40% --layout=reverse --border'
# export FZF_DEFAULT_COMMAND="rg" export FZF_DEFAULT_COMMAND="fd --type f"
# export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
# export FZF_ALT_C_COMMAND="find . -type d" export FZF_ALT_C_COMMAND="fd --type d"
# alias fzf=fzf-tmux # alias fzf=fzf-tmux
# https://github.com/junegunn/fzf/issues/164#issuecomment-581837757 # https://github.com/junegunn/fzf/issues/164#issuecomment-581837757
@ -140,6 +140,16 @@ if [ $commands[fzf] ]; then
} }
bind-git-helper f b t r h s bind-git-helper f b t r h s
unset -f bind-git-helper unset -f bind-git-helper
if [ $commands[fasd] ]; then
# https://github.com/junegunn/fzf/wiki/examples#with-fasd-1
fasd_fzf() {
local dir
dir="$(fasd -Rds "$1" | fzf -1 -0 --no-sort +m | awk '{print $2}')" && cd "${dir}" || return 1
}
alias j=fasd_fzf # override prezto's fasd integration
fi
fi fi
if [ $commands[exa] ]; then if [ $commands[exa] ]; then

Loading…
Cancel
Save