fish-shell/share/functions/prompt_pwd.fish

15 lines
648 B
Fish
Raw Normal View History

switch (uname)
case Darwin
2013-09-12 09:06:45 +00:00
function prompt_pwd --description "Print the current working directory, shortened to fit the prompt"
echo $PWD | sed -e "s|^$HOME|~|" -e 's|^/private||' -e 's-\([^/.]\)[^/]*/-\1/-g'
end
case 'CYGWIN_*'
2013-09-12 09:06:45 +00:00
function prompt_pwd --description "Print the current working directory, shortened to fit the prompt"
echo $PWD | sed -e "s|^$HOME|~|" -e 's|^/cygdrive/\(.\)|\1/:|' -e 's-\([^/.]\)[^/]*/-\1/-g' -e 's-^\([^/]\)/:/\?-\u\1:/-'
end
case '*'
2013-09-12 09:06:45 +00:00
function prompt_pwd --description "Print the current working directory, shortened to fit the prompt"
echo $PWD | sed -e "s|^$HOME|~|" -e 's-\([^/.]\)[^/]*/-\1/-g'
end
end