fish-shell/share/functions/dirs.fish
Fabian Homborg 5ca63c4956 dirs: Stringify
Two useless forks plus one per element in $dirstack.
2017-01-06 16:13:01 +01:00

15 lines
383 B
Fish

function dirs --description 'Print directory stack'
# process options
if set -q argv[1]
switch $argv[1]
case -c
# clear directory stack
set -e -g dirstack
return 0
end
end
# replace $HOME with ~
string replace -r '^'"$HOME"'($|/)' '~$1' -- $PWD $dirstack | string join " "
echo
end