diff options
Diffstat (limited to 'themes')
| -rw-r--r-- | themes/avit.zsh-theme | 21 | ||||
| -rw-r--r-- | themes/bira.zsh-theme | 8 | ||||
| -rw-r--r-- | themes/bureau.zsh-theme | 58 | ||||
| -rw-r--r-- | themes/kennethreitz.zsh-theme | 8 | ||||
| -rw-r--r-- | themes/robbyrussell.zsh-theme | 10 | ||||
| -rw-r--r-- | themes/ys.zsh-theme | 54 | 
6 files changed, 84 insertions, 75 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 diff --git a/themes/bureau.zsh-theme b/themes/bureau.zsh-theme index 148abec10..c6296500d 100644 --- a/themes/bureau.zsh-theme +++ b/themes/bureau.zsh-theme @@ -23,31 +23,35 @@ bureau_git_branch () {  }  bureau_git_status () { -  _INDEX=$(command git status --porcelain -b 2> /dev/null)    _STATUS="" -  if $(echo "$_INDEX" | grep '^[AMRD]. ' &> /dev/null); then -    _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_STAGED" -  fi -  if $(echo "$_INDEX" | grep '^.[MTD] ' &> /dev/null); then -    _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNSTAGED" -  fi -  if $(echo "$_INDEX" | command grep -E '^\?\? ' &> /dev/null); then -    _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNTRACKED" -  fi -  if $(echo "$_INDEX" | grep '^UU ' &> /dev/null); then -    _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNMERGED" -  fi -  if $(command git rev-parse --verify refs/stash >/dev/null 2>&1); then -    _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_STASHED" -  fi -  if $(echo "$_INDEX" | grep '^## .*ahead' &> /dev/null); then -    _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_AHEAD" -  fi -  if $(echo "$_INDEX" | grep '^## .*behind' &> /dev/null); then -    _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_BEHIND" -  fi -  if $(echo "$_INDEX" | grep '^## .*diverged' &> /dev/null); then -    _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_DIVERGED" +  if [[ $(command git status --short 2> /dev/null) != "" ]]; then +    _INDEX=$(command git status --porcelain -b 2> /dev/null) +    if $(echo "$_INDEX" | command grep '^[AMRD]. ' &> /dev/null); then +      _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_STAGED" +    fi +    if $(echo "$_INDEX" | command grep '^.[MTD] ' &> /dev/null); then +      _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNSTAGED" +    fi +    if $(echo "$_INDEX" | command grep -E '^\?\? ' &> /dev/null); then +      _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNTRACKED" +    fi +    if $(echo "$_INDEX" | command grep '^UU ' &> /dev/null); then +      _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNMERGED" +    fi +    if $(command git rev-parse --verify refs/stash >/dev/null 2>&1); then +      _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_STASHED" +    fi +    if $(echo "$_INDEX" | command grep '^## .*ahead' &> /dev/null); then +      _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_AHEAD" +    fi +    if $(echo "$_INDEX" | command grep '^## .*behind' &> /dev/null); then +      _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_BEHIND" +    fi +    if $(echo "$_INDEX" | command grep '^## .*diverged' &> /dev/null); then +      _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_DIVERGED" +    fi +  else +    _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_CLEAN"    fi    echo $_STATUS @@ -84,10 +88,10 @@ _LIBERTY="$_LIBERTY%{$reset_color%}"  get_space () {    local STR=$1$2    local zero='%([BSUbfksu]|([FB]|){*})' -  local LENGTH=${#${(S%%)STR//$~zero/}}  +  local LENGTH=${#${(S%%)STR//$~zero/}}    local SPACES=""    (( LENGTH = ${COLUMNS} - $LENGTH - 1)) -   +    for i in {0..$LENGTH}      do        SPACES="$SPACES " @@ -101,7 +105,7 @@ _1RIGHT="[%*] "  bureau_precmd () {    _1SPACES=`get_space $_1LEFT $_1RIGHT` -  print  +  print    print -rP "$_1LEFT$_1SPACES$_1RIGHT"  } diff --git a/themes/kennethreitz.zsh-theme b/themes/kennethreitz.zsh-theme index 109be0c22..b255a8d66 100644 --- a/themes/kennethreitz.zsh-theme +++ b/themes/kennethreitz.zsh-theme @@ -1,13 +1,15 @@  local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" -PROMPT='%{$fg[green]%}%c \ +PROMPT='$(virtualenv_prompt_info)%{[03m%}%{$fg[green]%}%c \  $(git_prompt_info)\ +\  %{$fg[red]%}%(!.#.»)%{$reset_color%} '  PROMPT2='%{$fg[red]%}\ %{$reset_color%}'  RPS1='%{$fg[blue]%}%~%{$reset_color%} ${return_code} ' -ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}:: %{$fg[yellow]%}(" +ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[yellow]%}("  ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%} "  ZSH_THEME_GIT_PROMPT_CLEAN=""  ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$fg[yellow]%}" - +ZSH_THEME_VIRTUAL_ENV_PROMPT_PREFIX="%{$reset_color%}%{[03m%}%{$fg[blue]%}" +ZSH_THEME_VIRTUAL_ENV_PROMPT_SUFFIX="!%{$reset_color%} "
\ No newline at end of file diff --git a/themes/robbyrussell.zsh-theme b/themes/robbyrussell.zsh-theme index 24e1e8c52..f9eca6a87 100644 --- a/themes/robbyrussell.zsh-theme +++ b/themes/robbyrussell.zsh-theme @@ -1,7 +1,7 @@ -local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)" -PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' +local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )" +PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)' -ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"  ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" diff --git a/themes/ys.zsh-theme b/themes/ys.zsh-theme index fd8adc41e..89d5355dc 100644 --- a/themes/ys.zsh-theme +++ b/themes/ys.zsh-theme @@ -1,18 +1,9 @@  # Clean, simple, compatible and meaningful.  # Tested on Linux, Unix and Windows under ANSI colors. -# It is recommended to use with a dark background and the font Inconsolata. +# It is recommended to use with a dark background.  # Colors: black, red, green, yellow, *blue, magenta, cyan, and white. -#  -# http://ysmood.org/wp/2013/03/my-ys-terminal-theme/ -# Mar 2013 ys - -# Machine name. -function box_name { -    [ -f ~/.box-name ] && cat ~/.box-name || echo $HOST -} - -# Directory info. -local current_dir='${PWD/#$HOME/~}' +# +# Mar 2013 Yad Smood  # VCS  YS_VCS_PROMPT_PREFIX1=" %{$fg[white]%}on%{$reset_color%} " @@ -21,7 +12,7 @@ YS_VCS_PROMPT_SUFFIX="%{$reset_color%}"  YS_VCS_PROMPT_DIRTY=" %{$fg[red]%}x"  YS_VCS_PROMPT_CLEAN=" %{$fg[green]%}o" -# Git info. +# Git info  local git_info='$(git_prompt_info)'  ZSH_THEME_GIT_PROMPT_PREFIX="${YS_VCS_PROMPT_PREFIX1}git${YS_VCS_PROMPT_PREFIX2}"  ZSH_THEME_GIT_PROMPT_SUFFIX="$YS_VCS_PROMPT_SUFFIX" @@ -44,29 +35,26 @@ ys_hg_prompt_info() {  	fi  } -# Prompt format: \n # USER at MACHINE in DIRECTORY on git:BRANCH STATE [TIME] \n $  -PROMPT=" -%{$terminfo[bold]$fg[blue]%}#%{$reset_color%} \ -%{$fg[cyan]%}%n \ -%{$fg[white]%}at \ -%{$fg[green]%}$(box_name) \ -%{$fg[white]%}in \ -%{$terminfo[bold]$fg[yellow]%}${current_dir}%{$reset_color%}\ -${hg_info}\ -${git_info} \ -%{$fg[white]%}[%*] -%{$terminfo[bold]$fg[red]%}$ %{$reset_color%}" +local exit_code="%(?,,C:%{$fg[red]%}%?%{$reset_color%})" -if [[ "$USER" == "root" ]]; then +# Prompt format: +# +# PRIVILEGES USER @ MACHINE in DIRECTORY on git:BRANCH STATE [TIME] C:LAST_EXIT_CODE +# $ COMMAND +# +# For example: +# +# % ys @ ys-mbp in ~/.oh-my-zsh on git:master x [21:47:42] C:0 +# $  PROMPT="  %{$terminfo[bold]$fg[blue]%}#%{$reset_color%} \ -%{$bg[yellow]%}%{$fg[cyan]%}%n%{$reset_color%} \ -%{$fg[white]%}at \ -%{$fg[green]%}$(box_name) \ +%(#,%{$bg[yellow]%}%{$fg[black]%}%n%{$reset_color%},%{$fg[cyan]%}%n) \ +%{$fg[white]%}@ \ +%{$fg[green]%}%m \  %{$fg[white]%}in \ -%{$terminfo[bold]$fg[yellow]%}${current_dir}%{$reset_color%}\ +%{$terminfo[bold]$fg[yellow]%}%~%{$reset_color%}\  ${hg_info}\ -${git_info} \ -%{$fg[white]%}[%*] +${git_info}\ + \ +%{$fg[white]%}[%*] $exit_code  %{$terminfo[bold]$fg[red]%}$ %{$reset_color%}" -fi  | 
