1
0
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
prezto/themes/kphoen.zsh-theme

72 lines
2.1 KiB

14 years ago
# ------------------------------------------------------------------------------
# FILE: kphoen.zsh-theme
# DESCRIPTION: oh-my-zsh theme file.
# AUTHOR: Kévin Gomez (geek63@gmail.com)
# VERSION: 1.0.0
# SCREENSHOT:
# ------------------------------------------------------------------------------
if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then
local R="%{$terminfo[sgr0]%}"
local MAGENTA="%{$fg[magenta]%}"
local YELLOW="%{$fg[yellow]%}"
local GREEN="%{$fg[green]%}"
local BLUE="%{$fg[blue]%}"
local CYAN="%{$fg[cyan]%}"
local RED="%{$fg[red]%}"
fi
14 years ago
PROMPT='[$RED%n$R@$MAGENTA%m$R:$BLUE%~$R$GIT_PROMPT_INFO]
%# '
14 years ago
# display exitcode on the right when >0
return_code="%(?..$RED%? ↵$R)"
RPROMPT='${return_code}$GIT_RPROMPT_INFO$R'
14 years ago
git_prompt_info ()
{
if [ -z "$(git_prompt__git_dir)" ]; then
GIT_PROMPT_INFO=''
GIT_RPROMPT_INFO=''
return
fi
14 years ago
local branch=''
14 years ago
git_prompt__branch
branch="$GIT_PROMPT_BRANCH"
14 years ago
git_prompt__rebase_info
branch="${branch}$GIT_PROMPT_REBASE_INFO"
14 years ago
GIT_PROMPT_INFO=" on $GREEN${branch}$R"
14 years ago
local rprompt=''
git_prompt__dirty_state
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_ADDED" = 'yes' ]]; then
rprompt="$GREEN ✚"
fi
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_MODIFIED" = 'yes' ]]; then
rprompt="${rprompt}$BLUE ✹"
fi
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_MODIFIED" = 'yes' ]]; then
rprompt="${rprompt}$BLUE ✹"
fi
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_DELETED" = 'yes' ]]; then
rprompt="${rprompt}$RED ✖"
fi
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_DELETED" = 'yes' ]]; then
rprompt="${rprompt}$RED ✖"
fi
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_RENAMED" = 'yes' ]]; then
rprompt="${rprompt}$MAGENTA ➜"
fi
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_UNMERGED" = 'yes' ]]; then
rprompt="${rprompt}$YELLOW ═"
fi
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED" = 'yes' ]]; then
rprompt="${rprompt}$CYAN ✭"
fi
GIT_RPROMPT_INFO=$rprompt
}