Skip to content

Instantly share code, notes, and snippets.

@DekusDenial
Created November 17, 2013 06:11
Show Gist options
  • Save DekusDenial/7509948 to your computer and use it in GitHub Desktop.
Save DekusDenial/7509948 to your computer and use it in GitHub Desktop.
my zsh theme
# PROMPT='
# %{$fg[red]%}⌈ %{$fg[white]%}%n%{$fg[red]%} ⌋ %{$fg[blue]%}➤➤➤ %{$fg[red]%}❝ %{$fg[yellow]%}$(get_pwd) %{$fg[red]%}❞ %{$(put_spacing)%}%{$fg[cyan]%}%{$(git_prompt_info)%}
# %{$fg[magenta]%}%i %{$fg[red]%}⚡%{$fg[red]%}%@ %{$fg[red]%}➜ %{$reset_color%}'
PROMPT='
%{$fg[red]%}⌈ %{$fg[white]%}%n%{$fg[red]%} ⌋ %{$fg[blue]%}➤➤➤ %{$fg[red]%}❝ %{$fg[yellow]%}$(get_pwd) %{$fg[red]%}❞ %{$fg[cyan]%}%{$(git_prompt_info)%}
%{$fg[magenta]%}%i %{$fg[red]%}⚡%{$fg[red]%}%@ %{$fg[red]%}➜ %{$reset_color%}'
function get_pwd() {
echo "${PWD/$HOME/~}"
}
function git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
}
function put_spacing() {
local git=$(git_prompt_info)
if [ ${#git} != 0 ]; then
((git=${#git} - 10))
else
git=0
fi
local termwidth
(( termwidth = ${COLUMNS} - 3 - ${#HOST} - ${#$(get_pwd)} - ${git} ))
local spacing=""
for i in {1..$termwidth}; do
spacing="${spacing} "
done
echo $spacing
}
ZSH_THEME_GIT_PROMPT_PREFIX="[git:"
ZSH_THEME_GIT_PROMPT_SUFFIX="] %{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}+"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[white]%}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment