From f6fb34845d31a840c73416f138dae1761ea4adb9 Mon Sep 17 00:00:00 2001 From: Alexandre Joly Date: Tue, 10 Sep 2013 09:14:24 +0200 Subject: [PATCH 01/25] updated the arguments list to the newest version (0.24.0) of cocoapods --- plugins/pod/_pod | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/pod/_pod b/plugins/pod/_pod index 563fa5e6..6dd8b637 100644 --- a/plugins/pod/_pod +++ b/plugins/pod/_pod @@ -3,18 +3,19 @@ # ----------------------------------------------------------------------------- # FILE: _pod -# DESCRIPTION: Cocoapods autocomplete plugin for Oh-My-Zsh +# DESCRIPTION: Cocoapods (0.24.0) autocomplete plugin for Oh-My-Zsh # http://cocoapods.org # AUTHOR: Alexandre Joly (alexandre.joly@mekanics.ch) # GITHUB: https://github.com/mekanics # TWITTER: @jolyAlexandre -# VERSION: 0.0.1 +# VERSION: 0.0.2 # LICENSE: MIT # ----------------------------------------------------------------------------- local -a _1st_arguments _1st_arguments=( 'help:Show help for the given command.' + 'init:Generate a Podfile for the current directory.' 'install:Install project dependencies' 'ipc:Inter-process communication' 'list:List pods' From bdb2cabaa68a8c3af72df5a10bb3925fe1eda45e Mon Sep 17 00:00:00 2001 From: Alexandre Joly Date: Tue, 10 Sep 2013 09:17:09 +0200 Subject: [PATCH 02/25] typo --- plugins/pod/_pod | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/pod/_pod b/plugins/pod/_pod index 6dd8b637..745e9b15 100644 --- a/plugins/pod/_pod +++ b/plugins/pod/_pod @@ -14,8 +14,8 @@ local -a _1st_arguments _1st_arguments=( - 'help:Show help for the given command.' - 'init:Generate a Podfile for the current directory.' + 'help:Show help for the given command' + 'init:Generate a Podfile for the current directory' 'install:Install project dependencies' 'ipc:Inter-process communication' 'list:List pods' From 40b1cf01035a3d74395b5d9def4f79af17fca4c8 Mon Sep 17 00:00:00 2001 From: Alexandre Joly Date: Tue, 10 Sep 2013 15:20:57 +0200 Subject: [PATCH 03/25] repo list search one level deeper the folder structure changed '.cocoapods/' -> '.cocoapods/repos' --- plugins/pod/_pod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/pod/_pod b/plugins/pod/_pod index 745e9b15..ba0c9ab3 100644 --- a/plugins/pod/_pod +++ b/plugins/pod/_pod @@ -159,7 +159,7 @@ __first_command_list () } __repo_list() { - _wanted application expl 'repo' compadd $(command ls -1 ~/.cocoapods 2>/dev/null | sed -e 's/ /\\ /g') + _wanted application expl 'repo' compadd $(command ls -1 ~/.cocoapods/repos 2>/dev/null | sed -e 's/ /\\ /g') } __pod-repo() { From 0eb86f82d6d3a6cf05b11818bb69ba4de80124da Mon Sep 17 00:00:00 2001 From: Alexandre Joly Date: Tue, 29 Oct 2013 10:33:37 +0100 Subject: [PATCH 04/25] updated to the latest version of cocoapods 0.27.1 --- plugins/pod/_pod | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/pod/_pod b/plugins/pod/_pod index ba0c9ab3..8c0f4460 100644 --- a/plugins/pod/_pod +++ b/plugins/pod/_pod @@ -3,12 +3,12 @@ # ----------------------------------------------------------------------------- # FILE: _pod -# DESCRIPTION: Cocoapods (0.24.0) autocomplete plugin for Oh-My-Zsh +# DESCRIPTION: Cocoapods (0.27.1) autocomplete plugin for Oh-My-Zsh # http://cocoapods.org # AUTHOR: Alexandre Joly (alexandre.joly@mekanics.ch) # GITHUB: https://github.com/mekanics # TWITTER: @jolyAlexandre -# VERSION: 0.0.2 +# VERSION: 0.0.3 # LICENSE: MIT # ----------------------------------------------------------------------------- @@ -33,6 +33,7 @@ local -a _repo_arguments _repo_arguments=( 'add:Add a spec repo' 'lint:Validates all specs in a repo' + 'remove:Remove a spec repo.' 'update:Update a spec repo' ) @@ -194,6 +195,12 @@ __pod-repo() { (add) _arguments \ $_inherited_options + + (remove) + _arguments \ + $_inherited_options \ + ':feature:__repo_list' + ;; esac ;; esac From 78df6e96f5ad2d6df77af39f70f4906a09700849 Mon Sep 17 00:00:00 2001 From: Brandon W Maister Date: Tue, 29 Oct 2013 23:02:44 -0400 Subject: [PATCH 05/25] pip: successfully cache all the packages Switch to using curl and regular expressions to generate a local cache file so that we don't need to hit pypi.python.org every time. This (obviously) results in a massive speed improvement, especially if you spawn new shells frequently. This also makes the autocompletion work for me, it didn't before. (pip would always time out.) And, also, for fun: This allows you to explicitly set which pip indexes to use. Technically the old version of the plugin should have had this behavior automatically -- without having to do more than configure pip -- but the install completion never worked for me so this is a net gain in functionality. --- plugins/pip/_pip | 4 ++-- plugins/pip/pip.plugin.zsh | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 plugins/pip/pip.plugin.zsh diff --git a/plugins/pip/_pip b/plugins/pip/_pip index fb8765c7..967da48c 100644 --- a/plugins/pip/_pip +++ b/plugins/pip/_pip @@ -6,8 +6,8 @@ _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]')) + zsh-pip-cache-packages + piplist=($(cat $ZSH_PIP_CACHE_FILE)) fi } diff --git a/plugins/pip/pip.plugin.zsh b/plugins/pip/pip.plugin.zsh new file mode 100644 index 00000000..78532a6d --- /dev/null +++ b/plugins/pip/pip.plugin.zsh @@ -0,0 +1,37 @@ +# Usage: +# Just add pip to your installed plugins. + +# If you would like to change the cheeseshops used for autocomplete set +# ZSH_PIP_INDEXES in your zshrc. If one of your indexes are bogus you won't get +# any kind of error message, pip will just not autocomplete from them. Double +# check! +# +# If you would like to clear your cache, go ahead and do a +# "zsh-pip-clear-cache". + +ZSH_PIP_CACHE_FILE=~/.pip/zsh-cache +ZSH_PIP_INDEXES=(https://pypi.python.org/simple/) + +zsh-pip-clear-cache() { + rm $ZSH_PIP_CACHE_FILE + unset piplist +} + +zsh-pip-cache-packages() { + if [[ ! -d ${PIP_CACHE_FILE:h} ]]; then + mkdir -p ${PIP_CACHE_FILE:h} + fi + + if [[ ! -f $ZSH_PIP_CACHE_FILE ]]; then + echo -n "(...caching package index...)" + tmp_cache=/tmp/zsh_tmp_cache + for index in $ZSH_PIP_INDEXES ; do + # well... I've already got two problems + curl $index 2>/dev/null | \ + sed -nr '/^([^<]+).*/\1/p' \ + >> $tmp_cache + done + sort $tmp_cache | uniq | tr '\n' ' ' > $ZSH_PIP_CACHE_FILE + rm $tmp_cache + fi +} From 008e57aa5aec0f38445785da58a11462ef9451f9 Mon Sep 17 00:00:00 2001 From: Brandon W Maister Date: Wed, 30 Oct 2013 21:00:08 -0400 Subject: [PATCH 06/25] Make the pip cache work with djangopypi2 Also add a test function that allows messing with the cache-creating regex with some assurance that you're not trampling other people's index-parsing. --- plugins/pip/pip.plugin.zsh | 43 +++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/plugins/pip/pip.plugin.zsh b/plugins/pip/pip.plugin.zsh index 78532a6d..71f977bb 100644 --- a/plugins/pip/pip.plugin.zsh +++ b/plugins/pip/pip.plugin.zsh @@ -17,6 +17,10 @@ zsh-pip-clear-cache() { unset piplist } +zsh-pip-clean-packages() { + sed -nr '/([^<]+).*/\1/p' +} + zsh-pip-cache-packages() { if [[ ! -d ${PIP_CACHE_FILE:h} ]]; then mkdir -p ${PIP_CACHE_FILE:h} @@ -28,10 +32,47 @@ zsh-pip-cache-packages() { for index in $ZSH_PIP_INDEXES ; do # well... I've already got two problems curl $index 2>/dev/null | \ - sed -nr '/^([^<]+).*/\1/p' \ + zsh-pip-clean-packages \ >> $tmp_cache done sort $tmp_cache | uniq | tr '\n' ' ' > $ZSH_PIP_CACHE_FILE rm $tmp_cache fi } + +# A test function that validates the regex against known forms of the simple +# index. If you modify the regex to make it work for you, you should add a test +# case in here and make sure that your changes don't break things for someone +# else. +zsh-pip-test-clean-packages() { + local expected + local actual + expected="0x10c-asm +1009558_nester" + + actual=$(echo -n "Simple Index +0x10c-asm
+1009558_nester
+" | zsh-pip-clean-packages) + + if [[ $actual != $expected ]] ; then + echo -e "python's simple index is broken:\n$actual\n !=\n$expected" + else + echo "python's simple index is fine" + fi + + actual=$(echo -n ' + + Simple Package Index + + + 0x10c-asm
+ 1009558_nester
+' | zsh-pip-clean-packages) + + if [[ $actual != $expected ]] ; then + echo -e "the djangopypi2 index is broken:\n$actual\n !=\n$expected" + else + echo "the djangopypi2 index is fine" + fi +} From 96798c42f046fec7f01f53d10dd63f30ed6a1e07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zsolt=20Sz=2E=20Sztup=C3=A1k?= Date: Mon, 11 Nov 2013 18:09:33 +0000 Subject: [PATCH 07/25] Fix issues with special characters when running mvn Setting the locale to C will stabilize sed, so it won't stop processing the mvn output when it encounters invalid characters (like binary data) This makes it also more viable to add the `alias mvn='mvn-color`, as the coloring is less obtrusive, and there won't be any issues with sed breaking because of an invalid character inside the stream --- plugins/mvn/mvn.plugin.zsh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index 799f6fc8..0c914190 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -24,16 +24,18 @@ export RESET_FORMATTING=`tput sgr0` # Wrapper function for Maven's mvn command. mvn-color() { - # Filter mvn output using sed - mvn $@ | sed -e "s/\(\[INFO\]\ \-.*\)/${TEXT_BLUE}${BOLD}\1/g" \ - -e "s/\(\[INFO\]\ \[.*\)/${RESET_FORMATTING}${BOLD}\1${RESET_FORMATTING}/g" \ + ( + # Filter mvn output using sed. Before filtering set the locale to C, so invalid characters won't break some sed implementations + unset LANG + LC_CTYPE=C mvn $@ | sed -e "s/\(\[INFO\]\)\(.*\)/${TEXT_BLUE}${BOLD}\1${RESET_FORMATTING}\2/g" \ -e "s/\(\[INFO\]\ BUILD SUCCESSFUL\)/${BOLD}${TEXT_GREEN}\1${RESET_FORMATTING}/g" \ - -e "s/\(\[WARNING\].*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}/g" \ - -e "s/\(\[ERROR\].*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}/g" \ + -e "s/\(\[WARNING\]\)\(.*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}\2/g" \ + -e "s/\(\[ERROR\]\)\(.*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}\2/g" \ -e "s/Tests run: \([^,]*\), Failures: \([^,]*\), Errors: \([^,]*\), Skipped: \([^,]*\)/${BOLD}${TEXT_GREEN}Tests run: \1${RESET_FORMATTING}, Failures: ${BOLD}${TEXT_RED}\2${RESET_FORMATTING}, Errors: ${BOLD}${TEXT_RED}\3${RESET_FORMATTING}, Skipped: ${BOLD}${TEXT_YELLOW}\4${RESET_FORMATTING}/g" # Make sure formatting is reset echo -ne ${RESET_FORMATTING} + ) } # Override the mvn command with the colorized one. From a7540844d5142d0ab3fae38b660c690859435bb5 Mon Sep 17 00:00:00 2001 From: Petter Abrahamsson Date: Thu, 14 Nov 2013 07:06:54 -0500 Subject: [PATCH 08/25] Add support for colored ls output on OpenBSD --- lib/theme-and-appearance.zsh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh index 2677615c..0353f9db 100644 --- a/lib/theme-and-appearance.zsh +++ b/lib/theme-and-appearance.zsh @@ -11,6 +11,10 @@ then # On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors); # otherwise, leave ls as is, because NetBSD's ls doesn't support -G gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty' + elif [[ "$(uname -s)" == "OpenBSD" ]]; then + # On OpenBSD, test if "colorls" is installed (this one supports colors); + # otherwise, leave ls as is, because OpenBSD's ls doesn't support -G + colorls -G -d . &>/dev/null 2>&1 && alias ls='colorls -G' else ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G' fi From ae6b26327a01211e7109c00c36650db05be75a55 Mon Sep 17 00:00:00 2001 From: Pedro Henrique Passalini Date: Thu, 14 Nov 2013 14:30:21 -0200 Subject: [PATCH 09/25] add new alias to zeus --- plugins/zeus/zeus.plugin.zsh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/plugins/zeus/zeus.plugin.zsh b/plugins/zeus/zeus.plugin.zsh index eddfb4f9..5ec9fa57 100644 --- a/plugins/zeus/zeus.plugin.zsh +++ b/plugins/zeus/zeus.plugin.zsh @@ -53,3 +53,17 @@ alias zall='zeus test test/unit/*; zeus test test/functional/; zeus cucumber' # Clean up crashed zeus instances. alias zsw='rm .zeus.sock' alias zweep='rm .zeus.sock' + +# Reset database +alias zdbr='zeus rake db:reset db:test:prepare' +alias zdbreset='zeus rake db:reset db:test:prepare' + +# Migrate and prepare database +alias zdbm='zeus rake db:migrate db:test:prepare' +alias zdbmigrate='zeus rake db:migrate db:test:prepare' + +# Create database +alias zdbc='zeus rake db:create' + +# Create, migrate and prepare database +alias zdbcm='zeus rake db:create db:migrate db:test:prepare' \ No newline at end of file From dcf7c7cce0c4824a728de9ed0cabdfa073829e8d Mon Sep 17 00:00:00 2001 From: Pedro Henrique Passalini Date: Thu, 14 Nov 2013 14:36:20 -0200 Subject: [PATCH 10/25] add aliases to readme --- plugins/zeus/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/zeus/README.md b/plugins/zeus/README.md index d7c2aef8..8964eaae 100644 --- a/plugins/zeus/README.md +++ b/plugins/zeus/README.md @@ -41,3 +41,13 @@ * `zsw` aliases `rm .zeus.sock` * `zweep` aliases `rm .zeus.sock` + +`zdbr` aliases `zeus rake db:reset db:test:prepare` +`zdbreset` aliases `zeus rake db:reset db:test:prepare` + +`zdbm` aliases `zeus rake db:migrate db:test:prepare` +`zdbmigrate` aliases `zeus rake db:migrate db:test:prepare` + +`zdbc` aliases `zeus rake db:create` + +`zdbcm` aliases `zeus rake db:create db:migrate db:test:prepare` From 3930a63253c08eafb5baf73508031932e0ed7437 Mon Sep 17 00:00:00 2001 From: Eddie Monge Date: Thu, 14 Nov 2013 16:17:23 -0800 Subject: [PATCH 11/25] no tabs in a space-d file --- themes/agnoster.zsh-theme | 64 +++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 762f63c5..01cdc80e 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -95,38 +95,38 @@ prompt_git() { } prompt_hg() { - local rev status - if $(hg id >/dev/null 2>&1); then - if $(hg prompt >/dev/null 2>&1); then - if [[ $(hg prompt "{status|unknown}") = "?" ]]; then - # if files are not added - prompt_segment red white - st='±' - elif [[ -n $(hg prompt "{status|modified}") ]]; then - # if any modification - prompt_segment yellow black - st='±' - else - # if working copy is clean - prompt_segment green black - fi - echo -n $(hg prompt "☿ {rev}@{branch}") $st - else - st="" - rev=$(hg id -n 2>/dev/null | sed 's/[^-0-9]//g') - branch=$(hg id -b 2>/dev/null) - if `hg st | grep -Eq "^\?"`; then - prompt_segment red black - st='±' - elif `hg st | grep -Eq "^(M|A)"`; then - prompt_segment yellow black - st='±' - else - prompt_segment green black - fi - echo -n "☿ $rev@$branch" $st - fi - fi + local rev status + if $(hg id >/dev/null 2>&1); then + if $(hg prompt >/dev/null 2>&1); then + if [[ $(hg prompt "{status|unknown}") = "?" ]]; then + # if files are not added + prompt_segment red white + st='±' + elif [[ -n $(hg prompt "{status|modified}") ]]; then + # if any modification + prompt_segment yellow black + st='±' + else + # if working copy is clean + prompt_segment green black + fi + echo -n $(hg prompt "☿ {rev}@{branch}") $st + else + st="" + rev=$(hg id -n 2>/dev/null | sed 's/[^-0-9]//g') + branch=$(hg id -b 2>/dev/null) + if `hg st | grep -Eq "^\?"`; then + prompt_segment red black + st='±' + elif `hg st | grep -Eq "^(M|A)"`; then + prompt_segment yellow black + st='±' + else + prompt_segment green black + fi + echo -n "☿ $rev@$branch" $st + fi + fi } # Dir: current working directory From 6f48f586ba55507bb90fa8dd078b01c0333b907d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20F=C3=A6revaag?= Date: Sat, 16 Nov 2013 02:15:17 +0100 Subject: [PATCH 12/25] Added wd plugin --- plugins/wd2/wd2/wd.plugin.zsh | 9 ++ plugins/wd2/wd2/wd.sh | 201 ++++++++++++++++++++++++++++++++++ 2 files changed, 210 insertions(+) create mode 100755 plugins/wd2/wd2/wd.plugin.zsh create mode 100755 plugins/wd2/wd2/wd.sh diff --git a/plugins/wd2/wd2/wd.plugin.zsh b/plugins/wd2/wd2/wd.plugin.zsh new file mode 100755 index 00000000..e0846ffd --- /dev/null +++ b/plugins/wd2/wd2/wd.plugin.zsh @@ -0,0 +1,9 @@ +#!/bin/zsh + +# WARP +# ==== +# oh-my-zsh plugin +# +# @github.com/mfaerevaag/wd + +alias wd='. ~/.oh-my-zsh/plugins/wd/wd.sh' diff --git a/plugins/wd2/wd2/wd.sh b/plugins/wd2/wd2/wd.sh new file mode 100755 index 00000000..7852028c --- /dev/null +++ b/plugins/wd2/wd2/wd.sh @@ -0,0 +1,201 @@ +#!/bin/zsh + +# WARP +# ==== +# Jump to custom directories in terminal +# because `cd` takes too long... +# +# @github.com/mfaerevaag/wd + + +## variables +CONFIG=$HOME/.warprc + +## colors +BLUE="\033[96m" +GREEN="\033[92m" +YELLOW="\033[93m" +RED="\033[91m" +NOC="\033[m" + + +## load warp points +typeset -A points +while read line +do + arr=(${(s,:,)line}) + key=${arr[1]} + val=${arr[2]} + + points[$key]=$val +done < $CONFIG + + +## functions +# prepended wd_ to not conflict with your environment (no sub shell) + +wd_warp() +{ + if [[ $1 =~ "^\.+$" ]] + then + if [[ $#1 < 2 ]] + then + wd_print_msg $YELLOW "Warping to current directory?" + else + (( n = $#1 - 1 )) + wd_print_msg $BLUE "Warping..." + cd -$n > /dev/null + fi + elif [[ ${points[$1]} != "" ]] + then + wd_print_msg $BLUE "Warping..." + cd ${points[$1]} + else + wd_print_msg $RED "Unkown warp point '$1'" + fi +} + +wd_add() +{ + if [[ $1 =~ "^\.+$" ]] + then + wd_print_msg $RED "Illeagal warp point (see README)." + elif [[ ${points[$1]} == "" ]] || $2 + then + wd_remove $1 > /dev/null + print "$1:$PWD" >> $CONFIG + wd_print_msg $GREEN "Warp point added" + else + wd_print_msg $YELLOW "Warp point '$1' alredy exists. Use 'add!' to overwrite." + fi +} + +wd_remove() +{ + if [[ ${points[$1]} != "" ]] + then + if wd_tmp=`sed "/^$1:/d" $CONFIG` + then + echo $wd_tmp > $CONFIG + wd_print_msg $GREEN "Warp point removed" + else + wd_print_msg $RED "Warp point unsuccessfully removed. Sorry!" + fi + else + wd_print_msg $RED "Warp point was not found" + fi +} + +wd_show() +{ + wd_print_msg $BLUE "Warp points to current directory:" + wd_list_all | grep $PWD$ +} + +wd_list_all() +{ + wd_print_msg $BLUE "All warp points:" + while read line + do + if [[ $line != "" ]] + then + arr=(${(s,:,)line}) + key=${arr[1]} + val=${arr[2]} + + print "\t" $key "\t -> \t" $val + fi + done < $CONFIG +} + +wd_print_msg() +{ + if [[ $1 == "" || $2 == "" ]] + then + print " $RED*$NOC Could not print message. Sorry!" + else + print " $1*$NOC $2" + fi +} + +wd_print_usage() +{ + print "Usage: wd [add|-a|--add] [rm|-r|--remove] [ls|-l|--list] " + print "\nCommands:" + print "\t add \t Adds the current working directory to your warp points" + print "\t add! \t Overwrites existing warp point" + print "\t remove Removes the given warp point" + print "\t list \t Outputs all stored warp points" + print "\t help \t Show this extremely helpful text" +} + + +## run + +# get opts +args=`getopt -o a:r:lhs -l add:,remove:,list,help,show -- $*` + +if [[ $? -ne 0 || $#* -eq 0 ]] +then + wd_print_usage +else + # can't exit, as this would exit the excecuting shell + # e.i. your terminal + + #set -- $args # WTF + + for i + do + case "$i" + in + -a|--add|add) + wd_add $2 false + shift + shift + break + ;; + -a!|--add!|add!) + wd_add $2 true + shift + shift + break + ;; + -r|--remove|rm) + wd_remove $2 + shift + shift + break + ;; + -l|--list|ls) + wd_list_all + shift + break + ;; + -h|--help|help) + wd_print_usage + shift + break + ;; + -s|--show|show) + wd_show + shift + break + ;; + *) + wd_warp $i + shift + break + ;; + --) + shift; break;; + esac + done +fi + + +## garbage collection +# if not, next time warp will pick up variables from this run +# remember, there's no sub shell +points="" +args="" +unhash -d val &> /dev/null # fixes issue #1 From 81192343568b924c901e260f7b6beda887e43fff Mon Sep 17 00:00:00 2001 From: Eddie Monge Date: Sat, 16 Nov 2013 11:59:15 -0800 Subject: [PATCH 13/25] standardize logic blocks --- oh-my-zsh.sh | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 15c1dce4..2ae07668 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -1,6 +1,5 @@ # Check for updates on initial load... -if [ "$DISABLE_AUTO_UPDATE" != "true" ] -then +if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then /usr/bin/env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh $ZSH/tools/check_for_upgrade.sh fi @@ -69,8 +68,7 @@ done unset config_file # Load the theme -if [ "$ZSH_THEME" = "random" ] -then +if [ "$ZSH_THEME" = "random" ]; then themes=($ZSH/themes/*zsh-theme) N=${#themes[@]} ((N=(RANDOM%N)+1)) @@ -78,13 +76,10 @@ then source "$RANDOM_THEME" echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..." else - if [ ! "$ZSH_THEME" = "" ] - then - if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ] - then + if [ ! "$ZSH_THEME" = "" ]; then + if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ]; then source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" - elif [ -f "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" ] - then + elif [ -f "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" ]; then source "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" else source "$ZSH/themes/$ZSH_THEME.zsh-theme" From ae1fe0029c63debfe44dcba52761389c6c876b31 Mon Sep 17 00:00:00 2001 From: Gaetan Semet Date: Sun, 17 Nov 2013 00:03:16 +0100 Subject: [PATCH 14/25] Add support for sublime 3 Signed-off-by: Gaetan Semet --- plugins/sublime/sublime.plugin.zsh | 38 ++++++++++++++++-------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh index 72f56754..56627918 100755 --- a/plugins/sublime/sublime.plugin.zsh +++ b/plugins/sublime/sublime.plugin.zsh @@ -2,30 +2,32 @@ local _sublime_darwin_paths > /dev/null 2>&1 _sublime_darwin_paths=( - "/usr/local/bin/subl" - "$HOME/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" - "$HOME/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" - "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" - "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" + "/usr/local/bin/subl" + "$HOME/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl" + "$HOME/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" + "$HOME/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" + "/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl" + "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" + "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ) if [[ $('uname') == 'Linux' ]]; then - if [ -f '/usr/bin/sublime_text' ]; then - st_run() { nohup /usr/bin/sublime_text $@ > /dev/null & } - else - st_run() { nohup /usr/bin/sublime-text $@ > /dev/null & } - fi - alias st=st_run + if [ -f '/usr/bin/sublime_text' ]; then + st_run() { nohup /usr/bin/sublime_text $@ > /dev/null & } + else + st_run() { nohup /usr/bin/sublime-text $@ > /dev/null & } + fi + alias st=st_run elif [[ $('uname') == 'Darwin' ]]; then - for _sublime_path in $_sublime_darwin_paths; do - if [[ -a $_sublime_path ]]; then - alias subl="'$_sublime_path'" - alias st=subl - break - fi - done + for _sublime_path in $_sublime_darwin_paths; do + if [[ -a $_sublime_path ]]; then + alias subl="'$_sublime_path'" + alias st=subl + break + fi + done fi alias stt='st .' From 037b39a8172b8a268ca5c857e5badee047b32929 Mon Sep 17 00:00:00 2001 From: Sean Escriva Date: Sat, 16 Nov 2013 15:39:01 -0800 Subject: [PATCH 15/25] Add simple plugin for chruby ruby version manager --- plugins/chruby/chruby.plugin.zsh | 99 ++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 plugins/chruby/chruby.plugin.zsh diff --git a/plugins/chruby/chruby.plugin.zsh b/plugins/chruby/chruby.plugin.zsh new file mode 100644 index 00000000..2a2c80cf --- /dev/null +++ b/plugins/chruby/chruby.plugin.zsh @@ -0,0 +1,99 @@ +# +# INSTRUCTIONS +# +# With either a manual or brew installed chruby things should just work. +# +# If you'd prefer to specify an explicit path to load chruby from +# you can set variables like so: +# +# zstyle :omz:plugins:chruby path /local/path/to/chruby.sh +# zstyle :omz:plugins:chruby auto /local/path/to/auto.sh +# +# TODO +# - autodetermine correct source path on non OS X systems +# - completion if ruby-install exists + +# rvm and rbenv plugins also provide this alias +alias rubies='chruby' + +local _chruby_path +local _chruby_auto + +_homebrew-installed() { + whence brew &> /dev/null +} + +_chruby-from-homebrew-installed() { + brew --prefix chruby &> /dev/null +} + +_ruby-build_installed() { + whence ruby-build &> /dev/null +} + +_ruby-install-installed() { + whence ruby-install &> /dev/null +} + +# Simple definition completer for ruby-build +if _ruby-build_installed; then + _ruby-build() { compadd $(ruby-build --definitions) } + compdef _ruby-build ruby-build +fi + +_source_from_omz_settings() { + zstyle -s :omz:plugins:chruby path _chruby_path + zstyle -s :omz:plugins:chruby auto _chruby_auto + + if _chruby_path && [[ -r _chruby_path ]]; then + source ${_chruby_path} + fi + + if _chruby_auto && [[ -r _chruby_auto ]]; then + source ${_chruby_auto} + fi +} + +_chruby_dirs() { + chrubydirs=($HOME/.rubies/ $PREFIX/opt/rubies) + for dir in chrubydirs; do + if [[ -d $dir ]]; then + RUBIES+=$dir + fi + done +} + +if _homebrew-installed && _chruby-from-homebrew-installed ; then + source $(brew --prefix chruby)/share/chruby/chruby.sh + source $(brew --prefix chruby)/share/chruby/auto.sh + _chruby_dirs +elif [[ -r "/usr/local/share/chruby/chruby.sh" ]] ; then + source /usr/local/share/chruby/chruby.sh + source /usr/local/share/chruby/auto.sh + _chruby_dirs +else + _source_from_omz_settings + _chruby_dirs +fi + +function ensure_chruby() { + $(whence chruby) +} + +function current_ruby() { + local _ruby + _ruby="$(chruby |grep \* |tr -d '* ')" + if [[ $(chruby |grep -c \*) -eq 1 ]]; then + echo ${_ruby} + else + echo "system" + fi +} + +function chruby_prompt_info() { + echo "$(current_ruby)" +} + +# complete on installed rubies +_chruby() { compadd $(chruby | tr -d '* ') } +compdef _chruby chruby From 613d116cda381b9747e22d13ed1381cec26eb8e3 Mon Sep 17 00:00:00 2001 From: Stig Sandbeck Mathisen Date: Tue, 19 Nov 2013 09:12:05 +0100 Subject: [PATCH 16/25] Add pyenv plugin --- plugins/pyenv/pyenv.plugin.zsh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 plugins/pyenv/pyenv.plugin.zsh diff --git a/plugins/pyenv/pyenv.plugin.zsh b/plugins/pyenv/pyenv.plugin.zsh new file mode 100644 index 00000000..b3dc7aa1 --- /dev/null +++ b/plugins/pyenv/pyenv.plugin.zsh @@ -0,0 +1,31 @@ +_homebrew-installed() { + type brew &> /dev/null +} + +_pyenv-from-homebrew-installed() { + brew --prefix pyenv &> /dev/null +} + +FOUND_PYENV=0 +pyenvdirs=("$HOME/.pyenv" "/usr/local/pyenv" "/opt/pyenv") +if _homebrew-installed && _pyenv-from-homebrew-installed ; then + pyenvdirs=($(brew --prefix pyenv) "${pyenvdirs[@]}") +fi + +for pyenvdir in "${pyenvdirs[@]}" ; do + if [ -d $pyenvdir/bin -a $FOUND_PYENV -eq 0 ] ; then + FOUND_PYENV=1 + export PYENV_ROOT=$pyenvdir + export PATH=${pyenvdir}/bin:$PATH + eval "$(pyenv init --no-rehash - zsh)" + + function pyenv_prompt_info() { + echo "$(pyenv version-name)" + } + fi +done +unset pyenvdir + +if [ $FOUND_PYENV -eq 0 ] ; then + function pyenv_prompt_info() { echo "system: $(python -V 2>&1 | cut -f 2 -d ' ')" } +fi From 9b37fcba5e350d049d4bbf145672cecd37356c23 Mon Sep 17 00:00:00 2001 From: Thomas Kriechbaumer Date: Tue, 19 Nov 2013 17:05:48 +0100 Subject: [PATCH 17/25] unified and improved Rails plugin --- plugins/{rails3/_rails3 => rails/_rails} | 17 ++++-- plugins/rails/rails.plugin.zsh | 68 ++++++++++++++++++++---- plugins/rails3/rails3.plugin.zsh | 32 ----------- plugins/rails4/rails4.plugin.zsh | 32 ----------- 4 files changed, 71 insertions(+), 78 deletions(-) rename plugins/{rails3/_rails3 => rails/_rails} (80%) delete mode 100644 plugins/rails3/rails3.plugin.zsh delete mode 100644 plugins/rails4/rails4.plugin.zsh diff --git a/plugins/rails3/_rails3 b/plugins/rails/_rails similarity index 80% rename from plugins/rails3/_rails3 rename to plugins/rails/_rails index 97915e68..96f57ce6 100644 --- a/plugins/rails3/_rails3 +++ b/plugins/rails/_rails @@ -1,10 +1,6 @@ #compdef rails #autoload -# rails 3 zsh completion, based on homebrew completion -# Extracted from https://github.com/robbyrussell/oh-my-zsh/blob/30620d463850c17f86e7a56fbf6a8b5e793a4e07/plugins/rails3/_rails3 -# Published by Christopher Chow - local -a _1st_arguments _1st_arguments=( 'generate:Generate new code (short-cut alias: "g")' @@ -14,14 +10,20 @@ _1st_arguments=( 'new:Create a new Rails application. "rails new my_app" creates a new application called MyApp in "./my_app"' 'application:Generate the Rails application code' 'destroy:Undo code generated with "generate"' + 'benchmarker:See how fast a piece of code runs' 'profiler:Get profile information from a piece of code' 'plugin:Install a plugin' + + 'plugin new:Generates skeleton for developing a Rails plugin' + 'runner:Run a piece of code in the application environment (short-cut alias: "r")' ) _rails_generate_arguments() { generate_arguments=( + assets controller + decorator generator helper integration_test @@ -36,9 +38,11 @@ _rails_generate_arguments() { scaffold_controller session_migration stylesheets + task ) } + _arguments \ '(--version)--version[show version]' \ '(--help)--help[show help]' \ @@ -50,7 +54,10 @@ if (( CURRENT == 1 )); then fi case "$words[1]" in - generate) + g|generate) + _rails_generate_arguments + _wanted generate_arguments expl 'all generate' compadd -a generate_arguments ;; + d|destroy) _rails_generate_arguments _wanted generate_arguments expl 'all generate' compadd -a generate_arguments ;; esac diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh index dd8b174b..23d15a9a 100644 --- a/plugins/rails/rails.plugin.zsh +++ b/plugins/rails/rails.plugin.zsh @@ -1,20 +1,70 @@ +function _rails_command () { + if [ -e "script/server" ]; then + ruby script/$@ + elif [ -e "script/rails" ]; then + ruby script/rails $@ + elif [ -e "bin/rails" ]; then + bin/rails $@ + else + rails $@ + fi +} + +function _rake_command () { + if [ -e "bin/rake" ]; then + bin/rake $@ + else + rake $@ + fi +} + +alias rails='_rails_command' +compdef _rails_command=rails + +alias rake='_rake_command' +compdef _rake_command=rake + +alias devlog='tail -f log/development.log' +alias prodlog='tail -f log/production.log' +alias testlog='tail -f log/test.log' + +alias -g RED='RAILS_ENV=development' +alias -g REP='RAILS_ENV=production' +alias -g RET='RAILS_ENV=test' + +# Rails aliases +alias rc='rails console' +alias rd='rails destroy' +alias rdb='rails dbconsole' +alias rg='rails generate' +alias rgm='rails generate migration' +alias rp='rails plugin' +alias ru='rails runner' +alias rs='rails server' +alias rsd='rails server --debugger' + +# Rake aliases +alias rdm='rake db:migrate' +alias rdr='rake db:rollback' +alias rdc='rake db:create' +alias rds='rake db:seed' +alias rdd='rake db:drop' +alias rdtc='rake db:test:clone' +alias rdtp='rake db:test:prepare' + +alias rlc='rake log:clear' +alias rn='rake notes' +alias rr='rake routes' + +# legacy stuff alias ss='thin --stats "/thin/stats" start' alias sg='ruby script/generate' alias sd='ruby script/destroy' alias sp='ruby script/plugin' alias sr='ruby script/runner' alias ssp='ruby script/spec' -alias rdbm='rake db:migrate' -alias rdbtp='rake db:test:prepare' -alias migrate='rake db:migrate && rake db:test:prepare' alias sc='ruby script/console' alias sd='ruby script/server --debugger' -alias devlog='tail -f log/development.log' -alias testlog='tail -f log/test.log' -alias prodlog='tail -f log/production.log' -alias -g RET='RAILS_ENV=test' -alias -g REP='RAILS_ENV=production' -alias -g RED='RAILS_ENV=development' function remote_console() { /usr/bin/env ssh $1 "( cd $2 && ruby script/console production )" diff --git a/plugins/rails3/rails3.plugin.zsh b/plugins/rails3/rails3.plugin.zsh deleted file mode 100644 index b53d18d0..00000000 --- a/plugins/rails3/rails3.plugin.zsh +++ /dev/null @@ -1,32 +0,0 @@ -# Rails 3 aliases, backwards-compatible with Rails 2. - -function _rails_command () { - if [ -e "script/server" ]; then - ruby script/$@ - else - if [ -e "bin/rails" ]; then - bin/rails $@ - else - rails $@ - fi - fi -} - -alias rc='_rails_command console' -alias rd='_rails_command destroy' -alias rdb='_rails_command dbconsole' -alias rdbm='rake db:migrate db:test:clone' -alias rg='_rails_command generate' -alias rgm='_rails_command generate migration' -alias rp='_rails_command plugin' -alias ru='_rails_command runner' -alias rs='_rails_command server' -alias rsd='_rails_command server --debugger' -alias devlog='tail -f log/development.log' -alias testlog='tail -f log/test.log' -alias prodlog='tail -f log/production.log' -alias rdm='rake db:migrate' -alias rdr='rake db:rollback' -alias -g RET='RAILS_ENV=test' -alias -g REP='RAILS_ENV=production' -alias -g RED='RAILS_ENV=development' diff --git a/plugins/rails4/rails4.plugin.zsh b/plugins/rails4/rails4.plugin.zsh deleted file mode 100644 index cb6cf816..00000000 --- a/plugins/rails4/rails4.plugin.zsh +++ /dev/null @@ -1,32 +0,0 @@ -# Rails 4 aliases - -function _rails_command () { - if [ -e "script/server" ]; then - ruby script/$@ - elif [ -e "script/rails" ]; then - ruby script/rails $@ - else - ruby bin/rails $@ - fi -} - -alias rc='_rails_command console' -alias rd='_rails_command destroy' -alias rdb='_rails_command dbconsole' -alias rdbm='rake db:migrate db:test:clone' -alias rg='_rails_command generate' -alias rgm='_rails_command generate migration' -alias rp='_rails_command plugin' -alias ru='_rails_command runner' -alias rs='_rails_command server' -alias rsd='_rails_command server --debugger' -alias devlog='tail -f log/development.log' -alias testlog='tail -f log/test.log' -alias prodlog='tail -f log/production.log' -alias rdm='rake db:migrate' -alias rdc='rake db:create' -alias rdr='rake db:rollback' -alias rds='rake db:seed' -alias rlc='rake log:clear' -alias rn='rake notes' -alias rr='rake routes' From 4d3fb286d84846b2c64368c38dd8b728da466eac Mon Sep 17 00:00:00 2001 From: aph Date: Thu, 21 Nov 2013 16:58:57 +0000 Subject: [PATCH 18/25] fix pip plugin --- plugins/pip/pip.plugin.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/pip/pip.plugin.zsh b/plugins/pip/pip.plugin.zsh index 71f977bb..b5433ae9 100644 --- a/plugins/pip/pip.plugin.zsh +++ b/plugins/pip/pip.plugin.zsh @@ -18,12 +18,12 @@ zsh-pip-clear-cache() { } zsh-pip-clean-packages() { - sed -nr '/([^<]+).*/\1/p' + sed -n '/\([^<]\{1,\}\).*/\1/p' } zsh-pip-cache-packages() { - if [[ ! -d ${PIP_CACHE_FILE:h} ]]; then - mkdir -p ${PIP_CACHE_FILE:h} + if [[ ! -d ${ZSH_PIP_CACHE_FILE:h} ]]; then + mkdir -p ${ZSH_PIP_CACHE_FILE:h} fi if [[ ! -f $ZSH_PIP_CACHE_FILE ]]; then From b5b3519ac7c163b62bfc01a42a87a7a745d9df6d Mon Sep 17 00:00:00 2001 From: Thibaud Guillaume-Gentil Date: Fri, 22 Nov 2013 09:48:51 +0100 Subject: [PATCH 19/25] Update _heroku config arguments (Heroku Client v3) --- plugins/heroku/_heroku | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/heroku/_heroku b/plugins/heroku/_heroku index a95c3864..46663303 100644 --- a/plugins/heroku/_heroku +++ b/plugins/heroku/_heroku @@ -23,8 +23,10 @@ _1st_arguments=( "auth\:login":"log in with your heroku credentials" "auth\:logout":"clear local authentication credentials" "config":"display the config vars for an app" - "config\:add":"add one or more config vars" - "config\:remove":"remove a config var" + "config\:pull":"pull heroku config vars down to the local environment" + "config\:push":"push local config vars to heroku" + "config\:set":"set one or more config vars" + "config\:unset":"unset one or more config vars" "db\:push":"push local data up to your app" "db\:pull":"pull heroku data down into your local database" "domains":"list custom domains for an app" From d12113a9e89fed866db625f7e110fb62333b2746 Mon Sep 17 00:00:00 2001 From: Johann Visagie Date: Fri, 22 Nov 2013 14:59:04 +0100 Subject: [PATCH 20/25] Use precmd hook for updating OS X proxy icon Using the chpwd hook function causes some junk to be printed to STDOUT after returning from a subshell wherein the working directory was changed. In rare cases, this can cause issues with 3rd party tools. An example is this issue with the Python virtualenvwrapper tool: https://bitbucket.org/dhellmann/virtualenvwrapper/issue/216/lsvirtualenv-and-workon-output-broken-in --- plugins/terminalapp/terminalapp.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/terminalapp/terminalapp.plugin.zsh b/plugins/terminalapp/terminalapp.plugin.zsh index 2249b1e2..6e47ee18 100644 --- a/plugins/terminalapp/terminalapp.plugin.zsh +++ b/plugins/terminalapp/terminalapp.plugin.zsh @@ -32,7 +32,7 @@ if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then # Register the function so it is called whenever the working # directory changes. autoload add-zsh-hook - add-zsh-hook chpwd update_terminal_cwd + add-zsh-hook precmd update_terminal_cwd # Tell the terminal about the initial directory. update_terminal_cwd From ec779d5f737f0f70a7353bb0e78dc2d38606c8d9 Mon Sep 17 00:00:00 2001 From: christianschmidt Date: Sat, 23 Nov 2013 15:32:22 +0100 Subject: [PATCH 21/25] Update _pass to follow symlinks for completion Based on: http://comments.gmane.org/gmane.comp.encryption.pass/235 --- plugins/pass/_pass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/pass/_pass b/plugins/pass/_pass index f6c1a6c4..d8ec3882 100644 --- a/plugins/pass/_pass +++ b/plugins/pass/_pass @@ -101,7 +101,7 @@ _pass_cmd_show () { _pass_complete_entries_helper () { local IFS=$'\n' local prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}" - _values -C 'passwords' $(find "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print | sed -e "s#${prefix}.##" -e 's#\.gpg##' | sort) + _values -C 'passwords' $(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print | sed -e "s#${prefix}.##" -e 's#\.gpg##' | sort) } _pass_complete_entries_with_subdirs () { From 3d851daf456f4ba418fb00eccb20ea2f4f7dd4b5 Mon Sep 17 00:00:00 2001 From: Dhruva Sagar Date: Fri, 29 Nov 2013 12:28:52 +0530 Subject: [PATCH 22/25] Added Amuse zsh theme --- themes/amuse.zsh-theme | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 themes/amuse.zsh-theme diff --git a/themes/amuse.zsh-theme b/themes/amuse.zsh-theme new file mode 100644 index 00000000..548f6d39 --- /dev/null +++ b/themes/amuse.zsh-theme @@ -0,0 +1,21 @@ +# vim:ft=zsh ts=2 sw=2 sts=2 + +rvm_current() { + rvm current 2>/dev/null +} + +rbenv_version() { + rbenv version 2>/dev/null | awk '{print $1}' +} + +PROMPT=' +%{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) ⌚ %{$fg_bold[red]%}%*%{$reset_color%} +$ ' + +ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}⭠ " +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?" +ZSH_THEME_GIT_PROMPT_CLEAN="" + +RPROMPT='%{$fg_bold[red]%}$(rbenv_version)%{$reset_color%}' From 699c82eb89094e3c2ca81dfd96b44d155bca6fba Mon Sep 17 00:00:00 2001 From: ych Date: Fri, 29 Nov 2013 18:34:12 +0800 Subject: [PATCH 23/25] Add FreeBSD support for autojump plugin --- plugins/autojump/autojump.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh index f856f2f0..0aa14959 100644 --- a/plugins/autojump/autojump.plugin.zsh +++ b/plugins/autojump/autojump.plugin.zsh @@ -5,6 +5,8 @@ if [ $commands[autojump] ]; then # check if autojump is installed . /etc/profile.d/autojump.zsh elif [ -f /etc/profile.d/autojump.sh ]; then # gentoo installation . /etc/profile.d/autojump.sh + elif [ -f /usr/local/share/autojump/autojump.zsh ]; then # freebsd installation + . /usr/local/share/autojump/autojump.zsh elif [ -f $HOME/.autojump/etc/profile.d/autojump.zsh ]; then # manual user-local installation . $HOME/.autojump/etc/profile.d/autojump.zsh elif [ -f /opt/local/etc/profile.d/autojump.zsh ]; then # mac os x with ports From 1493d88e3f92c7034da5c1b1638ba19544aa3ccb Mon Sep 17 00:00:00 2001 From: Thomas Kriechbaumer Date: Sun, 1 Dec 2013 15:31:48 +0100 Subject: [PATCH 24/25] Added migration notification for rails plugin --- plugins/rails3/rails3.plugin.zsh | 4 ++++ plugins/rails4/rails4.plugin.zsh | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 plugins/rails3/rails3.plugin.zsh create mode 100644 plugins/rails4/rails4.plugin.zsh diff --git a/plugins/rails3/rails3.plugin.zsh b/plugins/rails3/rails3.plugin.zsh new file mode 100644 index 00000000..261b9210 --- /dev/null +++ b/plugins/rails3/rails3.plugin.zsh @@ -0,0 +1,4 @@ +echo "It looks like you have been using the 'rails3' plugin," +echo "which has been deprecated in favor of a newly consolidated 'rails' plugin." +echo "You will want to modify your ~/.zshrc configuration to begin using it." +echo "Learn more at https://github.com/robbyrussell/oh-my-zsh/pull/2240" diff --git a/plugins/rails4/rails4.plugin.zsh b/plugins/rails4/rails4.plugin.zsh new file mode 100644 index 00000000..5452c242 --- /dev/null +++ b/plugins/rails4/rails4.plugin.zsh @@ -0,0 +1,4 @@ +echo "It looks like you have been using the 'rails4' plugin," +echo "which has been deprecated in favor of a newly consolidated 'rails' plugin." +echo "You will want to modify your ~/.zshrc configuration to begin using it." +echo "Learn more at https://github.com/robbyrussell/oh-my-zsh/pull/2240" From 96bd365542dd9df0afe37e944996936bdaa17969 Mon Sep 17 00:00:00 2001 From: Jens Tinfors Date: Sun, 1 Dec 2013 15:33:23 +0100 Subject: [PATCH 25/25] Adds the hgsl alias for one-line shortlog convenience --- plugins/mercurial/mercurial.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/mercurial/mercurial.plugin.zsh b/plugins/mercurial/mercurial.plugin.zsh index c18aa726..d2db89d0 100644 --- a/plugins/mercurial/mercurial.plugin.zsh +++ b/plugins/mercurial/mercurial.plugin.zsh @@ -13,6 +13,7 @@ alias hglr='hg pull --rebase' alias hgo='hg outgoing' alias hgp='hg push' alias hgs='hg status' +alias hgsl='log --limit 20 --template "{node|short} | {date|isodatesec} | {author|user}: {desc|strip|firstline}\n" ' # this is the 'git commit --amend' equivalent alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip'