83cf8dc16f51babbb0193c5b97e568739c1f40de

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #4790 from lckarssen/avit-theme-fixes

Avit theme fixes

Diff

 1diff --git a/themes/avit.zsh-theme b/themes/avit.zsh-theme
 2index 65466b82f4458e52c4728801c2c76a8b0b43291a..87d5be30a9593b02e848e5ecd77fd457be1c5e58 100644
 3--- a/themes/avit.zsh-theme
 4+++ b/themes/avit.zsh-theme
 5@@ -2,16 +2,25 @@
 6 
 7 PROMPT='
 8 $(_user_host)${_current_dir} $(git_prompt_info) $(_ruby_version)
 9-▶ '
10+%{$fg[$CARETCOLOR]%}▶%{$resetcolor%} '
11 
12-PROMPT2='%{$fg[grey]%}◀%{$reset_color%} '
13+PROMPT2='%{$fg[$CARETCOLOR]%}◀%{$reset_color%} '
14 
15 RPROMPT='$(_vi_status)%{$(echotc UP 1)%}$(_git_time_since_commit) $(git_prompt_status) ${_return_status}%{$(echotc DO 1)%}'
16 
17-local _current_dir="%{$fg[blue]%}%3~%{$reset_color%} "
18-local _return_status="%{$fg[red]%}%(?..⍉)%{$reset_color%}"
19+local _current_dir="%{$fg_bold[blue]%}%3~%{$reset_color%} "
20+local _return_status="%{$fg_bold[red]%}%(?..⍉)%{$reset_color%}"
21 local _hist_no="%{$fg[grey]%}%h%{$reset_color%}"
22 
23+function _current_dir() {
24+  local _max_pwd_length="65"
25+  if [[ $(echo -n $PWD | wc -c) -gt ${_max_pwd_length} ]]; then
26+    echo "%{$fg_bold[blue]%}%-2~ ... %3~%{$reset_color%} "
27+  else
28+    echo "%{$fg_bold[blue]%}%~%{$reset_color%} "
29+  fi
30+}
31+
32 function _user_host() {
33   if [[ -n $SSH_CONNECTION ]]; then
34     me="%n@%m"
35@@ -85,13 +94,13 @@ ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%}⚑ "
36 ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}✖ "
37 ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}▴ "
38 ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[cyan]%}§ "
39-ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%}◒ "
40+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[white]%}◒ "
41 
42 # Colors vary depending on time lapsed.
43 ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}"
44 ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}"
45 ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}"
46-ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[grey]%}"
47+ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[white]%}"
48 
49 # LS colors, made with http://geoff.greer.fm/lscolors/
50 export LSCOLORS="exfxcxdxbxegedabagacad"
51diff --git a/themes/bira.zsh-theme b/themes/bira.zsh-theme
52index 2157204778f6c346569e4f69d638ce7c792a685f..1ead935539b196f4ac8c14043ce64ef9c7f80ede 100644
53--- a/themes/bira.zsh-theme
54+++ b/themes/bira.zsh-theme
55@@ -1,7 +1,13 @@
56 # ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
57 local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
58 
59-local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
60+
61+if [[ $UID -eq 0 ]]; then
62+    local user_host='%{$terminfo[bold]$fg[red]%}%n@%m%{$reset_color%}'
63+else
64+    local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
65+fi
66+
67 local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}'
68 local rvm_ruby=''
69 if which rvm-prompt &> /dev/null; then