From 1d9eacb34f59f3bf82a9de0d7b474cb4c501e3fd Mon Sep 17 00:00:00 2001 From: Paul Gideon Dann Date: Thu, 19 May 2011 10:55:19 +0100 Subject: [PATCH 01/51] Plugin to make WOL nice & easy --- plugins/wakeonlan/wakeonlan.plugin.zsh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 plugins/wakeonlan/wakeonlan.plugin.zsh diff --git a/plugins/wakeonlan/wakeonlan.plugin.zsh b/plugins/wakeonlan/wakeonlan.plugin.zsh new file mode 100644 index 00000000..08db1bde --- /dev/null +++ b/plugins/wakeonlan/wakeonlan.plugin.zsh @@ -0,0 +1,15 @@ +function wake() { + local config_file=~/.wakeonlan/$1 + if [[ ! -f $config_file ]]; then + echo "ERROR: There is no configuration file at \"$config_file\"." + return + fi + + which wakeonlan > /dev/null + if [[ ! $? == 0 ]]; then + echo "ERROR: Can't find \"wakeonlan\". Are you sure it's installed?" + return + fi + + wakeonlan -f $config_file +} From bf2c55ac5a789d8874e6d8e06360608b4234e872 Mon Sep 17 00:00:00 2001 From: Ben Lumley Date: Tue, 16 Aug 2011 17:23:33 +0100 Subject: [PATCH 02/51] Gallois theme - made the git branch/status show for those of us without rvm --- themes/gallois.zsh-theme | 2 ++ 1 file changed, 2 insertions(+) diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme index 259640ba..f9406dd9 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 ' From 14411cb904b7682fe2a5c69861bfffa96f124707 Mon Sep 17 00:00:00 2001 From: Paul Gideon Dann Date: Mon, 19 Sep 2011 12:40:29 +0100 Subject: [PATCH 03/51] Tweaks to the wakeonlan plugin These were suggested by sorin-ionescu in pull request #343. --- plugins/wakeonlan/wakeonlan.plugin.zsh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/plugins/wakeonlan/wakeonlan.plugin.zsh b/plugins/wakeonlan/wakeonlan.plugin.zsh index 08db1bde..752bfc60 100644 --- a/plugins/wakeonlan/wakeonlan.plugin.zsh +++ b/plugins/wakeonlan/wakeonlan.plugin.zsh @@ -1,15 +1,18 @@ function wake() { - local config_file=~/.wakeonlan/$1 - if [[ ! -f $config_file ]]; then + local config_file="$HOME/.wakeonlan/$1" + if [[ ! -f "$config_file" ]]; then echo "ERROR: There is no configuration file at \"$config_file\"." - return + return 1 fi - which wakeonlan > /dev/null - if [[ ! $? == 0 ]]; then + if (( ! $+commands[wakeonlan] )); then echo "ERROR: Can't find \"wakeonlan\". Are you sure it's installed?" - return + return 1 fi wakeonlan -f $config_file } + +if (( $+functions[compdef] )); then + compdef "_arguments '1:device to wake:_files -W '\''$HOME/.wakeonlan'\'''" wake +fi From aa7ddd51cc4bd6afca23760ba3e3cc777305b1da Mon Sep 17 00:00:00 2001 From: Paul Gideon Dann Date: Mon, 19 Sep 2011 12:45:34 +0100 Subject: [PATCH 04/51] Forgot to quote the path parameter to wakeonlan --- plugins/wakeonlan/wakeonlan.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/wakeonlan/wakeonlan.plugin.zsh b/plugins/wakeonlan/wakeonlan.plugin.zsh index 752bfc60..8406b8f7 100644 --- a/plugins/wakeonlan/wakeonlan.plugin.zsh +++ b/plugins/wakeonlan/wakeonlan.plugin.zsh @@ -10,7 +10,7 @@ function wake() { return 1 fi - wakeonlan -f $config_file + wakeonlan -f "$config_file" } if (( $+functions[compdef] )); then From e94039d62b04e61507cbaa57c5fa955d97c8eca9 Mon Sep 17 00:00:00 2001 From: Paul Gideon Dann Date: Mon, 19 Sep 2011 15:42:58 +0100 Subject: [PATCH 05/51] Splitting wakeonlan plugin completion into separate file --- plugins/wakeonlan/_wake | 4 ++++ plugins/wakeonlan/wakeonlan.plugin.zsh | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 plugins/wakeonlan/_wake diff --git a/plugins/wakeonlan/_wake b/plugins/wakeonlan/_wake new file mode 100644 index 00000000..4ab10d37 --- /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 index 8406b8f7..6cef7d44 100644 --- a/plugins/wakeonlan/wakeonlan.plugin.zsh +++ b/plugins/wakeonlan/wakeonlan.plugin.zsh @@ -12,7 +12,3 @@ function wake() { wakeonlan -f "$config_file" } - -if (( $+functions[compdef] )); then - compdef "_arguments '1:device to wake:_files -W '\''$HOME/.wakeonlan'\'''" wake -fi From 7ba54d197dac8d5ae380271259ba4d8843f01b4f Mon Sep 17 00:00:00 2001 From: Paul Gideon Dann Date: Tue, 20 Sep 2011 09:26:32 +0100 Subject: [PATCH 06/51] Adding README file for the wakeonlan plugin --- plugins/wakeonlan/README | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 plugins/wakeonlan/README diff --git a/plugins/wakeonlan/README b/plugins/wakeonlan/README new file mode 100644 index 00000000..16fdd458 --- /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 + +...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. From 2ca2ad3fc5b8635b22d33fd0f1c1511f44e9fff8 Mon Sep 17 00:00:00 2001 From: fceccon Date: Tue, 20 Sep 2011 12:04:06 +0200 Subject: [PATCH 07/51] First search in the custom folder for the theme --- oh-my-zsh.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index c4522491..6ab2ba35 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -45,7 +45,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 From 6095fe4f7157ba444addaf436f9f44e3d491a784 Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Thu, 20 Oct 2011 14:12:13 +0800 Subject: [PATCH 08/51] add: battery plugin --- plugins/battery/battery.plugin.zsh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 plugins/battery/battery.plugin.zsh diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh new file mode 100644 index 00000000..bc75c5cf --- /dev/null +++ b/plugins/battery/battery.plugin.zsh @@ -0,0 +1,20 @@ +if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then + function battery_pct_remaining() { echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" } + function battery_time_remaining() { echo $(acpi | cut -f3 -d ',') } + function battery_pct_prompt() { + b=$(battery_pct_remaining) + if [ $b -gt 50 ] ; then + color='green' + elif [ $b -gt 20 ] ; then + color='yellow' + else + color='red' + fi + echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}" + } +else + error_msg='no battery' + function battery_pct_remaining() { echo $error_msg } + function battery_time_remaining() { echo $error_msg } + function battery_pct_prompt() { echo '' } +fi From a5545bd31c76a4f34339dc4e7b87f74fa0174015 Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Thu, 20 Oct 2011 14:12:56 +0800 Subject: [PATCH 09/51] add: rbenv plugin --- plugins/rbenv/rbenv.plugin.zsh | 44 ++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 plugins/rbenv/rbenv.plugin.zsh diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh new file mode 100644 index 00000000..136ea75e --- /dev/null +++ b/plugins/rbenv/rbenv.plugin.zsh @@ -0,0 +1,44 @@ +FOUND_RBENV=0 +for rbenvdir in "$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv" ; do + if [ -d $rbenvdir/bin -a $FOUND_RBENV -eq 0 ] ; then + FOUND_RBENV=1 + export RBENV_ROOT=$rbenvdir + export PATH=${rbenvdir}/bin:$PATH + eval "$(rbenv init -)" + + alias rubies="rbenv versions" + alias gemsets="rbenv gemset list" + + function current_ruby() { + echo "$(rbenv version-name)" + } + + function current_gemset() { + echo "$(rbenv gemset active 2&>/dev/null | sed -e ":a" -e '$ s/\n/+/gp;N;b a') | head -n1" + } + + function gems { + local rbenv_path=$(rbenv prefix) + gem list $@ | sed \ + -Ee "s/\([0-9\.]+( .+)?\)/$fg[blue]&$reset_color/g" \ + -Ee "s|$(echo $rbenv_path)|$fg[magenta]\$rbenv_path$reset_color|g" \ + -Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \ + -Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g" + } + + function rbenv_prompt_info() { + if [[ -n $(current_gemset) ]] ; then + echo "$(current_ruby)@$(current_gemset)" + else + echo "$(current_ruby)" + fi + } + fi +done +unset rbenvdir + +if [ $FOUND_RBENV -eq 0 ] ; then + alias rubies='ruby -v' + function gemsets() { echo 'not supported' } + function rbenv_prompt_info() { echo "system: $(ruby -v | cut -f-2 -d ' ')" } +fi From 31cddcd32427a5f5d3daa0da168d39aba5b510b4 Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Thu, 20 Oct 2011 15:27:49 +0800 Subject: [PATCH 10/51] fix: rbenv: I need to find a proper way to test changes... --- plugins/rbenv/rbenv.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh index 136ea75e..ae37404c 100644 --- a/plugins/rbenv/rbenv.plugin.zsh +++ b/plugins/rbenv/rbenv.plugin.zsh @@ -14,7 +14,7 @@ for rbenvdir in "$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv" ; do } function current_gemset() { - echo "$(rbenv gemset active 2&>/dev/null | sed -e ":a" -e '$ s/\n/+/gp;N;b a') | head -n1" + echo "$(rbenv gemset active 2&>/dev/null | sed -e ":a" -e '$ s/\n/+/gp;N;b a' | head -n1)" } function gems { From a2afccae194470e71dd256b594964ddfe0e5c221 Mon Sep 17 00:00:00 2001 From: ornicar Date: Tue, 25 Oct 2011 09:53:59 +0200 Subject: [PATCH 11/51] Add yaourt --sucre alias in archlinux plugin --- plugins/archlinux/archlinux.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index b5e51903..294dc535 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -9,6 +9,7 @@ if [[ -x `which yaourt` ]]; then alias yaconf='yaourt -C' # Fix all configuration files with vimdiff # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips alias yaupg='yaourt -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system. + alias yasu='yaourt --sucre' # Same as yaupg, but without confirmation alias yain='yaourt -S' # Install specific package(s) from the repositories alias yains='yaourt -U' # Install specific package not from the repositories but from a file alias yare='yaourt -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies From 0f13387b074aa20b035251ea85e4f8a82eddbfa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lache=CC=80ze=20Alexandre?= Date: Wed, 2 Nov 2011 03:55:26 +0100 Subject: [PATCH 12/51] Added completion plugin for jake --- plugins/jake-node/jake-node.plugin.zsh | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 plugins/jake-node/jake-node.plugin.zsh diff --git a/plugins/jake-node/jake-node.plugin.zsh b/plugins/jake-node/jake-node.plugin.zsh new file mode 100644 index 00000000..d629fa4b --- /dev/null +++ b/plugins/jake-node/jake-node.plugin.zsh @@ -0,0 +1,28 @@ +##-----Autocomplete for Jake tool---- +# Jake : https://github.com/mde/jake +# Warning : Jakefile should have the right cas : Jakefile +# Add a .jake_tasks file to your working directory +# Author : Alexandre Lacheze (@al3xstrat) +# Inspiration : http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh + +function _jake_does_task_list_need_generating () { + if [ ! -f .jake_tasks ]; then + return 0; + else + accurate=$(stat -f%m .jake_tasks) + changed=$(stat -f%m Jakefile) + return $(expr $accurate '>=' $changed) + fi +} + +function _jake () { + if [ -f Jakefile ]; then + if _jake_does_task_list_need_generating; then + echo "\nGenerating .jake_tasks..." > /dev/stderr + jake -T | cut -d " " -f 2 | sed -E "s/.\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" > .jake_tasks + fi + reply=( `cat .jake_tasks` ) + fi +} + +compctl -K _jake jake \ No newline at end of file From a78387cb5d46c98336a8fa0abd72d682f1c00c8b Mon Sep 17 00:00:00 2001 From: Alexandre Date: Wed, 2 Nov 2011 13:29:28 +0100 Subject: [PATCH 13/51] Minor modifications in comment-header --- plugins/jake-node/jake-node.plugin.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/jake-node/jake-node.plugin.zsh b/plugins/jake-node/jake-node.plugin.zsh index d629fa4b..d365aee9 100644 --- a/plugins/jake-node/jake-node.plugin.zsh +++ b/plugins/jake-node/jake-node.plugin.zsh @@ -1,7 +1,7 @@ -##-----Autocomplete for Jake tool---- +#---oh-my-zsh plugin : take Autocomplete for Jake tool--- # Jake : https://github.com/mde/jake -# Warning : Jakefile should have the right cas : Jakefile -# Add a .jake_tasks file to your working directory +# Warning : Jakefile should have the right case : Jakefile +# Warnign : Add a .jake_tasks file to your working directory # Author : Alexandre Lacheze (@al3xstrat) # Inspiration : http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh From 456993e03be3193056b9a18a809a18414cf9df00 Mon Sep 17 00:00:00 2001 From: Alexandre Date: Wed, 2 Nov 2011 13:31:06 +0100 Subject: [PATCH 14/51] minor modifications in comment header (the revenge) --- plugins/jake-node/jake-node.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/jake-node/jake-node.plugin.zsh b/plugins/jake-node/jake-node.plugin.zsh index d365aee9..ff9f6b5c 100644 --- a/plugins/jake-node/jake-node.plugin.zsh +++ b/plugins/jake-node/jake-node.plugin.zsh @@ -1,4 +1,4 @@ -#---oh-my-zsh plugin : take Autocomplete for Jake tool--- +#---oh-my-zsh plugin : task Autocomplete for Jake tool--- # Jake : https://github.com/mde/jake # Warning : Jakefile should have the right case : Jakefile # Warnign : Add a .jake_tasks file to your working directory From 452f1213018551f6a388224bbfd1c84ef73b3770 Mon Sep 17 00:00:00 2001 From: Benjamin Boudreau Date: Mon, 7 Nov 2011 13:42:16 -0500 Subject: [PATCH 15/51] Add apt-history to debian plugin --- plugins/debian/debian.plugin.zsh | 42 ++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh index 09771881..16a5d54c 100644 --- a/plugins/debian/debian.plugin.zsh +++ b/plugins/debian/debian.plugin.zsh @@ -54,7 +54,7 @@ if [[ $use_sudo -eq 1 ]]; then # apt-get only alias ads="sudo $apt_pref dselect-upgrade" - + # Install all .deb files in the current directory. # Warning: you will need to put the glob in single quotes if you use: # glob_subst @@ -113,9 +113,6 @@ alias allpkgs='aptitude search -F "%p" --disable-columns ~i' alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc' - - - # Functions ################################################################# # create a simple script that can be used to 'duplicate' a system apt-copy() { @@ -132,11 +129,46 @@ apt-copy() { chmod +x apt-copy.sh } +# Prints apt history +# Usage: +# apt-history install +# apt-history upgrade +# apt-history remove +# apt-history rollback +# apt-history list +# Based On: http://linuxcommando.blogspot.com/2008/08/how-to-show-apt-log-history.html +apt-history () { + case "$1" in + install) + zgrep --no-filename 'install ' $(ls -rt /var/log/dpkg*) + ;; + upgrade|remove) + zgrep --no-filename $1 $(ls -rt /var/log/dpkg*) + ;; + rollback) + zgrep --no-filename upgrade $(ls -rt /var/log/dpkg*) | \ + grep "$2" -A10000000 | \ + grep "$3" -B10000000 | \ + awk '{print $4"="$5}' + ;; + list) + zcat $(ls -rt /var/log/dpkg*) + ;; + *) + echo "Parameters:" + echo " install - Lists all packages that have been installed." + echo " upgrade - Lists all packages that have been upgraded." + echo " remove - Lists all packages that have been removed." + echo " rollback - Lists rollback information." + echo " list - Lists all contains of dpkg logs." + ;; + esac +} # Kernel-package building shortcut kerndeb () { # temporarily unset MAKEFLAGS ( '-j3' will fail ) - MAKEFLAGS=$( print - $MAKEFLAGS | perl -pe 's/-j\s*[\d]+//g' ) + MAKEFLAGS=$( print - $MAKEFLAGS | perl -pe 's/-j\s*[\d]+//g' ) print '$MAKEFLAGS set to '"'$MAKEFLAGS'" appendage='-custom' # this shows up in $ (uname -r ) revision=$(date +"%Y%m%d") # this shows up in the .deb file name From 419ffdc48d218156b578d46d7fb5c64adcccb3de Mon Sep 17 00:00:00 2001 From: Kir Shatrov Date: Wed, 9 Nov 2011 14:46:38 +0400 Subject: [PATCH 16/51] Rails Migrations support --- plugins/rails3/rails3.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/rails3/rails3.plugin.zsh b/plugins/rails3/rails3.plugin.zsh index f4ee637e..792cde2b 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' From 444145b495338ca3fbc86f0956003a1074f845df Mon Sep 17 00:00:00 2001 From: Mario Fernandez Date: Wed, 9 Nov 2011 23:01:45 +0100 Subject: [PATCH 17/51] FIX: commands like ruby and rake where not being completed --- plugins/bundler/bundler.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 3c96b8da..89f62232 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -41,6 +41,6 @@ for cmd in $bundled_commands; do alias $cmd=bundled_$cmd if which _$cmd > /dev/null 2>&1; then - compdef _$cmd bundled_$cmd + compdef _$cmd bundled_$cmd=$cmd fi done From 40c47a737571468b759bbc30e4b4dc4b5f77470f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ho=CC=88ltje?= Date: Tue, 15 Nov 2011 01:14:03 -0500 Subject: [PATCH 18/51] lib/termsupport now uses add-zsh-hook This is needed to play nice with plugins that need various hooks. --- lib/termsupport.zsh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 22e7f372..22198950 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 From 5277a0ffaacbc2e23c8753fefdf1c4fe6d1e7685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ho=CC=88ltje?= Date: Tue, 15 Nov 2011 01:20:29 -0500 Subject: [PATCH 19/51] Added add-zsh-hook support to themes I added add-zsh-hook support to the themes that didn't have it already. This allows the themes to co-exist with plugins and lib/termsupport. --- themes/apple.zsh-theme | 7 +++++-- themes/jonathan.zsh-theme | 28 ++++++++++++++++------------ themes/kolo.zsh-theme | 5 ++++- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/themes/apple.zsh-theme b/themes/apple.zsh-theme index 92f1df94..275341dc 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/jonathan.zsh-theme b/themes/jonathan.zsh-theme index add48527..a170a13d 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 6e04e159..e743289c 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 From 4173ba1e95403f3d2cd28b0ad5d5f2c0691f86b7 Mon Sep 17 00:00:00 2001 From: Graham McMillan Date: Tue, 15 Nov 2011 13:46:14 -0500 Subject: [PATCH 20/51] Added option to disable the update prompt. Set DISABLE_UPDATE_PROMPT to true to enable. --- tools/check_for_upgrade.sh | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index aeaa0e41..524aa509 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 + From 7ec2dd984a7605b28fcaed411f33403802bc876a Mon Sep 17 00:00:00 2001 From: Russell Harmon Date: Wed, 16 Nov 2011 04:32:05 -0500 Subject: [PATCH 21/51] Use printf rather than echo -e in update.sh update.sh is an "sh" script, not a zsh or bash script. On platforms which have real sh, echo does not have the -e option. --- tools/upgrade.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 52a8cc4d..6ffe56f4 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" From 3512eca2cefee9b89b08230021c25f6e30525e31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ho=CC=88ltje?= Date: Wed, 16 Nov 2011 09:25:45 -0500 Subject: [PATCH 22/51] set fpath correctly for custom plugins Custom plugins weren't being added to the fpath correctly. --- oh-my-zsh.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 891e8d46..8f5e2472 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -13,9 +13,16 @@ 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 +# 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 From 258457ea4fe0b8fcb1f6d0242071edb82cab449a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ho=CC=88ltje?= Date: Wed, 16 Nov 2011 09:46:05 -0500 Subject: [PATCH 23/51] Moved ZSH_CUSTOM declaration before fpath is set * also normalized style to match the guide. --- oh-my-zsh.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 8f5e2472..7ae41c33 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -13,6 +13,12 @@ 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 +# 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:=()} @@ -28,12 +34,6 @@ done 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 From 10618f323f2915c2a7281e258a42d05faf1cc1af Mon Sep 17 00:00:00 2001 From: Matt Outten Date: Wed, 16 Nov 2011 11:14:26 -0500 Subject: [PATCH 24/51] Add the --format tag to knife list commands This commit adds the --format tag to all of the autocompletion functions. The default format changed from json to a "human readable" format as of version 0.10. This change should be backward compatible. Alternatively, these commands could be simplified by using the new default human readable format. --- plugins/knife/_knife | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/knife/_knife b/plugins/knife/_knife index 7f8c95ee..f336380a 100644 --- a/plugins/knife/_knife +++ b/plugins/knife/_knife @@ -138,27 +138,27 @@ _knife_options3() { # The chef_x_remote functions use knife to get a list of objects of type x on the server _chef_roles_remote() { - (knife role list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') + (knife role list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') } _chef_clients_remote() { - (knife client list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') + (knife client list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') } _chef_nodes_remote() { - (knife node list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') + (knife node list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') } _chef_cookbooks_remote() { - (knife cookbook list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') + (knife cookbook list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') } _chef_sitecookbooks_remote() { - (knife cookbook site list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') + (knife cookbook site list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') } _chef_data_bags_remote() { - (knife data bag list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') + (knife data bag list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') } # The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server From 31badac2ea2ecdc77cf4c339fcef9472940cb261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lache=CC=80ze=20Alexandre?= Date: Fri, 2 Dec 2011 12:54:04 +0100 Subject: [PATCH 25/51] Jake-node plugin : update - remove the need to write a `jake_tasks` in the directory - use most recent usage of completion with zsh - tested for MacOSX and Ubuntu --- plugins/jake-node/jake-node.plugin.zsh | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/plugins/jake-node/jake-node.plugin.zsh b/plugins/jake-node/jake-node.plugin.zsh index ff9f6b5c..a9eef402 100644 --- a/plugins/jake-node/jake-node.plugin.zsh +++ b/plugins/jake-node/jake-node.plugin.zsh @@ -1,28 +1,14 @@ #---oh-my-zsh plugin : task Autocomplete for Jake tool--- # Jake : https://github.com/mde/jake -# Warning : Jakefile should have the right case : Jakefile -# Warnign : Add a .jake_tasks file to your working directory +# Warning : Jakefile should have the right case : Jakefile or jakefile +# Tested on : MacOSX 10.7 (Lion), Ubuntu 11.10 # Author : Alexandre Lacheze (@al3xstrat) # Inspiration : http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh -function _jake_does_task_list_need_generating () { - if [ ! -f .jake_tasks ]; then - return 0; - else - accurate=$(stat -f%m .jake_tasks) - changed=$(stat -f%m Jakefile) - return $(expr $accurate '>=' $changed) - fi -} - function _jake () { - if [ -f Jakefile ]; then - if _jake_does_task_list_need_generating; then - echo "\nGenerating .jake_tasks..." > /dev/stderr - jake -T | cut -d " " -f 2 | sed -E "s/.\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" > .jake_tasks - fi - reply=( `cat .jake_tasks` ) + if [ -f Jakefile ]||[ -f jakefile ]; then + compadd `jake -T | cut -d " " -f 2 | sed -E "s/.\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"` fi } -compctl -K _jake jake \ No newline at end of file +compdef _jake jake \ No newline at end of file From 3fc812afc9af75e49a8f99bad3ada41672547503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6ran=20Gustafsson?= Date: Sat, 3 Dec 2011 13:18:37 +0100 Subject: [PATCH 26/51] Removed duplicate setting and sorted the remaining --- lib/history.zsh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/history.zsh b/lib/history.zsh index ca6f5707..876936b8 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 From b16099f3cb9855affa14d0f03adf6563f8df4cbe Mon Sep 17 00:00:00 2001 From: Steven De Coeyer Date: Tue, 6 Dec 2011 15:18:29 +0100 Subject: [PATCH 27/51] Added Zhann theme. Based on Robbyrussel theme, but shows the current ruby version and has some color variations. --- themes/zhann.zsh-theme | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 themes/zhann.zsh-theme diff --git a/themes/zhann.zsh-theme b/themes/zhann.zsh-theme new file mode 100644 index 00000000..6c056dfb --- /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) %{$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]%})" From 42b0123427d2bdee0e3221d930bb48038c601932 Mon Sep 17 00:00:00 2001 From: Max Persson Date: Wed, 7 Dec 2011 11:08:42 +0100 Subject: [PATCH 28/51] Added brute force package completin on install subcommand --- plugins/pip/_pip | 60 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/plugins/pip/_pip b/plugins/pip/_pip index b5801017..8c03d851 100644 --- a/plugins/pip/_pip +++ b/plugins/pip/_pip @@ -3,30 +3,39 @@ # pip zsh completion, based on homebrew completion +_pip_all() { + all_pkgs=(`pip search * | cut -d ' ' -f 1 | tr '[A-Z]' '[a-z]'`) +} + _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 +44,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 all_pkgs expl 'packages' compadd -a all_pkgs fi ;; uninstall) _pip_installed From 1c4997f5cada6f1ff1f205b20cf321cfc6b6d347 Mon Sep 17 00:00:00 2001 From: Max Persson Date: Wed, 7 Dec 2011 13:32:58 +0100 Subject: [PATCH 29/51] Added caching of packages --- plugins/pip/_pip | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/pip/_pip b/plugins/pip/_pip index 8c03d851..07d37c80 100644 --- a/plugins/pip/_pip +++ b/plugins/pip/_pip @@ -4,7 +4,10 @@ # pip zsh completion, based on homebrew completion _pip_all() { - all_pkgs=(`pip search * | cut -d ' ' -f 1 | tr '[A-Z]' '[a-z]'`) + # we cache the list of packages (originally from the macports plugin) + if (( ! $+piplist )); then + piplist=($(pip search * | cut -d ' ' -f 1 | tr '[A-Z]' '[a-z]')) + fi } _pip_installed() { @@ -62,7 +65,7 @@ case "$words[1]" in if [[ "$state" == packages ]]; then _pip_all - _wanted all_pkgs expl 'packages' compadd -a all_pkgs + _wanted piplist expl 'packages' compadd -a piplist fi ;; uninstall) _pip_installed From 5eae9421883d71b954d4abaa6056b28874ad47ec Mon Sep 17 00:00:00 2001 From: Max Persson Date: Wed, 7 Dec 2011 14:09:43 +0100 Subject: [PATCH 30/51] Added message when caching packages --- plugins/pip/_pip | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/pip/_pip b/plugins/pip/_pip index 07d37c80..df53ba5c 100644 --- a/plugins/pip/_pip +++ b/plugins/pip/_pip @@ -6,6 +6,7 @@ _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 } From d25fb095a9d1f814fe2b4d0f42ffe827780d4a59 Mon Sep 17 00:00:00 2001 From: Dominick LoBraico Date: Fri, 9 Dec 2011 12:18:54 -0600 Subject: [PATCH 31/51] forks miloshadzic theme to add more directory info as well as user and host info --- themes/pygmalion.zsh-theme | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 themes/pygmalion.zsh-theme diff --git a/themes/pygmalion.zsh-theme b/themes/pygmalion.zsh-theme new file mode 100644 index 00000000..cf3bb908 --- /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%} ' + From 8ca019f02a4dc718fe5fc8b1186108eb376360c9 Mon Sep 17 00:00:00 2001 From: Suvash Thapaliya Date: Mon, 12 Dec 2011 23:55:07 +0100 Subject: [PATCH 32/51] Added my own theme file : suvash Since I store my dotfiles on github and plan to submodule oh-my-zsh i supposed it was a good idea to submit my theme as well. --- themes/suvash.zsh-theme | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 themes/suvash.zsh-theme diff --git a/themes/suvash.zsh-theme b/themes/suvash.zsh-theme new file mode 100644 index 00000000..f50657db --- /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="" From 3e7e52a25fbfdb57f291ee9575a606f845dbff57 Mon Sep 17 00:00:00 2001 From: Christoph Neuroth Date: Wed, 14 Dec 2011 11:47:24 +0100 Subject: [PATCH 33/51] add support for autojump installed via macports --- plugins/autojump/autojump.plugin.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh index da0a1276..6f9b80bf 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 From 1a49f6443c0230b8e182294546ed9ef2a5110bf2 Mon Sep 17 00:00:00 2001 From: Matt Parnell Date: Sat, 12 Nov 2011 21:09:27 -0800 Subject: [PATCH 34/51] add sprunge.us pastebin uploader - uses files, or pipes --- plugins/sprunge/sprunge.plugin.zsh | 64 ++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 plugins/sprunge/sprunge.plugin.zsh diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh new file mode 100644 index 00000000..9f9432ac --- /dev/null +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -0,0 +1,64 @@ +# Contributed and SLIGHTLY modded by Matt Parnell/ilikenwf +# 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 [&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 +} From 03424fdadba13fea2297a94144e989926cabdcb3 Mon Sep 17 00:00:00 2001 From: Andrew Tch Date: Sun, 18 Dec 2011 00:23:31 +0200 Subject: [PATCH 35/51] Symfony 2 completion --- plugins/symfony2/symfony2.plugin.zsh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 plugins/symfony2/symfony2.plugin.zsh diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh new file mode 100644 index 00000000..64426684 --- /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 From 1ced49b85a859b399728ce32ef77399874f5172b Mon Sep 17 00:00:00 2001 From: Cameron Johnston Date: Sun, 18 Dec 2011 22:15:00 -0700 Subject: [PATCH 36/51] adding support for chef environments in knife plugin --- plugins/knife/_knife | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/knife/_knife b/plugins/knife/_knife index 7f8c95ee..32ff9fc9 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) From a62d22726be1c3a02405bf327449e605be8fc5b2 Mon Sep 17 00:00:00 2001 From: Steven De Coeyer Date: Mon, 19 Dec 2011 15:26:37 +0100 Subject: [PATCH 37/51] show gemset next to ruby version --- themes/zhann.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/zhann.zsh-theme b/themes/zhann.zsh-theme index 6c056dfb..3dff29c9 100644 --- a/themes/zhann.zsh-theme +++ b/themes/zhann.zsh-theme @@ -1,5 +1,5 @@ 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) %{$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%}" From a21dc477c26ce29c839ca3aa36af91efcad179ea Mon Sep 17 00:00:00 2001 From: Trevor Wennblom Date: Tue, 20 Dec 2011 16:16:02 -0600 Subject: [PATCH 38/51] add note about custom plugins --- templates/zshrc.zsh-template | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 1ab40aba..64b1ece6 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -23,6 +23,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) From dd14e075b7dd39906e2075ac6dd8f5bcc66b6129 Mon Sep 17 00:00:00 2001 From: "julien@macbook" Date: Wed, 21 Dec 2011 15:03:55 +0100 Subject: [PATCH 39/51] Ignore submodules dirty in prompt info --- lib/git.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git.zsh b/lib/git.zsh index f0434365..defa062c 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" From d8521693f4e2c140391065e7b721d7452134259f Mon Sep 17 00:00:00 2001 From: Kyle Smith Date: Thu, 22 Dec 2011 14:02:01 -0500 Subject: [PATCH 40/51] Added support for entries in /etc/ssh/ssh_known_hosts. --- lib/completion.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/completion.zsh b/lib/completion.zsh index b3cc9182..0e5d480f 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)"$( Date: Fri, 23 Dec 2011 11:14:22 +0400 Subject: [PATCH 41/51] Added alias gcm='git checkout master --- plugins/git/git.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 183c56c1..c1b382b2 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' From 0b583638ae7bc58928b77669919600e27f4738b0 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Sun, 11 Dec 2011 20:27:35 +0530 Subject: [PATCH 42/51] Fix upgrade and uninstall functions to pick up $ZSH value --- lib/functions.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/functions.zsh b/lib/functions.zsh index ef7cc638..d2dcadd0 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() { From 59baf390e96751fc51299ecefe921ba8718ba3aa Mon Sep 17 00:00:00 2001 From: Tate Johnson Date: Mon, 26 Dec 2011 13:16:26 +1000 Subject: [PATCH 43/51] Black on white theme inspired by Sam Stephenson's terminal screenshot on https://github.com/sstephenson/rbenv --- themes/sammy.zsh-theme | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 themes/sammy.zsh-theme diff --git a/themes/sammy.zsh-theme b/themes/sammy.zsh-theme new file mode 100644 index 00000000..52e6e4bb --- /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=")" From f999fd8e121c1fd4d097c25be59c6020e1aed830 Mon Sep 17 00:00:00 2001 From: Michael Holachek Date: Mon, 26 Dec 2011 12:20:02 -0500 Subject: [PATCH 44/51] Added example aliases in ZSH template. Added a new theme. Example aliases allow for an easier way to open ZSH config file/folder in Textmate. New theme is mh.zsh-theme. --- templates/zshrc.zsh-template | 4 ++++ themes/mh.zsh-theme | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 themes/mh.zsh-theme diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 1ab40aba..25cf4f23 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" diff --git a/themes/mh.zsh-theme b/themes/mh.zsh-theme new file mode 100644 index 00000000..34a3765b --- /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:' From 480d1247b89ae089564eb0ca7d66aef989b9f5e5 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Mon, 26 Dec 2011 10:15:35 -0800 Subject: [PATCH 45/51] Updating installation documentation to show a curl example as well for those who don't have wget installed. --- README.textile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.textile b/README.textile index 2dbfbe5a..eca96808 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 From 967e84ebaa180ad2ab1eebc9a512f94d93e84aea Mon Sep 17 00:00:00 2001 From: Andreas Steinel Date: Thu, 29 Dec 2011 02:22:40 +0100 Subject: [PATCH 46/51] multiple versions could occur and should also be highlighted --- plugins/rvm/rvm.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/rvm/rvm.plugin.zsh b/plugins/rvm/rvm.plugin.zsh index 24621fe0..604c0071 100644 --- a/plugins/rvm/rvm.plugin.zsh +++ b/plugins/rvm/rvm.plugin.zsh @@ -37,7 +37,7 @@ function gems { local current_gemset=`rvm-prompt g` gem list $@ | sed \ - -Ee "s/\([0-9\.]+( .+)?\)/$fg[blue]&$reset_color/g" \ + -Ee "s/\([0-9, \.]+( .+)?\)/$fg[blue]&$reset_color/g" \ -Ee "s|$(echo $rvm_path)|$fg[magenta]\$rvm_path$reset_color|g" \ -Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \ -Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g" From 2176cf37fb1eed028c53a2095098d585489b1cce Mon Sep 17 00:00:00 2001 From: Simon Jefford Date: Thu, 29 Dec 2011 21:54:19 +0000 Subject: [PATCH 47/51] bundler plugin - don't "bundle exec rails" As per http://blog.wyeworks.com/2011/12/27/bundle-exec-rails-executes-bundler-setup-3-times --- plugins/bundler/bundler.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 89f62232..7b73c8fe 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -10,7 +10,7 @@ alias bu="bundle update" # The following is based on https://github.com/gma/bundler-exec -bundled_commands=(cap capify cucumber foreman guard heroku nanoc rackup rails rainbows rake rspec ruby shotgun spec spork thin unicorn unicorn_rails) +bundled_commands=(cap capify cucumber foreman guard heroku nanoc rackup rainbows rake rspec ruby shotgun spec spork thin unicorn unicorn_rails) ## Functions From cb501645d70ad1e50b6b3d3553618e585074533f Mon Sep 17 00:00:00 2001 From: Gustavo Barron Date: Fri, 30 Dec 2011 12:11:41 -0600 Subject: [PATCH 48/51] Get the Hostname Main library should use ZSH native hostname function --- lib/completion.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/completion.zsh b/lib/completion.zsh index 0e5d480f..b964595e 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -39,7 +39,7 @@ hosts=( "$_global_ssh_hosts[@]" "$_ssh_hosts[@]" "$_etc_hosts[@]" - `hostname` + "$HOST" localhost ) zstyle ':completion:*:hosts' hosts $hosts From a49fcea9f5d281cccce2ad421db253455a248109 Mon Sep 17 00:00:00 2001 From: Patrick Lindborg Date: Mon, 2 Jan 2012 21:48:19 +0100 Subject: [PATCH 49/51] Fixed the rfind command in the ruby plugin --- plugins/ruby/ruby.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ruby/ruby.plugin.zsh b/plugins/ruby/ruby.plugin.zsh index 08ca9c60..38e4d7cd 100644 --- a/plugins/ruby/ruby.plugin.zsh +++ b/plugins/ruby/ruby.plugin.zsh @@ -3,4 +3,4 @@ alias sgem='sudo gem' # Find ruby file -alias rfind='find . -name *.rb | xargs grep -n' +alias rfind='find . -name "*.rb" | xargs grep -n' From a28b8889ee80856b65dd792dedd7735a1b94443c Mon Sep 17 00:00:00 2001 From: Alexander Madyankin Date: Thu, 5 Jan 2012 11:16:17 +0600 Subject: [PATCH 50/51] Apple Terminal.app resume directory plugin --- plugins/terminalapp/terminalapp.plugin.zsh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 plugins/terminalapp/terminalapp.plugin.zsh diff --git a/plugins/terminalapp/terminalapp.plugin.zsh b/plugins/terminalapp/terminalapp.plugin.zsh new file mode 100644 index 00000000..4695ad05 --- /dev/null +++ b/plugins/terminalapp/terminalapp.plugin.zsh @@ -0,0 +1,11 @@ +# Set Apple Terminal.app resume directory +# based on this answer: http://superuser.com/a/315029 + +function chpwd { + local SEARCH=' ' + local REPLACE='%20' + local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}" + printf '\e]7;%s\a' "$PWD_URL" +} + +chpwd \ No newline at end of file From 7a361870a97d9d34158542503f942fb0c67accfc Mon Sep 17 00:00:00 2001 From: lucapette Date: Fri, 6 Jan 2012 22:10:57 +0100 Subject: [PATCH 51/51] add annotate --- plugins/bundler/bundler.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 7b73c8fe..55564a25 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -10,7 +10,7 @@ alias bu="bundle update" # The following is based on https://github.com/gma/bundler-exec -bundled_commands=(cap capify cucumber foreman guard heroku nanoc rackup rainbows rake rspec ruby shotgun spec spork thin unicorn unicorn_rails) +bundled_commands=(annotate cap capify cucumber foreman guard heroku nanoc rackup rainbows rake rspec ruby shotgun spec spork thin unicorn unicorn_rails) ## Functions