fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
867946468
master
1# localization: tier1 2function dirh --description"Print the current directory history (the prev and next lists)" 3set -l options h/help 4argparse -n dirh --max-args=0$options --$argv 5or return 6 7if set -q _flag_help 8__fish_print_help dirh 9return 0 10end 11 12set -l dirc( count $dirprev ) 13if test $dirc -gt 0 14set -l dirprev_rev$dirprev [ -1 .. 1 ] 15# This can't be (seq $dirc -1 1) because of BSD. 16set -l dirnum( seq 1 $dirc ) 17for iin $dirnum [ -1 .. 1 ] 18printf '%2d) %s\n' $i $dirprev_rev [ $i ] 19end 20end 21 22echo ( set_color $fish_color_history_current ) ' ' $PWD ( set_color --reset) 23 24set -l dirc( count $dirnext ) 25if test $dirc -gt 0 26set -l dirnext_rev$dirnext [ -1 .. 1 ] 27for iin ( seq $dirc ) 28printf '%2d) %s\n' $i $dirnext_rev [ $i ] 29end 30end 31echo 32end