bd384a060b835b6a155f1a55338afd15c54e1cb2

Author
Marc Cornellà <marc.cornella@live.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

Merge pull request #4667 from dbohdan/patch-1

"fishy" theme: Shorten path .foo to .f, not .

Diff

 1diff --git a/themes/fishy.zsh-theme b/themes/fishy.zsh-theme
 2index 8b24172a2e742494de54c28b19f781abd756eb87..83bd455b576441b744b7e493c8b27fc5f970c1f0 100644
 3--- a/themes/fishy.zsh-theme
 4+++ b/themes/fishy.zsh-theme
 5@@ -1,13 +1,13 @@
 6 # ZSH Theme emulating the Fish shell's default prompt.
 7 
 8 _fishy_collapsed_wd() {
 9-  echo $(pwd | perl -pe "
10+  echo $(pwd | perl -pe '
11    BEGIN {
12-      binmode STDIN,  ':encoding(UTF-8)';
13-      binmode STDOUT, ':encoding(UTF-8)';
14-   }; s|^$HOME|~|g; s|/([^/])[^/]*(?=/)|/\$1|g
15-")
16-} 
17+      binmode STDIN,  ":encoding(UTF-8)";
18+      binmode STDOUT, ":encoding(UTF-8)";
19+   }; s|^$ENV{HOME}|~|g; s|/([^/.])[^/]*(?=/)|/$1|g; s|/\.([^/])[^/]*(?=/)|/.$1|g
20+')
21+}
22 
23 local user_color='green'; [ $UID -eq 0 ] && user_color='red'
24 PROMPT='%n@%m %{$fg[$user_color]%}$(_fishy_collapsed_wd)%{$reset_color%}%(!.#.>) '