mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-15 09:27:38 +00:00
343cafef34
darcs-hash:20060217101339-ac50b-d93d2c620a4b7f75f05ff461a6edbee001da7613.gz
26 lines
598 B
Fish
26 lines
598 B
Fish
|
|
function dirh -d (_ "Print the current directory history (the back- and fwd- lists)")
|
|
# Avoid set comment
|
|
set -l current (command pwd)
|
|
set -l separator " "
|
|
set -l line_len (echo (count $dirprev) + (echo $dirprev $current $dirnext | wc -m) | bc)
|
|
if test $line_len -gt $COLUMNS
|
|
# Print one entry per line if history is long
|
|
set separator "\n"
|
|
end
|
|
|
|
for i in $dirprev
|
|
echo -n -e $i$separator
|
|
end
|
|
|
|
set_color $fish_color_history_current
|
|
echo -n -e $current$separator
|
|
set_color normal
|
|
|
|
for i in (seq (echo (count $dirnext)) -1 1)
|
|
echo -n -e $dirnext[$i]$separator
|
|
end
|
|
|
|
echo
|
|
end
|
|
|