summaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
Diffstat (limited to 'themes')
-rw-r--r--themes/Soliah.zsh-theme33
-rw-r--r--themes/bira.zsh-theme2
-rw-r--r--themes/dogenpunk.zsh-theme85
-rw-r--r--themes/gallois.zsh-theme19
-rw-r--r--themes/jonathan.zsh-theme137
-rw-r--r--themes/jtriley.zsh-theme8
-rw-r--r--themes/murilasso.zsh-theme14
7 files changed, 292 insertions, 6 deletions
diff --git a/themes/Soliah.zsh-theme b/themes/Soliah.zsh-theme
index 1c0ab3cc9..237e70fda 100644
--- a/themes/Soliah.zsh-theme
+++ b/themes/Soliah.zsh-theme
@@ -1,4 +1,4 @@
-PROMPT='%{$fg[blue]%}%n%{$reset_color%} on %{$fg[red]%}%M%{$reset_color%} in %{$fg[blue]%}%~%b%{$reset_color%}$(git_time_since_commit)$(git_prompt_info)
+PROMPT='%{$fg[blue]%}%n%{$reset_color%} on %{$fg[red]%}%M%{$reset_color%} in %{$fg[blue]%}%~%b%{$reset_color%}$(git_time_since_commit)$(check_git_prompt_info)
$ '
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%}"
@@ -16,6 +16,29 @@ 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[cyan]%}"
+
+# Git sometimes goes into a detached head state. git_prompt_info doesn't
+# return anything in this case. So wrap it in another function and check
+# for an empty string.
+function check_git_prompt_info() {
+ if git rev-parse --git-dir > /dev/null 2>&1; then
+ if [[ -z $(git_prompt_info) ]]; then
+ echo "%{$fg[magenta]%}detached-head%{$reset_color%})"
+ else
+ echo "$(git_prompt_info)"
+ fi
+ fi
+}
+
+# Determine if we are using a gemset.
+function rvm_gemset() {
+ GEMSET=`rvm gemset list | grep '=>' | cut -b4-`
+ if [[ -n $GEMSET ]]; then
+ echo "%{$fg[yellow]%}$GEMSET%{$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() {
@@ -49,15 +72,15 @@ function git_time_since_commit() {
fi
if [ "$HOURS" -gt 24 ]; then
- echo "($COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
+ echo "($(rvm_gemset)$COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
elif [ "$MINUTES" -gt 60 ]; then
- echo "($COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
+ echo "($(rvm_gemset)$COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
else
- echo "($COLOR${MINUTES}m%{$reset_color%}|"
+ echo "($(rvm_gemset)$COLOR${MINUTES}m%{$reset_color%}|"
fi
else
COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL"
- echo "($COLOR~|"
+ echo "($(rvm_gemset)$COLOR~|"
fi
fi
}
diff --git a/themes/bira.zsh-theme b/themes/bira.zsh-theme
index f0ee6a5bd..5642eaeb8 100644
--- a/themes/bira.zsh-theme
+++ b/themes/bira.zsh-theme
@@ -3,7 +3,7 @@ local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}'
-local rvm_ruby='%{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v g)›%{$reset_color%}'
+local rvm_ruby='%{$fg[red]%}‹$(rvm-prompt i v g)›%{$reset_color%}'
local git_branch='$(git_prompt_info)%{$reset_color%}'
PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch}
diff --git a/themes/dogenpunk.zsh-theme b/themes/dogenpunk.zsh-theme
new file mode 100644
index 000000000..f4d65ab74
--- /dev/null
+++ b/themes/dogenpunk.zsh-theme
@@ -0,0 +1,85 @@
+# -----------------------------------------------------------------------------
+# FILE: dogenpunk.zsh-theme
+# DESCRIPTION: oh-my-zsh theme file.
+# AUTHOR: Matthew Nelson (dogenpunk@gmail.com)
+# VERSION: 0.1
+# SCREENSHOT: coming soon
+# -----------------------------------------------------------------------------
+
+MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}"
+local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}"
+
+PROMPT='%{$fg[blue]%}%m%{$reset_color%}%{$fg_bold[white]%} ओम् %{$reset_color%}%{$fg[cyan]%}%~:%{$reset_color%}$(git_time_since_commit)$(git_prompt_info)
+%{$fg[red]%}%!%{$reset_color%} $(prompt_char) '
+
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[green]%}git%{$reset_color%}@%{$bg[white]%}%{$fg[black]%}"
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})"
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!%{$reset_color%}"
+ZSH_THEME_GIT_PROMPT_CLEAN=""
+
+RPROMPT='${return_status}$(git_prompt_status)%{$reset_color%}'
+
+ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚"
+ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹"
+ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖"
+ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜"
+ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═"
+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭"
+
+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
+ echo "%{$fg[cyan]%}◯ %{$reset_color%}"
+}
+
+# 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[cyan]%}"
+
+# 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 [[ -n $(git status -s 2> /dev/null) ]]; then
+ if [ "$MINUTES" -gt 30 ]; then
+ COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG"
+ elif [ "$MINUTES" -gt 10 ]; then
+ COLOR="$ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM"
+ else
+ COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT"
+ fi
+ else
+ COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL"
+ fi
+
+ if [ "$HOURS" -gt 24 ]; then
+ echo "($COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
+ elif [ "$MINUTES" -gt 60 ]; then
+ echo "($COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
+ else
+ echo "($COLOR${MINUTES}m%{$reset_color%}|"
+ fi
+ else
+ COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL"
+ echo "($COLOR~|"
+ fi
+ fi
+}
diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme
new file mode 100644
index 000000000..259640ba4
--- /dev/null
+++ b/themes/gallois.zsh-theme
@@ -0,0 +1,19 @@
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}["
+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
+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"
+ fi
+}
+
+#RVM and git settings
+if [[ -s ~/.rvm/scripts/rvm ]] ; then
+ RPS1='$(git_custom_status)%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1'
+fi
+
+PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b '
diff --git a/themes/jonathan.zsh-theme b/themes/jonathan.zsh-theme
new file mode 100644
index 000000000..add485279
--- /dev/null
+++ b/themes/jonathan.zsh-theme
@@ -0,0 +1,137 @@
+function precmd {
+ local TERMWIDTH
+ (( TERMWIDTH = ${COLUMNS} - 1 ))
+
+
+ ###
+ # Truncate the path if it's too long.
+
+ PR_FILLBAR=""
+ PR_PWDLEN=""
+
+ local promptsize=${#${(%):---(%n@%m:%l)---()--}}
+ local rubyprompt=`rvm_prompt_info`
+ local rubypromptsize=${#${rubyprompt}}
+ local pwdsize=${#${(%):-%~}}
+
+ if [[ "$promptsize + $rubypromptsize + $pwdsize" -gt $TERMWIDTH ]]; then
+ ((PR_PWDLEN=$TERMWIDTH - $promptsize))
+ else
+ PR_FILLBAR="\${(l.(($TERMWIDTH - ($promptsize + $rubypromptsize + $pwdsize)))..${PR_HBAR}.)}"
+ fi
+
+}
+
+
+setopt extended_glob
+preexec () {
+ if [[ "$TERM" == "screen" ]]; then
+ local CMD=${1[(wr)^(*=*|sudo|-*)]}
+ echo -n "\ek$CMD\e\\"
+ fi
+}
+
+
+setprompt () {
+ ###
+ # Need this so the prompt will work.
+
+ setopt prompt_subst
+
+
+ ###
+ # See if we can use colors.
+
+ autoload colors zsh/terminfo
+ if [[ "$terminfo[colors]" -ge 8 ]]; then
+ colors
+ fi
+ for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE GREY; do
+ eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
+ eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'
+ (( count = $count + 1 ))
+ done
+ PR_NO_COLOUR="%{$terminfo[sgr0]%}"
+
+ ###
+ # Modify Git prompt
+ ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[green]%}"
+ ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
+ ZSH_THEME_GIT_PROMPT_DIRTY=""
+ ZSH_THEME_GIT_PROMPT_CLEAN=""
+
+ ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚"
+ ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹"
+ ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖"
+ ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜"
+ ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═"
+ ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭"
+
+ ###
+ # 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]:--}
+
+
+ ###
+ # Decide if we need to set titlebar text.
+
+ case $TERM in
+ xterm*)
+ PR_TITLEBAR=$'%{\e]0;%(!.-=*[ROOT]*=- | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\a%}'
+ ;;
+ screen)
+ PR_TITLEBAR=$'%{\e_screen \005 (\005t) | %(!.-=[ROOT]=- | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\e\\%}'
+ ;;
+ *)
+ PR_TITLEBAR=''
+ ;;
+ esac
+
+
+ ###
+ # Decide whether to set a screen title
+ if [[ "$TERM" == "screen" ]]; then
+ PR_STITLE=$'%{\ekzsh\e\\%}'
+ else
+ PR_STITLE=''
+ fi
+
+
+ ###
+ # 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_GREEN%$PR_PWDLEN<...<%~%<<\
+$PR_GREY)`rvm_prompt_info`$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_HBAR${(e)PR_FILLBAR}$PR_HBAR$PR_SHIFT_OUT$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_CYAN$PR_SHIFT_IN$PR_LLCORNER$PR_BLUE$PR_HBAR$PR_SHIFT_OUT(\
+$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_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'
+
+ 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 '
+}
+
+setprompt
diff --git a/themes/jtriley.zsh-theme b/themes/jtriley.zsh-theme
new file mode 100644
index 000000000..ec62a2208
--- /dev/null
+++ b/themes/jtriley.zsh-theme
@@ -0,0 +1,8 @@
+#PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
+PROMPT="%{$fg_bold[cyan]%}%T%{$fg_bold[green]%} %{$fg_bold[white]%}%n%{$fg[magenta]%}@%{$fg_bold[white]%}%m %{$fg_bold[green]%}%d
+%{$fg_bold[yellow]%}%% $(git_prompt_info)%{$reset_color%}"
+
+#ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$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]%})"
diff --git a/themes/murilasso.zsh-theme b/themes/murilasso.zsh-theme
new file mode 100644
index 000000000..310357b45
--- /dev/null
+++ b/themes/murilasso.zsh-theme
@@ -0,0 +1,14 @@
+local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
+local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
+local current_dir='%{$terminfo[bold]$fg[blue]%}%~%{$reset_color%}'
+local rvm_ruby='%{$fg[red]%}$(rvm_prompt_info)%{$reset_color%}'
+local git_branch='%{$fg[blue]%}$(git_prompt_info)%{$reset_color%}'
+
+PROMPT="${user_host}:${current_dir} ${rvm_ruby}
+${git_branch} %B$%b "
+RPS1="${return_code}"
+
+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%}"