Skip to content

Instantly share code, notes, and snippets.

@zartc
Created June 12, 2016 16:03
Show Gist options
  • Save zartc/7afc1d32aa62ddf06bbc1b6e214b1210 to your computer and use it in GitHub Desktop.
Save zartc/7afc1d32aa62ddf06bbc1b6e214b1210 to your computer and use it in GitHub Desktop.
my own zsh theme
local _prompt_char="$"
#local _prompt_char="%2{%2G😊%} "
local _NEWLINE=$'\n'
#local _return_code="%(?..%{$fg[red]%}%? %{$reset_color%})"
#local _current_dir="%{$fg[blue]%}%3~%{$reset_color%}"
local _current_dir="%40<..<%{$fg[cyan]%}%d %{$reset_color%}"
#local _prompt_sign="%{$fg_bold[red]%}%(!.#.➜)%{$reset_color%}"
local _ret_status="%(?:%{$fg_bold[green]%}${_prompt_char}:%{$fg_bold[red]%}${_prompt_char}) %{$reset_color%}"
function _user_host() {
if [[ -n $SSH_CONNECTION ]]; then
me="%n@%m"
elif [[ $LOGNAME != $USER ]]; then
me="%n"
fi
if [[ -n $me ]]; then
echo "%{$FG[033]%}[$me] %{$reset_color%} "
fi
}
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[magenta]%} "
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX=" 3"
ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX=" 4"
ZSH_THEME_GIT_PROMPT_ADDED=" 5"
ZSH_THEME_GIT_PROMPT_AHEAD=" 6"
ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE=" 7"
ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR=" 8"
ZSH_THEME_GIT_PROMPT_BEHIND=" 9"
ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE=" 10"
ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR=" 11"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%} ✔"
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%} *"
ZSH_THEME_GIT_PROMPT_DIVERGED=" 15"
ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE=" 16"
ZSH_THEME_GIT_PROMPT_MODIFIED=" 17"
ZSH_THEME_GIT_PROMPT_REMOTE_EXISTS=" 19"
ZSH_THEME_GIT_PROMPT_REMOTE_MISSING=" 20"
ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_DETAILED=" 21"
ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_PREFIX=" 22"
ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_SUFFIX=" 23"
ZSH_THEME_GIT_PROMPT_RENAMED=" 24"
ZSH_THEME_GIT_PROMPT_SHA_AFTER=" 25"
ZSH_THEME_GIT_PROMPT_SHA_BEFORE=" 26"
ZSH_THEME_GIT_PROMPT_STASHED="%{$fg[blue]%} &"
ZSH_THEME_GIT_PROMPT_UNMERGED=" 29"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[yellow]%} ?"
# TIP: use spectrum_ls to display the color code
export PROMPT='${_NEWLINE}$(_user_host)${_current_dir}${_NEWLINE}${_ret_status}%{$reset_color%}'
export RPROMPT='$(git_prompt_info)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment