2014-10-03 00:22:55 +00:00
|
|
|
set -l args_pre
|
|
|
|
set -l args_post
|
2013-08-16 18:47:04 +00:00
|
|
|
switch (uname)
|
|
|
|
case Darwin
|
2014-10-03 00:22:55 +00:00
|
|
|
set args_pre $args_pre -e 's|^/private/|/|'
|
2013-08-16 18:47:04 +00:00
|
|
|
case 'CYGWIN_*'
|
2014-10-03 00:22:55 +00:00
|
|
|
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"
|
2014-10-26 06:20:49 +00:00
|
|
|
set -l realhome ~
|
2015-08-08 19:59:05 +00:00
|
|
|
echo $PWD | sed -e "s|^$realhome\$|~|" -e "s|^$realhome/|~/|" $args_pre -e 's-\([^/.]\)[^/]*/-\1/-g' $args_post
|
2006-02-12 13:14:21 +00:00
|
|
|
end
|