2015-09-30 20:59:46 +00:00
|
|
|
set -l s1
|
|
|
|
set -l r1
|
2013-08-16 18:47:04 +00:00
|
|
|
switch (uname)
|
|
|
|
case Darwin
|
2015-09-30 20:59:46 +00:00
|
|
|
set s1 '^/private/'
|
|
|
|
set r1 /
|
2013-08-16 18:47:04 +00:00
|
|
|
case 'CYGWIN_*'
|
2015-09-30 20:59:46 +00:00
|
|
|
set s1 '^/cygdrive/(.)'
|
|
|
|
set r1 '$1:'
|
2014-10-03 00:22:55 +00:00
|
|
|
end
|
|
|
|
|
2015-09-30 20:59:46 +00:00
|
|
|
function prompt_pwd -V s1 -V r1 --description "Print the current working directory, shortened to fit the prompt"
|
|
|
|
set realhome ~
|
|
|
|
string replace -r '^'"$realhome"'($|/)' '~$1' $PWD | string replace -r "$s1" "$r1" | string replace -ar '([^/.])[^/]*/' '$1/'
|
2006-02-12 13:14:21 +00:00
|
|
|
end
|