summaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
authorRobby Russell <robby@planetargon.com>2016-03-11 00:18:00 -0800
committerRobby Russell <robby@planetargon.com>2016-03-11 00:18:00 -0800
commit83cf8dc16f51babbb0193c5b97e568739c1f40de (patch)
tree20a48739078b134d12e9662bc7711acd74a2c11e /themes
parentfdff70006c2cf577e1bf47e87faf7b793b1ec4de (diff)
parent55fed4f8cdfcf7791fd22b28ef65b00dcc9e1a5f (diff)
downloadzsh-83cf8dc16f51babbb0193c5b97e568739c1f40de.tar.gz
zsh-83cf8dc16f51babbb0193c5b97e568739c1f40de.tar.bz2
zsh-83cf8dc16f51babbb0193c5b97e568739c1f40de.zip
Merge pull request #4790 from lckarssen/avit-theme-fixes
Avit theme fixes
Diffstat (limited to 'themes')
-rw-r--r--themes/avit.zsh-theme21
-rw-r--r--themes/bira.zsh-theme8
2 files changed, 22 insertions, 7 deletions
diff --git a/themes/avit.zsh-theme b/themes/avit.zsh-theme
index 65466b82f..87d5be30a 100644
--- a/themes/avit.zsh-theme
+++ b/themes/avit.zsh-theme
@@ -2,16 +2,25 @@
PROMPT='
$(_user_host)${_current_dir} $(git_prompt_info) $(_ruby_version)
-▶ '
+%{$fg[$CARETCOLOR]%}▶%{$resetcolor%} '
-PROMPT2='%{$fg[grey]%}◀%{$reset_color%} '
+PROMPT2='%{$fg[$CARETCOLOR]%}◀%{$reset_color%} '
RPROMPT='$(_vi_status)%{$(echotc UP 1)%}$(_git_time_since_commit) $(git_prompt_status) ${_return_status}%{$(echotc DO 1)%}'
-local _current_dir="%{$fg[blue]%}%3~%{$reset_color%} "
-local _return_status="%{$fg[red]%}%(?..⍉)%{$reset_color%}"
+local _current_dir="%{$fg_bold[blue]%}%3~%{$reset_color%} "
+local _return_status="%{$fg_bold[red]%}%(?..⍉)%{$reset_color%}"
local _hist_no="%{$fg[grey]%}%h%{$reset_color%}"
+function _current_dir() {
+ local _max_pwd_length="65"
+ if [[ $(echo -n $PWD | wc -c) -gt ${_max_pwd_length} ]]; then
+ echo "%{$fg_bold[blue]%}%-2~ ... %3~%{$reset_color%} "
+ else
+ echo "%{$fg_bold[blue]%}%~%{$reset_color%} "
+ fi
+}
+
function _user_host() {
if [[ -n $SSH_CONNECTION ]]; then
me="%n@%m"
@@ -85,13 +94,13 @@ ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%}⚑ "
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}✖ "
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}▴ "
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[cyan]%}§ "
-ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%}◒ "
+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[white]%}◒ "
# Colors vary depending on time lapsed.
ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}"
ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}"
ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}"
-ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[grey]%}"
+ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[white]%}"
# LS colors, made with http://geoff.greer.fm/lscolors/
export LSCOLORS="exfxcxdxbxegedabagacad"
diff --git a/themes/bira.zsh-theme b/themes/bira.zsh-theme
index 215720477..1ead93553 100644
--- a/themes/bira.zsh-theme
+++ b/themes/bira.zsh-theme
@@ -1,7 +1,13 @@
# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
-local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
+
+if [[ $UID -eq 0 ]]; then
+ local user_host='%{$terminfo[bold]$fg[red]%}%n@%m%{$reset_color%}'
+else
+ local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
+fi
+
local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}'
local rvm_ruby=''
if which rvm-prompt &> /dev/null; then