Skip to content

Instantly share code, notes, and snippets.

@liul85
Created August 23, 2016 11:53
Show Gist options
  • Save liul85/8e7c896df2583f2d1e489dc8ef30bfe9 to your computer and use it in GitHub Desktop.
Save liul85/8e7c896df2583f2d1e489dc8ef30bfe9 to your computer and use it in GitHub Desktop.
oh-my-zsh theme
local current_dir='${PWD/#$HOME/~}'
YS_VCS_PROMPT_PREFIX1="%{$fg[white]%}on%{$reset_color%} "
YS_VCS_PROMPT_PREFIX2=":%{$fg[cyan]%}"
YS_VCS_PROMPT_SUFFIX="%{$reset_color%} "
YS_VCS_PROMPT_DIRTY=" %{$fg[red]%}❌"
YS_VCS_PROMPT_CLEAN=" %{$fg[green]%}✅"
local git_info='$(git_prompt_info)'
local git_last_commit='$(git log --pretty=format:"%h \"%s\"" -1 2> /dev/null)'
ZSH_THEME_GIT_PROMPT_PREFIX="${YS_VCS_PROMPT_PREFIX1}git${YS_VCS_PROMPT_PREFIX2}"
ZSH_THEME_GIT_PROMPT_SUFFIX="$YS_VCS_PROMPT_SUFFIX"
ZSH_THEME_GIT_PROMPT_DIRTY="$YS_VCS_PROMPT_DIRTY"
ZSH_THEME_GIT_PROMPT_CLEAN="$YS_VCS_PROMPT_CLEAN"
PROMPT="
%{$fg[green]%}%* \
%{$fg[cyan]%}%n $fg[white]in\
%{$terminfo[bold]$fg[yellow]%} [${current_dir}]%{$reset_color%} \
${git_info}\
➜ %{$reset_color%}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment