summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.textile8
-rw-r--r--lib/completion.zsh2
-rw-r--r--lib/functions.zsh4
-rw-r--r--lib/git.zsh2
-rw-r--r--lib/history.zsh13
-rw-r--r--lib/termsupport.zsh10
-rw-r--r--oh-my-zsh.sh30
-rw-r--r--plugins/autojump/autojump.plugin.zsh4
-rw-r--r--plugins/git/git.plugin.zsh1
-rw-r--r--plugins/knife/_knife9
-rw-r--r--plugins/nyan/nyan.plugin.zsh5
-rw-r--r--plugins/pip/_pip64
-rw-r--r--plugins/rails3/rails3.plugin.zsh2
-rw-r--r--plugins/sprunge/sprunge.plugin.zsh64
-rw-r--r--plugins/symfony2/symfony2.plugin.zsh13
-rw-r--r--plugins/wakeonlan/README29
-rw-r--r--plugins/wakeonlan/_wake4
-rw-r--r--plugins/wakeonlan/wakeonlan.plugin.zsh14
-rw-r--r--templates/zshrc.zsh-template5
-rw-r--r--themes/apple.zsh-theme7
-rw-r--r--themes/gallois.zsh-theme2
-rw-r--r--themes/jonathan.zsh-theme28
-rw-r--r--themes/kolo.zsh-theme5
-rw-r--r--themes/mh.zsh-theme24
-rw-r--r--themes/pygmalion.zsh-theme9
-rw-r--r--themes/sammy.zsh-theme6
-rw-r--r--themes/suvash.zsh-theme23
-rw-r--r--themes/zhann.zsh-theme7
-rw-r--r--tools/check_for_upgrade.sh24
-rw-r--r--tools/upgrade.sh18
30 files changed, 362 insertions, 74 deletions
diff --git a/README.textile b/README.textile
index 2dbfbe5a6..eca968089 100644
--- a/README.textile
+++ b/README.textile
@@ -8,6 +8,14 @@ h2. Setup
h3. The automatic installer... (do you trust me?)
+You can install this via the command line with either `curl` or `wget`.
+
+h4. via `curl`
+
+@curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh@
+
+h4. via `wget`
+
@wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh@
h3. The manual way
diff --git a/lib/completion.zsh b/lib/completion.zsh
index b3cc91822..0e5d480ff 100644
--- a/lib/completion.zsh
+++ b/lib/completion.zsh
@@ -32,9 +32,11 @@ zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-dir
cdpath=(.)
# use /etc/hosts and known_hosts for hostname completion
+[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
[ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
hosts=(
+ "$_global_ssh_hosts[@]"
"$_ssh_hosts[@]"
"$_etc_hosts[@]"
`hostname`
diff --git a/lib/functions.zsh b/lib/functions.zsh
index ef7cc6383..d2dcadd0c 100644
--- a/lib/functions.zsh
+++ b/lib/functions.zsh
@@ -3,11 +3,11 @@ function zsh_stats() {
}
function uninstall_oh_my_zsh() {
- /bin/sh $ZSH/tools/uninstall.sh
+ /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/uninstall.sh
}
function upgrade_oh_my_zsh() {
- /bin/sh $ZSH/tools/upgrade.sh
+ /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh
}
function take() {
diff --git a/lib/git.zsh b/lib/git.zsh
index f04343650..defa062c6 100644
--- a/lib/git.zsh
+++ b/lib/git.zsh
@@ -6,7 +6,7 @@ function git_prompt_info() {
# Checks if working tree is dirty
parse_git_dirty() {
- if [[ -n $(git status -s 2> /dev/null) ]]; then
+ if [[ -n $(git status -s --ignore-submodules=dirty 2> /dev/null) ]]; then
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
else
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
diff --git a/lib/history.zsh b/lib/history.zsh
index ca6f57079..876936b87 100644
--- a/lib/history.zsh
+++ b/lib/history.zsh
@@ -3,14 +3,11 @@ HISTFILE=$HOME/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
-setopt hist_ignore_dups # ignore duplication command history list
-setopt share_history # share command history data
-
-setopt hist_verify
-setopt inc_append_history
+setopt append_history
setopt extended_history
setopt hist_expire_dups_first
+setopt hist_ignore_dups # ignore duplication command history list
setopt hist_ignore_space
-
-setopt SHARE_HISTORY
-setopt APPEND_HISTORY
+setopt hist_verify
+setopt inc_append_history
+setopt share_history # share command history data
diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
index 22e7f372f..221989502 100644
--- a/lib/termsupport.zsh
+++ b/lib/termsupport.zsh
@@ -4,7 +4,7 @@
#Limited support for Apple Terminal (Terminal can't set window or tab separately)
function title {
[ "$DISABLE_AUTO_TITLE" != "true" ] || return
- if [[ "$TERM" == screen* ]]; then
+ if [[ "$TERM" == screen* ]]; then
print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
print -Pn "\e]2;$2:q\a" #set window name
@@ -16,14 +16,18 @@ 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 {
+function omz_termsupport_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 {
+function omz_termsupport_preexec {
emulate -L zsh
setopt extended_glob
local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
title "$CMD" "%100>...>$2%<<"
}
+
+autoload -U add-zsh-hook
+add-zsh-hook precmd omz_termsupport_precmd
+add-zsh-hook preexec omz_termsupport_preexec
diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
index 891e8d467..aeeaa3daf 100644
--- a/oh-my-zsh.sh
+++ b/oh-my-zsh.sh
@@ -13,20 +13,27 @@ fpath=($ZSH/functions $ZSH/completions $fpath)
# TIP: Add files you don't want in git to .gitignore
for config_file ($ZSH/lib/*.zsh) source $config_file
-# Add all defined plugins to fpath
+# Set ZSH_CUSTOM to the path where your custom config files
+# and plugins exists, or else we will use the default custom/
+if [[ -z "$ZSH_CUSTOM" ]]; then
+ ZSH_CUSTOM="$ZSH/custom"
+fi
+
+# Add all defined plugins to fpath. This must be done
+# before running compinit.
plugin=${plugin:=()}
-for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath)
+for plugin ($plugins); do
+ if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then
+ fpath=($ZSH_CUSTOM/plugins/$plugin $fpath)
+ elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
+ fpath=($ZSH/plugins/$plugin $fpath)
+ fi
+done
# Load and run compinit
autoload -U compinit
compinit -i
-# Set ZSH_CUSTOM to the path where your custom config files
-# and plugins exists, or else we will use the default custom/
-if [ "$ZSH_CUSTOM" = "" ]
-then
- ZSH_CUSTOM="$ZSH/custom"
-fi
# Load all of the plugins that were defined in ~/.zshrc
for plugin ($plugins); do
@@ -52,7 +59,12 @@ then
else
if [ ! "$ZSH_THEME" = "" ]
then
- source "$ZSH/themes/$ZSH_THEME.zsh-theme"
+ if [ -f "$ZSH/custom/$ZSH_THEME.zsh-theme" ]
+ then
+ source "$ZSH/custom/$ZSH_THEME.zsh-theme"
+ else
+ source "$ZSH/themes/$ZSH_THEME.zsh-theme"
+ fi
fi
fi
diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh
index da0a12765..6f9b80bff 100644
--- a/plugins/autojump/autojump.plugin.zsh
+++ b/plugins/autojump/autojump.plugin.zsh
@@ -1,3 +1,5 @@
-if [ -f `brew --prefix`/etc/autojump ]; then
+if [ -f /opt/local/etc/profile.d/autojump.sh ]; then
+ . /opt/local/etc/profile.d/autojump.sh
+elif [ -f `brew --prefix`/etc/autojump ]; then
. `brew --prefix`/etc/autojump
fi
diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
index 183c56c1c..c1b382b2c 100644
--- a/plugins/git/git.plugin.zsh
+++ b/plugins/git/git.plugin.zsh
@@ -17,6 +17,7 @@ alias gca='git commit -v -a'
compdef _git gca=git-commit
alias gco='git checkout'
compdef _git gco=git-checkout
+alias gcm='git checkout master'
alias gb='git branch'
compdef _git gb=git-branch
alias gba='git branch -a'
diff --git a/plugins/knife/_knife b/plugins/knife/_knife
index 7f8c95ee5..32ff9fc99 100644
--- a/plugins/knife/_knife
+++ b/plugins/knife/_knife
@@ -26,7 +26,7 @@ _knife() {
case $state in
knifecmd)
- compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec index node recipe role search ssh status windows $cloudproviders
+ compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec environment index node recipe role search ssh status windows $cloudproviders
;;
knifesubcmd)
case $words[2] in
@@ -42,6 +42,9 @@ _knife() {
cookbook)
compadd -Q "$@" test list create download delete "metadata from" show "bulk delete" metadata upload
;;
+ environment)
+ compadd -Q "$@" list create delete edit show "from file"
+ ;;
node)
compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete"
;;
@@ -161,6 +164,10 @@ _chef_data_bags_remote() {
(knife data bag list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
}
+_chef_environments_remote() {
+ (knife environment list | awk '{print $1}')
+}
+
# The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server
_chef_cookbooks_local() {
(for i in $( grep cookbook_path $HOME/.chef/knife.rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' ); do ls $i; done)
diff --git a/plugins/nyan/nyan.plugin.zsh b/plugins/nyan/nyan.plugin.zsh
new file mode 100644
index 000000000..6321e5f5a
--- /dev/null
+++ b/plugins/nyan/nyan.plugin.zsh
@@ -0,0 +1,5 @@
+if [[ -x `which nc` ]]; then
+ alias nyan='nc -v miku.acm.uiuc.edu 23' # nyan cat
+fi
+
+
diff --git a/plugins/pip/_pip b/plugins/pip/_pip
index b58010173..df53ba5ce 100644
--- a/plugins/pip/_pip
+++ b/plugins/pip/_pip
@@ -3,30 +3,43 @@
# pip zsh completion, based on homebrew completion
+_pip_all() {
+ # we cache the list of packages (originally from the macports plugin)
+ if (( ! $+piplist )); then
+ echo -n " (caching package index...)"
+ piplist=($(pip search * | cut -d ' ' -f 1 | tr '[A-Z]' '[a-z]'))
+ fi
+}
+
_pip_installed() {
- installed_pkgs=(`pip freeze`)
+ installed_pkgs=(`pip freeze | cut -d '=' -f 1`)
}
local -a _1st_arguments
_1st_arguments=(
- 'bundle:Create pybundles (archives containing multiple packages)'
- 'freeze:Output all currently installed packages (exact versions) to stdout'
- 'help:Show available commands'
- 'install:Install packages'
- 'search:Search PyPI'
- 'uninstall:Uninstall packages'
- 'unzip:Unzip individual packages'
- 'zip:Zip individual packages'
+ 'bundle:create pybundles (archives containing multiple packages)'
+ 'freeze:output all currently installed packages (exact versions) to stdout'
+ 'help:show available commands'
+ 'install:install packages'
+ 'search:search PyPI'
+ 'uninstall:uninstall packages'
+ 'unzip:unzip individual packages'
+ 'zip:zip individual packages'
)
local expl
-local -a pkgs installed_pkgs
+local -a all_pkgs installed_pkgs
_arguments \
- '(--version)--version[Show version number of program and exit]' \
- '(-v --verbose)'{-v,--verbose}'[Give more output]' \
- '(-q --quiet)'{-q,--quiet}'[Give less output]' \
- '(-h --help)'{-h,--help}'[Show help]' \
+ '(--version)--version[show version number of program and exit]' \
+ '(-h --help)'{-h,--help}'[show help]' \
+ '(-E --environment)'{-E,--environment}'[virtualenv environment to run pip in]' \
+ '(-s --enable-site-packages)'{-s,--enable-site-packages}'[include site-packages in virtualenv]' \
+ '(-v --verbose)'{-v,--verbose}'[give more output]' \
+ '(-q --quiet)'{-q,--quiet}'[give less output]' \
+ '(--log)--log[log file location]' \
+ '(--proxy)--proxy[proxy in form user:passwd@proxy.server:port]' \
+ '(--timeout)--timeout[socket timeout (default 15s)]' \
'*:: :->subcmds' && return 0
if (( CURRENT == 1 )); then
@@ -35,10 +48,25 @@ if (( CURRENT == 1 )); then
fi
case "$words[1]" in
- list)
- if [[ "$state" == forms ]]; then
- _pip_installed
- _requested installed_pkgs expl 'installed packages' compadd -a installed_pkgs
+ search)
+ _arguments \
+ '(--index)--index[base URL of Python Package Index]' ;;
+ freeze)
+ _arguments \
+ '(-l --local)'{-l,--local}'[report only virtualenv packages]' ;;
+ install)
+ _arguments \
+ '(-U --upgrade)'{-U,--upgrade}'[upgrade all packages to the newest available version]' \
+ '(-f --find-links)'{-f,--find-links}'[URL for finding packages]' \
+ '(--no-deps --no-dependencies)'{--no-deps,--no-dependencies}'[iIgnore package dependencies]' \
+ '(--no-install)--no-install[only download packages]' \
+ '(--no-download)--no-download[only install downloaded packages]' \
+ '(--install-option)--install-option[extra arguments to be supplied to the setup.py]' \
+ '1: :->packages' && return 0
+
+ if [[ "$state" == packages ]]; then
+ _pip_all
+ _wanted piplist expl 'packages' compadd -a piplist
fi ;;
uninstall)
_pip_installed
diff --git a/plugins/rails3/rails3.plugin.zsh b/plugins/rails3/rails3.plugin.zsh
index f4ee637e6..792cde2bd 100644
--- a/plugins/rails3/rails3.plugin.zsh
+++ b/plugins/rails3/rails3.plugin.zsh
@@ -17,3 +17,5 @@ alias rp='_rails_command plugin'
alias rs='_rails_command server'
alias rsd='_rails_command server --debugger'
alias devlog='tail -f log/development.log'
+alias rdm='rake db:migrate'
+alias rdr='rake db:rollback'
diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh
new file mode 100644
index 000000000..9f9432ac8
--- /dev/null
+++ b/plugins/sprunge/sprunge.plugin.zsh
@@ -0,0 +1,64 @@
+# Contributed and SLIGHTLY modded by Matt Parnell/ilikenwf <parwok -at- gmail>
+# Created by the blogger at the URL below...I don't know where to find his/her name
+# Original found at http://www.shellperson.net/sprunge-pastebin-script/
+
+usage() {
+description | fmt -s >&2
+}
+
+description() {
+cat << HERE
+
+DESCRIPTION
+ Upload data and fetch URL from the pastebin http://sprunge.us
+
+USAGE
+ $0 filename.txt
+ $0 text string
+ $0 < filename.txt
+ piped_data | $0
+
+NOTES
+--------------------------------------------------------------------------
+* INPUT METHODS *
+$0 can accept piped data, STDIN redirection [<filename.txt], text strings following the command as arguments, or filenames as arguments. Only one of these methods can be used at a time, so please see the note on precedence. Also, note that using a pipe or STDIN redirection will treat tabs as spaces, or disregard them entirely (if they appear at the beginning of a line). So I suggest using a filename as an argument if tabs are important either to the function or readability of the code.
+
+* PRECEDENCE *
+STDIN redirection has precedence, then piped input, then a filename as an argument, and finally text strings as an arguments.
+
+ EXAMPLE:
+ echo piped | "$0" arguments.txt < stdin_redirection.txt
+
+In this example, the contents of file_as_stdin_redirection.txt would be uploaded. Both the piped_text and the file_as_argument.txt are ignored. If there is piped input and arguments, the arguments will be ignored, and the piped input uploaded.
+
+* FILENAMES *
+If a filename is misspelled or doesn't have the necessary path description, it will NOT generate an error, but will instead treat it as a text string and upload it.
+--------------------------------------------------------------------------
+
+HERE
+exit
+}
+
+sprunge() {
+ if [ -t 0 ]; then
+ echo Running interactively, checking for arguments... >&2
+ if [ "$*" ]; then
+ echo Arguments present... >&2
+ if [ -f "$*" ]; then
+ echo Uploading the contents of "$*"... >&2
+ cat "$*"
+ else
+ echo Uploading the text: \""$*"\"... >&2
+ echo "$*"
+ fi | curl -F 'sprunge=<-' http://sprunge.us
+ else
+ echo No arguments found, printing USAGE and exiting. >&2
+ usage
+ fi
+ else
+ echo Using input from a pipe or STDIN redirection... >&2
+ while read -r line ; do
+ echo $line
+ done | curl -F 'sprunge=<-' http://sprunge.us
+ fi
+}
diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh
new file mode 100644
index 000000000..644266841
--- /dev/null
+++ b/plugins/symfony2/symfony2.plugin.zsh
@@ -0,0 +1,13 @@
+# Symfony2 basic command completion
+
+_symfony2_get_command_list () {
+ app/console --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }'
+}
+
+_symfony2 () {
+ if [ -f app/console ]; then
+ compadd `_symfony2_get_command_list`
+ fi
+}
+
+compdef _symfony2 app/console \ No newline at end of file
diff --git a/plugins/wakeonlan/README b/plugins/wakeonlan/README
new file mode 100644
index 000000000..16fdd4587
--- /dev/null
+++ b/plugins/wakeonlan/README
@@ -0,0 +1,29 @@
+This plugin provides a wrapper around the "wakeonlan" tool available from most
+distributions' package repositories, or from the following website:
+
+http://gsd.di.uminho.pt/jpo/software/wakeonlan/
+
+In order to use this wrapper, create the ~/.wakeonlan directory, and place in
+that directory one file for each device you would like to be able to wake. Give
+the file a name that describes the device, such as its hostname. Each file
+should contain a line with the mac address of the target device and the network
+broadcast address.
+
+For instance, there might be a file ~/.wakeonlan/leto with the following
+contents:
+
+00:11:22:33:44:55:66 192.168.0.255
+
+To wake that device, use the following command:
+
+# wake leto
+
+The available device names will be autocompleted, so:
+
+# wake <tab>
+
+...will suggest "leto", along with any other configuration files that were
+placed in the ~/.wakeonlan directory.
+
+For more information regarding the configuration file format, check the
+wakeonlan man page.
diff --git a/plugins/wakeonlan/_wake b/plugins/wakeonlan/_wake
new file mode 100644
index 000000000..4ab10d374
--- /dev/null
+++ b/plugins/wakeonlan/_wake
@@ -0,0 +1,4 @@
+#compdef wake
+#autoload
+
+_arguments "1:device to wake:_files -W '$HOME/.wakeonlan'" && return 0
diff --git a/plugins/wakeonlan/wakeonlan.plugin.zsh b/plugins/wakeonlan/wakeonlan.plugin.zsh
new file mode 100644
index 000000000..6cef7d44a
--- /dev/null
+++ b/plugins/wakeonlan/wakeonlan.plugin.zsh
@@ -0,0 +1,14 @@
+function wake() {
+ local config_file="$HOME/.wakeonlan/$1"
+ if [[ ! -f "$config_file" ]]; then
+ echo "ERROR: There is no configuration file at \"$config_file\"."
+ return 1
+ fi
+
+ if (( ! $+commands[wakeonlan] )); then
+ echo "ERROR: Can't find \"wakeonlan\". Are you sure it's installed?"
+ return 1
+ fi
+
+ wakeonlan -f "$config_file"
+}
diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template
index 1ab40aba6..e52553241 100644
--- a/templates/zshrc.zsh-template
+++ b/templates/zshrc.zsh-template
@@ -7,6 +7,10 @@ ZSH=$HOME/.oh-my-zsh
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
+# Example aliases
+# alias zshconfig="mate ~/.zshrc"
+# alias ohmyzsh="mate ~/.oh-my-zsh"
+
# Set to this to use case-sensitive completion
# CASE_SENSITIVE="true"
@@ -23,6 +27,7 @@ ZSH_THEME="robbyrussell"
# COMPLETION_WAITING_DOTS="true"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
+# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(git)
diff --git a/themes/apple.zsh-theme b/themes/apple.zsh-theme
index 92f1df941..275341dc6 100644
--- a/themes/apple.zsh-theme
+++ b/themes/apple.zsh-theme
@@ -2,7 +2,7 @@ function toon {
echo -n ""
}
-get_git_dirty() {
+get_git_dirty() {
git diff --quiet || echo '*'
}
@@ -18,9 +18,12 @@ zstyle ':vcs_info:*' formats \
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
zstyle ':vcs_info:*' enable git cvs svn
-precmd () {
+theme_precmd () {
vcs_info
}
setopt prompt_subst
PROMPT='%{$fg[magenta]%}$(toon)%{$reset_color%} %~/ %{$reset_color%}${vcs_info_msg_0_}%{$reset_color%}'
+
+autoload -U add-zsh-hook
+add-zsh-hook precmd theme_precmd \ No newline at end of file
diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme
index 259640ba4..f9406dd96 100644
--- a/themes/gallois.zsh-theme
+++ b/themes/gallois.zsh-theme
@@ -14,6 +14,8 @@ git_custom_status() {
#RVM and git settings
if [[ -s ~/.rvm/scripts/rvm ]] ; then
RPS1='$(git_custom_status)%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1'
+else
+ RPS1='$(git_custom_status) $EPS1'
fi
PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b '
diff --git a/themes/jonathan.zsh-theme b/themes/jonathan.zsh-theme
index add485279..a170a13d0 100644
--- a/themes/jonathan.zsh-theme
+++ b/themes/jonathan.zsh-theme
@@ -1,19 +1,19 @@
-function precmd {
+function theme_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
@@ -24,7 +24,7 @@ function precmd {
setopt extended_glob
-preexec () {
+theme_preexec () {
if [[ "$TERM" == "screen" ]]; then
local CMD=${1[(wr)^(*=*|sudo|-*)]}
echo -n "\ek$CMD\e\\"
@@ -69,7 +69,7 @@ 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]%}"
@@ -81,10 +81,10 @@ setprompt () {
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%}'
@@ -96,8 +96,8 @@ setprompt () {
PR_TITLEBAR=''
;;
esac
-
-
+
+
###
# Decide whether to set a screen title
if [[ "$TERM" == "screen" ]]; then
@@ -105,8 +105,8 @@ setprompt () {
else
PR_STITLE=''
fi
-
-
+
+
###
# Finally, the prompt.
@@ -135,3 +135,7 @@ $PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT$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
diff --git a/themes/kolo.zsh-theme b/themes/kolo.zsh-theme
index 6e04e1595..e743289c3 100644
--- a/themes/kolo.zsh-theme
+++ b/themes/kolo.zsh-theme
@@ -7,7 +7,7 @@ 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
-precmd () {
+theme_precmd () {
if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] {
zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{green}]'
} else {
@@ -19,3 +19,6 @@ precmd () {
setopt prompt_subst
PROMPT='%B%F{magenta}%c%B%F{green}${vcs_info_msg_0_}%B%F{magenta} %{$reset_color%}%% '
+
+autoload -U add-zsh-hook
+add-zsh-hook precmd theme_precmd
diff --git a/themes/mh.zsh-theme b/themes/mh.zsh-theme
new file mode 100644
index 000000000..34a3765b1
--- /dev/null
+++ b/themes/mh.zsh-theme
@@ -0,0 +1,24 @@
+# mh theme
+# preview: http://cl.ly/1y2x0W0E3t2C0F29043z
+
+# features:
+# path is autoshortened to ~30 characters
+# displays git status (if applicable in current folder)
+# turns username green if superuser, otherwise it is white
+
+# if superuser make the username green
+if [ $UID -eq 0 ]; then NCOLOR="green"; else NCOLOR="white"; fi
+
+# prompt
+PROMPT='[%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[red]%}%30<...<%~%<<%{$reset_color%}]%(!.#.$) '
+RPROMPT='$(git_prompt_info)'
+
+# git theming
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[gray]%}(%{$fg_no_bold[yellow]%}%B"
+ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[gray]%})%{$reset_color%} "
+ZSH_THEME_GIT_PROMPT_CLEAN=""
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}✱"
+
+# LS colors, made with http://geoff.greer.fm/lscolors/
+export LSCOLORS="Gxfxcxdxbxegedabagacad"
+export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:'
diff --git a/themes/pygmalion.zsh-theme b/themes/pygmalion.zsh-theme
new file mode 100644
index 000000000..cf3bb908f
--- /dev/null
+++ b/themes/pygmalion.zsh-theme
@@ -0,0 +1,9 @@
+# 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='%{$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/sammy.zsh-theme b/themes/sammy.zsh-theme
new file mode 100644
index 000000000..52e6e4bb6
--- /dev/null
+++ b/themes/sammy.zsh-theme
@@ -0,0 +1,6 @@
+PROMPT='%{$fg[white]%}%c$(git_prompt_info)$ % %{$reset_color%}'
+
+ZSH_THEME_GIT_PROMPT_PREFIX="("
+ZSH_THEME_GIT_PROMPT_SUFFIX=""
+ZSH_THEME_GIT_PROMPT_DIRTY="*)"
+ZSH_THEME_GIT_PROMPT_CLEAN=")"
diff --git a/themes/suvash.zsh-theme b/themes/suvash.zsh-theme
new file mode 100644
index 000000000..f50657db2
--- /dev/null
+++ b/themes/suvash.zsh-theme
@@ -0,0 +1,23 @@
+function prompt_char {
+ git branch >/dev/null 2>/dev/null && echo '±' && return
+ hg root >/dev/null 2>/dev/null && echo 'Hg' && return
+ echo '○'
+}
+
+function virtualenv_info {
+ [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') '
+}
+
+function collapse_pwd {
+ echo $(pwd | sed -e "s,^$HOME,~,")
+}
+
+PROMPT='%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) using %{$reset_color%}%{$fg[red]%}$(~/.rvm/bin/rvm-prompt)%{$reset_color%}
+$(virtualenv_info)$(prompt_char) '
+
+
+ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}"
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!"
+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?"
+ZSH_THEME_GIT_PROMPT_CLEAN=""
diff --git a/themes/zhann.zsh-theme b/themes/zhann.zsh-theme
new file mode 100644
index 000000000..3dff29c9c
--- /dev/null
+++ b/themes/zhann.zsh-theme
@@ -0,0 +1,7 @@
+PROMPT='%{$fg_bold[green]%}%p %{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
+RPROMPT='%{$reset_color%} %{$fg[red]%}$(~/.rvm/bin/rvm-prompt i v g) %{$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]%})"
diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
index aeaa0e415..524aa509d 100644
--- a/tools/check_for_upgrade.sh
+++ b/tools/check_for_upgrade.sh
@@ -8,6 +8,12 @@ function _update_zsh_update() {
echo "LAST_EPOCH=$(_current_epoch)" > ~/.zsh-update
}
+function _upgrade_zsh() {
+ /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh
+ # update the zsh file
+ _update_zsh_update
+}
+
if [ -f ~/.zsh-update ]
then
. ~/.zsh-update
@@ -19,17 +25,21 @@ then
epoch_diff=$(($(_current_epoch) - $LAST_EPOCH))
if [ $epoch_diff -gt 6 ]
then
- echo "[Oh My Zsh] Would you like to check for updates?"
- echo "Type Y to update oh-my-zsh: \c"
- read line
- if [ "$line" = Y ] || [ "$line" = y ]
+ if [ "$DISABLE_UPDATE_PROMPT" = "true" ]
then
- /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh
- # update the zsh file
- _update_zsh_update
+ _upgrade_zsh
+ else
+ echo "[Oh My Zsh] Would you like to check for updates?"
+ echo "Type Y to update oh-my-zsh: \c"
+ read line
+ if [ "$line" = Y ] || [ "$line" = y ]
+ then
+ _upgrade_zsh
+ fi
fi
fi
else
# create the zsh file
_update_zsh_update
fi
+
diff --git a/tools/upgrade.sh b/tools/upgrade.sh
index 52a8cc4da..6ffe56f4c 100644
--- a/tools/upgrade.sh
+++ b/tools/upgrade.sh
@@ -1,12 +1,12 @@
current_path=`pwd`
-echo -e "\033[0;34mUpgrading Oh My Zsh\033[0m"
+printf '\033[0;34m%s\033[0m\n' "Upgrading Oh My Zsh"
( cd $ZSH && git pull origin master )
-echo -e "\033[0;32m"' __ __ '"\033[0m"
-echo -e "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m"
-echo -e "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m"
-echo -e "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m"
-echo -e "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m"
-echo -e "\033[0;32m"' /____/ '"\033[0m"
-echo -e "\033[0;34mHooray! Oh My Zsh has been updated and/or is at the current version.\033[0m"
-echo -e "\033[0;34mTo keep up on the latest, be sure to follow Oh My Zsh on twitter: \033[1mhttp://twitter.com/ohmyzsh\033[0m"
+printf '\033[0;32m%s\033[0m\n' ' __ __ '
+printf '\033[0;32m%s\033[0m\n' ' ____ / /_ ____ ___ __ __ ____ _____/ /_ '
+printf '\033[0;32m%s\033[0m\n' ' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '
+printf '\033[0;32m%s\033[0m\n' '/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '
+printf '\033[0;32m%s\033[0m\n' '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '
+printf '\033[0;32m%s\033[0m\n' ' /____/ '
+printf '\033[0;34m%s\033[0m\n' 'Hooray! Oh My Zsh has been updated and/or is at the current version.'
+printf '\033[0;34m%s\033[1m%s\033[0m\n' 'To keep up on the latest, be sure to follow Oh My Zsh on twitter: ' 'http://twitter.com/ohmyzsh'
cd "$current_path"