Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'mine' into hg_scm_plugin

Conflicts:
	scm/hg.scm.zsh
  • Loading branch information...
commit cb0516c7da30557e7aa66c118b2a9769560c4148 2 parents 675dd9c + 26f3fb7
@RobinRamael authored
Showing with 484 additions and 78 deletions.
  1. +3 −1 .gitignore
  2. +2 −2 README.textile
  3. +2 −0  lib/aliases.zsh
  4. +36 −23 lib/functions.zsh
  5. +4 −0 lib/git.zsh
  6. +26 −21 lib/termsupport.zsh
  7. +3 −2 lib/{appearance.zsh → theme-and-appearance.zsh}
  8. +3 −0  oh-my-zsh.sh
  9. +3 −0  plugins/bundler/bundler.plugin.zsh
  10. +1 −1  plugins/gem/gem.plugin.zsh
  11. +52 −6 plugins/osx/osx.plugin.zsh
  12. +3 −1 plugins/rails3/rails3.plugin.zsh
  13. +16 −0 plugins/savedir/savedir.plugin.zsh
  14. +42 −0 plugins/svn/svn.plugin.zsh
  15. +2 −2 scm/git.scm.zsh
  16. +60 −3 themes/Soliah.zsh-theme
  17. +1 −1  themes/afowler.zsh-theme
  18. +1 −1  themes/arrow.zsh-theme
  19. +1 −4 themes/awesomepanda.zsh-theme
  20. +1 −1  themes/clean.zsh-theme
  21. +56 −0 themes/dieter.zsh-theme
  22. +1 −1  themes/dst.zsh-theme
  23. +19 −0 themes/flazz.zsh-theme
  24. +1 −1  themes/jreese.zsh-theme
  25. +6 −0 themes/lambda.zsh-theme
  26. +7 −0 themes/nanotech.zsh-theme
  27. +43 −0 themes/nicoulaj.zsh-theme
  28. +1 −1  themes/philips.zsh-theme
  29. +1 −1  themes/pmcgee.zsh-theme
  30. +24 −0 themes/rixius.zsh-theme
  31. +48 −0 themes/sorin.zsh-theme
  32. +14 −4 themes/theunraveler.zsh-theme
  33. +1 −1  tools/check_for_upgrade.sh
