diff options
author | axel <axel@liljencrantz.se> | 2006-02-07 04:17:17 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2006-02-07 04:17:17 +1000 |
commit | 08251dcc984ae23cc61abef9e32fb13fb135e468 (patch) | |
tree | 8ada6a89e64eec7efc5883c28b48a0abd6395139 /init | |
parent | 57d53c70e3d1baabbe3207ce0356ca8e38842198 (diff) |
Only hide /private directories under OS X
darcs-hash:20060206181717-ac50b-043020858020be5dc55c34240329916696f5892a.gz
Diffstat (limited to 'init')
-rw-r--r-- | init/fish_function.fish | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/init/fish_function.fish b/init/fish_function.fish index 481b0830..5eb78d36 100644 --- a/init/fish_function.fish +++ b/init/fish_function.fish @@ -175,10 +175,8 @@ end # application for the file. # -function open -d "Open file in default application" - if test (uname) = Darwin - open $argv - else +if not test (uname) = Darwin + function open -d "Open file in default application" mimedb -l -- $argv end end @@ -188,12 +186,23 @@ end # function is used by the default prompt command. # -function prompt_pwd -d "Print the current working directory, shortend to fit the prompt" - if test "$PWD" != "$HOME" - printf "%s" (echo $PWD|sed -e 's|/private||' -e "s|^$HOME|~|" -e 's-/\([^/]\)\([^/]*\)-/\1-g') - echo $PWD|sed -e 's-.*/[^/]\([^/]*$\)-\1-' - else - echo '~' +if test (uname) = Darwin + function prompt_pwd -d "Print the current working directory, shortend to fit the prompt" + if test "$PWD" != "$HOME" + printf "%s" (echo $PWD|sed -e 's|/private||' -e "s|^$HOME|~|" -e 's-/\([^/]\)\([^/]*\)-/\1-g') + echo $PWD|sed -e 's-.*/[^/]\([^/]*$\)-\1-' + else + echo '~' + end + end +else + function prompt_pwd -d "Print the current working directory, shortend to fit the prompt" + if test "$PWD" != "$HOME" + printf "%s" (echo $PWD|sed -e "s|^$HOME|~|" -e 's-/\([^/]\)\([^/]*\)-/\1-g') + echo $PWD|sed -e 's-.*/[^/]\([^/]*$\)-\1-' + else + echo '~' + end end end |