fish-shell/share/functions/dirh.fish
axel c2f6c6c1d2 Do gettext translation of descriptions just-in-time internally in fish
darcs-hash:20060301165347-ac50b-3df9feec60dd9860e0988396d10b550a501f6802.gz
2006-03-02 02:53:47 +10:00

26 lines
599 B
Fish

function dirh -d (N_ "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