Skip to content

Instantly share code, notes, and snippets.

@Crowles
Last active August 8, 2017 18:01
Show Gist options
  • Save Crowles/55bc9a1f5c224b77212413694b8ceb42 to your computer and use it in GitHub Desktop.
Save Crowles/55bc9a1f5c224b77212413694b8ceb42 to your computer and use it in GitHub Desktop.
Shell themes
# crstov-zsh (2017).
# Chris Rowles <github.com/Crowles>
if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then
turquoise="%F{81}"
orange="%F{166}"
purple="%F{135}"
hotpink="%F{161}"
limegreen="%F{118}"
grey="%F{250}"
yellow="%F{220}"
white="%F{15}"
else
turquoise="$fg[cyan]"
orange="$fg[yellow]"
purple="$fg[magenta]"
hotpink="$fg[red]"
limegreen="$fg[green]"
grey="$fg[grey]"
yellow="$fg[yellow]"
white="$fg[white]"
fi
BWG="%{$bg[white]%}%{$fg[black]%}"
l_host="%{$purple%}%n@%M%{$reset_color%}"
l_path="%{$white%}%c%{$reset_color%}"
l_git="%{${purple%}$(git_prompt_info)%{$reset_color%}"
local ret_status="%(?:%{$limegreen%}$ :%{$orange%}$ %s)"
#PS1=$'\xF0\x9F\x94\xA5'
PROMPT=$'${l_host} ${l_path} %{${purple%}$(git_prompt_info)%{$reset_color%}${ret_status}%{$reset_color%}'
#RPROMPT=$'%{$BWG%}%T%{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$yellow%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$purple%})%{$orange%} ✘ %{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$purple%})%{$limegreen%} ✔ %{$reset_color%}"
PS1='\[\033]0;${PWD//[^[:ascii:]]/?}\007\]' # set window title
PS1=$PS1'\[\033[01;32m\]\[\033[01m\033[01;32m\]\u\[\033[01;00m\]@\[\033[01;32m\]\h ' # user @ host
PS1=$PS1'\[\033[01;00m\]\W' # current working directory
if test -z "$WINELOADERNOEXEC"
then
GIT_EXEC_PATH="$(git --exec-path 2>/dev/null)"
COMPLETION_PATH="${GIT_EXEC_PATH%/libexec/git-core}"
COMPLETION_PATH="${COMPLETION_PATH%/lib/git-core}"
COMPLETION_PATH="$COMPLETION_PATH/share/git/completion"
if test -f "$COMPLETION_PATH/git-prompt.sh"
then
. "$COMPLETION_PATH/git-completion.bash"
. "$COMPLETION_PATH/git-prompt.sh"
PS1="$PS1"'\[\033[33m\]' # change color to cyan
PS1="$PS1"'`__git_ps1`' # bash function
fi
fi
PS1=$PS1'\n\[\033[01;32m\]└─\[\033[01m\033[01;00m\] \$\[\033[00m\] ' # newline prompt
MSYS2_PS1="$PS1" # for detection by MSYS2 SDK's bash.basrc
PS1='\[\033]0;${PWD//[^[:ascii:]]/?}\007\]' # set window title
PS1="$PS1"'\n' # new line
PS1="$PS1"'\[\e[1m\]' # begin bright bold
PS1="$PS1"'\[\033[35m\]' # change to purple
PS1="$PS1"'\u@\h ' # user@host
ps1="$PS1"'\[\e[0m\]' # end bright bold
PS1="$PS1"'\[\033[37m\]' # change to white
PS1="$PS1"'\w' # current working directory
if test -z "$WINELOADERNOEXEC"
then
GIT_EXEC_PATH="$(git --exec-path 2>/dev/null)"
COMPLETION_PATH="${GIT_EXEC_PATH%/libexec/git-core}"
COMPLETION_PATH="${COMPLETION_PATH%/lib/git-core}"
COMPLETION_PATH="$COMPLETION_PATH/share/git/completion"
if test -f "$COMPLETION_PATH/git-prompt.sh"
then
. "$COMPLETION_PATH/git-completion.bash"
. "$COMPLETION_PATH/git-prompt.sh"
PS1="$PS1"'\[\033[33m\]' # change color to cyan
PS1="$PS1"'`__git_ps1`' # bash function
fi
fi
PS1="$PS1"'\[\033[32m\]'
PS1="$PS1"' $ ' # prompt: always $
PS1="$PS1"'\[\033[37m\]' # change to white
MSYS2_PS1="$PS1" # for detection by MSYS2 SDK's bash.basrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment