Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added initial jnrowe theme.

  • Loading branch information...
commit 97c66649485e227aba86b6006a6058a981da5092 1 parent 8f33231
James Rowe JNRowe authored robbyrussell committed

Showing 1 changed file with 31 additions and 0 deletions. Show diff stats Hide diff stats

  1. +31 0 themes/jnrowe.zsh-theme
31 themes/jnrowe.zsh-theme
... ... @@ -0,0 +1,31 @@
  1 +autoload -U add-zsh-hook
  2 +autoload -Uz vcs_info
  3 +
  4 +zstyle ':vcs_info:*' actionformats \
  5 + '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
  6 +zstyle ':vcs_info:*' formats \
  7 + '%F{2}%s%F{7}:%F{2}(%F{1}%b%F{2})%f '
  8 +zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
  9 +zstyle ':vcs_info:*' enable git
  10 +
  11 +add-zsh-hook precmd prompt_jnrowe_precmd
  12 +
  13 +prompt_jnrowe_precmd () {
  14 + vcs_info
  15 +
  16 + if [ "${vcs_info_msg_0_}" = "" ]; then
  17 + dir_status="%F{2}→%f"
  18 + elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then
  19 + dir_status="%F{1}▶%f"
  20 + elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then
  21 + dir_status="%F{3}▶%f"
  22 + else
  23 + dir_status="%F{2}▶%f"
  24 + fi
  25 +}
  26 +
  27 +local ret_status="%(?:%{$fg_bold[green]%}Ξ:%{$fg_bold[red]%}%S↑%s%?)"
  28 +
  29 +PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg_bold[yellow]%}%2~ ${vcs_info_msg_0_}${dir_status}%{$reset_color%} '
  30 +
  31 +# vim: set ft=zsh ts=4 sw=4 et:

0 comments on commit 97c6664

Please sign in to comment.
Something went wrong with that request. Please try again.