View
4 .gitignore
@@ -2,4 +2,6 @@ locals.zsh
log/.zsh_history
projects.zsh
custom/*
-!custom/example.zsh
+!custom/example.zsh
+catche/*
+cache
View
4 README.textile
@@ -8,7 +8,7 @@ h2. Setup
h3. The automatic installer... (do you trust me?)
-@wget http://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh@
+@wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh@
h3. The manual way
@@ -38,7 +38,7 @@ h2. Usage
* enable the plugins you want in your @~/.zshrc@ (take a look at @plugins/@ to see what's possible)
** example: @plugins=(git osx ruby)@
* Theme support: Change the @ZSH_THEME@ environment variable in @~/.zshrc@.
-** Take a look at the "current themes":http://wiki.github.com/robbyrussell/oh-my-zsh/themes that come bundled with _Oh My Zsh_.
+** Take a look at the "current themes":https://wiki.github.com/robbyrussell/oh-my-zsh/themes that come bundled with _Oh My Zsh_.
* much much more... take a look at @lib/@ what _Oh My Zsh_ offers...
h2. Useful
View
2  lib/aliases.zsh
@@ -20,4 +20,6 @@ alias l='ls -la'
alias ll='ls -l'
alias sl=ls # often screw this up
+
alias afind='ack-grep -il'
+
View
59 lib/functions.zsh
@@ -1,26 +1,3 @@
-## fixme, i duplicated this in xterms - oops
-function title {
- if [[ $TERM == "screen" ]]; then
- # Use these two for GNU Screen:
- print -nR $'\033k'$1$'\033'\\\
-
- print -nR $'\033]0;'$2$'\a'
- elif [[ ($TERM =~ "^xterm") ]] || [[ ($TERM == "rxvt") ]]; then
- # Use this one instead for XTerms:
- print -nR $'\033]0;'$*$'\a'
- fi
-}
-
-function precmd {
- title zsh "$PWD"
-}
-
-function preexec {
- emulate -L zsh
- local -a cmd; cmd=(${(z)1})
- title $cmd[1]:t "$cmd[2,-1]"
-}
-
function zsh_stats() {
history | awk '{print $2}' | sort | uniq -c | sort -rn | head
}
@@ -37,3 +14,39 @@ function take() {
mkdir -p $1
cd $1
}
+
+function extract() {
+ unset REMOVE_ARCHIVE
+
+ if test "$1" = "-r"; then
+ REMOVE=1
+ shift
+ fi
+ if [[ -f $1 ]]; then
+ case $1 in
+ *.tar.bz2) tar xvjf $1;;
+ *.tar.gz) tar xvzf $1;;
+ *.tar.xz) tar xvJf $1;;
+ *.tar.lzma) tar --lzma -xvf $1;;
+ *.bz2) bunzip $1;;
+ *.rar) unrar $1;;
+ *.gz) gunzip $1;;
+ *.tar) tar xvf $1;;
+ *.tbz2) tar xvjf $1;;
+ *.tgz) tar xvzf $1;;
+ *.zip) unzip $1;;
+ *.Z) uncompress $1;;
+ *.7z) 7z x $1;;
+ *) echo "'$1' cannot be extracted via >extract<";;
+ esac
+
+ if [[ $REMOVE_ARCHIVE -eq 1 ]]; then
+ echo removing "$1";
+ /bin/rm "$1";
+ fi
+
+ else
+ echo "'$1' is not a valid file"
+ fi
+}
+
View
4 lib/git.zsh
@@ -26,6 +26,10 @@ git_prompt_status() {
fi
if $(echo "$INDEX" | grep '^ M ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
+ elif $(echo "$INDEX" | grep '^AM ' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
+ elif $(echo "$INDEX" | grep '^ T ' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
fi
if $(echo "$INDEX" | grep '^R ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_RENAMED$STATUS"
View
47 lib/termsupport.zsh
@@ -1,21 +1,26 @@
-case "$TERM" in
- xterm*|rxvt*)
- preexec () {
- print -Pn "\e]0;%n@%m: $1\a" # xterm
- }
- precmd () {
- print -Pn "\e]0;%n@%m: %~\a" # xterm
- }
- ;;
- screen*)
- preexec () {
- local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]}
- echo -ne "\ek$CMD\e\\"
- print -Pn "\e]0;%n@%m: $1\a" # xterm
- }
- precmd () {
- echo -ne "\ekzsh\e\\"
- print -Pn "\e]0;%n@%m: %~\a" # xterm
- }
- ;;
-esac
+#usage: title short_tab_title looooooooooooooooooooooggggggg_windows_title
+#http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1
+#Fully support screen, iterm, and probably most modern xterm and rxvt
+#Limited support for Apple Terminal (Terminal can't set window or tab separately)
+function title {
+ if [[ "$TERM" == "screen" ]]; then
+ print -Pn "\ek$1\e\\" #set screen hardstatus, usually truncated at 20 chars
+ elif [[ ($TERM =~ "^xterm") ]] || [[ ($TERM == "rxvt") ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
+ print -Pn "\e]2;$2\a" #set window name
+ print -Pn "\e]1;$1\a" #set icon (=tab) name (will override window name on broken terminal)
+ fi
+}
+
+ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD
+ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~"
+
+#Appears when you have the prompt
+function precmd {
+ title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE
+}
+
+#Appears at the beginning of (and during) of command execution
+function preexec {
+ local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
+ title "$CMD" "%100>...>$2%<<"
+}
View
5 lib/appearance.zsh → lib/theme-and-appearance.zsh
@@ -46,10 +46,11 @@ done
function get_scm_prompt () {
for scm in $scms; do
if [ $("scm_in_"$scm"_repo") ]; then
- echo `"scm_"$scm"_prompt_info"`
+ echo -n `"scm_"$scm"_prompt_info"`
fi
done
}
# Load the theme
-source "$ZSH/themes/$ZSH_THEME.zsh-theme"
+source "$ZSH/themes/$ZSH_THEME.zsh-theme"
+
View
3  oh-my-zsh.sh
@@ -14,6 +14,9 @@ for config_file ($ZSH/custom/*.zsh) source $config_file
plugin=${plugin:=()}
for plugin ($plugins) source $ZSH/plugins/$plugin/$plugin.plugin.zsh
+# Load the theme
+source "$ZSH/themes/$ZSH_THEME.zsh-theme"
+
# Check for updates on initial load...
if [ "$DISABLE_AUTO_UPDATE" = "true" ]
then
View
3  plugins/bundler/bundler.plugin.zsh
@@ -0,0 +1,3 @@
+alias be="bundle exec"
+alias bi="bundle install"
+alias bu="bundle update"
View
2  plugins/gem/gem.plugin.zsh
@@ -1,4 +1,4 @@
-# add brew completion function to path
+# add gem completion function to path
fpath=($ZSH/plugins/gem $fpath)
autoload -U compinit
compinit -i
View
58 plugins/osx/osx.plugin.zsh
@@ -1,11 +1,57 @@
+function savepath() {
+ pwd > ~/.current_path~
+}
+
function tab() {
- osascript 2>/dev/null <<EOF
+savepath
+osascript >/dev/null <<EOF
+on do_submenu(app_name, menu_name, menu_item, submenu_item)
+ -- bring the target application to the front
+ tell application app_name
+ activate
+ end tell
tell application "System Events"
- tell process "Terminal" to keystroke "t" using command down
- end
- tell application "Terminal"
+ tell process app_name
+ tell menu bar 1
+ tell menu bar item menu_name
+ tell menu menu_name
+ tell menu item menu_item
+ tell menu menu_item
+ click menu item submenu_item
+ end tell
+ end tell
+ end tell
+ end tell
+ end tell
+ end tell
+ end tell
+end do_submenu
+
+do_submenu("Terminal", "Shell", "New Tab", 1)
+EOF
+}
+
+function itab() {
+savepath
+osascript >/dev/null <<EOF
+on do_submenu(app_name, menu_name, menu_item)
+ -- bring the target application to the front
+ tell application app_name
activate
- do script with command "cd \"$PWD\"; $*" in window 1
end tell
+ tell application "System Events"
+ tell process app_name
+ tell menu bar 1
+ tell menu bar item menu_name
+ tell menu menu_name
+ click menu item menu_item
+ end tell
+ end tell
+ end tell
+ end tell
+ end tell
+end do_submenu
+
+do_submenu("iTerm", "Shell", "New Tab")
EOF
-}
+}
View
4 plugins/rails3/rails3.plugin.zsh
@@ -3,6 +3,8 @@ alias rg='ruby script/rails generate'
alias rd='ruby script/rails destroy'
alias rp='ruby script/rails plugin'
alias rdbm='rake db:migrate db:test:clone'
+alias rdbmr='rake db:migrate && rake db:migrate:redo'
alias rc='ruby script/rails console'
-alias rd='ruby script/rais server --debugger'
+alias rd='ruby script/rails server --debugger'
alias devlog='tail -f log/development.log'
+
View
16 plugins/savedir/savedir.plugin.zsh
@@ -0,0 +1,16 @@
+# plugin for switching between shell sessions whilst maintaining the current working directory.
+# Use sd or save_dir to save out the current dir and gd or get_dir to chage to the last saved directory.
+
+export DIR_SAVE_FILE=/var/tmp/saved_dir # change this at will.
+
+function save_dir {
+ pwd > $DIR_SAVE_FILE
+}
+
+function get_dir {
+ cd $(cat $DIR_SAVE_FILE)
+}
+
+
+alias sd=save_dir
+alias gd=get_dir
View
42 plugins/svn/svn.plugin.zsh
@@ -0,0 +1,42 @@
+function svn_prompt_info {
+ if [[ -d .svn ]]; then
+ echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\
+$ZSH_THEME_REPO_NAME_COLOR$(svn_get_repo_name)$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(svn_dirty)$ZSH_PROMPT_BASE_COLOR"
+ fi
+}
+
+
+function in_svn() {
+ if [[ -d .svn ]]; then
+ echo 1
+ fi
+}
+
+function svn_get_repo_name {
+ if [ is_svn ]; then
+ svn info | sed -n 's/Repository\ Root:\ .*\///p' | read SVN_ROOT
+
+ svn info | sed -n "s/URL:\ .*$SVN_ROOT\///p" | sed "s/\/.*$//"
+ fi
+}
+
+function svn_get_rev_nr {
+ if [ is_svn ]; then
+ svn info 2> /dev/null | sed -n s/Revision:\ //p
+ fi
+}
+
+function svn_dirty_choose {
+ if [ is_svn ]; then
+ s=$(svn status 2>/dev/null)
+ if [ $s ]; then
+ echo $1
+ else
+ echo $2
+ fi
+ fi
+}
+
+function svn_dirty {
+ svn_dirty_choose $ZSH_THEME_SVN_PROMPT_DIRTY $ZSH_THEME_SVN_PROMPT_CLEAN
+}
View
4 scm/git.scm.zsh
@@ -1,5 +1,5 @@
function scm_in_git_repo () {
- if [[ -d .git ]]; then
+ if [ "$(git st 2>/dev/null)" ]; then
echo 1
fi
}
@@ -19,4 +19,4 @@ scm_parse_git_dirty () {
else
echo "$ZSH_THEME_SCM_PROMPT_CLEAN"
fi
-}
+}
View
63 themes/Soliah.zsh-theme
@@ -1,6 +1,63 @@
-PROMPT='%{$fg[blue]%}%B%20~%b%{$reset_color%}%{$(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)$(git_prompt_info)
+$ '
-ZSH_THEME_GIT_PROMPT_PREFIX="(%{$fg[green]%}"
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})"
-ZSH_THEME_GIT_PROMPT_DIRTY="*%{$reset_color%}"
+# Text to display if the branch is dirty
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}"
+
+# Text to display if the branch is clean
+ZSH_THEME_GIT_PROMPT_CLEAN=""
+
+# 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
+}
View
2  themes/afowler.zsh-theme
@@ -1,4 +1,4 @@
-if [ "$(whoami)" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi
+if [ $UID -eq 0 ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
View
2  themes/arrow.zsh-theme
@@ -1,4 +1,4 @@
-if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="yellow"; fi
+if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="yellow"; fi
PROMPT='%{$fg[$NCOLOR]%}%c ➤ %{$reset_color%}'
RPROMPT='%{$fg[$NCOLOR]%}%p $(git_prompt_info)%{$reset_color%}'
View
5 themes/awesomepanda.zsh-theme
@@ -1,5 +1,3 @@
-# the svn plugin has to be activated for this to work.
-
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(get_scm_prompt)%{$reset_color%}'
ZSH_THEME_SCM_PROMPT_PREFIX=":(%{$fg[red]%}"
@@ -7,5 +5,4 @@ ZSH_THEME_SCM_PROMPT_SUFFIX=" %{$reset_color%}"
ZSH_THEME_SCM_PROMPT_DIRTY="%{$fg_bold[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}"
ZSH_THEME_SCM_PROMPT_CLEAN="%{$fg_bold[blue]%})%{$reset_color%}"
-ZSH_THEME_SCM_DISPLAY_NAME=1
-
+ZSH_THEME_SCM_DISPLAY_NAME=1
View
2  themes/clean.zsh-theme
@@ -1,4 +1,4 @@
-if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="white"; fi
+if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="white"; fi
PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) '
RPROMPT='[%*]'
View
56 themes/dieter.zsh-theme
@@ -0,0 +1,56 @@
+# the idea of this theme is to contain a lot of info in a small string, by
+# compressing some parts and colorcoding, which bring useful visual cues,
+# while limiting the amount of colors and such to keep it easy on the eyes.
+# When a command exited >0, the timestamp will be in red and the exit code
+# will be on the right edge.
+# The exit code visual cues will only display once.
+# (i.e. they will be reset, even if you hit enter a few times on empty command prompts)
+
+typeset -A host_repr
+
+# translate hostnames into shortened, colorcoded strings
+host_repr=('dieter-ws-a7n8x-arch' "%{$fg_bold[green]%}ws" 'dieter-p4sci-arch' "%{$fg_bold[blue]%}p4")
+
+# local time, color coded by last return code
+time_enabled="%(?.%{$fg[green]%}.%{$fg[red]%})%*%{$reset_color%}"
+time_disabled="%{$fg[green]%}%*%{$reset_color%}"
+time=$time_enabled
+
+# user part, color coded by privileges
+local user="%(!.%{$fg[blue]%}.%{$fg[blue]%})%n%{$reset_color%}"
+
+# Hostname part. compressed and colorcoded per host_repr array
+# if not found, regular hostname in default color
+local host="@${host_repr[$(hostname)]:-$(hostname)}%{$reset_color%}"
+
+# Compacted $PWD
+local pwd="%{$fg[blue]%}%c%{$reset_color%}"
+
+PROMPT='${time} ${user}${host} ${pwd} $(git_prompt_info)'
+
+# i would prefer 1 icon that shows the "most drastic" deviation from HEAD,
+# but lets see how this works out
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}"
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%} %{$fg[yellow]%}?%{$fg[green]%}%{$reset_color%}"
+ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}"
+
+# elaborate exitcode on the right when >0
+return_code_enabled="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
+return_code_disabled=
+return_code=$return_code_enabled
+
+RPS1='${return_code}'
+
+function accept-line-or-clear-warning () {
+ if [[ -z $BUFFER ]]; then
+ time=$time_disabled
+ return_code=$return_code_disabled
+ else
+ time=$time_enabled
+ return_code=$return_code_enabled
+ fi
+ zle accept-line
+}
+zle -N accept-line-or-clear-warning
+bindkey '^M' accept-line-or-clear-warning
View
2  themes/dst.zsh-theme
@@ -5,7 +5,7 @@ ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!"
ZSH_THEME_GIT_PROMPT_CLEAN=""
function prompt_char {
- if [ "$(whoami)" = "root" ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi
+ if [ $UID -eq 0 ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi
}
PROMPT='%(?, ,%{$fg[red]%}FAIL%{$reset_color%}
View
19 themes/flazz.zsh-theme
@@ -0,0 +1,19 @@
+if [ "$(whoami)" = "root" ]
+then CARETCOLOR="red"
+else CARETCOLOR="blue"
+fi
+
+local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
+
+PROMPT='%m%{${fg_bold[magenta]}%} :: %{$reset_color%}%{${fg[green]}%}%3~ $(git_prompt_info)%{${fg_bold[$CARETCOLOR]}%}%#%{${reset_color}%} '
+
+RPS1='$(vi_mode_prompt_info) ${return_code}'
+
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[cyan]%}‹"
+ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}"
+
+MODE_INDICATOR="%{$fg_bold[magenta]%}<%{$reset_color%}%{$fg[magenta]%}<<%{$reset_color%}"
+
+# TODO use 265 colors
+#MODE_INDICATOR="$FX[bold]$FG[020]<$FX[no_bold]%{$fg[blue]%}<<%{$reset_color%}"
+# TODO use two lines if git
View
2  themes/jreese.zsh-theme
@@ -1,6 +1,6 @@
# ZSH Theme - Preview: http://dl.dropbox.com/u/1552408/Screenshots/2010-04-08-oh-my-zsh.png
-if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="green"; fi
+if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
PROMPT='%{$fg[$NCOLOR]%}%n%{$fg[green]%}@%m%{$reset_color%} %~ \
View
6 themes/lambda.zsh-theme
@@ -0,0 +1,6 @@
+# ZSH Theme - Preview: http://cl.ly/350F0F0k1M2y3A2i3p1S
+
+PROMPT='λ %~/ $(git_prompt_info)%{$reset_color%}'
+
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}"
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
View
7 themes/nanotech.zsh-theme
@@ -0,0 +1,7 @@
+PROMPT='%F{green}%2c%F{blue} [%f '
+RPROMPT='$(git_prompt_info) %F{blue}] %F{green}%D{%L:%M} %F{yellow}%D{%p}%f'
+
+ZSH_THEME_GIT_PROMPT_PREFIX="%F{yellow}"
+ZSH_THEME_GIT_PROMPT_SUFFIX="%f"
+ZSH_THEME_GIT_PROMPT_DIRTY=" %F{red}*%f"
+ZSH_THEME_GIT_PROMPT_CLEAN=""
View
43 themes/nicoulaj.zsh-theme
@@ -0,0 +1,43 @@
+#!/usr/bin/env zsh
+# ------------------------------------------------------------------------------
+# Prompt for the Zsh shell:
+# * One line.
+# * VCS info on the right prompt.
+# * Only shows the path on the left prompt by default.
+# * Crops the path to a defined length and only shows the path relative to
+# the current VCS repository root.
+# * Wears a different color wether the last command succeeded/failed.
+# * Shows user@hostname if connected through SSH.
+# * Shows if logged in as root or not.
+# ------------------------------------------------------------------------------
+
+# Customizable parameters.
+PROMPT_PATH_MAX_LENGTH=30
+PROMPT_DEFAULT_END=❯
+PROMPT_ROOT_END=❯❯❯
+PROMPT_SUCCESS_COLOR=$FG[071]
+PROMPT_FAILURE_COLOR=$FG[124]
+PROMPT_VCS_INFO_COLOR=$FG[242]
+
+# Set required options.
+setopt promptsubst
+
+# Load required modules.
+autoload -U add-zsh-hook
+autoload -Uz vcs_info
+
+# Add hook for calling vcs_info before each command.
+add-zsh-hook precmd vcs_info
+
+# Set vcs_info parameters.
+zstyle ':vcs_info:*' enable hg bzr git
+zstyle ':vcs_info:*:*' check-for-changes true # Can be slow on big repos.
+zstyle ':vcs_info:*:*' unstagedstr '!'
+zstyle ':vcs_info:*:*' stagedstr '+'
+zstyle ':vcs_info:*:*' actionformats "%S" "%r/%s/%b %u%c (%a)"
+zstyle ':vcs_info:*:*' formats "%S" "%r/%s/%b %u%c"
+zstyle ':vcs_info:*:*' nvcsformats "%~" ""
+
+# Define prompts.
+PROMPT="%(0?.%{$PROMPT_SUCCESS_COLOR%}.%{$PROMPT_FAILURE_COLOR%})${SSH_TTY:+[%n@%m]}%{$FX[bold]%}%$PROMPT_PATH_MAX_LENGTH<..<"'${vcs_info_msg_0_%%.}'"%<<%(!.$PROMPT_ROOT_END.$PROMPT_DEFAULT_END)%{$FX[no-bold]%}%{$FX[reset]%} "
+RPROMPT="%{$PROMPT_VCS_INFO_COLOR%}"'$vcs_info_msg_1_'"%{$FX[reset]%}"
View
2  themes/philips.zsh-theme
@@ -1,4 +1,4 @@
-if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="green"; fi
+if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) '
RPROMPT='[%*]'
View
2  themes/pmcgee.zsh-theme
@@ -1,4 +1,4 @@
-if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="green"; fi
+if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
PROMPT='
%{$fg[$NCOLOR]%}%B%n@%m%b%{$reset_color%} %{$fg[white]%}%B${PWD/#$HOME/~}%b%{$reset_color%}
View
24 themes/rixius.zsh-theme
@@ -0,0 +1,24 @@
+# /|/ 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 {
+ echo $(pwd | sed -e "s,^$HOME,~,")
+}
+function prompt_char {
+ echo -n "%{$bg[white]%}%{$fg[red]%}"
+ git branch >/dev/null 2>/dev/null && echo "±%{$reset_color%}" && return
+ echo "≥%{$reset_color%}"
+}
+RIXIUS_PRE="%{$bg[white]%}%{$fg[red]%}"
+
+PROMPT='
+%{$RIXIUS_PRE%}%n%{$reset_color%} in %{$fg_bold[green]%}$(collapse_pwd)%{$reset_color%}$(git_prompt_info)
+$(prompt_char) '
+RPROMPT='%{$RIXIUS_PRE%}%T%{$reset_color%}'
+
+ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}"
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
+ZSH_THEME_GIT_PROMPT_DIRTY=" %{$RIXIUS_PRE%}!%{$reset_color%}"
+ZSH_THEME_GIT_PROMPT_CLEAN=" %{$RIXIUS_PRE%}√%{$reset_color%}"
View
48 themes/sorin.zsh-theme
@@ -0,0 +1,48 @@
+# ------------------------------------------------------------------------------
+# 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
+# ------------------------------------------------------------------------------
+
+
+if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then
+ MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}"
+ local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}"
+
+ PROMPT='%{$fg[cyan]%}%c$(git_prompt_info) %(!.%{$fg_bold[red]%}#.%{$fg_bold[green]%}❯)%{$reset_color%} '
+
+ ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[blue]%}git%{$reset_color%}:%{$fg[red]%}"
+ ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
+ ZSH_THEME_GIT_PROMPT_DIRTY=""
+ 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]%} ✭"
+else
+ MODE_INDICATOR="❮❮❮"
+ local return_status="%(?::⏎)"
+
+ PROMPT='%c$(git_prompt_info) %(!.#.❯) '
+
+ ZSH_THEME_GIT_PROMPT_PREFIX=" git:"
+ ZSH_THEME_GIT_PROMPT_SUFFIX=""
+ ZSH_THEME_GIT_PROMPT_DIRTY=""
+ ZSH_THEME_GIT_PROMPT_CLEAN=""
+
+ RPROMPT='${return_status}$(git_prompt_status)'
+
+ ZSH_THEME_GIT_PROMPT_ADDED=" ✚"
+ ZSH_THEME_GIT_PROMPT_MODIFIED=" ✹"
+ ZSH_THEME_GIT_PROMPT_DELETED=" ✖"
+ ZSH_THEME_GIT_PROMPT_RENAMED=" ➜"
+ ZSH_THEME_GIT_PROMPT_UNMERGED=" ═"
+ ZSH_THEME_GIT_PROMPT_UNTRACKED=" ✭"
+fi
View
18 themes/theunraveler.zsh-theme
@@ -1,6 +1,16 @@
-# Comment
+# Comment
-ZSH_THEME_GIT_PROMPT_PREFIX=' (git:'
-ZSH_THEME_GIT_PROMPT_SUFFIX=')'
+PROMPT='%{$fg[magenta]%}[%c] %{$reset_color%}'
-PROMPT='%{$fg[magenta]%}[%c]$(git_prompt_info) $ %{$reset_color%}'
+RPROMPT='%{$fg[magenta]%}$(git_prompt_info)%{$reset_color%} $(git_prompt_status)%{$reset_color%}'
+
+ZSH_THEME_GIT_PROMPT_PREFIX=""
+ZSH_THEME_GIT_PROMPT_SUFFIX=""
+ZSH_THEME_GIT_PROMPT_DIRTY=""
+ZSH_THEME_GIT_PROMPT_CLEAN=""
+ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%} ✈"
+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_UNTRACKED="%{$fg[grey]%} ✱"
View
2  tools/check_for_upgrade.sh
@@ -16,7 +16,7 @@ then
_update_zsh_update && return 0;
fi
- epoch_diff=$((${_current_epoch} - $LAST_EPOCH))
+ epoch_diff=$(($(_current_epoch) - $LAST_EPOCH))
if [ $epoch_diff -gt 6 ]
then
echo "[Oh My Zsh] Would you like to check for updates?"
Please sign in to comment.
Something went wrong with that request. Please try again.