Skip to content

Instantly share code, notes, and snippets.

@jarlah
Forked from kpmeen/echelon.zsh
Created May 5, 2017 21:00
Show Gist options
  • Save jarlah/ec01278676f6c0b8470ceb0d1f5e1181 to your computer and use it in GitHub Desktop.
Save jarlah/ec01278676f6c0b8470ceb0d1f5e1181 to your computer and use it in GitHub Desktop.
My custom ZSH themes...
# echelon
function virtualenv_info {
[ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') '
}
function box_name {
hostname -s
}
function build_prompt {
local current_dir='${PWD/#$HOME/~}'
local git_info='$(git_prompt_info)'
echo "[%{$FG[039]%}%*%{$reset_color%}] %{$FG[040]%}%n%{$reset_color%}%{$FG[239]%}@%{$reset_color%}%{$FG[033]%}$(box_name)%{$reset_color%}%{$FG[239]%}/%{$reset_color%}%{$terminfo[bold]$FG[006]%}${current_dir}%{$reset_color%} ${git_info} λ$(virtualenv_info)%(?.%{%F{green}%}.%{%F{red}%}✘) %{$reset_color%}"
}
PROMPT="$(build_prompt)"
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$reset_color%}["
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}]"
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$FG[202]%}✘"
ZSH_THEME_GIT_PROMPT_CLEAN=" %{$FG[040]%}✔"
# echelon2
NEWLINE='
'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$FG[009]%}\ue0a0%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_SUFFIX=""
ZSH_THEME_GIT_PROMPT_DIRTY=" %F{red}✘%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=" %F{green}✔%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_ADDED=" %F{green}✚%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_MODIFIED=" %F{blue}✹%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DELETED=" %F{red}✖%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_UNTRACKED=" %F{yellow}✭%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_RENAMED=" ➜"
ZSH_THEME_GIT_PROMPT_UNMERGED=" ═"
ZSH_THEME_GIT_PROMPT_AHEAD=" ⬆"
ZSH_THEME_GIT_PROMPT_BEHIND=" ⬇"
ZSH_THEME_GIT_PROMPT_DIVERGED=" ⬍"
LINE1="%{$FG[039]%}╭─"
LINE2="%{$FG[039]%}╰─ "
function virtualenv_info {
[ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') '
}
function box_name {
echo "%{$FG[040]%}%n%{$FG[239]%}@%{$FG[033]%}$(hostname -s)"
}
function echelon_git_info {
local git_info='$(git_prompt_info)'
echo "${git_info}"
}
function end_prompt {
echo "$LINE2%{$FG[255]$terminfo[bold]%}λ$(virtualenv_info)%(?.%{$FG[002]%}.%{$FG[001]%}✘)%{$reset_color%} "
}
function build_prompt {
local current_dir='${PWD/#$HOME/~}'
local git_info='$(git_prompt_info)'
echo "$LINE1$(box_name) %{$terminfo[bold]$FG[006]%}${current_dir}%{$FG[255]%}$NEWLINE$(end_prompt)"
}
PROMPT="$(build_prompt)%{$reset_color%}"
RPROMPT="$(echelon_git_info) [%{$FG[039]%}%*%{$reset_color%}]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment