Skip to content

Instantly share code, notes, and snippets.

@pichfl
Last active December 20, 2015 01:19
Show Gist options
  • Save pichfl/6048392 to your computer and use it in GitHub Desktop.
Save pichfl/6048392 to your computer and use it in GitHub Desktop.
My personal zsh theme for oh my zsh
# This theme is a small multiline modification of the fantastic robbyrussell.zsh-theme.
# Fix rendering errors when using multibyte characters
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
prompt_context() {
local user=`whoami`
if [[ -n "$SSH_CLIENT" ]]; then
echo "%{$fg_bold[blue]%}%n$fg_bold[red]%}@%m%{$reset_color%}"
else
echo "%{$fg_bold[blue]%}%n@%m%{$reset_color%}"
fi
}
prompt_arrow() {
local user=`whoami`
if [[ -n "$SSH_CLIENT" ]]; then
echo "%{$fg_bold[red]%}➜%{$reset_color%} "
else
echo "%{$fg_bold[blue]%}➜%{$reset_color%} "
fi
}
promt_path() {
echo %{$fg_bold[cyan]%}%~%{$reset_color%}
}
promt_echo_git() {
echo %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}
}
PROMPT='
$(prompt_context) $(promt_path) $(promt_echo_git)
$(prompt_arrow)'
ZSH_THEME_GIT_PROMPT_PREFIX="±(%{$fg[magenta]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✘%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}) %{$fg[green]%}✔︎%{$reset_color%}"
@pichfl
Copy link
Author

pichfl commented Jul 21, 2013

A small preview
Screenshot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment