Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: f113c41948
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 53 lines (39 sloc) 1.894 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
# Oh My Zsh theme from https://github.com/Larandar/
# Other ZSH can maybe be on my Github
# Inspirations : Bira, Gentoo, Lambda, Miloshadzic and Sorin

function __custom_git_prompt() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
ZSH_GIT_BRANCH="${ref#refs/heads/}"

if [ -d $PWD/.git ] ; then
ZSH_GIT_REPO=$(basename $PWD)
else
ZSH_GIT_REPO="$(basename $(dirname $(git rev-parse --git-dir)))"
fi

ZSH_GIT_DIRTY="$(parse_git_dirty)"
[ ${ZSH_GIT_DIRTY} ] && ZSH_GIT_DIRTY+=" " && ZSH_GIT_STATUT="${ZSH_COLOR_BASE}[ $(git_prompt_status) ${ZSH_COLOR_BASE}]"

echo " ${ZSH_COLOR_BASE}git:{ ${ZSH_COLOR_GIT_REPO}${ZSH_GIT_REPO}${ZSH_COLOR_BASE} @ ${ZSH_COLOR_GIT_BRANCH}${ZSH_GIT_BRANCH}${ZSH_COLOR_BASE} ${ZSH_GIT_DIRTY}${COLOR_BASE}}${ZSH_GIT_STATUT}"
}

function __custom_prompt() {
echo "$(__custom_git_prompt)"
}

ZSH_COLOR_VOID="%{$reset_color%}"
ZSH_COLOR_BASE="%{%F{3}%}"
ZSH_COLOR_SUB1="%{%F{4}%}"
ZSH_COLOR_SUB2="%{%F{5}%}"
ZSH_COLOR_RBASE="%{%F{13}%}"

ZSH_COLOR_GIT_REPO="%{%F{6}%}"
ZSH_COLOR_GIT_BRANCH="%{%F{9}%}"

ZSH_COLOR_ERROR="%{%F{1}%}"
ZSH_COLOR_HOST="${ZSH_COLOR_RBASE}"
ZSH_COLOR_RESET="${ZSH_COLOR_BASE}"


ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡${ZSH_COLOR_RESET}"

ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%}✚"
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%}✹"
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}✖"
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%}➜"
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%}|"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%}✭"

PROMPT="${ZSH_COLOR_BASE}╭─[ ${ZSH_COLOR_SUB1}%n${ZSH_COLOR_BASE} @${ZSH_COLOR_HOST}%m${ZSH_COLOR_BASE} ] ${ZSH_COLOR_SUB2}%2~${ZSH_COLOR_BASE} \$(__custom_git_prompt)
${ZSH_COLOR_BASE}╰─ ${ZSH_COLOR_SUB1} %{%b%}${ZSH_COLOR_VOID}"

return_code="%(?..${ZSH_COLOR_ERROR}%? ↵${ZSH_COLOR_VOID})"
RPROMPT="${return_code}${ZSH_COLOR_VOID} ${ZSH_COLOR_RBASE}!%!${ZSH_COLOR_VOID}"
Something went wrong with that request. Please try again.