diff --git a/zshrc b/zshrc index 7dbfb93..0dc4640 100644 --- a/zshrc +++ b/zshrc @@ -706,24 +706,24 @@ function translate() ## fzf -# fd - cd to selected directory (exclude hidden directories -fd() { +# ff - cd to selected directory (exclude hidden directories +ff() { local dir dir=$(find ${1:-.} -path '*/\.*' -prune \ -o -type d -print 2> /dev/null | fzf +m) && cd "$dir" } -# fdh - hidden directories only -fdh() { +# ffh - hidden directories only +ffh() { local dir dir=$(find ${1:-.} -type d 2> /dev/null | fzf +m) && cd "$dir" } -# fda - all directories +# ffa - all directories -# fdr - cd to selected parent directory -fdr() { +# ffr - cd to selected parent directory +ffr() { local declare dirs=() get_parent_dirs() { if [[ -d "${1}" ]]; then dirs+=("$1"); else return; fi @@ -737,8 +737,8 @@ fdr() { cd "$DIR" } -# fdf - cd into the directory of the selected file -fdf() { +# fff - cd into the directory of the selected file +fff() { local file local dir file=$(fzf +m -q "$1") && dir=$(dirname "$file") && cd "$dir"