├── README.md ├── completions ├── a.fish ├── d.fish ├── f.fish ├── fasd.fish ├── fasd_cd.fish ├── s.fish ├── sd.fish ├── sf.fish ├── z.fish └── zz.fish ├── conf.d └── fasd.fish └── functions ├── __fasd_print_completions.fish ├── a.fish ├── d.fish ├── f.fish ├── fasd_cd.fish ├── s.fish ├── sd.fish ├── sf.fish ├── z.fish └── zz.fish /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | #### fasd 4 | > [fasd] plugin for [Oh My Fish][omf-link]. 5 | 6 | [![MIT License](https://img.shields.io/badge/license-MIT-007EC7.svg?style=flat-square)](/LICENSE) 7 | [![Fish Shell Version](https://img.shields.io/badge/fish-v2.2.0-007EC7.svg?style=flat-square)](http://fishshell.com) 8 | [![Oh My Fish Framework](https://img.shields.io/badge/Oh%20My%20Fish-Framework-007EC7.svg?style=flat-square)](https://www.github.com/oh-my-fish/oh-my-fish) 9 | 10 |
11 | 12 | ## Install 13 | 14 | ```fish 15 | $ omf install fasd 16 | ``` 17 | 18 | 19 | # License 20 | 21 | [MIT][mit] © [simnalamburt][author] et [al][contributors] 22 | 23 | 24 | [fasd]: https://github.com/clvv/fasd 25 | [mit]: http://opensource.org/licenses/MIT 26 | [author]: http://github.com/simnalamburt 27 | [contributors]: https://github.com/oh-my-fish/plugin-fasd/graphs/contributors 28 | [omf-link]: https://www.github.com/oh-my-fish/oh-my-fish 29 | 30 | [license-badge]: https://img.shields.io/badge/license-MIT-007EC7.svg?style=flat-square 31 | -------------------------------------------------------------------------------- /completions/a.fish: -------------------------------------------------------------------------------- 1 | complete -c a -a "(__fasd_print_completions -a)" -f -A 2 | -------------------------------------------------------------------------------- /completions/d.fish: -------------------------------------------------------------------------------- 1 | complete -c d -a "(__fasd_print_completions -d)" -f -A 2 | -------------------------------------------------------------------------------- /completions/f.fish: -------------------------------------------------------------------------------- 1 | complete -c f -a "(__fasd_print_completions -f)" -f -A 2 | -------------------------------------------------------------------------------- /completions/fasd.fish: -------------------------------------------------------------------------------- 1 | complete -c fasd -a "(__fasd_print_completions)" -f -A 2 | -------------------------------------------------------------------------------- /completions/fasd_cd.fish: -------------------------------------------------------------------------------- 1 | complete -c fasd_cd -a "(__fasd_print_completions -d)" -f -A 2 | -------------------------------------------------------------------------------- /completions/s.fish: -------------------------------------------------------------------------------- 1 | complete -c s -a "(__fasd_print_completions)" -f -A 2 | -------------------------------------------------------------------------------- /completions/sd.fish: -------------------------------------------------------------------------------- 1 | complete -c sd -a "(__fasd_print_completions -d)" -f -A 2 | -------------------------------------------------------------------------------- /completions/sf.fish: -------------------------------------------------------------------------------- 1 | complete -c sf -a "(__fasd_print_completions -f)" -f -A 2 | -------------------------------------------------------------------------------- /completions/z.fish: -------------------------------------------------------------------------------- 1 | complete -c z -a "(__fasd_print_completions -d)" -f -A 2 | -------------------------------------------------------------------------------- /completions/zz.fish: -------------------------------------------------------------------------------- 1 | complete -c zz -a "(__fasd_print_completions -d)" -f -A 2 | -------------------------------------------------------------------------------- /conf.d/fasd.fish: -------------------------------------------------------------------------------- 1 | # Detect fasd 2 | if type -q fasd 3 | # Hook into fish preexec event 4 | function __fasd_run -e fish_preexec 5 | if type -q disown 6 | command fasd --proc (command fasd --sanitize "$argv" | tr -s ' ' \n) > "/dev/null" 2>&1 &; disown 7 | else 8 | command fasd --proc (command fasd --sanitize "$argv" | tr -s ' ' \n) > "/dev/null" 2>&1 & 9 | end 10 | end 11 | else 12 | echo "🍒 Please install 'fasd' first!" 13 | end 14 | -------------------------------------------------------------------------------- /functions/__fasd_print_completions.fish: -------------------------------------------------------------------------------- 1 | function __fasd_print_completions 2 | set cmd (commandline -po) '' 3 | fasd $argv $cmd[2..-1] -l 4 | end 5 | -------------------------------------------------------------------------------- /functions/a.fish: -------------------------------------------------------------------------------- 1 | function a -d "any" 2 | command fasd -a $argv 3 | end 4 | -------------------------------------------------------------------------------- /functions/d.fish: -------------------------------------------------------------------------------- 1 | function d -d "directory" 2 | command fasd -d $argv 3 | end 4 | -------------------------------------------------------------------------------- /functions/f.fish: -------------------------------------------------------------------------------- 1 | function f -d "file" 2 | command fasd -f $argv 3 | end 4 | -------------------------------------------------------------------------------- /functions/fasd_cd.fish: -------------------------------------------------------------------------------- 1 | function fasd_cd -d 'Function to execute built-in cd' 2 | # if no $argv, identical with `fasd` 3 | if test (count $argv) -le 1 4 | command fasd "$argv" 5 | else 6 | command fasd -e 'printf %s' $argv | read -l ret 7 | test -z "$ret"; 8 | and return 9 | test -d "$ret"; 10 | and cd "$ret"; 11 | or printf "%s\n" $ret 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /functions/s.fish: -------------------------------------------------------------------------------- 1 | function s -d "show / search / select" 2 | command fasd -si $argv 3 | end 4 | -------------------------------------------------------------------------------- /functions/sd.fish: -------------------------------------------------------------------------------- 1 | function sd -d "interactive directory selection" 2 | command fasd -sid $argv 3 | end 4 | -------------------------------------------------------------------------------- /functions/sf.fish: -------------------------------------------------------------------------------- 1 | function sf -d "interactive file selection" 2 | command fasd -sif $argv 3 | end 4 | -------------------------------------------------------------------------------- /functions/z.fish: -------------------------------------------------------------------------------- 1 | function z -d "cd, same functionality as j in autojump" 2 | fasd_cd -d $argv 3 | end 4 | -------------------------------------------------------------------------------- /functions/zz.fish: -------------------------------------------------------------------------------- 1 | function zz -d "cd with interactive selection" 2 | fasd_cd -di $argv 3 | end 4 | --------------------------------------------------------------------------------