diff options
Diffstat (limited to 'themes')
53 files changed, 1076 insertions, 211 deletions
diff --git a/themes/adben.zsh-theme b/themes/adben.zsh-theme index 9f777e847..aa3093f64 100644 --- a/themes/adben.zsh-theme +++ b/themes/adben.zsh-theme @@ -1,26 +1,118 @@ #!/usr/bin/env zsh -local USER_HOST='%{$terminfo[bold]$fg[yellow]%}%n@%m%{$reset_color%}' -local RETURN_CODE="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" -local GIT_BRANCH='%{$terminfo[bold]$fg[red]%}$(git_prompt_info)%{$reset_color%}' -local CURRENT_DIR='%{$terminfo[bold]$fg[green]%} %~%{$reset_color%}' -local RUBY_RVM='%{$fg[gray]%}‹$(rvm-prompt i v g)›%{$reset_color%}' -local COMMAND_TIP='%{$terminfo[bold]$fg[blue]%}$(wget -qO - http://www.commandlinefu.com/commands/random/plaintext | sed 1d | sed '/^$/d' | sed 's/^/║/g')%{$reset_color%}' -######### PROMPT ######### -PROMPT="%{$terminfo[bold]$fg[blue]%}╔═ %{$reset_color%}${USER_HOST} ${CURRENT_DIR} ${RUBY_RVM} ${GIT_BRANCH} -${COMMAND_TIP} -%{$terminfo[bold]$fg[blue]%}╚═ %{$reset_color%}%B%{$terminfo[bold]$fg[white]%}$%b%{$reset_color%} " -RPS1='${RETURN_CODE}' -RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}' -######### PROMPT ######### -########## GIT ########### -ZSH_THEME_GIT_PROMPT_PREFIX="‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$GIT_PROMPT_INFO%}›" -ZSH_THEME_GIT_PROMPT_DIRTY=" %{$GIT_DIRTY_COLOR%}✘" -ZSH_THEME_GIT_PROMPT_CLEAN=" %{$GIT_CLEAN_COLOR%}✔" -ZSH_THEME_GIT_PROMPT_ADDED="%{$FG[082]%}✚%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_MODIFIED="%{$FG[166]%}✹%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DELETED="%{$FG[160]%}✖%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_RENAMED="%{$FG[220]%}➜%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$FG[082]%}═%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$FG[190]%}✭%{$reset_color%}" -########## GIT ########### +# # +# # #README +# # +# # This theme provides two customizable header functionalities: +# # a) displaying a pseudo-random message from a database of quotations +# # (https://en.wikipedia.org/wiki/Fortune_%28Unix%29) +# # b) displaying randomly command line tips from The command line fu +# # (http://www.commandlinefu.com) community: in order to make use of this functionality +# # you will need Internet connection. +# # This theme provides as well information for the current user's context, like; +# # branch and status for the current version control system (git and svn currently +# # supported) and time, presented to the user in a non invasive volatile way. +# # +# # #REQUIREMENTS +# # This theme requires wget:: +# # -Homebrew-osx- brew install wget +# # -Debian/Ubuntu- apt-get install wget +# # and fortune :: +# # -Homebrew-osx- brew install fortune +# # -Debian/Ubuntu- apt-get install fortune +# # +# # optionally: +# # -Oh-myzsh vcs plug-ins git and svn. +# # -Solarized theme (https://github.com/altercation/solarized/) +# # -OS X: iTerm 2 (http://www.iterm2.com/) +# # -font Source code pro (https://github.com/adobe/source-code-pro) +# # +# # This theme's look and feel is based on the Aaron Toponce's zsh theme, more info: +# # http://pthree.org/2008/11/23/727/ +# # enjoy! +########## COLOR ########### +for COLOR in CYAN WHITE YELLOW MAGENTA BLACK BLUE RED DEFAULT GREEN GREY; do + eval PR_$COLOR='%{$fg[${(L)COLOR}]%}' + eval PR_BRIGHT_$COLOR='%{$fg_bold[${(L)COLOR}]%}' +done +PR_RESET="%{$reset_color%}" +RED_START="${PR_RESET}${PR_GREY}<${PR_RESET}${PR_RED}<${PR_BRIGHT_RED}<${PR_RESET} " +RED_END="${PR_RESET}${PR_BRIGHT_RED}>${PR_RESET}${PR_RED}>${PR_GREY}>${PR_RESET} " +GREEN_END="${PR_RESET}${PR_BRIGHT_GREEN}>${PR_RESET}${PR_GREEN}>${PR_GREY}>${PR_RESET} " +GREEN_BASE_START="${PR_RESET}${PR_GREY}>${PR_RESET}${PR_GREEN}>${PR_BRIGHT_GREEN}>${PR_RESET}" +GREEN_START_P1="${PR_RESET}${GREEN_BASE_START}${PR_RESET} " +DIVISION="${PR_RESET}${PR_RED} < ${PR_RESET}" +VCS_DIRTY_COLOR="${PR_RESET}${PR_YELLOW}" +Vcs_CLEAN_COLOR="${PR_RESET}${PR_GREEN}" +VCS_SUFIX_COLOR="${PR_RESET}${PR_RED}› ${PR_RESET}" +# ########## COLOR ########### +# ########## SVN ########### +ZSH_THEME_SVN_PROMPT_PREFIX="${PR_RESET}${PR_RED}‹svn:" +ZSH_THEME_SVN_PROMPT_SUFFIX="" +ZSH_THEME_SVN_PROMPT_DIRTY="${VCS_DIRTY_COLOR} ✘${VCS_SUFIX_COLOR}" +ZSH_THEME_SVN_PROMPT_CLEAN="${VCS_CLEAN_COLOR} ✔${VCS_SUFIX_COLOR}" +# ########## SVN ########### +# ########## GIT ########### +ZSH_THEME_GIT_PROMPT_PREFIX="${PR_RESET}${PR_RED}‹git:" +ZSH_THEME_GIT_PROMPT_SUFFIX="" +ZSH_THEME_GIT_PROMPT_DIRTY="${VCS_DIRTY_COLOR} ✘${VCS_SUFIX_COLOR}" +ZSH_THEME_GIT_PROMPT_CLEAN="${VCS_CLEAN_COLOR} ✔${VCS_SUFIX_COLOR}" +ZSH_THEME_GIT_PROMPT_ADDED="${PR_RESET}${PR_YELLOW} ✚${PR_RESET}" +ZSH_THEME_GIT_PROMPT_MODIFIED="${PR_RESET}${PR_YELLOW} ✹${PR_RESET}" +ZSH_THEME_GIT_PROMPT_DELETED="${PR_RESET}${PR_YELLOW} ✖${PR_RESET}" +ZSH_THEME_GIT_PROMPT_RENAMED="${PR_RESET}${PR_YELLOW} ➜${PR_RESET}" +ZSH_THEME_GIT_PROMPT_UNMERGED="${PR_RESET}${PR_YELLOW} ═${PR_RESET}" +ZSH_THEME_GIT_PROMPT_UNTRACKED="${PR_RESET}${PR_YELLOW} ✭${PR_RESET}" +# ########## GIT ########### +function precmd { + #gets the fortune + ps1_fortune () { + #Choose from all databases, regardless of whether they are considered "offensive" + fortune -a + } + #obtains the tip + ps1_command_tip () { + wget -qO - http://www.commandlinefu.com/commands/random/plaintext | sed 1d | sed '/^$/d' + } + prompt_header () { + if [[ "true" == "$ENABLE_COMMAND_TIP" ]]; then + ps1_command_tip + else + ps1_fortune + fi + } + PROMPT_HEAD="${RED_START}${PR_YELLOW}$(prompt_header)${PR_RESET}" + # set a simple variable to show when in screen + if [[ -n "${WINDOW}" ]]; then + SCREEN="" + fi +} + +# Context: user@directory or just directory +prompt_context () { + local user=`whoami` + if [[ "$user" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then + echo -n "${PR_RESET}${PR_RED}$user@%m${PR_RESET}${PR_BRIGHT_YELLOW}%~%<<${PR_RESET}" + else + echo -n "${PR_RESET}${PR_BRIGHT_YELLOW}%~%<<${PR_RESET}" + fi +} + +set_prompt () { + # required for the prompt + setopt prompt_subst + autoload colors zsh/terminfo + if [[ "$terminfo[colors]" -gt 8 ]]; then + colors + fi + + # ######### PROMPT ######### + PROMPT='${PROMPT_HEAD} +${RED_START}$(prompt_context) +${GREEN_START_P1}' + RPROMPT='${PR_RESET}$(git_prompt_info)$(svn_prompt_info)${PR_YELLOW}%D{%R.%S %a %b %d %Y} ${GREEN_END}${PR_RESET}' + # Matching continuation prompt + PROMPT2='${GREEN_BASE_START}${PR_RESET} %_ ${GREEN_BASE_START}${PR_RESET} ' + # ######### PROMPT ######### +} + +set_prompt diff --git a/themes/af-magic.zsh-theme b/themes/af-magic.zsh-theme index c1b00c62b..97d142a0f 100644 --- a/themes/af-magic.zsh-theme +++ b/themes/af-magic.zsh-theme @@ -1,14 +1,6 @@ # af-magic.zsh-theme -# -# Author: Andy Fleming -# URL: http://andyfleming.com/ # Repo: https://github.com/andyfleming/oh-my-zsh # Direct Link: https://github.com/andyfleming/oh-my-zsh/blob/master/themes/af-magic.zsh-theme -# -# Created on: June 19, 2012 -# Last modified on: June 20, 2012 - - if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" @@ -27,7 +19,12 @@ eval my_gray='$FG[237]' eval my_orange='$FG[214]' # right prompt -RPROMPT='$my_gray%n@%m%{$reset_color%}%' +if type "virtualenv_prompt_info" > /dev/null +then + RPROMPT='$(virtualenv_prompt_info)$my_gray%n@%m%{$reset_color%}%' +else + RPROMPT='$my_gray%n@%m%{$reset_color%}%' +fi # git settings ZSH_THEME_GIT_PROMPT_PREFIX="$FG[075](branch:" diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index c3107c06c..2b33c48bc 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -6,7 +6,7 @@ # # README # # In order for this theme to render correctly, you will need a -# [Powerline-patched font](https://gist.github.com/1595572). +# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts). # # In addition, I recommend the # [Solarized theme](https://github.com/altercation/solarized/) and, if you're @@ -26,7 +26,7 @@ # A few utility functions to make it easy and re-usable to draw segmented prompts CURRENT_BG='NONE' -SEGMENT_SEPARATOR='⮀' +SEGMENT_SEPARATOR='' # Begin a segment # Takes two arguments, background and foreground. Both can be omitted, @@ -69,9 +69,10 @@ prompt_context() { # Git: branch/detached head, dirty status prompt_git() { - local ref dirty + local ref dirty mode repo_path + repo_path=$(git rev-parse --git-dir 2>/dev/null) + if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then - ZSH_THEME_GIT_PROMPT_DIRTY='±' dirty=$(parse_git_dirty) ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)" if [[ -n $dirty ]]; then @@ -79,7 +80,62 @@ prompt_git() { else prompt_segment green black fi - echo -n "${ref/refs\/heads\//⭠ }$dirty" + + if [[ -e "${repo_path}/BISECT_LOG" ]]; then + mode=" <B>" + elif [[ -e "${repo_path}/MERGE_HEAD" ]]; then + mode=" >M<" + elif [[ -e "${repo_path}/rebase" || -e "${repo_path}/rebase-apply" || -e "${repo_path}/rebase-merge" || -e "${repo_path}/../.dotest" ]]; then + mode=" >R>" + fi + + setopt promptsubst + autoload -Uz vcs_info + + zstyle ':vcs_info:*' enable git + zstyle ':vcs_info:*' get-revision true + zstyle ':vcs_info:*' check-for-changes true + zstyle ':vcs_info:*' stagedstr '✚' + zstyle ':vcs_info:git:*' unstagedstr '●' + zstyle ':vcs_info:*' formats ' %u%c' + zstyle ':vcs_info:*' actionformats ' %u%c' + vcs_info + echo -n "${ref/refs\/heads\// }${vcs_info_msg_0_%% }${mode}" + fi +} + +prompt_hg() { + local rev status + if $(hg id >/dev/null 2>&1); then + if $(hg prompt >/dev/null 2>&1); then + if [[ $(hg prompt "{status|unknown}") = "?" ]]; then + # if files are not added + prompt_segment red white + st='±' + elif [[ -n $(hg prompt "{status|modified}") ]]; then + # if any modification + prompt_segment yellow black + st='±' + else + # if working copy is clean + prompt_segment green black + fi + echo -n $(hg prompt "☿ {rev}@{branch}") $st + else + st="" + rev=$(hg id -n 2>/dev/null | sed 's/[^-0-9]//g') + branch=$(hg id -b 2>/dev/null) + if `hg st | grep -Eq "^\?"`; then + prompt_segment red black + st='±' + elif `hg st | grep -Eq "^(M|A)"`; then + prompt_segment yellow black + st='±' + else + prompt_segment green black + fi + echo -n "☿ $rev@$branch" $st + fi fi } @@ -88,6 +144,14 @@ prompt_dir() { prompt_segment blue black '%~' } +# Virtualenv: current working virtualenv +prompt_virtualenv() { + local virtualenv_path="$VIRTUAL_ENV" + if [[ -n $virtualenv_path && -n $VIRTUAL_ENV_DISABLE_PROMPT ]]; then + prompt_segment blue black "(`basename $virtualenv_path`)" + fi +} + # Status: # - was there an error # - am I root @@ -106,9 +170,11 @@ prompt_status() { build_prompt() { RETVAL=$? prompt_status + prompt_virtualenv prompt_context prompt_dir prompt_git + prompt_hg prompt_end } diff --git a/themes/amuse.zsh-theme b/themes/amuse.zsh-theme new file mode 100644 index 000000000..548f6d39d --- /dev/null +++ b/themes/amuse.zsh-theme @@ -0,0 +1,21 @@ +# vim:ft=zsh ts=2 sw=2 sts=2 + +rvm_current() { + rvm current 2>/dev/null +} + +rbenv_version() { + rbenv version 2>/dev/null | awk '{print $1}' +} + +PROMPT=' +%{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) ⌚ %{$fg_bold[red]%}%*%{$reset_color%} +$ ' + +ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}⭠ " +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?" +ZSH_THEME_GIT_PROMPT_CLEAN="" + +RPROMPT='%{$fg_bold[red]%}$(rbenv_version)%{$reset_color%}' diff --git a/themes/avit.zsh-theme b/themes/avit.zsh-theme new file mode 100644 index 000000000..a21a9c8c4 --- /dev/null +++ b/themes/avit.zsh-theme @@ -0,0 +1,102 @@ +# AVIT ZSH Theme + +PROMPT=' +$(_user_host)${_current_dir} $(git_prompt_info) $(_ruby_version) +▶ ' + +PROMPT2='%{$fg[grey]%}◀%{$reset_color%} ' + +RPROMPT='$(_vi_status)%{$(echotc UP 1)%}$(_git_time_since_commit) $(git_prompt_status) ${_return_status}%{$(echotc DO 1)%}' + +local _current_dir="%{$fg[blue]%}%3~%{$reset_color%} " +local _return_status="%{$fg[red]%}%(?..⍉)%{$reset_color%}" +local _hist_no="%{$fg[grey]%}%h%{$reset_color%}" + +function _user_host() { + if [[ -n $SSH_CONNECTION ]]; then + me="%n@%m" + elif [[ $LOGNAME != $USER ]]; then + me="%n" + fi + if [[ -n $me ]]; then + echo "%{$fg[cyan]%}$me%{$reset_color%}:" + fi +} + +function _vi_status() { + if {echo $fpath | grep -q "plugins/vi-mode"}; then + echo "$(vi_mode_prompt_info)" + fi +} + +function _ruby_version() { + if {echo $fpath | grep -q "plugins/rvm"}; then + echo "%{$fg[grey]%}$(rvm_prompt_info)%{$reset_color%}" + fi +} + +# Determine the time since last commit. If branch is clean, +# use a neutral color, otherwise colors will vary according to time. +function _git_time_since_commit() { + if git rev-parse --git-dir > /dev/null 2>&1; then + # Only proceed if there is actually a commit. + if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then + # Get the last commit. + last_commit=$(git log --pretty=format:'%at' -1 2> /dev/null) + now=$(date +%s) + seconds_since_last_commit=$((now-last_commit)) + + # Totals + minutes=$((seconds_since_last_commit / 60)) + hours=$((seconds_since_last_commit/3600)) + + # Sub-hours and sub-minutes + days=$((seconds_since_last_commit / 86400)) + sub_hours=$((hours % 24)) + sub_minutes=$((minutes % 60)) + + if [ $hours -gt 24 ]; then + commit_age="${days}d" + elif [ $minutes -gt 60 ]; then + commit_age="${sub_hours}h${sub_minutes}m" + else + commit_age="${minutes}m" + fi + + color=$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL + echo "$color$commit_age%{$reset_color%}" + fi + fi +} + +if [[ $USER == "root" ]]; then + CARETCOLOR="red" +else + CARETCOLOR="white" +fi + +MODE_INDICATOR="%{$fg_bold[yellow]%}❮%{$reset_color%}%{$fg[yellow]%}❮❮%{$reset_color%}" + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" + +ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}✗%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✔%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%}✚ " +ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%}⚑ " +ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}✖ " +ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}▴ " +ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[cyan]%}§ " +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%}◒ " + +# Colors vary depending on time lapsed. +ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}" +ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}" +ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}" +ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[grey]%}" + +# LS colors, made with http://geoff.greer.fm/lscolors/ +export LSCOLORS="exfxcxdxbxegedabagacad" +export LS_COLORS='di=34;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=34;46:cd=34;43:su=0;41:sg=0;46:tw=0;42:ow=0;43:' +export GREP_COLOR='1;33' + diff --git a/themes/bureau.zsh-theme b/themes/bureau.zsh-theme new file mode 100644 index 000000000..4d9cae0cc --- /dev/null +++ b/themes/bureau.zsh-theme @@ -0,0 +1,113 @@ +# oh-my-zsh Bureau Theme + +### NVM + +ZSH_THEME_NVM_PROMPT_PREFIX="%B⬡%b " +ZSH_THEME_NVM_PROMPT_SUFFIX="" + +### Git [±master ▾●] + +ZSH_THEME_GIT_PROMPT_PREFIX="[%{$fg_bold[green]%}±%{$reset_color%}%{$fg_bold[white]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}]" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[green]%}✓%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg[cyan]%}▴%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_BEHIND="%{$fg[magenta]%}▾%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_STAGED="%{$fg_bold[green]%}●%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_UNSTAGED="%{$fg_bold[yellow]%}●%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[red]%}●%{$reset_color%}" + +bureau_git_branch () { + ref=$(command git symbolic-ref HEAD 2> /dev/null) || \ + ref=$(command git rev-parse --short HEAD 2> /dev/null) || return + echo "${ref#refs/heads/}" +} + +bureau_git_status () { + _INDEX=$(command git status --porcelain -b 2> /dev/null) + _STATUS="" + if $(echo "$_INDEX" | grep '^[AMRD]. ' &> /dev/null); then + _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_STAGED" + fi + if $(echo "$_INDEX" | grep '^.[MTD] ' &> /dev/null); then + _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNSTAGED" + fi + if $(echo "$_INDEX" | grep -E '^\?\? ' &> /dev/null); then + _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNTRACKED" + fi + if $(echo "$_INDEX" | grep '^UU ' &> /dev/null); then + _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNMERGED" + fi + if $(command git rev-parse --verify refs/stash >/dev/null 2>&1); then + _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_STASHED" + fi + if $(echo "$_INDEX" | grep '^## .*ahead' &> /dev/null); then + _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_AHEAD" + fi + if $(echo "$_INDEX" | grep '^## .*behind' &> /dev/null); then + _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_BEHIND" + fi + if $(echo "$_INDEX" | grep '^## .*diverged' &> /dev/null); then + _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_DIVERGED" + fi + + echo $_STATUS +} + +bureau_git_prompt () { + local _branch=$(bureau_git_branch) + local _status=$(bureau_git_status) + local _result="" + if [[ "${_branch}x" != "x" ]]; then + _result="$ZSH_THEME_GIT_PROMPT_PREFIX$_branch" + if [[ "${_status}x" != "x" ]]; then + _result="$_result $_status" + fi + _result="$_result$ZSH_THEME_GIT_PROMPT_SUFFIX" + fi + echo $_result +} + + +_PATH="%{$fg_bold[white]%}%~%{$reset_color%}" + +if [[ "%#" == "#" ]]; then + _USERNAME="%{$fg_bold[red]%}%n" + _LIBERTY="%{$fg[red]%}#" +else + _USERNAME="%{$fg_bold[white]%}%n" + _LIBERTY="%{$fg[green]%}$" +fi +_USERNAME="$_USERNAME%{$reset_color%}@%m" +_LIBERTY="$_LIBERTY%{$reset_color%}" + + +get_space () { + local STR=$1$2 + local zero='%([BSUbfksu]|([FB]|){*})' + local LENGTH=${#${(S%%)STR//$~zero/}} + local SPACES="" + (( LENGTH = ${COLUMNS} - $LENGTH - 1)) + + for i in {0..$LENGTH} + do + SPACES="$SPACES " + done + + echo $SPACES +} + +_1LEFT="$_USERNAME $_PATH" +_1RIGHT="[%*] " + +bureau_precmd () { + _1SPACES=`get_space $_1LEFT $_1RIGHT` + print + print -rP "$_1LEFT$_1SPACES$_1RIGHT" +} + +setopt prompt_subst +PROMPT='> $_LIBERTY ' +RPROMPT='$(nvm_prompt_info) $(bureau_git_prompt)' + +autoload -U add-zsh-hook +add-zsh-hook precmd bureau_precmd diff --git a/themes/candy-kingdom.zsh-theme b/themes/candy-kingdom.zsh-theme index 25aeb6597..718977d90 100644 --- a/themes/candy-kingdom.zsh-theme +++ b/themes/candy-kingdom.zsh-theme @@ -1,11 +1,4 @@ # neuralsanwich.zsh-theme -# -# Author: Sean Jones -# URL: http://www.neuralsandwich.com -# Repo: -# Direct link: -# Create: -# Modified: if [ "x$OH_MY_ZSH_HG" = "x" ]; then OH_MY_ZSH_HG="hg" diff --git a/themes/crcandy.zsh-theme b/themes/crcandy.zsh-theme new file mode 100644 index 000000000..0a63c1245 --- /dev/null +++ b/themes/crcandy.zsh-theme @@ -0,0 +1,8 @@ +PROMPT=$' +%{$fg_bold[green]%}%n@%m %{$fg[blue]%}%D{[%I:%M:%S]} %{$reset_color%}%{$fg[white]%}[%~]%{$reset_color%} $(git_prompt_info)\ +%{$fg[blue]%}->%{$fg_bold[blue]%} %#%{$reset_color%} ' + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[" +ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}" +ZSH_THEME_GIT_PROMPT_CLEAN="" diff --git a/themes/crunch.zsh-theme b/themes/crunch.zsh-theme index b2759a1b0..2fc066381 100644 --- a/themes/crunch.zsh-theme +++ b/themes/crunch.zsh-theme @@ -29,7 +29,7 @@ ZSH_THEME_GIT_PROMPT_DIRTY=" $CRUNCH_GIT_DIRTY_COLOR✗" # Our elements: CRUNCH_TIME_="$CRUNCH_BRACKET_COLOR{$CRUNCH_TIME_COLOR%T$CRUNCH_BRACKET_COLOR}%{$reset_color%}" -if which rvm-prompt &> /dev/null; then +if [ -e ~/.rvm/bin/rvm-prompt ]; then CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\${\$(~/.rvm/bin/rvm-prompt i v g)#ruby-}$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}" else if which rbenv &> /dev/null; then diff --git a/themes/dallas.zsh-theme b/themes/dallas.zsh-theme index e9b4f852a..e9e86177b 100644 --- a/themes/dallas.zsh-theme +++ b/themes/dallas.zsh-theme @@ -3,7 +3,7 @@ # Grab the current date (%D) and time (%T) wrapped in {}: {%D %T} DALLAS_CURRENT_TIME_="%{$fg[white]%}{%{$fg[yellow]%}%D %T%{$fg[white]%}}%{$reset_color%}" # Grab the current version of ruby in use (via RVM): [ruby-1.8.7] -if which rvm-prompt &> /dev/null; then +if [ -e ~/.rvm/bin/rvm-prompt ]; then DALLAS_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[magenta]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}" else if which rbenv &> /dev/null; then @@ -14,7 +14,7 @@ fi DALLAS_CURRENT_MACH_="%{$fg[green]%}%m%{$fg[white]%}:%{$reset_color%}" # Grab the current filepath, use shortcuts: ~/Desktop # Append the current git branch, if in a git repository: ~aw@master -DALLAS_CURRENT_LOCA_="%{$fg[cyan]%}%~\$(git_prompt_info)%{$reset_color%}" +DALLAS_CURRENT_LOCA_="%{$fg[cyan]%}%~\$(git_prompt_info)%{$reset_color%}\$(parse_git_dirty)" # Grab the current username: dallas DALLAS_CURRENT_USER_="%{$fg[red]%}%n%{$reset_color%}" # Use a % for normal users and a # for privelaged (root) users. diff --git a/themes/dogenpunk.zsh-theme b/themes/dogenpunk.zsh-theme index f4d65ab74..0bd38acc2 100644 --- a/themes/dogenpunk.zsh-theme +++ b/themes/dogenpunk.zsh-theme @@ -1,10 +1,4 @@ -# ----------------------------------------------------------------------------- -# FILE: dogenpunk.zsh-theme -# DESCRIPTION: oh-my-zsh theme file. -# AUTHOR: Matthew Nelson (dogenpunk@gmail.com) -# VERSION: 0.1 -# SCREENSHOT: coming soon -# ----------------------------------------------------------------------------- +# dogenpunk.zsh-theme MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}" local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}" diff --git a/themes/duellj.zsh-theme b/themes/duellj.zsh-theme index 7350b4335..3849c35be 100644 --- a/themes/duellj.zsh-theme +++ b/themes/duellj.zsh-theme @@ -1,4 +1,3 @@ - # user, host, full path, and time/date # on two lines for easier vgrepping # entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 diff --git a/themes/eastwood.zsh-theme b/themes/eastwood.zsh-theme index db2529990..1b284cdc2 100644 --- a/themes/eastwood.zsh-theme +++ b/themes/eastwood.zsh-theme @@ -1,4 +1,4 @@ -#RVM settings +# RVM settings if [[ -s ~/.rvm/scripts/rvm ]] ; then RPS1="%{$fg[yellow]%}rvm:%{$reset_color%}%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt)%{$reset_color%} $EPS1" else @@ -12,7 +12,7 @@ ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}" ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}" ZSH_THEME_GIT_PROMPT_CLEAN="" -#Customized git status, oh-my-zsh currently does not allow render dirty status before branch +# Customized git status, oh-my-zsh currently does not allow render dirty status before branch git_custom_status() { local cb=$(current_branch) if [ -n "$cb" ]; then diff --git a/themes/essembeh.zsh-theme b/themes/essembeh.zsh-theme new file mode 100644 index 000000000..939bb7a4c --- /dev/null +++ b/themes/essembeh.zsh-theme @@ -0,0 +1,30 @@ +# Theme with full path names and hostname +# Handy if you work on different servers all the time; + +local return_code="%(?..%{$fg_bold[red]%}%? ↵%{$reset_color%})" + +function my_git_prompt_info() { + ref=$(git symbolic-ref HEAD 2> /dev/null) || return + GIT_STATUS=$(git_prompt_status) + [[ -n $GIT_STATUS ]] && GIT_STATUS=" $GIT_STATUS" + echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$GIT_STATUS$ZSH_THEME_GIT_PROMPT_SUFFIX" +} + +# Colored prompt +ZSH_THEME_COLOR_USER="green" +ZSH_THEME_COLOR_HOST="green" +ZSH_THEME_COLOR_PWD="yellow" +test -n "$SSH_CONNECTION" && ZSH_THEME_COLOR_USER="red" && ZSH_THEME_COLOR_HOST="red" +test `id -u` = 0 && ZSH_THEME_COLOR_USER="magenta" && ZSH_THEME_COLOR_HOST="magenta" +PROMPT='%{$fg_bold[$ZSH_THEME_COLOR_USER]%}%n@%{$fg_bold[$ZSH_THEME_COLOR_HOST]%}%M%{$reset_color%}:%{$fg_bold[$ZSH_THEME_COLOR_PWD]%}%~%{$reset_color%} $(my_git_prompt_info)%(!.#.$) ' +RPS1="${return_code}" + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[cyan]%}(" +ZSH_THEME_GIT_PROMPT_SUFFIX=") %{$reset_color%}" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%%" +ZSH_THEME_GIT_PROMPT_ADDED="+" +ZSH_THEME_GIT_PROMPT_MODIFIED="*" +ZSH_THEME_GIT_PROMPT_RENAMED="~" +ZSH_THEME_GIT_PROMPT_DELETED="!" +ZSH_THEME_GIT_PROMPT_UNMERGED="?" + diff --git a/themes/fino-time.zsh-theme b/themes/fino-time.zsh-theme index 7154e09f1..901c4d99f 100644 --- a/themes/fino-time.zsh-theme +++ b/themes/fino-time.zsh-theme @@ -1,4 +1,4 @@ -# Fino-time theme by Aexander Berezovsky (http://berezovsky.me) based on Fino by Max Masnick (http://max.masnick.me) +# fino-time.zsh-theme # Use with a dark background and 256-color terminal! # Meant for people with RVM and git. Tested only on OS X 10.7. diff --git a/themes/fino.zsh-theme b/themes/fino.zsh-theme index 26e547176..35e6e02c1 100644 --- a/themes/fino.zsh-theme +++ b/themes/fino.zsh-theme @@ -1,7 +1,7 @@ -# Fino theme by Max Masnick (http://max.masnick.me) +# fino.zsh-theme # Use with a dark background and 256-color terminal! -# Meant for people with RVM and git. Tested only on OS X 10.7. +# Meant for people with rbenv and git. Tested only on OS X 10.7. # You can set your computer name in the ~/.box-name file if you want. @@ -11,36 +11,33 @@ # # Also borrowing from http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/ -function virtualenv_info { - [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' -} - function prompt_char { - git branch >/dev/null 2>/dev/null && echo '±' && return - echo '○' + git branch >/dev/null 2>/dev/null && echo "±" && return + echo '○' } function box_name { [ -f ~/.box-name ] && cat ~/.box-name || hostname -s } - -local rvm_ruby='' +local ruby_env='' if which rvm-prompt &> /dev/null; then - rvm_ruby='‹$(rvm-prompt i v g)›%{$reset_color%}' + ruby_env=' ‹$(rvm-prompt i v g)›%{$reset_color%}' else if which rbenv &> /dev/null; then - rvm_ruby='‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}' + ruby_env=' ‹$(rbenv version-name)›%{$reset_color%}' fi fi + local current_dir='${PWD/#$HOME/~}' local git_info='$(git_prompt_info)' +local prompt_char='$(prompt_char)' -PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}${current_dir}%{$reset_color%}${git_info} %{$FG[239]%}using%{$FG[243]%} ${rvm_ruby} -╰─$(virtualenv_info)$(prompt_char) " +PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}${current_dir}%{$reset_color%}${git_info} %{$FG[239]%}using%{$FG[243]%}${ruby_env} +╰─${prompt_char} " ZSH_THEME_GIT_PROMPT_PREFIX=" %{$FG[239]%}on%{$reset_color%} %{$fg[255]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" ZSH_THEME_GIT_PROMPT_DIRTY="%{$FG[202]%}✘✘✘" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$FG[040]%}✔"
\ No newline at end of file +ZSH_THEME_GIT_PROMPT_CLEAN="%{$FG[040]%}✔" diff --git a/themes/fishy.zsh-theme b/themes/fishy.zsh-theme index e9f78a54e..8b24172a2 100644 --- a/themes/fishy.zsh-theme +++ b/themes/fishy.zsh-theme @@ -1,8 +1,13 @@ # ZSH Theme emulating the Fish shell's default prompt. _fishy_collapsed_wd() { - echo $(pwd | perl -pe "s|^$HOME|~|g; s|/([^/])[^/]*(?=/)|/\$1|g") -} + echo $(pwd | perl -pe " + BEGIN { + binmode STDIN, ':encoding(UTF-8)'; + binmode STDOUT, ':encoding(UTF-8)'; + }; s|^$HOME|~|g; s|/([^/])[^/]*(?=/)|/\$1|g +") +} local user_color='green'; [ $UID -eq 0 ] && user_color='red' PROMPT='%n@%m %{$fg[$user_color]%}$(_fishy_collapsed_wd)%{$reset_color%}%(!.#.>) ' diff --git a/themes/fox.zsh-theme b/themes/fox.zsh-theme index 1959853cf..3ecd4e204 100644 --- a/themes/fox.zsh-theme +++ b/themes/fox.zsh-theme @@ -1,4 +1,5 @@ -#fox theme +# fox.zsh-theme + PROMPT='%{$fg[cyan]%}┌[%{$fg_bold[white]%}%n%{$reset_color%}%{$fg[cyan]%}☮%{$fg_bold[white]%}%M%{$reset_color%}%{$fg[cyan]%}]%{$fg[white]%}-%{$fg[cyan]%}(%{$fg_bold[white]%}%~%{$reset_color%}%{$fg[cyan]%})$(git_prompt_info) └> % %{$reset_color%}' diff --git a/themes/frisk.zsh-theme b/themes/frisk.zsh-theme index 2c999a6a6..653c7461f 100644 --- a/themes/frisk.zsh-theme +++ b/themes/frisk.zsh-theme @@ -10,13 +10,3 @@ ZSH_THEME_GIT_PROMPT_PREFIX=$ZSH_THEME_SCM_PROMPT_PREFIX$GIT_CB ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%} " ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}" ZSH_THEME_GIT_PROMPT_CLEAN="" - -## Bazaar integration -bzr_prompt_info() { - BZR_CB=`bzr nick 2> /dev/null | grep -v "ERROR" | cut -d ":" -f2 | awk -F / '{print "bzr::"$1}'` - if [ -n "$BZR_CB" ]; then - BZR_DIRTY="" - [[ -n `bzr status` ]] && BZR_DIRTY="%{$fg[red]%} *%{$reset_color%}" - echo "$ZSH_THEME_SCM_PROMPT_PREFIX$BZR_CB$BZR_DIRTY$ZSH_THEME_GIT_PROMPT_SUFFIX" - fi -} diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme index 3eac14867..f1057a9a9 100644 --- a/themes/gallois.zsh-theme +++ b/themes/gallois.zsh-theme @@ -7,18 +7,22 @@ ZSH_THEME_GIT_PROMPT_CLEAN="" git_custom_status() { local cb=$(current_branch) if [ -n "$cb" ]; then - echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX" + echo "$(parse_git_dirty)%{$fg_bold[yellow]%}$(work_in_progress)%{$reset_color%}$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX" fi } #RVM and git settings -if [[ -s ~/.rvm/scripts/rvm ]] ; then +if [[ -s ~/.rvm/scripts/rvm ]] ; then RPS1='$(git_custom_status)%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1' else if which rbenv &> /dev/null; then RPS1='$(git_custom_status)%{$fg[red]%}[`rbenv version | sed -e "s/ (set.*$//"`]%{$reset_color%} $EPS1' else - RPS1='$(git_custom_status) $EPS1' + if [[ -n `which chruby_prompt_info` && -n `chruby_prompt_info` ]]; then + RPS1='$(git_custom_status)%{$fg[red]%}[`chruby_prompt_info`]%{$reset_color%} $EPS1' + else + RPS1='$(git_custom_status) $EPS1' + fi fi fi diff --git a/themes/gianu.zsh-theme b/themes/gianu.zsh-theme new file mode 100644 index 000000000..faa80218e --- /dev/null +++ b/themes/gianu.zsh-theme @@ -0,0 +1,6 @@ +PROMPT='[%{$fg_bold[white]%}%n%{$reset_color%}@%{$fg_bold[red]%}%m%{$reset_color%} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)%{$reset_color%}]$ ' + +ZSH_THEME_GIT_PROMPT_PREFIX="(%{$fg_bold[green]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX=")" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%} %{$fg[yellow]%}✗%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$reset_color%}" diff --git a/themes/gnzh.zsh-theme b/themes/gnzh.zsh-theme index 3c6b8a409..33f187bc6 100644 --- a/themes/gnzh.zsh-theme +++ b/themes/gnzh.zsh-theme @@ -6,7 +6,7 @@ autoload -U colors zsh/terminfo # Used in the colour alias below colors setopt prompt_subst -# make some aliases for the colours: (coud use normal escap.seq's too) +# make some aliases for the colours: (could use normal escape sequences too) for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do eval PR_$color='%{$fg[${(L)color}]%}' done @@ -25,7 +25,7 @@ elif [[ $UID -eq 0 ]]; then # root fi # Check if we are on SSH or not -if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then +if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then eval PR_HOST='${PR_YELLOW}%M${PR_NO_COLOR}' #SSH else eval PR_HOST='${PR_GREEN}%M${PR_NO_COLOR}' # no SSH @@ -36,12 +36,12 @@ local return_code="%(?..%{$PR_RED%}%? ↵%{$PR_NO_COLOR%})" local user_host='${PR_USER}${PR_CYAN}@${PR_HOST}' local current_dir='%{$PR_BOLD$PR_BLUE%}%~%{$PR_NO_COLOR%}' local rvm_ruby='' -if which rvm-prompt &> /dev/null; then +if ${HOME}/.rvm/bin/rvm-prompt &> /dev/null; then # detect local user rvm installation + rvm_ruby='%{$PR_RED%}‹$(${HOME}/.rvm/bin/rvm-prompt i v g s)›%{$PR_NO_COLOR%}' +elif which rvm-prompt &> /dev/null; then # detect sysem-wide rvm installation rvm_ruby='%{$PR_RED%}‹$(rvm-prompt i v g s)›%{$PR_NO_COLOR%}' -else - if which rbenv &> /dev/null; then - rvm_ruby='%{$PR_RED%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$PR_NO_COLOR%}' - fi +elif which rbenv &> /dev/null; then # detect Simple Ruby Version management + rvm_ruby='%{$PR_RED%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$PR_NO_COLOR%}' fi local git_branch='$(git_prompt_info)%{$PR_NO_COLOR%}' diff --git a/themes/half-life.zsh-theme b/themes/half-life.zsh-theme new file mode 100644 index 000000000..c8d09ce47 --- /dev/null +++ b/themes/half-life.zsh-theme @@ -0,0 +1,99 @@ +# prompt style and colors based on Steve Losh's Prose theme: +# http://github.com/sjl/oh-my-zsh/blob/master/themes/prose.zsh-theme +# +# vcs_info modifications from Bart Trojanowski's zsh prompt: +# http://www.jukie.net/bart/blog/pimping-out-zsh-prompt +# +# git untracked files modification from Brian Carper: +# http://briancarper.net/blog/570/git-info-in-your-zsh-prompt + +function virtualenv_info { + [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' +} +PR_GIT_UPDATE=1 + +setopt prompt_subst +autoload colors +colors + +autoload -U add-zsh-hook +autoload -Uz vcs_info + +#use extended color pallete if available +if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then + turquoise="%F{81}" + orange="%F{166}" + purple="%F{135}" + hotpink="%F{161}" + limegreen="%F{118}" +else + turquoise="$fg[cyan]" + orange="$fg[yellow]" + purple="$fg[magenta]" + hotpink="$fg[red]" + limegreen="$fg[green]" +fi + +# enable VCS systems you use +zstyle ':vcs_info:*' enable git svn + +# check-for-changes can be really slow. +# you should disable it, if you work with large repositories +zstyle ':vcs_info:*:prompt:*' check-for-changes true + +# set formats +# %b - branchname +# %u - unstagedstr (see below) +# %c - stagedstr (see below) +# %a - action (e.g. rebase-i) +# %R - repository path +# %S - path in the repository +PR_RST="%{${reset_color}%}" +FMT_BRANCH=" on %{$turquoise%}%b%u%c${PR_RST}" +FMT_ACTION=" performing a %{$limegreen%}%a${PR_RST}" +FMT_UNSTAGED="%{$orange%}●" +FMT_STAGED="%{$limegreen%}●" + +zstyle ':vcs_info:*:prompt:*' unstagedstr "${FMT_UNSTAGED}" +zstyle ':vcs_info:*:prompt:*' stagedstr "${FMT_STAGED}" +zstyle ':vcs_info:*:prompt:*' actionformats "${FMT_BRANCH}${FMT_ACTION}" +zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH}" +zstyle ':vcs_info:*:prompt:*' nvcsformats "" + + +function steeef_preexec { + case "$(history $HISTCMD)" in + *git*) + PR_GIT_UPDATE=1 + ;; + *svn*) + PR_GIT_UPDATE=1 + ;; + esac +} +add-zsh-hook preexec steeef_preexec + +function steeef_chpwd { + PR_GIT_UPDATE=1 +} +add-zsh-hook chpwd steeef_chpwd + +function steeef_precmd { + if [[ -n "$PR_GIT_UPDATE" ]] ; then + # check for untracked files or updated submodules, since vcs_info doesn't + if [[ ! -z $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then + PR_GIT_UPDATE=1 + FMT_BRANCH="${PM_RST} on %{$turquoise%}%b%u%c%{$hotpink%}●${PR_RST}" + else + FMT_BRANCH="${PM_RST} on %{$turquoise%}%b%u%c${PR_RST}" + fi + zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH}" + + vcs_info 'prompt' + PR_GIT_UPDATE= + fi +} +add-zsh-hook precmd steeef_precmd + +PROMPT=$' +%{$purple%}%n%{$reset_color%} in %{$limegreen%}%~%{$reset_color%}$(rvm-prompt " with%{$fg[red]%} " v g "%{$reset_color%}")$vcs_info_msg_0_%{$orange%} λ%{$reset_color%} ' diff --git a/themes/intheloop.zsh-theme b/themes/intheloop.zsh-theme index 85b4a4d95..7a98db27a 100644 --- a/themes/intheloop.zsh-theme +++ b/themes/intheloop.zsh-theme @@ -1,4 +1,3 @@ -# ZSH theme by James Smith (http://loopj.com) # A multiline prompt with username, hostname, full path, return status, git branch, git dirty status, git remote status local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}" @@ -21,4 +20,4 @@ ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[grey]%}) %{$fg[yellow]%}⚡%{$reset_color%}" ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[grey]%})" ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE="%{$fg_bold[magenta]%}↓%{$reset_color%}" ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE="%{$fg_bold[magenta]%}↑%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE="%{$fg_bold[magenta]%}↕%{$reset_color%}"
\ No newline at end of file +ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE="%{$fg_bold[magenta]%}↕%{$reset_color%}" diff --git a/themes/itchy.zsh-theme b/themes/itchy.zsh-theme new file mode 100644 index 000000000..c23889edf --- /dev/null +++ b/themes/itchy.zsh-theme @@ -0,0 +1,18 @@ +# Inspired by http://peepcode.com/blog/2012/my-command-line-prompt + +local smiley="%(?,%{$fg[green]%}☺%{$reset_color%},%{$fg[red]%}☹%{$reset_color%})" + +local user="%{$fg[cyan]%}%n%{$reset_color%}" +local host="%{$fg[cyan]%}@%m%{$reset_color%}" +local pwd="%{$fg[yellow]%}%~%{$reset_color%}" + +PROMPT='${user}${host} ${pwd} +${smiley} ' + +RPROMPT='$(rvm-prompt || rbenv version) %{$fg[white]%}$(git_prompt_info)%{$reset_color%}' + +ZSH_THEME_GIT_PROMPT_PREFIX="" +ZSH_THEME_GIT_PROMPT_SUFFIX="" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%} ✗%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%} ✔%{$reset_color%}" + diff --git a/themes/jaischeema.zsh-theme b/themes/jaischeema.zsh-theme new file mode 100644 index 000000000..da1dd1e5d --- /dev/null +++ b/themes/jaischeema.zsh-theme @@ -0,0 +1,16 @@ +# jaischeema.zsh-theme + +PROMPT='%{$fg_bold[magenta]%}%m%{$reset_color%} at %{$fg_bold[green]%}%~%{$reset_color%} %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}% %{$reset_color%}%{$fg[red]%}❯%{$reset_color%} ' + +ZSH_THEME_GIT_PROMPT_PREFIX="±(%{$fg[red]%}" +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]%}) " + +if which rbenv &> /dev/null; then + RPROMPT='%{$fg[red]%}$(rbenv version | sed -e "s/ (set.*$//")%{$reset_color%}' +else + if which rvm-prompt &> /dev/null; then + RPROMPT='%{$fg[red]%}$(rvm-prompt)%{$reset_color%}' + fi +fi diff --git a/themes/jonathan.zsh-theme b/themes/jonathan.zsh-theme index 9f0f30271..bca92970c 100644 --- a/themes/jonathan.zsh-theme +++ b/themes/jonathan.zsh-theme @@ -71,17 +71,30 @@ setprompt () { ### # See if we can use extended characters to look nicer. - - typeset -A altchar - set -A altchar ${(s..)terminfo[acsc]} - PR_SET_CHARSET="%{$terminfo[enacs]%}" - PR_SHIFT_IN="%{$terminfo[smacs]%}" - PR_SHIFT_OUT="%{$terminfo[rmacs]%}" - PR_HBAR=${altchar[q]:--} - PR_ULCORNER=${altchar[l]:--} - PR_LLCORNER=${altchar[m]:--} - PR_LRCORNER=${altchar[j]:--} - PR_URCORNER=${altchar[k]:--} + # UTF-8 Fixed + + if [[ $(locale charmap) == "UTF-8" ]]; then + PR_SET_CHARSET="" + PR_SHIFT_IN="" + PR_SHIFT_OUT="" + PR_HBAR="─" + PR_ULCORNER="┌" + PR_LLCORNER="└" + PR_LRCORNER="┘" + PR_URCORNER="┐" + else + typeset -A altchar + set -A altchar ${(s..)terminfo[acsc]} + # Some stuff to help us draw nice lines + PR_SET_CHARSET="%{$terminfo[enacs]%}" + PR_SHIFT_IN="%{$terminfo[smacs]%}" + PR_SHIFT_OUT="%{$terminfo[rmacs]%}" + PR_HBAR='$PR_SHIFT_IN${altchar[q]:--}$PR_SHIFT_OUT' + PR_ULCORNER='$PR_SHIFT_IN${altchar[l]:--}$PR_SHIFT_OUT' + PR_LLCORNER='$PR_SHIFT_IN${altchar[m]:--}$PR_SHIFT_OUT' + PR_LRCORNER='$PR_SHIFT_IN${altchar[j]:--}$PR_SHIFT_OUT' + PR_URCORNER='$PR_SHIFT_IN${altchar[k]:--}$PR_SHIFT_OUT' + fi ### @@ -113,31 +126,31 @@ setprompt () { # Finally, the prompt. PROMPT='$PR_SET_CHARSET$PR_STITLE${(e)PR_TITLEBAR}\ -$PR_CYAN$PR_SHIFT_IN$PR_ULCORNER$PR_HBAR$PR_SHIFT_OUT$PR_GREY(\ +$PR_CYAN$PR_ULCORNER$PR_HBAR$PR_GREY(\ $PR_GREEN%$PR_PWDLEN<...<%~%<<\ -$PR_GREY)`rvm_prompt_info || rbenv_prompt_info`$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_HBAR${(e)PR_FILLBAR}$PR_HBAR$PR_SHIFT_OUT$PR_GREY(\ +$PR_GREY)`rvm_prompt_info || rbenv_prompt_info`$PR_CYAN$PR_HBAR$PR_HBAR${(e)PR_FILLBAR}$PR_HBAR$PR_GREY(\ $PR_CYAN%(!.%SROOT%s.%n)$PR_GREY@$PR_GREEN%m:%l\ -$PR_GREY)$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_URCORNER$PR_SHIFT_OUT\ +$PR_GREY)$PR_CYAN$PR_HBAR$PR_URCORNER\ -$PR_CYAN$PR_SHIFT_IN$PR_LLCORNER$PR_BLUE$PR_HBAR$PR_SHIFT_OUT(\ +$PR_CYAN$PR_LLCORNER$PR_BLUE$PR_HBAR(\ $PR_YELLOW%D{%H:%M:%S}\ -$PR_LIGHT_BLUE%{$reset_color%}`git_prompt_info``git_prompt_status`$PR_BLUE)$PR_CYAN$PR_SHIFT_IN$PR_HBAR\ -$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\ +$PR_LIGHT_BLUE%{$reset_color%}`git_prompt_info``git_prompt_status`$PR_BLUE)$PR_CYAN$PR_HBAR\ +$PR_HBAR\ >$PR_NO_COLOUR ' # display exitcode on the right when >0 return_code="%(?..%{$fg[red]%}%? ↵ %{$reset_color%})" - RPROMPT=' $return_code$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_BLUE$PR_HBAR$PR_SHIFT_OUT\ -($PR_YELLOW%D{%a,%b%d}$PR_BLUE)$PR_SHIFT_IN$PR_HBAR$PR_CYAN$PR_LRCORNER$PR_SHIFT_OUT$PR_NO_COLOUR' + RPROMPT=' $return_code$PR_CYAN$PR_HBAR$PR_BLUE$PR_HBAR\ +($PR_YELLOW%D{%a,%b%d}$PR_BLUE)$PR_HBAR$PR_CYAN$PR_LRCORNER$PR_NO_COLOUR' - PS2='$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\ -$PR_BLUE$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT(\ -$PR_LIGHT_GREEN%_$PR_BLUE)$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\ -$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT$PR_NO_COLOUR ' + PS2='$PR_CYAN$PR_HBAR\ +$PR_BLUE$PR_HBAR(\ +$PR_LIGHT_GREEN%_$PR_BLUE)$PR_HBAR\ +$PR_CYAN$PR_HBAR$PR_NO_COLOUR ' } setprompt autoload -U add-zsh-hook add-zsh-hook precmd theme_precmd -add-zsh-hook preexec theme_preexec
\ No newline at end of file +add-zsh-hook preexec theme_preexec diff --git a/themes/josh.zsh-theme b/themes/josh.zsh-theme index 142e76838..12dfe4069 100644 --- a/themes/josh.zsh-theme +++ b/themes/josh.zsh-theme @@ -31,7 +31,7 @@ function josh_prompt { prompt=" $prompt" done - prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info || rbenv_prompt_info)%{$reset_color%} $(git_prompt_info)" + prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info || rbenv_prompt_info)%{$reset_color%} $(current_branch)" echo $prompt } diff --git a/themes/juanghurtado.zsh-theme b/themes/juanghurtado.zsh-theme index 2f715cc9e..bc470e838 100644 --- a/themes/juanghurtado.zsh-theme +++ b/themes/juanghurtado.zsh-theme @@ -1,7 +1,4 @@ -# ------------------------------------------------------------------------ -# Juan G. Hurtado oh-my-zsh theme -# (Needs Git plugin for current_branch method) -# ------------------------------------------------------------------------ +# Needs Git plugin for current_branch method # Color shortcuts RED=$fg[red] @@ -43,4 +40,4 @@ ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$WHITE%}]" PROMPT=' %{$GREEN_BOLD%}%n@%m%{$WHITE%}:%{$YELLOW%}%~%u$(parse_git_dirty)$(git_prompt_ahead)%{$RESET_COLOR%} %{$BLUE%}>%{$RESET_COLOR%} ' -RPROMPT='%{$GREEN_BOLD%}$(current_branch)$(git_prompt_short_sha)$(git_prompt_status)%{$RESET_COLOR%}'
\ No newline at end of file +RPROMPT='%{$GREEN_BOLD%}$(current_branch)$(git_prompt_short_sha)$(git_prompt_status)%{$RESET_COLOR%}' diff --git a/themes/junkfood.zsh-theme b/themes/junkfood.zsh-theme index 57b4070dc..01fae4b95 100644 --- a/themes/junkfood.zsh-theme +++ b/themes/junkfood.zsh-theme @@ -1,8 +1,4 @@ -# ------------------------------------------------------------------------ -# Tyler Cipriani -# oh-my-zsh theme # Totally ripped off Dallas theme -# ------------------------------------------------------------------------ # Grab the current date (%W) and time (%t): JUNKFOOD_TIME_="%{$fg_bold[red]%}#%{$fg_bold[white]%}( %{$fg_bold[yellow]%}%W%{$reset_color%}@%{$fg_bold[white]%}%t )( %{$reset_color%}" diff --git a/themes/kiwi.zsh-theme b/themes/kiwi.zsh-theme new file mode 100644 index 000000000..f93de2b75 --- /dev/null +++ b/themes/kiwi.zsh-theme @@ -0,0 +1,12 @@ +# +# Kiwi ZSH Theme +# + +PROMPT='%{$fg_bold[green]%}┌[%{$fg_bold[cyan]%}kiwish-4.2%{$fg_bold[green]%}]-(%{$fg_bold[white]%}%2~%{$fg_bold[green]%})-$(git_prompt_info)$(svn_prompt_info)$(battery_pct_prompt) +└> % %{$reset_color%}' + +ZSH_THEME_GIT_PROMPT_PREFIX="[%{$reset_color%}%{$fg[white]%}git:%{$fg_bold[white]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg_bold[green]%}]-" + +ZSH_THEME_SVN_PROMPT_PREFIX="[%{$reset_color%}%{$fg[white]%}svn:%{$fg_bold[white]%}/" +ZSH_THEME_SVN_PROMPT_SUFFIX="%{$fg_bold[green]%}]-" diff --git a/themes/kphoen.zsh-theme b/themes/kphoen.zsh-theme index 0e9b5e73c..8e8894a34 100644 --- a/themes/kphoen.zsh-theme +++ b/themes/kphoen.zsh-theme @@ -1,11 +1,4 @@ -# ------------------------------------------------------------------------------ -# FILE: kphoen.zsh-theme -# DESCRIPTION: oh-my-zsh theme file. -# AUTHOR: Kévin Gomez (geek63@gmail.com) -# VERSION: 1.0.0 -# SCREENSHOT: -# ------------------------------------------------------------------------------ - +# kphoen.zsh-theme if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then PROMPT='[%{$fg[red]%}%n%{$reset_color%}@%{$fg[magenta]%}%m%{$reset_color%}:%{$fg[blue]%}%~%{$reset_color%}$(git_prompt_info)] diff --git a/themes/linuxonly b/themes/linuxonly.zsh-theme index a11b80d7f..a11b80d7f 100644 --- a/themes/linuxonly +++ b/themes/linuxonly.zsh-theme diff --git a/themes/macovsky-ruby.zsh-theme b/themes/macovsky-ruby.zsh-theme index 045376761..69d80d588 100644 --- a/themes/macovsky-ruby.zsh-theme +++ b/themes/macovsky-ruby.zsh-theme @@ -1,7 +1,7 @@ # ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" -if which rvm-prompt &> /dev/null; then +if [ -e ~/.rvm/bin/rvm-prompt ]; then PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' else if which rbenv &> /dev/null; then diff --git a/themes/macovsky.zsh-theme b/themes/macovsky.zsh-theme index b6978b929..2e6dce42d 100644 --- a/themes/macovsky.zsh-theme +++ b/themes/macovsky.zsh-theme @@ -1,7 +1,7 @@ # ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" -if which rvm-prompt &> /dev/null; then +if [ -e ~/.rvm/bin/rvm-prompt ]; then PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' else if which rbenv &> /dev/null; then diff --git a/themes/michelebologna.zsh-theme b/themes/michelebologna.zsh-theme new file mode 100644 index 000000000..ef4c6d740 --- /dev/null +++ b/themes/michelebologna.zsh-theme @@ -0,0 +1,44 @@ +# reference colors +GREEN="%{$fg_bold[green]%}" +RED="%{$fg_bold[red]%}" +CYAN="%{$fg_bold[cyan]%}" +YELLOW="%{$fg_bold[yellow]%}" +BLUE="%{$fg_bold[blue]%}" +MAGENTA="%{$fg_bold[magenta]%}" +WHITE="%{$fg_bold[white]%}" + +COLOR_ARRAY=($GREEN $RED $CYAN $YELLOW $BLUE $MAGENTA $WHITE) + +# color reset +RESET_COLOR="%{$reset_color%}" + +# which color should be applied? +USERNAME_NORMAL_COLOR=$WHITE +USERNAME_ROOT_COLOR=$RED +HOSTNAME_NORMAL_COLOR=$BLUE +# uncomment next line if you want auto-generated hostname color +#for i in `hostname`; HOSTNAME_NORMAL_COLOR=$COLOR_ARRAY[$[((#i))%7+1]] +HOSTNAME_ROOT_COLOR=$RED +HOSTNAME_COLOR=%(!.$HOSTNAME_ROOT_COLOR.$HOSTNAME_NORMAL_COLOR) +CURRENT_DIR_COLOR=$CYAN + +# zsh commands +USERNAME_COMMAND="%n" +HOSTNAME_COMMAND="%m" +CURRENT_DIR="%~" + +# output: colors + commands +USERNAME_OUTPUT="%(!..$USERNAME_NORMAL_COLOR$USERNAME_COMMAND$RESET_COLOR@)" +HOSTNAME_OUTPUT="$HOSTNAME_COLOR$HOSTNAME_COMMAND$RESET_COLOR" +CURRENT_DIR_OUTPUT="$CURRENT_DIR_COLOR$CURRENT_DIR" +LAST_COMMAND_OUTPUT="%(?.%(!.$RED.$GREEN).$YELLOW)" + +# git theming +ZSH_THEME_GIT_PROMPT_PREFIX="(" +ZSH_THEME_GIT_PROMPT_SUFFIX="" +ZSH_THEME_GIT_PROMPT_DIRTY=")$RED*" +ZSH_THEME_GIT_PROMPT_CLEAN=")" + +# wrap all together +PROMPT='$USERNAME_OUTPUT$HOSTNAME_OUTPUT:$CURRENT_DIR_OUTPUT $LAST_COMMAND_OUTPUT%#$RESET_COLOR ' +RPROMPT='%1(j.fg: [%j].) $GREEN$(git_prompt_info)$RESET_COLOR [%@]' diff --git a/themes/peepcode.zsh-theme b/themes/peepcode.zsh-theme new file mode 100644 index 000000000..ca2a8862f --- /dev/null +++ b/themes/peepcode.zsh-theme @@ -0,0 +1,44 @@ +# +# Based on Geoffrey Grosenbach's peepcode zsh theme from +# https://github.com/topfunky/zsh-simple +# + +git_repo_path() { + git rev-parse --git-dir 2>/dev/null +} + +git_commit_id() { + git rev-parse --short HEAD 2>/dev/null +} + +git_mode() { + if [[ -e "$repo_path/BISECT_LOG" ]]; then + echo "+bisect" + elif [[ -e "$repo_path/MERGE_HEAD" ]]; then + echo "+merge" + elif [[ -e "$repo_path/rebase" || -e "$repo_path/rebase-apply" || -e "$repo_path/rebase-merge" || -e "$repo_path/../.dotest" ]]; then + echo "+rebase" + fi +} + +git_dirty() { + if [[ "$repo_path" != '.' && `git ls-files -m` != "" ]]; then + echo " %{$fg_bold[grey]%}✗%{$reset_color%}" + fi +} + +git_prompt() { + local cb=$(current_branch) + if [ -n "$cb" ]; then + local repo_path=$(git_repo_path) + echo " %{$fg_bold[grey]%}$cb %{$fg[white]%}$(git_commit_id)%{$reset_color%}$(git_mode)$(git_dirty)" + fi +} + +local smiley="%(?,%{$fg[green]%}☺%{$reset_color%},%{$fg[red]%}☹%{$reset_color%})" + +PROMPT=' +%~ +${smiley} %{$reset_color%}' + +RPROMPT='%{$fg[white]%} $(~/.rvm/bin/rvm-prompt)$(git_prompt)%{$reset_color%}' diff --git a/themes/pure.zsh-theme b/themes/pure.zsh-theme new file mode 100644 index 000000000..1473194a5 --- /dev/null +++ b/themes/pure.zsh-theme @@ -0,0 +1,106 @@ +#!/usr/bin/env zsh + +# ------------------------------------------------------------------------------ +# +# Pure - A minimal and beautiful theme for oh-my-zsh +# +# Based on the custom Zsh-prompt of the same name by Sindre Sorhus. A huge +# thanks goes out to him for designing the fantastic Pure prompt in the first +# place! I'd also like to thank Julien Nicoulaud for his "nicoulaj" theme from +# which I've borrowed both some ideas and some actual code. You can find out +# more about both of these fantastic two people here: +# +# Sindre Sorhus +# Github: https://github.com/sindresorhus +# Twitter: https://twitter.com/sindresorhus +# +# Julien Nicoulaud +# Github: https://github.com/nicoulaj +# Twitter: https://twitter.com/nicoulaj +# +# ------------------------------------------------------------------------------ + +# Set required options +# +setopt prompt_subst + +# Load required modules +# +autoload -Uz vcs_info + +# Set vcs_info parameters +# +zstyle ':vcs_info:*' enable hg bzr git +zstyle ':vcs_info:*:*' unstagedstr '!' +zstyle ':vcs_info:*:*' stagedstr '+' +zstyle ':vcs_info:*:*' formats "$FX[bold]%r$FX[no-bold]/%S" "%s/%b" "%%u%c" +zstyle ':vcs_info:*:*' actionformats "$FX[bold]%r$FX[no-bold]/%S" "%s/%b" "%u%c (%a)" +zstyle ':vcs_info:*:*' nvcsformats "%~" "" "" + +# Fastest possible way to check if repo is dirty +# +git_dirty() { + # Check if we're in a git repo + command git rev-parse --is-inside-work-tree &>/dev/null || return + # Check if it's dirty + command git diff --quiet --ignore-submodules HEAD &>/dev/null; [ $? -eq 1 ] && echo "*" +} + +# Display information about the current repository +# +repo_information() { + echo "%F{blue}${vcs_info_msg_0_%%/.} %F{8}$vcs_info_msg_1_`git_dirty` $vcs_info_msg_2_%f" +} + +# Displays the exec time of the last command if set threshold was exceeded +# +cmd_exec_time() { + local stop=`date +%s` + local start=${cmd_timestamp:-$stop} + let local elapsed=$stop-$start + [ $elapsed -gt 5 ] && echo ${elapsed}s +} + +# Get the intial timestamp for cmd_exec_time +# +preexec() { + cmd_timestamp=`date +%s` +} + +# Output additional information about paths, repos and exec time +# +precmd() { + vcs_info # Get version control info before we start outputting stuff + print -P "\n$(repo_information) %F{yellow}$(cmd_exec_time)%f" +} + +# Define prompts +# +PROMPT="%(?.%F{magenta}.%F{red})❯%f " # Display a red prompt char on failure +RPROMPT="%F{8}${SSH_TTY:+%n@%m}%f" # Display username if connected via SSH + +# ------------------------------------------------------------------------------ +# +# List of vcs_info format strings: +# +# %b => current branch +# %a => current action (rebase/merge) +# %s => current version control system +# %r => name of the root directory of the repository +# %S => current path relative to the repository root directory +# %m => in case of Git, show information about stashes +# %u => show unstaged changes in the repository +# %c => show staged changes in the repository +# +# List of prompt format strings: +# +# prompt: +# %F => color dict +# %f => reset color +# %~ => current path +# %* => time +# %n => username +# %m => shortname host +# %(?..) => prompt conditional - %(condition.true.false) +# +# ------------------------------------------------------------------------------ diff --git a/themes/pygmalion.zsh-theme b/themes/pygmalion.zsh-theme index cf3bb908f..654e0fc37 100644 --- a/themes/pygmalion.zsh-theme +++ b/themes/pygmalion.zsh-theme @@ -1,9 +1,34 @@ # Yay! High voltage and arrows! -ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="" +prompt_setup_pygmalion(){ + ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" + ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " + ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}" + ZSH_THEME_GIT_PROMPT_CLEAN="" + + base_prompt='%{$fg[magenta]%}%n%{$reset_color%}%{$fg[cyan]%}@%{$reset_color%}%{$fg[yellow]%}%m%{$reset_color%}%{$fg[red]%}:%{$reset_color%}%{$fg[cyan]%}%0~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}' + post_prompt='%{$fg[cyan]%}⇒%{$reset_color%} ' + + base_prompt_nocolor=$(echo "$base_prompt" | perl -pe "s/%\{[^}]+\}//g") + post_prompt_nocolor=$(echo "$post_prompt" | perl -pe "s/%\{[^}]+\}//g") + + add-zsh-hook precmd prompt_pygmalion_precmd +} + +prompt_pygmalion_precmd(){ + local gitinfo=$(git_prompt_info) + local gitinfo_nocolor=$(echo "$gitinfo" | perl -pe "s/%\{[^}]+\}//g") + local exp_nocolor="$(print -P \"$base_prompt_nocolor$gitinfo_nocolor$post_prompt_nocolor\")" + local prompt_length=${#exp_nocolor} + + local nl="" + + if [[ $prompt_length -gt 40 ]]; then + nl=$'\n%{\r%}'; + fi + PROMPT="$base_prompt$gitinfo$nl$post_prompt" +} + +prompt_setup_pygmalion -PROMPT='%{$fg[magenta]%}%n%{$reset_color%}%{$fg[cyan]%}@%{$reset_color%}%{$fg[yellow]%}%m%{$reset_color%}%{$fg[red]%}:%{$reset_color%}%{$fg[cyan]%}%0~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}$(git_prompt_info)%{$fg[cyan]%}⇒%{$reset_color%} ' diff --git a/themes/rixius.zsh-theme b/themes/rixius.zsh-theme index c0c5c9c71..b33f23e1c 100644 --- a/themes/rixius.zsh-theme +++ b/themes/rixius.zsh-theme @@ -1,6 +1,3 @@ -# /|/ Code by Stephen -# /|/ "Rixius" Middleton -# # name in folder (github) # ± if in github repo, or ≥ if otherwise Time in 24-hour format is on right. function collapse_pwd { diff --git a/themes/rkj-repos.zsh-theme b/themes/rkj-repos.zsh-theme index 318c315bb..6289427c2 100644 --- a/themes/rkj-repos.zsh-theme +++ b/themes/rkj-repos.zsh-theme @@ -18,12 +18,17 @@ ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%}✂" ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%}✈" function mygit() { - ref=$(git symbolic-ref HEAD 2> /dev/null) || return - echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$( git_prompt_status )%{$reset_color%}$ZSH_THEME_GIT_PROMPT_SUFFIX" + ref1=$(git symbolic-ref HEAD 2> /dev/null) || return + ref2=$(git rev-parse HEAD | head -c 6) || return + ref="$ref1 %{$fg[grey]%}$ref2" + #ref=$(git symbolic-ref HEAD 2> /dev/null) $(git rev-parse HEAD | head -c 6) || return + echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$( git_prompt_status )%{$reset_color%}$ZSH_THEME_GIT_PROMPT_SUFFIX " } +function retcode() {} + # alternate prompt with git & hg PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} -%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <$(mygit)$(hg_prompt_info)>%{\e[0m%}%b ' +%{\e[0;34m%}%B└─%B[%{\e[1;35m%}%?$(retcode)%{\e[0;34m%}%B] <$(mygit)$(hg_prompt_info)>%{\e[0m%}%b ' PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' diff --git a/themes/rkj.zsh-theme b/themes/rkj.zsh-theme index 81b701e07..fe06161c8 100644 --- a/themes/rkj.zsh-theme +++ b/themes/rkj.zsh-theme @@ -2,7 +2,8 @@ # on two lines for easier vgrepping # entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 -PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} -%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B]%{\e[0m%}%b ' +function retcode() {} +PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} +%{\e[0;34m%}%B└─%B[%{\e[1;35m%}%?$(retcode)%{\e[0;34m%}%B]%{\e[0m%}%b ' diff --git a/themes/robbyrussell.zsh-theme b/themes/robbyrussell.zsh-theme index 7b524e82d..24e1e8c52 100644 --- a/themes/robbyrussell.zsh-theme +++ b/themes/robbyrussell.zsh-theme @@ -1,4 +1,5 @@ -PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' +local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)" +PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" diff --git a/themes/smt.zsh-theme b/themes/smt.zsh-theme index 7a287523e..f2b0526b7 100644 --- a/themes/smt.zsh-theme +++ b/themes/smt.zsh-theme @@ -1,10 +1,4 @@ -# ----------------------------------------------------------------------------- -# FILE: smt.zsh-theme -# DESCRIPTION: oh-my-zsh theme file, based on dogenpunk by Matthew Nelson. -# AUTHOR: Stephen Tudor (stephen@tudorstudio.com -# VERSION: 0.1 -# SCREENSHOT: coming soon -# ----------------------------------------------------------------------------- +# smt.zsh-theme, based on dogenpunk by Matthew Nelson. MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}" local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%} " @@ -29,6 +23,7 @@ ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$reset_color%}" function prompt_char() { git branch >/dev/null 2>/dev/null && echo "%{$fg[green]%}±%{$reset_color%}" && return hg root >/dev/null 2>/dev/null && echo "%{$fg_bold[red]%}☿%{$reset_color%}" && return + darcs show repo >/dev/null 2>/dev/null && echo "%{$fg_bold[green]%}❉%{$reset_color%}" && return echo "%{$fg[cyan]%}◯%{$reset_color%}" } diff --git a/themes/sonicradish.zsh-theme b/themes/sonicradish.zsh-theme new file mode 100644 index 000000000..508611830 --- /dev/null +++ b/themes/sonicradish.zsh-theme @@ -0,0 +1,37 @@ +#!/usr/bin/env zsh +#local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" + +setopt promptsubst + +autoload -U add-zsh-hook +ROOT_ICON_COLOR=$FG[111] +MACHINE_NAME_COLOR=$FG[208] +PROMPT_SUCCESS_COLOR=$FG[103] +PROMPT_FAILURE_COLOR=$FG[124] +PROMPT_VCS_INFO_COLOR=$FG[242] +PROMPT_PROMPT=$FG[208] +GIT_DIRTY_COLOR=$FG[124] +GIT_CLEAN_COLOR=$FG[148] +GIT_PROMPT_INFO=$FG[148] + +# Hash +ROOT_ICON="# " +if [[ $EUID -ne 0 ]] ; then + ROOT_ICON="" +fi + +PROMPT='%{$ROOT_ICON_COLOR%}$ROOT_ICON%{$reset_color%}%{$MACHINE_NAME_COLOR%}%m➜ %{$reset_color%}%{$PROMPT_SUCCESS_COLOR%}%c%{$reset_color%} %{$GIT_PROMPT_INFO%}$(git_prompt_info)%{$GIT_DIRTY_COLOR%}$(git_prompt_status) %{$reset_color%}%{$PROMPT_PROMPT%}ᐅ %{$reset_color%} ' + +#RPS1="${return_code}" + +ZSH_THEME_GIT_PROMPT_PREFIX=": " +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$GIT_PROMPT_INFO%} :" +ZSH_THEME_GIT_PROMPT_DIRTY=" %{$GIT_DIRTY_COLOR%}✘" +ZSH_THEME_GIT_PROMPT_CLEAN=" %{$GIT_CLEAN_COLOR%}✔" + +ZSH_THEME_GIT_PROMPT_ADDED="%{$FG[103]%}✚%{$rset_color%}" +ZSH_THEME_GIT_PROMPT_MODIFIED="%{$FG[103]%}✹%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DELETED="%{$FG[103]%}✖%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_RENAMED="%{$FG[103]%}➜%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_UNMERGED="%{$FG[103]%}═%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$FG[103]%}✭%{$reset_color%}" diff --git a/themes/sorin.zsh-theme b/themes/sorin.zsh-theme index 601dbe5d7..ac6a49840 100644 --- a/themes/sorin.zsh-theme +++ b/themes/sorin.zsh-theme @@ -1,11 +1,5 @@ -# ------------------------------------------------------------------------------ -# FILE: sorin.zsh-theme -# DESCRIPTION: oh-my-zsh theme file. -# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com) -# VERSION: 1.0.2 -# SCREENSHOT: http://i.imgur.com/aipDQ.png -# ------------------------------------------------------------------------------ - +# sorin.zsh-theme +# screenshot: http://i.imgur.com/aipDQ.png if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}" diff --git a/themes/steeef.zsh-theme b/themes/steeef.zsh-theme index 312229e9f..e0080b8a5 100644 --- a/themes/steeef.zsh-theme +++ b/themes/steeef.zsh-theme @@ -8,7 +8,7 @@ # http://briancarper.net/blog/570/git-info-in-your-zsh-prompt function virtualenv_info { - [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' + [ $VIRTUAL_ENV ] && echo '('$fg[blue]`basename $VIRTUAL_ENV`%{$reset_color%}') ' } PR_GIT_UPDATE=1 @@ -87,7 +87,7 @@ function steeef_precmd { else FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})" fi - zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH}" + zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH} " vcs_info 'prompt' PR_GIT_UPDATE= @@ -96,5 +96,5 @@ function steeef_precmd { add-zsh-hook precmd steeef_precmd PROMPT=$' -%{$purple%}%n%{$reset_color%} at %{$orange%}%m%{$reset_color%} in %{$limegreen%}%~%{$reset_color%} $vcs_info_msg_0_ -$(virtualenv_info)$ ' +%{$purple%}%n%{$reset_color%} at %{$orange%}%m%{$reset_color%} in %{$limegreen%}%~%{$reset_color%} $vcs_info_msg_0_$(virtualenv_info)%{$reset_color%} +$ ' diff --git a/themes/sunrise.zsh-theme b/themes/sunrise.zsh-theme index 88b371d79..4bea20a1b 100644 --- a/themes/sunrise.zsh-theme +++ b/themes/sunrise.zsh-theme @@ -1,20 +1,17 @@ -#------------------------------------------------------------------------------- -# Sunrise theme for oh-my-zsh by Adam Lindberg (eproxus@gmail.com) +# Sunrise theme for oh-my-zsh # Intended to be used with Solarized: http://ethanschoonover.com/solarized # (Needs Git plugin for current_branch method) -#------------------------------------------------------------------------------- # Color shortcuts -R=$fg[red] -G=$fg[green] -M=$fg[magenta] -RB=$fg_bold[red] -YB=$fg_bold[yellow] -BB=$fg_bold[blue] +R=$fg_no_bold[red] +G=$fg_no_bold[green] +M=$fg_no_bold[magenta] +Y=$fg_no_bold[yellow] +B=$fg_no_bold[blue] RESET=$reset_color if [ "$(whoami)" = "root" ]; then - PROMPTCOLOR="%{$RB%}" PREFIX="-!-"; + PROMPTCOLOR="%{$R%}" PREFIX="-!-"; else PROMPTCOLOR="" PREFIX="---"; fi @@ -73,13 +70,14 @@ function custom_git_prompt() { PROMPT='%B$PREFIX %2~ $(custom_git_prompt)%{$M%}%B»%b%{$RESET%} ' RPS1="${return_code}" -ZSH_THEME_GIT_PROMPT_PREFIX="%{$YB%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$YB%}›%{$RESET%} " +ZSH_THEME_GIT_PROMPT_PREFIX="%{$Y%}‹" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$Y%}›%{$RESET%} " ZSH_THEME_GIT_PROMPT_DIRTY="%{$R%}*" ZSH_THEME_GIT_PROMPT_CLEAN="" -ZSH_THEME_GIT_PROMPT_AHEAD="%{$BB%}➔" +ZSH_THEME_GIT_PROMPT_AHEAD="%{$B%}➔" + ZSH_THEME_GIT_STATUS_PREFIX=" " @@ -90,7 +88,7 @@ ZSH_THEME_GIT_PROMPT_STAGED_RENAMED="%{$G%}R" ZSH_THEME_GIT_PROMPT_STAGED_DELETED="%{$G%}D" # Not-staged -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$R%}⁇" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$R%}?" ZSH_THEME_GIT_PROMPT_MODIFIED="%{$R%}M" ZSH_THEME_GIT_PROMPT_DELETED="%{$R%}D" ZSH_THEME_GIT_PROMPT_UNMERGED="%{$R%}UU" diff --git a/themes/superjarin.zsh-theme b/themes/superjarin.zsh-theme index 0be816de0..2920d17a2 100644 --- a/themes/superjarin.zsh-theme +++ b/themes/superjarin.zsh-theme @@ -1,5 +1,5 @@ # Grab the current version of ruby in use (via RVM): [ruby-1.8.7] -if which rvm-prompt &> /dev/null; then +if [ -e ~/.rvm/bin/rvm-prompt ]; then JARIN_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}" else if which rbenv &> /dev/null; then @@ -11,13 +11,13 @@ fi # Append the current git branch, if in a git repository JARIN_CURRENT_LOCA_="%{$fg_bold[cyan]%}%~\$(git_prompt_info)%{$reset_color%}" ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%} <%{$fg[magenta]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[white]%}" # Do nothing if the branch is clean (no changes). -ZSH_THEME_GIT_PROMPT_CLEAN="%{$reset_color%}>" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[white]%}>" # Add a yellow ✗ if the branch is dirty -ZSH_THEME_GIT_PROMPT_DIRTY="%{$reset_color%}> %{$fg[yellow]%}✗" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[white]%}> %{$fg[yellow]%}✗" # Put it all together! PROMPT="$JARIN_CURRENT_RUBY_ $JARIN_CURRENT_LOCA_ " diff --git a/themes/trapd00r.zsh-theme b/themes/trapd00r.zsh-theme index cba14c42c..cb1c43c56 100644 --- a/themes/trapd00r.zsh-theme +++ b/themes/trapd00r.zsh-theme @@ -1,5 +1,4 @@ -# Name: trapd00r zsh theme -# Author: Magnus Woldrich <m@japh.se> +# trapd00r.zsh-theme # # This theme needs a terminal supporting 256 colors as well as unicode. It also # needs the script that splits up the current path and makes it fancy as located diff --git a/themes/wedisagree.zsh-theme b/themes/wedisagree.zsh-theme index 7cb27934d..9bdbce40d 100644 --- a/themes/wedisagree.zsh-theme +++ b/themes/wedisagree.zsh-theme @@ -25,7 +25,7 @@ PROMPT='%{$fg[magenta]%}[%c] %{$reset_color%}' # The right-hand prompt -RPROMPT='${time} %{$fg[magenta]%}$(git_prompt_info)%{$reset_color%}$(git_prompt_status)%{$reset_color%}' +RPROMPT='${time} %{$fg[magenta]%}$(git_prompt_info)%{$reset_color%}$(git_prompt_status)%{$reset_color%}$(git_prompt_ahead)%{$reset_color%}' # Add this at the start of RPROMPT to include rvm info showing ruby-version@gemset-name # %{$fg[yellow]%}$(~/.rvm/bin/rvm-prompt)%{$reset_color%} @@ -46,6 +46,7 @@ ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ⚡" # ⓜ ⑁ ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" # ⓧ ⑂ ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%} ➜" # ⓡ ⑄ ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%} ♒" # ⓤ ⑊ +ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg[blue]%} 𝝙" # More symbols to choose from: # ☀ ✹ ☄ ♆ ♀ ♁ ♐ ♇ ♈ ♉ ♚ ♛ ♜ ♝ ♞ ♟ ♠ ♣ ⚢ ⚲ ⚳ ⚴ ⚥ ⚤ ⚦ ⚒ ⚑ ⚐ ♺ ♻ ♼ ☰ ☱ ☲ ☳ ☴ ☵ ☶ ☷ @@ -104,4 +105,4 @@ function git_time_since_commit() { echo "($(rvm_gemset)$COLOR~|" fi fi -}
\ No newline at end of file +} diff --git a/themes/ys.zsh-theme b/themes/ys.zsh-theme new file mode 100644 index 000000000..a44f295f4 --- /dev/null +++ b/themes/ys.zsh-theme @@ -0,0 +1,47 @@ +# Clean, simple, compatible and meaningful. +# Tested on Linux, Unix and Windows under ANSI colors. +# It is recommended to use with a dark background and the font Inconsolata. +# Colors: black, red, green, yellow, *blue, magenta, cyan, and white. +# +# http://ysmood.org/wp/2013/03/my-ys-terminal-theme/ +# Mar 2013 ys + +# Machine name. +function box_name { + [ -f ~/.box-name ] && cat ~/.box-name || hostname +} + +# Directory info. +local current_dir='${PWD/#$HOME/~}' + +# Git info. +local git_info='$(git_prompt_info)' +ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[white]%}on%{$reset_color%} git:%{$fg[cyan]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}x" +ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}o" + +# Prompt format: \n # USER at MACHINE in DIRECTORY on git:BRANCH STATE [TIME] \n $ +PROMPT=" +%{$terminfo[bold]$fg[blue]%}#%{$reset_color%} \ +%{$fg[cyan]%}%n \ +%{$fg[white]%}at \ +%{$fg[green]%}$(box_name) \ +%{$fg[white]%}in \ +%{$terminfo[bold]$fg[yellow]%}${current_dir}%{$reset_color%}\ +${git_info} \ +%{$fg[white]%}[%*] +%{$terminfo[bold]$fg[red]%}$ %{$reset_color%}" + +if [[ "$(whoami)" == "root" ]]; then +PROMPT=" +%{$terminfo[bold]$fg[blue]%}#%{$reset_color%} \ +%{$bg[yellow]%}%{$fg[cyan]%}%n%{$reset_color%} \ +%{$fg[white]%}at \ +%{$fg[green]%}$(box_name) \ +%{$fg[white]%}in \ +%{$terminfo[bold]$fg[yellow]%}${current_dir}%{$reset_color%}\ +${git_info} \ +%{$fg[white]%}[%*] +%{$terminfo[bold]$fg[red]%}$ %{$reset_color%}" +fi diff --git a/themes/zhann.zsh-theme b/themes/zhann.zsh-theme index 574e0cec3..5c0854730 100644 --- a/themes/zhann.zsh-theme +++ b/themes/zhann.zsh-theme @@ -1,15 +1,25 @@ -PROMPT='%{$fg_bold[green]%}%p %{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' +autoload -U colors && colors -if which rvm-prompt &> /dev/null; then - RPROMPT='%{$reset_color%} %{$fg[red]%}$(~/.rvm/bin/rvm-prompt i v g) %{$reset_color%}' -else - if which rbenv &> /dev/null; then - RPROMPT='%{$reset_color%} %{$fg[red]%}$(rbenv version | sed -e "s/ (set.*$//") %{$reset_color%}' - fi -fi +autoload -Uz vcs_info +zstyle ':vcs_info:*' stagedstr '%F{green}●' +zstyle ':vcs_info:*' unstagedstr '%F{yellow}●' +zstyle ':vcs_info:*' check-for-changes true +zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{11}%r' +zstyle ':vcs_info:*' enable git svn +theme_precmd () { + if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] { + zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{green}]' + } else { + zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{red}●%F{green}]' + } + + vcs_info +} + +setopt prompt_subst +PROMPT='%B%F{blue}%c%B%F{green}${vcs_info_msg_0_}%B%F{magenta} %{$reset_color%}% ' + +autoload -U add-zsh-hook +add-zsh-hook precmd theme_precmd -ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[red]%}" -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]%})" |