eb14ee1c630a4ae02234e78eabf3e8416dc9d977
- Author
- Josh Price <joshcp@gmail.com>
- Committer
- Robby Russell <robby@planetargon.com>
- Date
Message
Added my own theme based on pat's
Diff
1diff --git a/themes/josh.zsh-theme b/themes/josh.zsh-theme
2new file mode 100644
3index 0000000000000000000000000000000000000000..9d59bd91ec1a6deb277439ab0ee3456adc59c861
4--- /dev/null
5+++ b/themes/josh.zsh-theme
6@@ -0,0 +1,43 @@
7+grey='\e[0;90m'
8+
9+ZSH_THEME_GIT_PROMPT_PREFIX="%{$grey%}("
10+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
11+ZSH_THEME_GIT_PROMPT_DIRTY="%{$grey%}) %{$fg[yellow]%}✗%{$reset_color%}"
12+ZSH_THEME_GIT_PROMPT_CLEAN="%{$grey%})"
13+
14+function pat_prompt {
15+ (( spare_width = ${COLUMNS} ))
16+ prompt=" "
17+
18+ branch=$(current_branch)
19+ ruby_version=$(rvm_prompt_info)
20+ path_size=${#PWD}
21+ branch_size=${#branch}
22+ ruby_size=${#ruby_version}
23+ machine_size=11
24+
25+ if [[ ${#branch} -eq 0 ]]
26+ then (( ruby_size = ruby_size + 1 ))
27+ else
28+ (( branch_size = branch_size + 4 ))
29+ if [[ -n $(git status -s 2> /dev/null) ]]; then
30+ (( branch_size = branch_size + 2 ))
31+ fi
32+ fi
33+
34+ (( spare_width = ${spare_width} - (${machine_size} + ${path_size} + ${branch_size} + ${ruby_size}) ))
35+
36+ while [ ${#prompt} -lt $spare_width ]; do
37+ prompt=" $prompt"
38+ done
39+
40+ prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info)%{$reset_color%} $(git_prompt_info)"
41+
42+ echo $prompt
43+}
44+
45+setopt prompt_subst
46+
47+PROMPT='
48+%n@%m $(pat_prompt)
49+%(?,%{%F{green}%},%{%F{red}%})⚡%{$reset_color%} '