Skip to content

Instantly share code, notes, and snippets.

@technic
Last active July 5, 2018 13:09
Show Gist options
  • Save technic/870a45622ffce6a91ca95208e2ee65b8 to your computer and use it in GitHub Desktop.
Save technic/870a45622ffce6a91ca95208e2ee65b8 to your computer and use it in GitHub Desktop.
my oh-my-zsh theme
# technic mod of bira theme
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
if [[ $UID -eq 0 ]]; then
local user_host='%{$terminfo[bold]$fg[red]%}%n@%m%{$reset_color%}'
local user_symbol='#'
else
local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
local user_symbol='$'
fi
local current_dir='%{$terminfo[bold]$fg[blue]%}%~%{$reset_color%}'
function git_prompt_nice_status() {
result="$(git_prompt_status)"
[[ -n ${result} ]] || return
echo "${ZSH_THEME_GIT_PROMPT_STATUS_PREFIX}${result}${ZSH_THEME_GIT_PROMPT_STATUS_SUFFIX}"
}
local git_branch='$(git_prompt_info)$(git_prompt_nice_status)%{$reset_color%}'
local virtualenv_info='$(virtualenv_prompt_info)'
PROMPT="┌ ${user_host} ${current_dir}${git_branch}${virtualenv_info}
└─${user_symbol}%b "
RPS1="%B${return_code}%b"
ZSH_THEME_VIRTUALENV_PREFIX=" %{$fg[magenta]%}py:("
ZSH_THEME_VIRTUALENV_SUFFIX=")%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[yellow]%}git:("
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[yellow]%})%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_STATUS_PREFIX="%{$fg[yellow]%}["
ZSH_THEME_GIT_PROMPT_STATUS_SUFFIX="%b%{$fg[yellow]%}]"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}✘"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}✔"
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%}%B+"
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[red]%}%B*"
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}%B-"
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[green]%}%B»"
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[cyan]%}%B!"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[red]%}%B?"
ZSH_THEME_GIT_PROMPT_STASHED="%b%{$FG[011]%}⚑"
# vim:ft=zsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment