Created
January 6, 2013 00:35
-
-
Save fitzyyf/4464510 to your computer and use it in GitHub Desktop.
I zsh theme from the the blinks theme modified from.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/blinks zsh theme | |
CURRENT_BG='NONE' | |
SEGMENT_SEPARATOR='⮀' | |
function _prompt_char() { | |
if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then | |
echo "%{%F{blue}%}⚙%{%f%k%b%}" | |
else | |
echo '%{%F{cyan}%}λ' | |
fi | |
} | |
# Begin a segment | |
# Takes two arguments, background and foreground. Both can be omitted, | |
# rendering default background/foreground. | |
prompt_segment() { | |
local bg fg | |
[[ -n $1 ]] && bg="%K{$1}" || bg="%k" | |
[[ -n $2 ]] && fg="%F{$2}" || fg="%f" | |
if [[ $CURRENT_BG != 'NONE' && $1 != $CURRENT_BG ]]; then | |
echo -n " %{$bg%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR%{$fg%} " | |
else | |
echo -n "%{$bg%}%{$fg%} " | |
fi | |
CURRENT_BG=$1 | |
[[ -n $3 ]] && echo -n $3 | |
} | |
ZSH_THEME_GIT_PROMPT_PREFIX=" git:" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="" | |
ZSH_THEME_GIT_PROMPT_DIRTY=" ✗✗✗" | |
ZSH_THEME_GIT_PROMPT_CLEAN=" ✔" | |
ZSH_THEME_GIT_PROMPT_ADDED=" ✚" | |
ZSH_THEME_GIT_PROMPT_MODIFIED=" ✹" | |
ZSH_THEME_GIT_PROMPT_DELETED=" ✖" | |
ZSH_THEME_GIT_PROMPT_RENAMED=" ➜" | |
ZSH_THEME_GIT_PROMPT_UNMERGED=" ═" | |
ZSH_THEME_GIT_PROMPT_UNTRACKED=" ✭" | |
# Status: | |
# - was there an error | |
# - am I root | |
# - are there background jobs? | |
prompt_status() { | |
local symbols | |
symbols=() | |
[[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}$RETVAL" | |
[[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡" | |
[[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙" | |
[[ -n "$symbols" ]] && prompt_segment black default "$symbols" | |
} | |
# set messages | |
PROMPT='╭─%{%f%k%b%}$(prompt_status)%{%K{black}%B%F{green}%}%n%{%B%F{blue}%}@%{%B%F{cyan}%}%m%{%B%F{green}%} %{$fg_bold[blue]%}%W %t %{%b%F{yellow}%K{black}%}%~%{%B%F{green}%}$(git_prompt_info)%E%{%f%k%b%} | |
╰─%{%K{black}%}$(_prompt_char)%{%K{black}%} %{%B%}%{%f%k%b%} ' | |
# RPROMPT='!%{%B%F{cyan}%}%!$(git_prompt_status)' | |
RPROMPT='$(git_prompt_status)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment