Last active
June 21, 2017 22:54
-
-
Save josephholsten/c459459db99275f39dc0081c6fe062fa to your computer and use it in GitHub Desktop.
fasd with fzf for interactive selection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# same default aliases as fasd, but with fzf(1) for interactive selection | |
# fzf(1) | |
export FZF_DEFAULT_COMMAND='ag -g ""' | |
FZF_PATH="/usr/local/opt/fzf" | |
if [ -f "$COMPLETION_PATH" ]; then | |
source "$FZF_PATH/shell/completion.bash" | |
source "$FZF_PATH/shell/key-bindings.bash" | |
fi | |
eval "$(fasd --init bash-hook bash-ccomp bash-ccomp-install)" | |
alias a='fasd -a' | |
alias d='fasd -d' | |
alias f='fasd -f' | |
function s() { | |
f=$(a "$@" | fzf +m -n2 --tac | awk '{print $2}') | |
fasd -A "$f" | |
echo "$f" | |
} | |
function sd() { | |
f=$(d "$@" | fzf +m -n2 --tac | awk '{print $2}') | |
fasd -A "$f" | |
echo "$f" | |
} | |
function sf() { | |
f=$(f "$@" | fzf +m -n2 --tac | awk '{print $2}') | |
fasd -A "$f" | |
echo "$f" | |
} | |
function z() { | |
f=$(d "$@" | fzf +m -n2 --tac | awk '{print $2}') | |
fasd -A "$f" | |
cd "$f" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment