Begining of 'alexg' theme, and core changes requred by that.

This commit is contained in:
alexg0 2009-12-13 19:21:48 -06:00
commit 3a96e67d9e
2 changed files with 28 additions and 2 deletions

View file

@ -1,7 +1,18 @@
# get the name of the branch we are on
function git_prompt_info() {
branch=$(current_branch_for_display) || return
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${branch}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
local type=${1:-$branch} # ; [[ -n "$type" ]] || type='branch'
branch=$(current_branch) || return
d_branch="$branch"
case $type in
*abbr*)
d_branch=${branch/master/M}
;;
esac
d_commit='';
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${d_branch}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
}
parse_git_dirty () {

15
themes/alexg.zsh-theme Normal file
View file

@ -0,0 +1,15 @@
# ZSH Theme - alexg
# Based on 'gallifrey' theme to look like
# git-prompt (http://volnitsky.com/project/git-prompt/)
#
# note: %F and %K dont work correctly on non-color terminals
local return_code="%(?,,%{$fg[red]%}%? ↵%{$reset_color%})"
local prompt_char="%B%(!,#,»)%b"
local who_where="%(!,%{$fg[magenta]%}%n@%m,%{$fg[blue]%}%m)%{$reset_color%}"
PROMPT='$(git_prompt_info abbr) $who_where %{$fg[cyan]%}%2~ %{$reset_color%}$prompt_char '
RPS1="${return_code}"
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX=" %{$reset_color%}"