μ΄ λͺ
λ Ήμ μ¬μ©νμ¬ μ°λΆν¬ 14.04λ₯Ό μ€μΉνμ΅λλ€.
$ sudo add-apt-repository ppa:aacebedo/fasd
$ sudo apt-get μ
λ°μ΄νΈ
$ sudo apt-get μ€μΉ fasd
κ·Έλ° λ€μ μμ λ₯Ό μ€ννλ €κ³ νμ§λ§ κ²°κ³Όκ° νμλμ§ μμ΅λλ€.
$ ν°μΉ example.txt
$ μ ν μ
$
μ κ° μλͺ» μ€μΉν건κ°μ? μλλ©΄ λ΄κ° μ€νν λͺ λ Ήμ΄ μ¬λ°λ₯΄μ§ μμ΅λκΉ?
λ΄ λ¬Έμ λ λμΌν λ¬Έμ κ° μμΌλ©° μ μ λμ μλνμ§ μμ΅λλ€.
μμ rc(μ: .bashrc
λλ .zshrc
)μ μ΄κΈ°ν μ½λ( eval "$(fasd --init auto)"
)λ₯Ό ν¬ν¨νκ³ μμ μ μΈμ€ν΄μ€λ₯Ό μ€ννμ΅λκΉ?
μ, νμ΅λλ€. λ€λ₯Έ zsh μΈμ μ μμνκ±°λ itermμ λ€μ μμνκ³ fasd/ fasd -a/λ₯Ό μ λ ₯ν ν μΆλ ₯ λ‘κ·Έλ₯Ό μ¬λ°°μΉν μ μμμ§λ§ μΌλ° μ΄κΈ°ν μ½λ eval "$(fasd --init auto)"μ μλνμ΅λλ€. μ무κ²λ 보μ¬μ£Όμ§ μμ΅λλ€.
λ€μμ λ‘κ·Έκ° λ¬΄μμΈμ§μ λν μ€λν«μ λλ€.
(eval):2: λͺ
λ Ήμ μ°Ύμ μ μμ: fasd
λͺ
λ Ή -c -tn
κΈ°λ³Έκ° -f -tn
첫 λ²μ§Έ
λͺ
λ Ή -c -tn
κΈ°λ³Έκ° -f -tn
첫 λ²μ§Έ
fasd -U -V fasd -K _fasd_zsh_cmd_complete -x 'C[-1,- e], s[-] n[1, e]' -c - 'c[-1,-A][-1,-D ]' -ffasd_cd -U -V fasd -K _fasd_zsh_cmd_complete -x 'C[-1,- e], s[-] n[1,e]' -c - 'c[-1,-A][-1,-D ]' -f
λͺ
λ Ή -c -tn
κΈ°λ³Έκ° -f -tn
첫 λ²μ§Έ
λλ "/usr/local/bin/fasd -a"λ₯Ό μλνμ§λ§ μ무 κ²λ λνλμ§ μμ΅λλ€. λ΄ $PATH λ³μμ /usr/local/binμ΄ μκΈ° λλ¬Έμ λͺ λ Ήμ μ°Ύμ μ μλ μ΄μ λ₯Ό λͺ¨λ₯΄κ² μ΅λλ€.
2017λ 12μ 18μΌ 08:15μ Euan Kemp < [email protected] [email protected] >μ΄(κ°) λ€μκ³Ό κ°μ΄ μΌμ΅λλ€.
μμ rc(μ: .bashrc λλ .zshrc)μ μ΄κΈ°ν μ½λ(eval "$(fasd --init auto)")λ₯Ό ν¬ν¨νκ³ μμ μ μΈμ€ν΄μ€λ₯Ό μ€ννμ΅λκΉ?
β
λΉμ μ΄ λκΈμ λ¬μκΈ° λλ¬Έμ μ΄κ²μ λ°λ κ²μ λλ€.
μ΄ μ΄λ©μΌμ μ§μ λ΅μ₯νκ±°λ GitHub https://github.com/clvv/fasd/issues/117#issuecomment-352297827 μμ νμΈνκ±°λ https://github.com/notifications/unsubscribe-auth/ADKNgnXANOaoBoWsmKj82G3Cfuiln8yrks5t μ€λ λλ₯Ό μμκ±°νμμμ€.
그건 κ·Έλ κ³ , μ μΌνκ² μλνλ "fasd -h"λ μ μ΄λ zshκ° λͺ λ Ήμ μμΉλ₯Ό ββμ°Ύμ μ μμμ νμΈνλ―λ‘ locaκ° λͺ λ Ήμ μ°Ύμ μ μλ μ΄μ λ₯Ό λͺ¨λ₯΄κ² μ΅λλ€.
2017λ 12μ 18μΌ 09:18μ Xiao-Meng Wang < [email protected] [email protected] >μ΄(κ°) λ€μκ³Ό κ°μ΄ μΌμ΅λλ€.
μ, νμ΅λλ€. λ€λ₯Έ zsh μΈμ μ μμνκ±°λ itermμ λ€μ μμνκ³ fasd/ fasd -a/λ₯Ό μ λ ₯ν ν μΆλ ₯ λ‘κ·Έλ₯Ό μ¬λ°°μΉν μ μμμ§λ§ μΌλ° μ΄κΈ°ν μ½λ eval "$(fasd --init auto)"μ μλνμ΅λλ€. μ무κ²λ 보μ¬μ£Όμ§ μμ΅λλ€.
λ€μμ λ‘κ·Έκ° λ¬΄μμΈμ§μ λν μ€λν«μ λλ€.
(eval):2: λͺ λ Ήμ μ°Ύμ μ μμ: fasd
λͺ λ Ή -c -tn
κΈ°λ³Έκ° -f -tn
첫 λ²μ§Έ
λͺ λ Ή -c -tn
κΈ°λ³Έκ° -f -tn
첫 λ²μ§Έ
fasd -U -V fasd -K _fasd_zsh_cmd_complete -x 'C[-1,- e], s[-] n[1, e]' -c - 'c[-1,-A][-1,-D ]' -ffasd_cd -U -V fasd -K _fasd_zsh_cmd_complete -x 'C[-1,- e], s[-] n[1,e]' -c - 'c[-1,-A][-1,-D ]' -f
λͺ λ Ή -c -tn
κΈ°λ³Έκ° -f -tn
첫 λ²μ§Έλλ "/usr/local/bin/fasd -a"λ₯Ό μλνμ§λ§ μ무 κ²λ λνλμ§ μμ΅λλ€. λ΄ $PATH λ³μμ /usr/local/binμ΄ μκΈ° λλ¬Έμ λͺ λ Ήμ μ°Ύμ μ μλ μ΄μ λ₯Ό λͺ¨λ₯΄κ² μ΅λλ€.
2017λ 12μ 18μΌ 08:15μ Euan Kemp < [email protected] [email protected] >μ΄(κ°) λ€μκ³Ό κ°μ΄ μΌμ΅λλ€.
μμ rc(μ: .bashrc λλ .zshrc)μ μ΄κΈ°ν μ½λ(eval "$(fasd --init auto)")λ₯Ό ν¬ν¨νκ³ μμ μ μΈμ€ν΄μ€λ₯Ό μ€ννμ΅λκΉ?
β
λΉμ μ΄ λκΈμ λ¬μκΈ° λλ¬Έμ μ΄κ²μ λ°λ κ²μ λλ€.
μ΄ μ΄λ©μΌμ μ§μ λ΅μ₯νκ±°λ GitHub https://github.com/clvv/fasd/issues/117#issuecomment-352297827 μμ νμΈνκ±°λ https://github.com/notifications/unsubscribe-auth/ADKNgnXANOaoBoWsmKj82G3Cfuiln8yrks5t μ€λ λλ₯Ό μμκ±°νμμμ€.
κ°μ λ¬Έμ , λ΄ νκ²½μ Windows 10μ Ubuntu νμ μμ€ν μ λλ€.
μ΅μνμ μ¬μμ°μ μ 곡νμμμ€.
λλ²κΉ μ μν΄ fasd μ΄κΈ°ν μ½λλ₯Ό λ€μκ³Ό κ°μ΄ λ³κ²½νλ κ²μ΄ λμμ΄ λ μ μμ΅λλ€.
set -x
eval "$(fasd --init auto)"
set +x
λλ μ€λ₯κ° λ°μνλ λͺ
λ Ή μμ set -x
λ₯Ό ν¬ν¨ν©λλ€.
μ΄λ¬ν λ¬Έμ λ₯Ό μ¬νν μ μμ΅λλ€. λ€μμ bashμμ fasd μ€μΉκ° μλνλλ‘ νκΈ° μν΄ μ€νν μ μλ λ¨κ³μ λλ€(μμ€ν μμ μμ μ νμΈνλ €λ κ²½μ° λ¬Έμ κ° bashrc κ΅¬μ± λλ λ€λ₯Έ κ³³μ μλμ§ μ¬λΆλ₯Ό μ’ν μ μμ).
$ testhome=$(mktemp -d)
$ mkdir -p ${testhome}/bin
$ curl -sSL -o "${testhome}/bin/fasd" https://raw.githubusercontent.com/clvv/fasd/master/fasd
$ chmod +x ${testhome}/bin/fasd
$ cat > "${testhome}/.bashrc" <<EOF
export PATH=$PATH:${testhome}/bin
# Ensure history is not blank; fasd grabs commands to process from history
# (https://github.com/clvv/fasd/blob/90b531a5daaa545c74c7d98974b54cbdb92659fc/fasd#L127-L130)
# and, if history is empty, will error out
echo "echo hello world" >> ~/.bash_history
eval "\$(fasd --init auto)"
EOF
$ env -i HOME=${testhome} bash
$ cd ~/bin
$ cd ~/bin
$ cd ~
$ z bin && pwd
$ touch example.txt
$ fasd example
μ°Έκ³ : μμ λ΄μ©μ bash μ€ν¬λ¦½νΈκ° μλλΌ fasdκ° μλνλλ‘ λνμ μμμ μ€νλμ΄μΌ ν©λλ€. μ½κ°λ§ μμ νλ©΄('bash'λ₯Ό 'zsh'λ‘ λ체) μμ λ΄μ©μ΄ zshμμλ μλν©λλ€.
μμ λ΄μ©μ μμλλ‘ μλν©λλ€( /tmp/tmp.zKxt6nvlxj/bin
λ° 6 /tmp/tmp.zKxt6nvlxj/bin/example.txt
μΆλ ₯).
κ°λ₯ν κ²½μ° λ€μ μ€ νλλ₯Ό μ 곡νμμμ€.
set -x
λ₯Ό μμ μ μ©ν ν fasd example
λλ fasd --init
μ μΆλ ₯)μλ νμΈμ Euanμ λλ€. μ¬κΈ°μ μ κ° μ»μ λͺ κ°μ§ κ²°κ³Όκ° μμ΅λλ€.
첫 λ²μ§Έ λΆλΆ, λλ λ¬΄μ¨ μΌμ΄ μΌμ΄λκ³ μλμ§ μ ν λͺ¨λ¦
λλ€:
μ΄κ²μ zshμ μμ΅λλ€
~ β€ set -x git:master *
νκ°ν "$(fasd --init auto)"
μ€μ +x
+zsh:2> fasd --μλ μ΄κΈ°ν
+zsh:2> νκ° $'{ if [ "$ZSH_VERSION" ] && compctl; then # zsh\n eval "$(fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install \n zsh-wcomp zsh-wcomp-install)"\n elif [ "$BASH_VERSION" ] && μλ£ ; then # bash\n eval "$(fasd --init posix-alias bash-hook bash-ccomp bash-ccomp-install)"\n else # posix μ
Έ\n eval "$(fasd --init posix-alias posix- νν¬)"\n fi\n} >> "/Users/Administrator/.config/fasd/fasd.log" 2>&1'
+(νκ°):1> [ 5.3 ']'
+(νκ°):1> μμΆ
+(νκ°):2> fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install
+(eval):2> νκ° $'alias a=\'fasd -a\'\nalias s=\'fasd -si\'\nalias sd=\'fasd -sid\'\nalias sf=\'fasd - sif\'\nalias d=\'fasd -d\'\nalias f=\'fasd -f\'\n# λ΄μ₯ cd\nfasd_cd()λ₯Ό μ€ννλ ν¨μ {\n if [ $# -le 1 ] ; then\n fasd "$@"\n else\n local _fasd_ret="$(fasd -e \'printf %s\' "$@")"\n [ -z "$_fasd_ret" ] && return\n [ -d "$_fasd_ret" ] && cd "$_fasd_ret" || printf %s\n "$_fasd_ret"\n fi\n}\nalias z=\'fasd_cd -d\'\nalias zz=\'fasd_cd -d -i\'\n\n# zsh νν¬ μΆκ°\n_fasd_preexec( ) {\n { νκ° "fasd --proc $(fasd --sanitize $1)"; } >> "/Users/Administrator/.config/fasd/fasd.log" 2>&1\n}\nautoload -Uz add-zsh-hook\nadd-zsh-hook preexec _fasd_preexec\n\n# zsh λͺ
λ Ή λͺ¨λ μλ£ \n_fasd_zsh_cmd_complete() {\n local compl\n read -c compl\n (( $+compstate )) && compstate[insert]=menu # compsysκ° λ‘λλ κ²½μ° νμ₯νμ§ μμ\n reply=(${(f)"$( fasd --complete "$compl")"})\n}\n\n# enbale λͺ
λ Ή λͺ¨λ μλ£\ncompctl -U -K _fasd_zsh_cmd_complete -V fasd -x \'C[-1,- e],s[- ]n[1,e]\' -c - \n \'c[-1,-A][-1,-D]\' -f -- fasd fasd_cd\n\n(( $+functions[compdef ] )) && {\n # zsh λ¨μ΄ λͺ¨λ μμ±\n _fasd_zsh_word_complete() {\n [ "$2" ] && λ‘컬 _fasd_cur="$2"\n [ -z "$_fasd_cur" ] && λ‘컬 _fasd_cur="${words [νμ¬]}"\n λ‘컬 fnd="${_fasd_cur//,/ }"\n λ‘컬 μ ν=${1:-e}\n fasd --query $typ "$fnd" 2>> "/μ¬μ©μ /κ΄λ¦¬μ/.config/fasd/fasd.log" | sed \'s/^[^ ] [ ] //\' | do\n compadd -U -V fasd "$line"\n μλ£\n compstate[insert]=menu # νμ₯ μμ\n }\n _fasd_zsh_word_complete_f() { _fasd_zsh_word_complete f ; }\n _fasd_zsh_word_complete_trigger() {\n local _fasd_cur="${words[CURRENT]}"\n eval $(fasd --word-complete-trigger _fasd_zsh_word_complete $_fasd_cur)\n }\n # zle μμ ― μ μ\n z -C fasd-complete μλ£ λ¨μ΄ _generic\n zstyle \':completion:fasd-complete: \' completer _fasd_zsh_word_complete\n zstyle \':completion:fasd-complete: \' λ©λ΄ μ ν\n\n zle -C fasd -complete-f μμ ν λ¨μ΄ _generic\n zstyle \':completion:fasd-complete-f: \' completer _fasd_zsh_word_complete_f\n zstyle \':completion:fasd-complete-f: \' λ©λ΄ μ ν\n\n zle -C fasd-complete-d complete-word _generic\n zstyle \':completion:fasd-complete-d: \' completer _fasd_zsh_word_complete_d\n zstyle \':completion:fasd-complete-d: \' λ©λ΄ μ ν\n }\n\n(( $+functions[compdef] )) && {\n # λ¨μ΄ λͺ¨λ μμ± νμ±ν\n orig_comp="$(zstyle -L \':completion:*\' completer 2>> "/Users/ κ΄λ¦¬μ/.config/fasd/fasd.log")"\n if [ "$orig_comp" ]; ) eval "$orig_comp _fasd_zsh_word_complete_trigger";;\n esac\n else\n zstyle \':completion: \' setword_\n figger_complete _fasd_zsh_ orig_comp\n}'
+(νκ°):1> λ³μΉ 'a=fasd -a'
+(νκ°):2> λ³μΉ '=fasd -si'
+(νκ°):3> λ³μΉ 'sd=fasd -sid'
+(νκ°):4> λ³μΉ 'sf=fasd -sif'
+(νκ°):5> λ³μΉ 'd=fasd -d'
+(νκ°):6> λ³μΉ 'f=fasd -f'
+(νκ°):17> λ³μΉ 'z=fasd_cd -d'
+(νκ°):18> λ³μΉ 'zz=fasd_cd -d -i'
+(νκ°):24> μλ λ‘λ -Uz add-zsh-hook
+(νκ°):25> zsh-hook preexec μΆκ° _fasd_preexec
+zsh:3> +x μ€μ
λ λ²μ§Έ λΆλΆμ μμ νμΌμ μμ±ν μ μμ΄μ 루νΈλ‘ λ³κ²½νκ³ μ΄ μ΅μ νκ²½μμ fasdκ° μλν©λλ€. μμ§ .bashrc νμΌμ λ§λ€μ§ μμμ΅λλ€.
bash-3.2$ sudo su
λΉλ°λ²νΈ:
sh-3.2# testhome=$(mktemp -d)
sh-3.2# mkdir -p ${ν
μ€νΈν}/bin
sh-3.2# cd ${ν
μ€νΈν}/bin
sh-3.2# ls
sh-3.2# μνΈ
/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.SFwFn0r6/bin
sh-3.2# 컬 -sSL -o "${testhome}/bin/fasd" https://raw.githubusercontent.com/clvv/fasd/master/fasd;chmod https://raw.githubusercontent.com/clvv/ fasd/master/fasd;chmod +x ${testhome}/bin/fasd;
sh-3.2# ls -al
μ΄ 40
drwxr-xr-x 3 λ£¨νΈ ν 96 12μ 28μΌ 16:51 .
drwx------ 3 λ£¨νΈ ν 96 Dec 28 16:50 ..
-rwxr-xr-x 1 λ£¨νΈ ν 20195 12μ 28μΌ 16:51 fasd
bash-3.2# νκ°ν "$(./bin/fasd --init auto)"
bash-3.2# μ ν
bash-3.2# ls
.viminfo bin example.txt
bash-3.2# echo "μλ
νμΈμ μΈκ³ μμ½" >> ~/.bash_history
bash-3.2# ls
.bash_history .viminfo λΉ example.txt
bash-3.2# λ΄λ³΄λ΄κΈ° κ²½λ‘=$PATH:${ν
μ€νΈν}/bin
bash-3.2# ls
.bash_history .fasd .viminfo λΉ example.txt
bash-3.2# v .fasd
bash: v: λͺ
λ Ήμ μ°Ύμ μ μμ
bash-3.2# κ³ μμ΄ .fasd
/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.SFwFn0r6/.fasd|1|1514451952
bash-3.2# ./bin/fasd
12 /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.SFwFn0r6/.fasd
bash-3.2# ./bin/fasd μμ
bash-3.2# rm example.txt
bash-3.2# ν°μΉ example.txt
bash-3.2# ./bin/fasd μμ
6 /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.SFwFn0r6/example.txt
2017λ 12μ 28μΌ 02:37μ Euan Kemp < [email protected] [email protected] >μ΄(κ°) λ€μκ³Ό κ°μ΄ μΌμ΅λλ€.
μ΅μνμ μ¬μμ°μ μ 곡νμμμ€.
λλ²κΉ μ μν΄ fasd μ΄κΈ°ν μ½λλ₯Ό λ€μκ³Ό κ°μ΄ λ³κ²½νλ κ²μ΄ λμμ΄ λ μ μμ΅λλ€.
μ€μ -x
νκ°ν "$(fasd --init auto)"
μ€μ +x
λλ μ€λ₯κ° λ°μνλ λͺ λ Ή μμ set -xλ₯Ό ν¬ν¨ν©λλ€.μ΄λ¬ν λ¬Έμ λ₯Ό μ¬νν μ μμ΅λλ€. λ€μμ bashμμ fasd μ€μΉκ° μλνλλ‘ νκΈ° μν΄ μ€νν μ μλ λ¨κ³μ λλ€(μμ€ν μμ μμ μ νμΈνλ €λ κ²½μ° λ¬Έμ κ° bashrc κ΅¬μ± λλ λ€λ₯Έ κ³³μ μλμ§ μ¬λΆλ₯Ό μ’ν μ μμ).
$ testhome=$(mktemp -d)
$ mkdir -p ${ν μ€νΈν}/bin
$ curl -sSL -o "${testhome}/bin/fasd" https://raw.githubusercontent.com/clvv/fasd/master/fasd https://raw.githubusercontent.com/clvv/fasd/master/fasd
$ chmod +x ${ν μ€νΈν}/bin/fasd$ κ³ μμ΄ > "${testhome}/.bashrc" <
λ΄λ³΄λ΄κΈ° κ²½λ‘=$PATH:${ν μ€νΈν}/bin κΈ°λ‘μ΄ λΉμ΄ μμ§ μμμ§ νμΈνμμμ€. fasdλ κΈ°λ‘μμ μ²λ¦¬ν λͺ λ Ήμ κ°μ Έμ΅λλ€.
(https://github.com/clvv/fasd/blob/90b531a5daaa545c74c7d98974b54cbdb92659fc/fasd7952c127-L130 https://github.com/clvv/fasd/blob/90b531a5
νμ€ν λ¦¬κ° λΉμ΄ μμΌλ©΄ μ€λ₯κ° λ°μν©λλ€.
echo "μλ νμΈμ μΈκ³ μμ½" >> ~/.bash_history
νκ°ν "$(fasd --init auto)"
EOF$ env -i HOME=${testhome} bash
$ cd ~/bin
$ cd ~/bin
$cd ~$ z bin && pwd
$ ν°μΉ example.txt
$ μ ν μ
μ°Έκ³ : μμ λ΄μ©μ bash μ€ν¬λ¦½νΈκ° μλλΌ fasdκ° μλνλλ‘ λνμ μμμ μ€νλμ΄μΌ ν©λλ€. μ½κ°λ§ μμ νλ©΄ μμ λ΄μ©μ΄ zshμμλ μλν©λλ€.μμ λ΄μ©μ μμλλ‘ μλν©λλ€(/tmp/tmp.zKxt6nvlxj/bin λ° 6 /tmp/tmp.zKxt6nvlxj/bin/example.txt μΈμ).
κ°λ₯ν κ²½μ° λ€μ μ€ νλλ₯Ό μ 곡νμμμ€.
무μμ΄ μ€λ¨λμλμ§μ λν μμΈν μ 보(μ: set -xλ₯Ό μμ μ μ©ν ν fasd example λλ fasd --initμ μΆλ ₯)
μμ κ°μ μ΅μνμ νκ²½μμ μ¬νν μ μλμ§ μ¬λΆ.
"λ΄ μ»΄ν¨ν°μμλ μλνμ§ μμ΅λλ€"λ§μ΄ μλ μ€μ μ΅μ μ¬μμ°
β
λΉμ μ΄ λκΈμ λ¬μκΈ° λλ¬Έμ μ΄κ²μ λ°λ κ²μ λλ€.
μ΄ μ΄λ©μΌμ μ§μ λ΅μ₯νκ±°λ GitHub https://github.com/clvv/fasd/issues/117#issuecomment-354156542 μμ νμΈνκ±°λ https://github.com/notifications/unsubscribe-auth/ADKNgl5x1H3BscF4Pa3- μ€λ λλ₯Ό μμκ±°νμμμ€.https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png https://cloud.githubusercontent.com/assets/143418/15842166/7 -b52498112777.png https://github.com/clvv/fasd https://raw.githubusercontent.com/clvv/fasd/master/fasd/r/n$ https://github.com/clvv/fasd/blob /90b531a5daaa545c74c7d98974b54cbdb92659fc/fasd#L127-L130 https://github.com/clvv/fasd/issues/117#issuecomment-354156542
λ΄ zsh μ΄κΈ°ν μ½λλ λ€μκ³Ό κ°μ΄ νμλ©λλ€.
fasd_cache = "$ ν / .config / fasd / fasd-init-zsh"
if ["$ (λͺ
λ Ή -v fasd)" -nt "$ fasd_cache" -o! -s "$ fasd_cache"]; κ·Έ λ€μμ
fasd --init posix-alias posix-hook zsh-hook zsh-ccomp zsh-ccomp-install zsh-ccomp zsh-ccomp-install> | "$ fasd_cache"
νμ΄
μμ€ "$ fasd_cache"
μ€μ ν΄μ λ fasd_cache
fasd-init-zshλ λ€μκ³Ό κ°μ΅λλ€.
fasd β€ κ³ μμ΄ fasd-init-zsh μμ: λ§μ€ν° *
λ³μΉ a = 'fasd -a'
λ³μΉ s = 'fasd -si'
λ³μΉ sd = 'fasd -sid'
λ³μΉ sf = 'fasd -sif'
λ³μΉ d = 'fasd -d'
λ³μΉ f = 'fasd -f'
fasd_cd () {
if [$ # -le 1]; κ·Έ λ€μμ
μ ν "$ @"
λ λ€λ₯Έ
μ§μ _fasd_ret = "$ (fasd -e 'printf% s'" $ @ ")"
[-z "$ _fasd_ret"] && 리ν΄
[-d "$ _fasd_ret"] && cd "$ _fasd_ret" || printf% s \n "$ _fasd_ret"
νμ΄
}
λ³μΉ z = 'fasd_cd -d'
λ³μΉ zz = 'fasd_cd -d -i'
_fasd_prompt_func () {
eval "fasd --proc $ (fasd --sanitize $ (κΈ°λ‘ 1 | \
sed "s / ^ [] [0-9] [] * //")) "" >> "/Users/Administrator/.config/fasd/fasd.log" 2> & 1
}
μΌμ΄μ€ $ PROMPT_COMMAND
_fasd_prompt_func ) ;;
*) PROMPT_COMMAND = "_ fasd_prompt_func; $ PROMPT_COMMAND" ;;
μ΄μ
_fasd_bash_cmd_complete () {
# "-e" λ€μμ μμ ν λͺ
λ Ή
νμ§ ν΅ν = $ {COMP_WORDS [COMP_CWORD]}
[[$ {COMP_WORDS [COMP_CWORD-1]} == - e]] && \COMPREPLY = ($ (compgen -A λͺ
λ Ή $ cur)) && λ°ν# "-A" λλ "-D" λ€μ μλ£λλ κΈ°λ³Έ readlineμ μ¬μ©νμ¬ μλ£μΌμ΄μ€ $ {COMP_WORDS [COMP_CWORD-1]}-A | -D) COMPREPLY = ($ (compgen -o κΈ°λ³Έ $ cur)) && λ¦¬ν΄ ;;μ΄μ# νμ₯λ λ³μΉμ μ¬μ©νμ¬ μλ£ κ²°κ³Όλ₯Ό μ»μ΅λλ€.λ‘컬 κ²°κ³Ό = $ (fasd --complete "$ (λ³μΉ -p $ COMP_WORDS \2 >> "/μ¬μ©μ/κ΄λ¦¬μ/.config/fasd/fasd.log" | \)' / \ 1 / p")$ {COMP_LINE # } "| μ½λ λμ -r ν; μν
quote_readline "$ λΌμΈ" 2> / dev / null || \
printf% q "$ λΌμΈ" 2> / dev / null && \
printf\n
μλ£)
λ‘컬 IFS = $ '\ n'; μλ£ = ($ κ²°κ³Ό)
}
_fasd_bash_hook_cmd_complete () {
cmdμ κ²½μ° $ *; ~νλ€
μλ£ -F _fasd_bash_cmd_complete $ cmd
μλ£
}
_fasd_bash_hook_cmd_complete fasd asdf sd sf z zz
fasd.logμμλ μ£Όλ‘ λ€μμ λν΄ μ΄μΌκΈ°ν©λλ€.
(eval):2: λͺ
λ Ήμ μ°Ύμ μ μμ: fasd
λͺ
λ Ή -c -tn
κΈ°λ³Έκ° -f -tn
첫 λ²μ§Έ
λͺ
λ Ή -c -tn
κΈ°λ³Έκ° -f -tn
첫 λ²μ§Έ
λͺ
λ Ή -c -tn
κΈ°λ³Έκ° -f -tn
첫 λ²μ§Έ
(eval):2: λͺ
λ Ήμ μ°Ύμ μ μμ: fasd
λͺ
λ Ή -c -tn
κΈ°λ³Έκ° -f -tn
첫 λ²μ§Έ
(eval):2: λͺ
λ Ήμ μ°Ύμ μ μμ: fasd
λͺ
λ Ή -c -tn
κΈ°λ³Έκ° -f -tn
첫 λ²μ§Έ
(eval):2: λͺ
λ Ήμ μ°Ύμ μ μμ: fasd
λͺ
λ Ή -c -tn
κΈ°λ³Έκ° -f -tn
첫 λ²μ§Έ
λͺ
λ Ή -c -tn
κΈ°λ³Έκ° -f -tn
첫 λ²μ§Έ
λͺ
λ Ή -c -tn
κΈ°λ³Έκ° -f -tn
첫 λ²μ§Έ
λͺ
λ Ή -c -tn
κΈ°λ³Έκ° -f -tn
첫 λ²μ§Έ
λͺ
λ Ή -c -tn
κ·Έλ¬λ λ΄κ° fasd -hλ₯Ό μ λ ₯νλ©΄ μλν©λλ€.
~ β€ fasd -h git:master*
fasd [μ΅μ
] [쿼리 ...]
[f|a|s|d|z] [opions] [쿼리 ...]
μ΅μ
:
-s μ μκ° μλ κ²½λ‘ λμ΄
-l μ μκ° μλ κ²½λ‘ λμ΄
-i λνμ λͺ¨λ
-μ΄μν
-λΉ
-λΉ
-a μΌμΉ νμΌ λ° λλ ν 리
-d λλ ν λ¦¬λ§ μΌμΉ
-f μΌμΉ νμΌλ§
-r μμλ‘λ§ μΌμΉ
-t μ΅κ·Ό μ‘μΈμ€λ‘λ§ μΌμΉ
-R μ λμ΄ μμ
-h κ°λ¨ν λμλ§ λ©μμ§ νμ
-[0-9] nλ²μ§Έ νλͺ© μ ν
fasd [-A|-D] [κ²½λ‘ ...]
-A κ²½λ‘ μΆκ°
-D μμ κ²½λ‘
~ β€ μμ:λ§μ€ν°*
2017λ 12μ 28μΌ, 17:15, Xiao-Meng Wang
[email protected]>μ λ€μκ³Ό κ°μ΄ μΌμ΅λλ€. μλ νμΈμ Euanμ λλ€. μ¬κΈ°μ μ κ° μ»μ λͺ κ°μ§ κ²°κ³Όκ° μμ΅λλ€.
첫 λ²μ§Έ λΆλΆ, λλ λ¬΄μ¨ μΌμ΄ μΌμ΄λκ³ μλμ§ μ ν λͺ¨λ¦ λλ€:
μ΄κ²μ zshμ μμ΅λλ€~ β€ set -x git:master*
νκ°ν "$(fasd --init auto)"
μ€μ +x+zsh:2> fasd --μλ μ΄κΈ°ν
+zsh:2> νκ° $'{ if [ "$ZSH_VERSION" ] && compctl; then # zsh\n eval "$(fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install \n zsh-wcomp zsh-wcomp-install)"\n elif [ "$BASH_VERSION" ] && μλ£ ; then # bash\n eval "$(fasd --init posix-alias bash-hook bash-ccomp bash-ccomp-install)"\n else # posix μ Έ\n eval "$(fasd --init posix-alias posix- νν¬)"\n fi\n} >> "/Users/Administrator/.config/fasd/fasd.log" 2>&1'
+(νκ°):1> [ 5.3 ']'
+(νκ°):1> μμΆ
+(νκ°):2> fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install
+(eval):2> νκ° $'alias a=\'fasd -a\'\nalias s=\'fasd -si\'\nalias sd=\'fasd -sid\'\nalias sf=\'fasd - sif\'\nalias d=\'fasd -d\'\nalias f=\'fasd -f\'\n# λ΄μ₯ cd\nfasd_cd()λ₯Ό μ€ννλ ν¨μ {\n if [ $# -le 1 ] ; then\n fasd "$@"\n else\n local _fasd_ret="$(fasd -e \'printf %s\' "$@")"\n [ -z "$_fasd_ret" ] && return\n [ -d "$_fasd_ret" ] && cd "$_fasd_ret" || printf %s\n "$_fasd_ret"\n fi\n}\nalias z=\'fasd_cd -d\'\nalias zz=\'fasd_cd -d -i\'\n\n# zsh νν¬ μΆκ°\n_fasd_preexec( ) {\n { νκ° "fasd --proc $(fasd --sanitize $1)"; } >> "/Users/Administrator/.config/fasd/fasd.log" 2>&1\n}\nautoload -Uz add-zsh-hook\nadd-zsh-hook preexec _fasd_preexec\n\n# zsh λͺ λ Ή λͺ¨λ μλ£ \n_fasd_zsh_cmd_complete() {\n local compl\n read -c compl\n (( $+compstate )) && compstate[insert]=menu # compsysκ° λ‘λλ κ²½μ° νμ₯νμ§ μμ\n reply=(${(f)"$( fasd --complete "$compl")"})\n}\n\n# enbale λͺ λ Ή λͺ¨λ μλ£\ncompctl -U -K _fasd_zsh_cmd_complete -V fasd -x \'C[-1,- e],s[- ]n[1,e]\' -c - \n \'c[-1,-A][-1,-D]\' -f -- fasd fasd_cd\n\n(( $+functions[compdef ] )) && {\n # zsh λ¨μ΄ λͺ¨λ μμ±\n _fasd_zsh_word_complete() {\n [ "$2" ] && λ‘컬 _fasd_cur="$2"\n [ -z "$_fasd_cur" ] && λ‘컬 _fasd_cur="${words [νμ¬]}"\n λ‘컬 fnd="${_fasd_cur//,/ }"\n λ‘컬 μ ν=${1:-e}\n fasd --query $typ "$fnd" 2>> "/μ¬μ©μ /κ΄λ¦¬μ/.config/fasd/fasd.log" | sed \'s/^[^ ] [ ] //\' | do\n compadd -U -V fasd "$line"\n μλ£\n compstate[insert]=menu # νμ₯ μμ\n }\n _fasd_zsh_word_complete_f() { _fasd_zsh_word_complete f ; }\n _fasd_zsh_word_complete_trigger() {\n local _fasd_cur="${words[CURRENT]}"\n eval $(fasd --word-complete-trigger _fasd_zsh_word_complete $_fasd_cur)\n }\n # zle μμ ― μ μ\n z -C fasd-complete μλ£ λ¨μ΄ _generic\n zstyle \':completion:fasd-complete: \' completer _fasd_zsh_word_complete\n zstyle \':completion:fasd-complete: \' λ©λ΄ μ ν\n\n zle -C fasd -complete-f μμ ν λ¨μ΄ _generic\n zstyle \':completion:fasd-complete-f: \' completer _fasd_zsh_word_complete_f\n zstyle \':completion:fasd-complete-f: \' λ©λ΄ μ ν\n\n zle -C fasd-complete-d complete-word _generic\n zstyle \':completion:fasd-complete-d: \' completer _fasd_zsh_word_complete_d\n zstyle \':completion:fasd-complete-d: \' λ©λ΄ μ ν\n }\n\n(( $+functions[compdef] )) && {\n # λ¨μ΄ λͺ¨λ μμ± νμ±ν\n orig_comp="$(zstyle -L \':completion:*\' completer 2>> "/Users/ κ΄λ¦¬μ/.config/fasd/fasd.log")"\n if [ "$orig_comp" ]; ) eval "$orig_comp _fasd_zsh_word_complete_trigger";;\n esac\n else\n zstyle \':completion: \' setword_\n figger_complete _fasd_zsh_ orig_comp\n}'
+(νκ°):1> λ³μΉ 'a=fasd -a'
+(νκ°):2> λ³μΉ '=fasd -si'
+(νκ°):3> λ³μΉ 'sd=fasd -sid'
+(νκ°):4> λ³μΉ 'sf=fasd -sif'
+(νκ°):5> λ³μΉ 'd=fasd -d'
+(νκ°):6> λ³μΉ 'f=fasd -f'
+(νκ°):17> λ³μΉ 'z=fasd_cd -d'
+(νκ°):18> λ³μΉ 'zz=fasd_cd -d -i'
+(νκ°):24> μλ λ‘λ -Uz add-zsh-hook
+(νκ°):25> zsh-hook preexec μΆκ° _fasd_preexec
+zsh:3> +x μ€μ λ λ²μ§Έ λΆλΆμ μμ νμΌμ μμ±ν μ μμ΄μ 루νΈλ‘ λ³κ²½νκ³ μ΄ μ΅μ νκ²½μμ fasdκ° μλν©λλ€. μμ§ .bashrc νμΌμ λ§λ€μ§ μμμ΅λλ€.
bash-3.2$ sudo su
λΉλ°λ²νΈ:
sh-3.2# testhome=$(mktemp -d)
sh-3.2# mkdir -p ${ν μ€νΈν}/bin
sh-3.2# cd ${ν μ€νΈν}/bin
sh-3.2# ls
sh-3.2# μνΈ
/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.SFwFn0r6/bin
sh-3.2# 컬 -sSL -o "${testhome}/bin/fasd" https://raw.githubusercontent.com/clvv/fasd/master/fasd;chmod https://raw.githubusercontent.com/clvv/ fasd/master/fasd;chmod +x ${testhome}/bin/fasd;
sh-3.2# ls -al
μ΄ 40
drwxr-xr-x 3 λ£¨νΈ ν 96 12μ 28μΌ 16:51 .
drwx------ 3 λ£¨νΈ ν 96 Dec 28 16:50 ..
-rwxr-xr-x 1 λ£¨νΈ ν 20195 12μ 28μΌ 16:51 fasd
bash-3.2# νκ°ν "$(./bin/fasd --init auto)"
bash-3.2# μ ν
bash-3.2# ls
.viminfo bin example.txt
bash-3.2# echo "μλ νμΈμ μΈκ³ μμ½" >> ~/.bash_history
bash-3.2# ls
.bash_history .viminfo λΉ example.txt
bash-3.2# λ΄λ³΄λ΄κΈ° κ²½λ‘=$PATH:${ν μ€νΈν}/bin
bash-3.2# ls
.bash_history .fasd .viminfo λΉ example.txt
bash-3.2# v .fasd
bash: v: λͺ λ Ήμ μ°Ύμ μ μμ
bash-3.2# κ³ μμ΄ .fasd
/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.SFwFn0r6/.fasd|1|1514451952
bash-3.2# ./bin/fasd
12 /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.SFwFn0r6/.fasd
bash-3.2# ./bin/fasd μμ
bash-3.2# rm example.txt
bash-3.2# ν°μΉ example.txt
bash-3.2# ./bin/fasd μμ
6 /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.SFwFn0r6/example.txt2017λ 12μ 28μΌ, 02:37, Euan Kemp
[email protected]>μ λ€μκ³Ό κ°μ΄ μΌμ΅λλ€. μ΅μνμ μ¬μμ°μ μ 곡νμμμ€.
λλ²κΉ μ μν΄ fasd μ΄κΈ°ν μ½λλ₯Ό λ€μκ³Ό κ°μ΄ λ³κ²½νλ κ²μ΄ λμμ΄ λ μ μμ΅λλ€.
μ€μ -x
νκ°ν "$(fasd --init auto)"
μ€μ +x
λλ μ€λ₯κ° λ°μνλ λͺ λ Ή μμ set -xλ₯Ό ν¬ν¨ν©λλ€.μ΄λ¬ν λ¬Έμ λ₯Ό μ¬νν μ μμ΅λλ€. λ€μμ bashμμ fasd μ€μΉκ° μλνλλ‘ νκΈ° μν΄ μ€νν μ μλ λ¨κ³μ λλ€(μμ€ν μμ μμ μ νμΈνλ €λ κ²½μ° λ¬Έμ κ° bashrc κ΅¬μ± λλ λ€λ₯Έ κ³³μ μλμ§ μ¬λΆλ₯Ό μ’ν μ μμ).
$ testhome=$(mktemp -d)
$ mkdir -p ${ν μ€νΈν}/bin
$ curl -sSL -o "${testhome}/bin/fasd" https://raw.githubusercontent.com/clvv/fasd/master/fasd https://raw.githubusercontent.com/clvv/fasd/master/fasd
$ chmod +x ${ν μ€νΈν}/bin/fasd$ κ³ μμ΄ > "${testhome}/.bashrc" <
λ΄λ³΄λ΄κΈ° κ²½λ‘=$PATH:${ν μ€νΈν}/bin κΈ°λ‘μ΄ λΉμ΄ μμ§ μμμ§ νμΈνμμμ€. fasdλ κΈ°λ‘μμ μ²λ¦¬ν λͺ λ Ήμ κ°μ Έμ΅λλ€.
(https://github.com/clvv/fasd/blob/90b531a5daaa545c74c7d98974b54cbdb92659fc/fasd7952c127-L130 https://github.com/clvv/fasd/blob/90b531a5
νμ€ν λ¦¬κ° λΉμ΄ μμΌλ©΄ μ€λ₯κ° λ°μν©λλ€.
echo "μλ νμΈμ μΈκ³ μμ½" >> ~/.bash_history
νκ°ν "\$(fasd --init auto)"
EOF$ env -i HOME=${testhome} bash
$ cd ~/bin
$ cd ~/bin
$cd ~$ z bin && pwd
$ ν°μΉ example.txt
$ μ ν μ
μ°Έκ³ : μμ λ΄μ©μ bash μ€ν¬λ¦½νΈκ° μλλΌ fasdκ° μλνλλ‘ λνμ μμμ μ€νλμ΄μΌ ν©λλ€. μ½κ°λ§ μμ νλ©΄ μμ λ΄μ©μ΄ zshμμλ μλν©λλ€.μμ λ΄μ©μ μμλλ‘ μλν©λλ€(/tmp/tmp.zKxt6nvlxj/bin λ° 6 /tmp/tmp.zKxt6nvlxj/bin/example.txt μΈμ).
κ°λ₯ν κ²½μ° λ€μ μ€ νλλ₯Ό μ 곡νμμμ€.
무μμ΄ μ€λ¨λμλμ§μ λν μμΈν μ 보(μ: set -xλ₯Ό μμ μ μ©ν ν fasd example λλ fasd --initμ μΆλ ₯)
μμ κ°μ μ΅μνμ νκ²½μμ μ¬νν μ μλμ§ μ¬λΆ.
"λ΄ μ»΄ν¨ν°μμλ μλνμ§ μμ΅λλ€"λ§μ΄ μλ μ€μ μ΅μ μ¬μμ°
β
λΉμ μ΄ λκΈμ λ¬μκΈ° λλ¬Έμ μ΄κ²μ λ°λ κ²μ λλ€.
μ΄ μ΄λ©μΌμ μ§μ λ΅μ₯νκ±°λ GitHub https://github.com/clvv/fasd/issues/117#issuecomment-354156542 μμ νμΈνκ±°λ https://github.com/notifications/unsubscribe-auth/ADKNgl5x1H3BscF4Pa3- μ€λ λλ₯Ό μμκ±°νμμμ€.https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png https://cloud.githubusercontent.com/assets/143418/17495839/afc5 -7290892c7bb5.png https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png https://cloud.githubusercontent.com/assets/1 -11e6-9aed-b52498112777.png https://github.com/clvv/fasd https://github.com/clvv/fasd https://raw.githubusercontent.com/clvv/fasd/master/fasd/r/ n $ https://raw.githubusercontent.com/clvv/fasd/master/fasd/r/n$ https://github.com/clvv/fasd/blob/90b531a5daaa545c74c7d98974b54cbdb92659fc/fasdhub#L127- .com/clvv/fasd/blob/90b531a5daaa545c74c7d98974b54cbdb92659fc/fasd#L127- L130 https://github.com/clvv1s/clvv/fasd/issues/117#issuecomment-35415 #issuecomment-354156542
κ΄λ ¨μ΄ μλμ§ νμ€νμ§ μμ΅λλ€. κ·Έλ¬λ https://github.com/jimhester/per-directory-history κ° fasdμ μΆ©λνλ€λ κ²μ μμμ΅λλ€. fasdκ° νμΌμ΄λ λλ ν 리λ₯Ό μΆμ νμ§ μλλ€λ λμΌν λ¬Έμ κ° μμ΅λλ€. λλ ν λ¦¬λ³ κΈ°λ‘ νλ¬κ·ΈμΈμ λΉνμ±ννλ©΄ fasdκ° μ λλ‘ μλν©λλ€.
λν bash
λ° zsh
λͺ¨λμ ν¨κ» Windowsμ© νμ μμ€ν
μμ μ΄κ²μ μ»μμ΅λλ€(μ¬κΈ°μ λ¬Έμ μΌ μ μμ).
rc
νμΌμμ λ€λ₯Έ λͺ¨λ κ²μ λΉνμ±ννλ €κ³ μλνμ§λ§ fasd
λͺ©λ‘μ νμ λΉμ΄ μμ΅λλ€.
λν repoμμ fasd
λ₯Ό μ¬μ©νκ³ ν¨ν€μ§ κ΄λ¦¬μλ‘ μ€μΉνλ €κ³ μλνμ§λ§ κ²°κ³Όκ° λ³κ²½λμ§ μμμ΅λλ€.
set -x
eval "$(fasd --init auto)"
set +x
+-zsh:2> fasd --init auto
+-zsh:2> eval $'{ if [ "$ZSH_VERSION" ] && compctl; then # zsh\n eval "$(fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install \\\n zsh-wcomp zsh-wcomp-install)"\n elif [ "$BASH_VERSION" ] && complete; then # bash\n eval "$(fasd --init posix-alias bash-hook bash-ccomp bash-ccomp-install)"\n else # posix shell\n eval "$(fasd --init posix-alias posix-hook)"\n fi\n} >> "/dev/null" 2>&1'
+(eval):1> [ 5.5.1 ']'
+(eval):1> compctl
+(eval):2> fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install
+(eval):2> eval $'alias a=\'fasd -a\'\nalias s=\'fasd -si\'\nalias sd=\'fasd -sid\'\nalias sf=\'fasd -sif\'\nalias d=\'fasd -d\'\nalias f=\'fasd -f\'\n# function to execute built-in cd\nfasd_cd() {\n if [ $# -le 1 ]; then\n fasd "$@"\n else\n local _fasd_ret="$(fasd -e \'printf %s\' "$@")"\n [ -z "$_fasd_ret" ] && return\n [ -d "$_fasd_ret" ] && cd "$_fasd_ret" || printf %s\\n "$_fasd_ret"\n fi\n}\nalias z=\'fasd_cd -d\'\nalias zz=\'fasd_cd -d -i\'\n\n# add zsh hook\n_fasd_preexec() {\n { eval "fasd --proc $(fasd --sanitize $1)"; } >> "/dev/null" 2>&1\n}\nautoload -Uz add-zsh-hook\nadd-zsh-hook preexec _fasd_preexec\n\n# zsh command mode completion\n_fasd_zsh_cmd_complete() {\n local compl\n read -c compl\n (( $+compstate )) && compstate[insert]=menu # no expand if compsys loaded\n reply=(${(f)"$(fasd --complete "$compl")"})\n}\n\n# enbale command mode completion\ncompctl -U -K _fasd_zsh_cmd_complete -V fasd -x \'C[-1,-*e],s[-]n[1,e]\' -c - \\\n \'c[-1,-A][-1,-D]\' -f -- fasd fasd_cd\n\n(( $+functions[compdef] )) && {\n # zsh word mode completion\n _fasd_zsh_word_complete() {\n [ "$2" ] && local _fasd_cur="$2"\n [ -z "$_fasd_cur" ] && local _fasd_cur="${words[CURRENT]}"\n local fnd="${_fasd_cur//,/ }"\n local typ=${1:-e}\n fasd --query $typ "$fnd" 2>> "/dev/null" | \\\n sort -nr | sed \'s/^[^ ]*[ ]*//\' | while read -r line; do\n compadd -U -V fasd "$line"\n done\n compstate[insert]=menu # no expand\n }\n _fasd_zsh_word_complete_f() { _fasd_zsh_word_complete f ; }\n _fasd_zsh_word_complete_d() { _fasd_zsh_word_complete d ; }\n _fasd_zsh_word_complete_trigger() {\n local _fasd_cur="${words[CURRENT]}"\n eval $(fasd --word-complete-trigger _fasd_zsh_word_complete $_fasd_cur)\n }\n # define zle widgets\n zle -C fasd-complete complete-word _generic\n zstyle \':completion:fasd-complete:*\' completer _fasd_zsh_word_complete\n zstyle \':completion:fasd-complete:*\' menu-select\n\n zle -C fasd-complete-f complete-word _generic\n zstyle \':completion:fasd-complete-f:*\' completer _fasd_zsh_word_complete_f\n zstyle \':completion:fasd-complete-f:*\' menu-select\n\n zle -C fasd-complete-d complete-word _generic\n zstyle \':completion:fasd-complete-d:*\' completer _fasd_zsh_word_complete_d\n zstyle \':completion:fasd-complete-d:*\' menu-select\n}\n\n(( $+functions[compdef] )) && {\n # enable word mode completion\n orig_comp="$(zstyle -L \':completion:\\*\' completer 2>> "/dev/null")"\n if [ "$orig_comp" ]; then\n case $orig_comp in\n *_fasd_zsh_word_complete_trigger*);;\n *) eval "$orig_comp _fasd_zsh_word_complete_trigger";;\n esac\n else\n zstyle \':completion:*\' completer _complete _fasd_zsh_word_complete_trigger\n fi\n unset orig_comp\n}'
+(eval):1> alias 'a=fasd -a'
+(eval):2> alias 's=fasd -si'
+(eval):3> alias 'sd=fasd -sid'
+(eval):4> alias 'sf=fasd -sif'
+(eval):5> alias 'd=fasd -d'
+(eval):6> alias 'f=fasd -f'
+(eval):17> alias 'z=fasd_cd -d'
+(eval):18> alias 'zz=fasd_cd -d -i'
+(eval):24> autoload -Uz add-zsh-hook
+(eval):25> add-zsh-hook preexec _fasd_preexec
+-zsh:3> set +x
μμκ° ~/.fasd
μΈμ§ νμ€νμ§ μμ§λ§ νμΌμ νμ λΉμ΄ μλ κ² κ°μ΅λλ€.
λλ₯Ό μν΄ λ£¨νΈλ‘ μ€ννλλ‘ μμ νμ¬ fasd --init posix-alias bash-hook bash-ccomp bash-ccomp-install
λΆλΆμ μΆμΆνλ λ° λμμ΄ λμμ΅λλ€.
fasd --init auto
λͺ
λ Ήμ μ¬μ©νκ³ eval, eval "$(fasd --init posix-alias bash-hook bash-ccomp bash-ccomp-install)"λ‘ λ¬Άκ³ λ£¨νΈμ /root/.bashrcμ μ μ©νμ¬ μμΆμ νλλ€. init λͺ
λ Ήμ νμνμ§ μμκ³ λ£¨νΈλ‘ μ€ννλ κ²λ§μΌλ‘λ μΆ©λΆνμ§λ§ νμΈν μκ°μ΄ λ μμμ§λ§ 루νΈλ₯Ό ν΅ν΄μλ§ μλνμ§ μμλ κ²μΌλ‘ κΈ°μ΅ν©λλ€. init λͺ
λ Ήμ bash λΆλΆλ μΆμΆν©λλ€.
λ―Έλμ λ μλ₯Ό μν΄ λ΄ ~/.fasd ν΄λμ κΆνμ΄ 600(λ£¨νΈ μ μ© rw)μ΄μκΈ° λλ¬Έμ λΉμ·ν λ¬Έμ κ° μμμ΅λλ€. μ΄ ν΄λλ₯Ό μ κ±°νκ³ λ΄ ~/.zshrcλ₯Ό μμ±νλ©΄ λ¬Έμ κ° ν΄κ²°λμμ΅λλ€.
λ―Έλμ λ μλ₯Ό μν΄ λ΄ ~/.fasd ν΄λμ κΆνμ΄ 600(λ£¨νΈ μ μ© rw)μ΄μκΈ° λλ¬Έμ λΉμ·ν λ¬Έμ κ° μμμ΅λλ€. μ΄ ν΄λλ₯Ό μ κ±°νκ³ λ΄ ~/.zshrcλ₯Ό μμ±νλ©΄ λ¬Έμ κ° ν΄κ²°λμμ΅λλ€.
μ΄κ²μ λμκ²λ λ¬Έμ μλ€
μ μκ²λ 100% https://github.com/clvv/fasd/issues/117#issuecomment -357458043μ΄μμ΅λλ€.
κ°μ₯ μ μ©ν λκΈ
κ΄λ ¨μ΄ μλμ§ νμ€νμ§ μμ΅λλ€. κ·Έλ¬λ https://github.com/jimhester/per-directory-history κ° fasdμ μΆ©λνλ€λ κ²μ μμμ΅λλ€. fasdκ° νμΌμ΄λ λλ ν 리λ₯Ό μΆμ νμ§ μλλ€λ λμΌν λ¬Έμ κ° μμ΅λλ€. λλ ν λ¦¬λ³ κΈ°λ‘ νλ¬κ·ΈμΈμ λΉνμ±ννλ©΄ fasdκ° μ λλ‘ μλν©λλ€.