summaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
authorJosh Price <joshcp@gmail.com>2010-08-17 23:22:26 +1000
committerRobby Russell <robby@planetargon.com>2010-08-19 07:17:50 -0700
commit1582570919b5bed145d38d1d60ae8572f4552f25 (patch)
treecb928b5a996acea52b94a219d292733f310a207b /themes
parenteb14ee1c630a4ae02234e78eabf3e8416dc9d977 (diff)
downloadzsh-1582570919b5bed145d38d1d60ae8572f4552f25.tar.gz
zsh-1582570919b5bed145d38d1d60ae8572f4552f25.tar.bz2
zsh-1582570919b5bed145d38d1d60ae8572f4552f25.zip
Made the user_machine_size calculation generic. Pwned the function name.
Diffstat (limited to 'themes')
-rw-r--r--themes/josh.zsh-theme8
1 files changed, 4 insertions, 4 deletions
diff --git a/themes/josh.zsh-theme b/themes/josh.zsh-theme
index 9d59bd91e..6bed1a70e 100644
--- a/themes/josh.zsh-theme
+++ b/themes/josh.zsh-theme
@@ -5,7 +5,7 @@ ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$grey%}) %{$fg[yellow]%}✗%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$grey%})"
-function pat_prompt {
+function josh_prompt {
(( spare_width = ${COLUMNS} ))
prompt=" "
@@ -14,7 +14,7 @@ function pat_prompt {
path_size=${#PWD}
branch_size=${#branch}
ruby_size=${#ruby_version}
- machine_size=11
+ user_machine_size=${#${(%):-%n@%m-}}
if [[ ${#branch} -eq 0 ]]
then (( ruby_size = ruby_size + 1 ))
@@ -25,7 +25,7 @@ function pat_prompt {
fi
fi
- (( spare_width = ${spare_width} - (${machine_size} + ${path_size} + ${branch_size} + ${ruby_size}) ))
+ (( spare_width = ${spare_width} - (${user_machine_size} + ${path_size} + ${branch_size} + ${ruby_size}) ))
while [ ${#prompt} -lt $spare_width ]; do
prompt=" $prompt"
@@ -39,5 +39,5 @@ function pat_prompt {
setopt prompt_subst
PROMPT='
-%n@%m $(pat_prompt)
+%n@%m $(josh_prompt)
%(?,%{%F{green}%},%{%F{red}%})⚡%{$reset_color%} '