e5beb1a6b5f31d2fa1c77598ef48d888b773e26c

Author
Dieter Plaetinck <dieter@plaetinck.be>
Committer
Dieter Plaetinck <dieter@plaetinck.be>
Date

Message

add dieter theme v1

Diff

 1diff --git a/themes/dieter.zsh-theme b/themes/dieter.zsh-theme
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..5b61c80ce68bb186acc41fa0a35b850cc776fed3
 4--- /dev/null
 5+++ b/themes/dieter.zsh-theme
 6@@ -0,0 +1,33 @@
 7+# the idea of this theme is to contain a lot of info in a small string, by compressing some parts,
 8+# and colorcoding, which bring useful visual cues.  While limiting the amount of colors and such to keep
 9+# it easy on the eyes
10+# exact return code (when >0) is on the right, so it stays out of the way
11+
12+# TODO: reset exit code visual cues (not exit code itself) after showing once
13+# TODO: compress hostname in window title
14+
15+typeset -A host_repr
16+host_repr=('dieter-ws-a7n8x-arch' "%{$fg_bold[green]%}ws" 'dieter-p4sci-arch' "%{$fg_bold[blue]%}p4")
17+
18+
19+# local time, color coded after last return code
20+local time="%(?.%{$fg[green]%}.%{$fg[red]%})%*%{$reset_color%}"
21+# user part, color coded after privileges
22+local user="%(!.%{$fg[blue]%}.%{$fg[blue]%})%n%{$reset_color%}"
23+# Hostname part.  compressed and colorcoded per host_repr array
24+# if not found, regular hostname in default color
25+local host="@${host_repr[$(hostname)]:-$(hostname)}%{$reset_color%}"
26+# Compacted $PWD
27+local pwd="%{$fg[blue]%}%c%{$reset_color%}"
28+
29+PROMPT='${time} ${user}${host} ${pwd} $(git_prompt_info)'
30+
31+# i would prefer 1 icon that shows the "most drastic" deviation from head, but lets see how this works out
32+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}"
33+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
34+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%} %{$fg[yellow]%}?%{$fg[green]%}%{$reset_color%}"
35+ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}"
36+
37+# elaborate exitcode on the right when >0
38+local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
39+RPS1="${return_code}"