File tree Expand file tree Collapse file tree 1 file changed +28
-6
lines changed
Expand file tree Collapse file tree 1 file changed +28
-6
lines changed Original file line number Diff line number Diff line change 11function init --on-event init_fasd
2+ # Detect fasd
23 if not available fasd
34 echo " 🍒 Please install 'fasd' first!"
4- else
5- function -e fish_preexec _run_fasd
6- fasd --proc (fasd --sanitize " $argv " ) > " /dev/null" 2>&1
7- end
5+ return
6+ end
87
9- function j
10- cd (fasd -d -e ' printf %s' " $argv " )
8+ #
9+ # Fish hooks
10+ #
11+ function -e fish_preexec _run_fasd
12+ fasd --proc (fasd --sanitize " $argv " ) > " /dev/null" 2>&1
13+ end
14+
15+ function fasd_cd -d ' Function to execute built-in cd'
16+ # if no $argv, identical with `fasd`
17+ set -l N (count $argv ^ /dev/null)
18+ if [ " $N " -le 1 ]
19+ fasd " $argv "
20+ else
21+ set -l ret (fasd -e ' printf %s' $argv )
22+ [ -z " $ret " ]; and return
23+ [ -d " $ret " ]; and cd " $ret " ; or printf " %s\n" $ret
1124 end
1225 end
26+
27+ alias a=' fasd -a'
28+ alias s=' fasd -si'
29+ alias sd=' fasd -sid'
30+ alias sf=' fasd -sif'
31+ alias d=' fasd -d'
32+ alias f=' fasd -f'
33+ alias z=' fasd_cd -d'
34+ alias zz=' fasd_cd -di'
1335end
You can’t perform that action at this time.
0 commit comments