From 61c94d5148fc9b6f051293fc3df7db70c50e348f Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Thu, 7 Jul 2022 11:20:32 -0700 Subject: [PATCH] use fd with fzf, usd fzf for fasd --- runcoms/zshrc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/runcoms/zshrc b/runcoms/zshrc index 13f4411..65cde3e 100644 --- a/runcoms/zshrc +++ b/runcoms/zshrc @@ -52,9 +52,9 @@ fi if [ $commands[fzf] ]; then export FZF_DEFAULT_OPTS='--height 40% --layout=reverse --border' - # export FZF_DEFAULT_COMMAND="rg" - # export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" - # export FZF_ALT_C_COMMAND="find . -type d" + export FZF_DEFAULT_COMMAND="fd --type f" + export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" + export FZF_ALT_C_COMMAND="fd --type d" # alias fzf=fzf-tmux # 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 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 if [ $commands[exa] ]; then