fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
4a3e55f69
master
1function __fish_cdh_args 2set -l all_dirs$dirprev $dirnext 3set -l uniq_dirs 4 5# This next bit of code doesn't do anything useful at the moment since the fish pager always 6# sorts, and eliminates duplicate, entries. But we do this to mimic the modal behavor of `cdh` 7# and in hope that the fish pager behavior will be changed to preserve the order of entries. 8for dirin $all_dirs [ -1 .. 1 ] 9if not contains $dir $uniq_dirs 10set uniq_dirs$uniq_dirs $dir 11end 12end 13 14for dirin $uniq_dirs 15set -l home_dir( string match -r" $HOME (/.*|\$)" " $dir " ) 16if set -q home_dir[ 2 ] 17set dir"~ $home_dir [ 2 ] " 18end 19echo $dir 20end 21end 22 23complete -c cdh -kxa'(__fish_cdh_args)'