1f284071de3dda88f2faa06b83f3775026e6b623
- Author
- Robby Russell <robby@planetargon.com>
- Committer
- Robby Russell <robby@planetargon.com>
- Date
Message
Merge pull request #1298 from nickhutchinson/fishy
Update fishy theme to collapse working directory in PROMPT
Diff
1diff --git a/themes/fishy.zsh-theme b/themes/fishy.zsh-theme
2index f9e506cae77d27e5782b4479c4683082bdcf0da0..e9f78a54e426b92a457306049b578bc58b135aab 100644
3--- a/themes/fishy.zsh-theme
4+++ b/themes/fishy.zsh-theme
5@@ -1,7 +1,11 @@
6 # ZSH Theme emulating the Fish shell's default prompt.
7
8+_fishy_collapsed_wd() {
9+ echo $(pwd | perl -pe "s|^$HOME|~|g; s|/([^/])[^/]*(?=/)|/\$1|g")
10+}
11+
12 local user_color='green'; [ $UID -eq 0 ] && user_color='red'
13-PROMPT='%n@%m %{$fg[$user_color]%}%~%{$reset_color%}%(!.#.>) '
14+PROMPT='%n@%m %{$fg[$user_color]%}$(_fishy_collapsed_wd)%{$reset_color%}%(!.#.>) '
15 PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
16
17 local return_status="%{$fg_bold[red]%}%(?..%?)%{$reset_color%}"