fish-shell/share/functions/prompt_pwd.fish
Kevin Ballard a7727765dc Clean up prompt_pwd with the new function -V flag
Also fixes `cd /private` displaying as no path on OS X.
2014-10-02 18:41:39 -07:00

13 lines
450 B
Fish

set -l args_pre
set -l args_post
switch (uname)
case Darwin
set args_pre $args_pre -e 's|^/private/|/|'
case 'CYGWIN_*'
set args_pre $args_pre -e 's|^/cygdrive/\(.\)|\1/:|'
set args_post $args_post -e 's-^\([^/]\)/:/\?-\u\1:/-'
end
function prompt_pwd -V args_pre -V args_post --description "Print the current working directory, shortened to fit the prompt"
echo $PWD | sed -e "s|^$HOME|~|" $args_pre -e 's-\([^/.]\)[^/]*/-\1/-g' $args_post
end