2016-04-14 18:37:19 -07:00
|
|
|
function dirh --description "Print the current directory history (the prev and next lists)"
|
|
|
|
if set -q argv[1]
|
|
|
|
switch $argv[1]
|
|
|
|
case -h --h --he --hel --help
|
|
|
|
__fish_print_help dirh
|
|
|
|
return 0
|
|
|
|
end
|
|
|
|
end
|
2006-02-08 19:20:05 +10:00
|
|
|
|
2016-04-14 18:37:19 -07:00
|
|
|
set -l dirc (count $dirprev)
|
|
|
|
set -l dirprev_rev $dirprev[-1..1]
|
|
|
|
for i in (seq $dirc -1 1)
|
|
|
|
printf '%2d) %s\n' $i $dirprev_rev[$i]
|
|
|
|
end
|
2006-02-08 19:20:05 +10:00
|
|
|
|
2016-04-14 18:37:19 -07:00
|
|
|
echo (set_color $fish_color_history_current)' ' $PWD(set_color normal)
|
2012-11-18 11:23:22 +01:00
|
|
|
|
2016-04-14 18:37:19 -07:00
|
|
|
set -l dirc (count $dirnext)
|
|
|
|
if test $dirc -gt 0
|
|
|
|
for i in (seq $dirc)
|
|
|
|
printf '%2d) %s\n' $i $dirnext[$i]
|
2012-05-04 18:37:24 -07:00
|
|
|
end
|
|
|
|
end
|
2006-02-08 19:20:05 +10:00
|
|
|
|
2016-04-14 18:37:19 -07:00
|
|
|
echo
|
2006-02-08 19:20:05 +10:00
|
|
|
end
|