From fdb3c0e68d36d20d1b75163755d568d42def5ac1 Mon Sep 17 00:00:00 2001 From: Anton Eicher Date: Wed, 19 Dec 2012 07:22:03 -0800 Subject: [PATCH 01/62] Added check for .git directory in current, before wasting time querying git. This saves seconds on my pc. --- plugins/git/git.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 154aa6db1..79300a166 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -73,12 +73,14 @@ alias gsd='git svn dcommit' # Usage example: git pull origin $(current_branch) # function current_branch() { + if [ ! -d .git ]; then return; fi ref=$(git symbolic-ref HEAD 2> /dev/null) || \ ref=$(git rev-parse --short HEAD 2> /dev/null) || return echo ${ref#refs/heads/} } function current_repository() { + if [ ! -d .git ]; then return; fi ref=$(git symbolic-ref HEAD 2> /dev/null) || \ ref=$(git rev-parse --short HEAD 2> /dev/null) || return echo $(git remote -v | cut -d':' -f 2) From 346f6b7d24d6021efa8c5167088f98c10f00ad3f Mon Sep 17 00:00:00 2001 From: Markus Faerevaag Date: Tue, 15 Jul 2014 17:42:30 +0200 Subject: [PATCH 02/62] [wd] v0.3.1: Improved completion and bug fixes --- plugins/wd/README.md | 28 +++---- plugins/wd/_wd.sh | 15 +--- plugins/wd/wd.plugin.zsh | 4 +- plugins/wd/wd.sh | 159 +++++++++++++++++++++++---------------- 4 files changed, 114 insertions(+), 92 deletions(-) diff --git a/plugins/wd/README.md b/plugins/wd/README.md index f9f4e7ac1..bc0ebe334 100644 --- a/plugins/wd/README.md +++ b/plugins/wd/README.md @@ -2,37 +2,39 @@ **Maintainer:** [mfaerevaag](https://github.com/mfaerevaag) -`wd` (warp directory) lets you jump to custom directories in zsh, without using cd. Why? Because cd seems ineffecient when the folder is frequently visited or has a long path. [Source](https://github.com/mfaerevaag/wd) +`wd` (*warp directory*) lets you jump to custom directories in zsh, without using `cd`. Why? Because `cd` seems ineffecient when the folder is frequently visited or has a long path. [Source](https://github.com/mfaerevaag/wd) ### Usage * Add warp point to current working directory: - wd add test + $ wd add foo If a warp point with the same name exists, use `add!` to overwrite it. - * From an other directory, warp to test with: + Note, a warp point cannot contain colons, or only consist of only spaces and dots. The first will conflict in how `wd` stores the warp points, and the second will conflict other features, as below. - wd test + * From an other directory (not necessarily), warp to `foo` with: - * You can warp back to previous directory, and so on, with the puncticulation syntax: + $ wd foo - wd .. - wd ... + * You can warp back to previous directory, and so on, with this dot syntax: + + $ wd .. + $ wd ... This is a wrapper for the zsh `dirs` function. * Remove warp point test point: - wd rm test - - * List warp points to current directory (stored in `~/.warprc`): - - wd show + $ wd rm foo * List all warp points (stored in `~/.warprc`): - wd ls + $ wd ls + + * List warp points to current directory + + $ wd show * Print usage with no opts or the `help` argument. diff --git a/plugins/wd/_wd.sh b/plugins/wd/_wd.sh index 29df63520..0b03d8fff 100644 --- a/plugins/wd/_wd.sh +++ b/plugins/wd/_wd.sh @@ -5,23 +5,16 @@ zstyle ':completion::complete:wd:*:commands' group-name commands zstyle ':completion::complete:wd:*:warp_points' group-name warp_points zstyle ':completion::complete:wd::' list-grouped -# Call `_wd()` when when trying to complete the command `wd` - zmodload zsh/mapfile + function _wd() { - local ret=1 local CONFIG=$HOME/.warprc - - # Stolen from - # http://stackoverflow.com/questions/9000698/completion-when-program-has-sub-commands - - # local curcontext="$curcontext" state line - # typeset -A opt_args + local ret=1 local -a commands local -a warp_points - warp_points=( "${(f)mapfile[$CONFIG]}" ) - # LIST="${mapfile[$FNAME]}" # Not required unless stuff uses it + + warp_points=( "${(f)mapfile[$CONFIG]//$HOME/~}" ) commands=( 'add:Adds the current working directory to your warp points' diff --git a/plugins/wd/wd.plugin.zsh b/plugins/wd/wd.plugin.zsh index 9800335fc..c0559293d 100644 --- a/plugins/wd/wd.plugin.zsh +++ b/plugins/wd/wd.plugin.zsh @@ -1,7 +1,7 @@ #!/bin/zsh -# WARP -# ==== +# WARP DIRECTORY +# ============== # oh-my-zsh plugin # # @github.com/mfaerevaag/wd diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh index 9ebad6808..dfb9ad89a 100755 --- a/plugins/wd/wd.sh +++ b/plugins/wd/wd.sh @@ -1,7 +1,7 @@ #!/bin/zsh -# WARP -# ==== +# WARP DIRECTORY +# ============== # Jump to custom directories in terminal # because `cd` takes too long... # @@ -9,26 +9,28 @@ ## variables -CONFIG=$HOME/.warprc +readonly CONFIG=$HOME/.warprc -## colors -BLUE="\033[96m" -GREEN="\033[92m" -YELLOW="\033[93m" -RED="\033[91m" -NOC="\033[m" +# colors +readonly BLUE="\033[96m" +readonly GREEN="\033[92m" +readonly YELLOW="\033[93m" +readonly RED="\033[91m" +readonly NOC="\033[m" +## init + # check if config file exists -if [[ ! -a $CONFIG ]] +if [ ! -e $CONFIG ] then - # if not: create config file - touch $CONFIG + # if not, create config file + touch $CONFIG fi -## load warp points +# load warp points typeset -A points -while read line +while read -r line do arr=(${(s,:,)line}) key=${arr[1]} @@ -39,72 +41,78 @@ done < $CONFIG ## functions -# prepended wd_ to not conflict with your environment (no sub shell) wd_warp() { - if [[ $1 =~ "^\.+$" ]] + local point=$1 + + if [[ $point =~ "^\.+$" ]] then - if [[ $#1 < 2 ]] + 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]} != "" ]] + elif [[ ${points[$point]} != "" ]] then - #wd_print_msg $BLUE "Warping..." - cd ${points[$1]} + cd ${points[$point]} else - wd_print_msg $RED "Unknown warp point '$1'" + wd_print_msg $RED "Unknown warp point '${point}'" fi } wd_add() { - if [[ $2 =~ "^\.+$" || $2 =~ "^\s*$" ]] + local force=$1 + local point=$2 + + if [[ $point =~ "^[\.]+$" ]] then - wd_print_msg $RED "Illegal warp point (see README)." - elif [[ ${points[$2]} == "" ]] || $1 + wd_print_msg $RED "Warp point cannot be just dots" + elif [[ $point =~ "(\s|\ )+" ]] then - wd_remove $2 > /dev/null - print "$2:$PWD" >> $CONFIG + wd_print_msg $RED "Warp point should not contain whitespace" + elif [[ $point == *:* ]] + then + wd_print_msg $RED "Warp point cannot contain colons" + elif [[ $point == "" ]] + then + wd_print_msg $RED "Warp point cannot be empty" + elif [[ ${points[$2]} == "" ]] || $force + then + wd_remove $point > /dev/null + printf "%q:%q\n" "${point}" "${PWD}" >> $CONFIG + wd_print_msg $GREEN "Warp point added" else - wd_print_msg $YELLOW "Warp point '$2' already exists. Use 'add!' to overwrite." + wd_print_msg $YELLOW "Warp point '${point}' already exists. Use 'add!' to overwrite." fi } wd_remove() { - if [[ ${points[$1]} != "" ]] + local point=$1 + + if [[ ${points[$point]} != "" ]] then - if wd_tmp=`sed "/^$1:/d" $CONFIG` + if sed -i.bak "s,^${point}:.*$,,g" $CONFIG then - # `>!` forces overwrite - # we need this if people use `setopt NO_CLOBBER` - echo $wd_tmp >! $CONFIG wd_print_msg $GREEN "Warp point removed" else - wd_print_msg $RED "Warp point unsuccessfully removed. Sorry!" + wd_print_msg $RED "Something bad happened! 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 + + while IFS= read -r line do if [[ $line != "" ]] then @@ -112,38 +120,52 @@ wd_list_all() key=${arr[1]} val=${arr[2]} - print "\t" $key "\t -> \t" $val + printf "%20s -> %s\n" $key $val fi - done < $CONFIG + done <<< $(sed "s:${HOME}:~:g" $CONFIG) +} + +wd_show() +{ + local cwd=$(print $PWD | sed "s:^${HOME}:~:") + + wd_print_msg $BLUE "Warp points to current directory:" + wd_list_all | grep -e "${cwd}$" } wd_print_msg() { - if [[ $1 == "" || $2 == "" ]] + local color=$1 + local msg=$2 + + if [[ $color == "" || $msg == "" ]] then - print " $RED*$NOC Could not print message. Sorry!" + print " ${RED}*${NOC} Could not print message. Sorry!" else - print " $1*$NOC $2" + print " ${color}*${NOC} ${msg}" 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 rm \t Removes the given warp point" - print "\t show \t Outputs warp points to current directory" - print "\t ls \t Outputs all stored warp points" - print "\t help \t Show this extremely helpful text" + cat <<- EOF +Usage: wd [add|-a|--add] [rm|-r|--remove] + +Commands: + add Adds the current working directory to your warp points + add! Overwrites existing warp point + rm Removes the given warp point + show Outputs warp points to current directory + ls Outputs all stored warp points + help Show this extremely helpful text +EOF } ## run # get opts -args=`getopt -o a:r:lhs -l add:,rm:,ls,help,show -- $*` +args=$(getopt -o a:r:lhs -l add:,rm:,ls,help,show -- $*) # check if no arguments were given if [[ $? -ne 0 || $#* -eq 0 ]] @@ -151,19 +173,16 @@ then wd_print_usage # check if config file is writeable -elif [[ ! -w $CONFIG ]] +elif [ ! -w $CONFIG ] then - wd_print_msg $RED "\'$CONFIG\' is not writeable." - # do nothing => exit + # do nothing # can't run `exit`, as this would exit the executing shell - # i.e. your terminal + wd_print_msg $RED "\'$CONFIG\' is not writeable." else - #set -- $args # WTF - - for i + for o do - case "$i" + case "$o" in -a|--add|add) wd_add false $2 @@ -190,7 +209,7 @@ else break ;; *) - wd_warp $i + wd_warp $o break ;; --) @@ -200,10 +219,18 @@ else done fi - ## garbage collection # if not, next time warp will pick up variables from this run # remember, there's no sub shell -unset points + +unset wd_warp +unset wd_add +unset wd_remove +unset wd_show +unset wd_list_all +unset wd_print_msg +unset wd_print_usage + unset args +unset points unset val &> /dev/null # fixes issue #1 From a6b655fae9640873c1629abe7ba25f4823f4b714 Mon Sep 17 00:00:00 2001 From: Markus Faerevaag Date: Fri, 30 May 2014 10:21:16 +0200 Subject: [PATCH 03/62] [wd] v0.2.2: Added MIT-License --- plugins/wd/LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 plugins/wd/LICENSE diff --git a/plugins/wd/LICENSE b/plugins/wd/LICENSE new file mode 100644 index 000000000..8caa6c6ce --- /dev/null +++ b/plugins/wd/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Markus Færevaag + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file From 5756ea0101dc60f5c5d3874a4a5baf58647aec9d Mon Sep 17 00:00:00 2001 From: ncanceill Date: Tue, 8 Jul 2014 16:49:05 +0200 Subject: [PATCH 04/62] Revert "specify python2 in shebang" "/usr/bin/python2" does not exist on Mac OSX (see #2382), so fuck people who have "python" symlinked to "python3" This reverts commit e5ed07e2b5740346d2a32b3a47204612d8808723 --- plugins/git-prompt/gitstatus.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git-prompt/gitstatus.py b/plugins/git-prompt/gitstatus.py index c665a9ee1..256841432 100644 --- a/plugins/git-prompt/gitstatus.py +++ b/plugins/git-prompt/gitstatus.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # -*- coding: UTF-8 -*- from subprocess import Popen, PIPE import re From 7478b754a1e53a6c058d7807700869474b68bb21 Mon Sep 17 00:00:00 2001 From: ncanceill Date: Fri, 25 Apr 2014 00:48:37 +0200 Subject: [PATCH 05/62] make sure cache dir exists, just like log dir --- cache/.easter-egg | 4 ++++ plugins/zsh_reload/zsh_reload.plugin.zsh | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 cache/.easter-egg diff --git a/cache/.easter-egg b/cache/.easter-egg new file mode 100644 index 000000000..4b6164edb --- /dev/null +++ b/cache/.easter-egg @@ -0,0 +1,4 @@ +This file is only here so that Git will keep a cache directory as .gitignore is ignoring all the files within it. + +Feel free to add love notes for people here. + diff --git a/plugins/zsh_reload/zsh_reload.plugin.zsh b/plugins/zsh_reload/zsh_reload.plugin.zsh index 94945bd48..3f44b99c6 100644 --- a/plugins/zsh_reload/zsh_reload.plugin.zsh +++ b/plugins/zsh_reload/zsh_reload.plugin.zsh @@ -1,10 +1,11 @@ # reload zshrc function src() { + local cache="$ZSH/cache" autoload -U compinit zrecompile - compinit -d "$ZSH/cache/zcomp-$HOST" + compinit -d "$cache/zcomp-$HOST" - for f in ~/.zshrc "$ZSH/cache/zcomp-$HOST"; do + for f in ~/.zshrc "$cache/zcomp-$HOST"; do zrecompile -p $f && command rm -f $f.zwc.old done From 39a1e2a083872ccca63fcc9ead44834627c176cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6stlin?= Date: Wed, 11 Jul 2012 14:29:54 +0200 Subject: [PATCH 06/62] gem plugin: added _files to install command is useful if you want to install a local gem from the filesystem --- plugins/gem/_gem | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/gem/_gem b/plugins/gem/_gem index 25967f1e7..92feebe95 100644 --- a/plugins/gem/_gem +++ b/plugins/gem/_gem @@ -59,6 +59,8 @@ case "$words[1]" in build) _files -g "*.gemspec" ;; + install) + _files ;; list) if [[ "$state" == forms ]]; then _gem_installed From bb928b59c409feacc660a64e800ce9129c058104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ben=20Z=C3=B6rb?= Date: Thu, 17 Jul 2014 11:27:00 +0200 Subject: [PATCH 07/62] #2914 fixed symfony2 autocomplete --- plugins/symfony2/symfony2.plugin.zsh | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh index 1d5177e6d..c8c102eee 100644 --- a/plugins/symfony2/symfony2.plugin.zsh +++ b/plugins/symfony2/symfony2.plugin.zsh @@ -1,23 +1,24 @@ # Symfony2 basic command completion +_symfony_console () { + echo "php $(find . -maxdepth 2 -mindepth 1 -name 'console')" +} + _symfony2_get_command_list () { - php $(find . -maxdepth 2 -mindepth 1 -name 'console') --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }' + `_symfony_console` --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }' } _symfony2 () { - if [ -f $(find . -maxdepth 2 -mindepth 1 -name 'console') ]; then - compadd `_symfony2_get_command_list` - fi + compadd `_symfony2_get_command_list` } -compdef _symfony2 $(find . -maxdepth 2 -mindepth 1 -name 'console') +compdef _symfony2 '`_symfony_console`' compdef _symfony2 sf #Alias -alias sf='php $(find . -maxdepth 2 -mindepth 1 -name 'console') ' -alias sfcl='php $(find . -maxdepth 2 -mindepth 1 -name 'console') cache:clear' -alias sfcw='php $(find . -maxdepth 2 -mindepth 1 -name 'console') cache:warmup' -alias sfroute='php $(find . -maxdepth 2 -mindepth 1 -name 'console') router:debug' -alias sfcontainer='php $(find . -maxdepth 2 -mindepth 1 -name 'console') container:debug' -alias sfgb='php $(find . -maxdepth 2 -mindepth 1 -name 'console') generate:bundle' - +alias sf='`_symfony_console`' +alias sfcl='sf cache:clear' +alias sfcw='sf cache:warmup' +alias sfroute='sf router:debug' +alias sfcontainer='sf container:debug' +alias sfgb='sf generate:bundle' \ No newline at end of file From 00b21d5ac322178b9b9e397b0b6178a3d7f4e9ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ho=CC=88ltje?= Date: Wed, 23 Apr 2014 09:41:09 -0400 Subject: [PATCH 08/62] Trust but verify 'scutil' to return ComputerName Apparently, it is possible to set up a Mac such that `scutil --get ComputerName` hasn't been set. This change checks if that fails and falls back to the original mechanism. Closes #2155 Closes #2183 --- oh-my-zsh.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index c217b91bb..8ce29ff38 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -38,9 +38,9 @@ for plugin ($plugins); do done # Figure out the SHORT hostname -if [ -n "$commands[scutil]" ]; then - # OS X - SHORT_HOST=$(scutil --get ComputerName) +if [[ "$OSTYPE" = darwin* ]]; then + # OS X's $HOST changes with dhcp, etc. Use ComputerName if possible. + SHORT_HOST=$(scutil --get ComputerName 2>/dev/null) || SHORT_HOST=${HOST/.*/} else SHORT_HOST=${HOST/.*/} fi From 63bae2aba9c43a70bbb374fc46e287d7bc46cc54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ho=CC=88ltje?= Date: Wed, 23 Apr 2014 10:13:26 -0400 Subject: [PATCH 09/62] Use $OSTYPE instead of uname to speed things up The $OSTYPE variable is set at ZSH compile time and can be safely used to determine the OS of the system. e.g. darwin (os x) --- plugins/battery/battery.plugin.zsh | 2 +- plugins/bundler/bundler.plugin.zsh | 2 +- plugins/jira/jira.plugin.zsh | 2 +- plugins/node/node.plugin.zsh | 2 +- plugins/rake-fast/rake-fast.plugin.zsh | 2 +- plugins/sublime/sublime.plugin.zsh | 2 +- plugins/web-search/web-search.plugin.zsh | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh index 32dd4b624..014bb15dd 100644 --- a/plugins/battery/battery.plugin.zsh +++ b/plugins/battery/battery.plugin.zsh @@ -8,7 +8,7 @@ # Modified to add support for Apple Mac # ########################################### -if [[ $(uname) == "Darwin" ]] ; then +if [[ "$OSTYPE" = darwin* ]] ; then function battery_pct() { local smart_battery_status="$(ioreg -rc "AppleSmartBattery")" diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 617dcde71..ba3d3f623 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -54,7 +54,7 @@ bundle_install() { if _bundler-installed && _within-bundled-project; then local bundler_version=`bundle version | cut -d' ' -f3` if [[ $bundler_version > '1.4.0' || $bundler_version = '1.4.0' ]]; then - if [[ "$(uname)" == 'Darwin' ]] + if [[ "$OSTYPE" = darwin* ]] then local cores_num="$(sysctl hw.ncpu | awk '{print $2}')" else diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh index 3d510e430..e4881151e 100644 --- a/plugins/jira/jira.plugin.zsh +++ b/plugins/jira/jira.plugin.zsh @@ -12,7 +12,7 @@ # jira ABC-123 # Opens an existing issue open_jira_issue () { local open_cmd - if [[ $(uname -s) == 'Darwin' ]]; then + if [[ "$OSTYPE" = darwin* ]]; then open_cmd='open' else open_cmd='xdg-open' diff --git a/plugins/node/node.plugin.zsh b/plugins/node/node.plugin.zsh index 2d78f2b4c..39d8b10d9 100644 --- a/plugins/node/node.plugin.zsh +++ b/plugins/node/node.plugin.zsh @@ -3,7 +3,7 @@ function node-docs { # get the open command local open_cmd - if [[ $(uname -s) == 'Darwin' ]]; then + if [[ "$OSTYPE" = darwin* ]]; then open_cmd='open' else open_cmd='xdg-open' diff --git a/plugins/rake-fast/rake-fast.plugin.zsh b/plugins/rake-fast/rake-fast.plugin.zsh index cb84f69a1..cfc9a079f 100644 --- a/plugins/rake-fast/rake-fast.plugin.zsh +++ b/plugins/rake-fast/rake-fast.plugin.zsh @@ -10,7 +10,7 @@ _rake_refresh () { _rake_does_task_list_need_generating () { if [ ! -f .rake_tasks ]; then return 0; else - if [[ $(uname -s) == 'Darwin' ]]; then + if [[ "$OSTYPE" = darwin* ]]; then accurate=$(stat -f%m .rake_tasks) changed=$(stat -f%m Rakefile) else diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh index 438f386fb..5acc75cc7 100644 --- a/plugins/sublime/sublime.plugin.zsh +++ b/plugins/sublime/sublime.plugin.zsh @@ -17,7 +17,7 @@ if [[ $('uname') == 'Linux' ]]; then fi done -elif [[ $('uname') == 'Darwin' ]]; then +elif [[ "$OSTYPE" = darwin* ]]; then local _sublime_darwin_paths > /dev/null 2>&1 _sublime_darwin_paths=( "/usr/local/bin/subl" diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh index 8eedb90ee..f056e38e8 100644 --- a/plugins/web-search/web-search.plugin.zsh +++ b/plugins/web-search/web-search.plugin.zsh @@ -4,7 +4,7 @@ function web_search() { # get the open command local open_cmd - if [[ $(uname -s) == 'Darwin' ]]; then + if [[ "$OSTYPE" = darwin* ]]; then open_cmd='open' else open_cmd='xdg-open' From db3dd6d755776daf19b55f6a1cae080ae684030a Mon Sep 17 00:00:00 2001 From: Guerki Date: Tue, 29 Jul 2014 09:21:10 +0200 Subject: [PATCH 10/62] Run Web-search as a Background Process with Nohup --- plugins/web-search/web-search.plugin.zsh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh index 8eedb90ee..e157a389d 100644 --- a/plugins/web-search/web-search.plugin.zsh +++ b/plugins/web-search/web-search.plugin.zsh @@ -1,7 +1,6 @@ # web_search from terminal function web_search() { - # get the open command local open_cmd if [[ $(uname -s) == 'Darwin' ]]; then @@ -38,8 +37,8 @@ function web_search() { done url="${url%?}" # remove the last '+' - - $open_cmd "$url" + nohup $open_cmd "$url" + rm nohup.out } From 80323ec4c3497e49c8294752e96b033426ae09db Mon Sep 17 00:00:00 2001 From: Josh Medeski Date: Thu, 31 Jul 2014 19:37:22 -0500 Subject: [PATCH 11/62] WP-CLI plugin init --- plugins/wp-cli/wp-cli.plugin.zsh | 138 +++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 plugins/wp-cli/wp-cli.plugin.zsh diff --git a/plugins/wp-cli/wp-cli.plugin.zsh b/plugins/wp-cli/wp-cli.plugin.zsh new file mode 100644 index 000000000..5d9551e24 --- /dev/null +++ b/plugins/wp-cli/wp-cli.plugin.zsh @@ -0,0 +1,138 @@ +# WP-CLI +# A command line interface for WordPress +# http://wp-cli.org/ + +# Cache + +# Cap + +# CLI + +# Comment + +# Core +alias wpcc='wp core config' +alias wpcd='wp core download' +alias wpci='wp core install' +alias wpcii='wp core is-installed' +alias wpcmc='wp core multisite-convert' +alias wpcmi='wp core multisite-install' +alias wpcu='wp core update' +alias wpcudb='wp core update-db' +alias wpcvc='wp core verify-checksums' + +# Cron +alias wpcre='wp cron event' +alias wpcrs='wp cron schedule' +alias wpcrt='wp cron test' + +# Db + +# Eval + +# Eval-File + +# Export + +# Help + +# Import + +# Media + +# Menu +alias wpmc='wp menu create' +alias wpmd='wp menu delete' +alias wpmi='wp menu item' +alias wpml='wp menu list' +alias wpmlo='wp menu location' + +# Network + +# Option + +# Plugin +alias wppa='activate' +alias wppda='deactivate' +alias wppd='delete' +alias wppg='get' +alias wppi='install' +alias wppis='is-installed' +alias wppl='list' +alias wppp='path' +alias wpps='search' +alias wppst='status' +alias wppt='toggle' +alias wppu='uninstall' +alias wppu='update' + +# Post +alias wppoc='wp post create' +alias wppod='wp post delete' +alias wppoe='wp post edit' +alias wppogen='wp post generate' +alias wppog='wp post get' +alias wppol='wp post list' +alias wppom='wp post meta' +alias wppou='wp post update' +alias wppou='wp post url' + +# Rewrite + +# Role + +# Scaffold + +# Search-Replace + +# Shell + +# Sidebar +alias wpsbl='wp sidebar list' + +# Site + +# Super-Admin + +# Term + +# Theme +alias wpta='wp theme activate' +alias wptd='wp theme delete' +alias wptdis='wp theme disable' +alias wpte='wp theme enable' +alias wptg='wp theme get' +alias wpti='wp theme install' +alias wptis='wp theme is-installed' +alias wptl='wp theme list' +alias wptm='wp theme mod' +alias wptp='wp theme path' +alias wpts='wp theme search' +alias wptst='wp theme status' +alias wptu='wp theme updatet' + +# Transient + +# User +alias wpuac='wp user add-cap' +alias wpuar='wp user add-role' +alias wpuc='wp user create' +alias wpud='wp user delete' +alias wpugen='wp user generate' +alias wpug='wp user get' +alias wpui='wp user import-csv' +alias wpul='wp user list' +alias wpulc='wp user list-caps' +alias wpum='wp user meta' +alias wpurc='wp user remove-cap' +alias wpurr='wp user remove-role' +alias wpusr='wp user set-role' +alias wpuu='wp user update' + +# Widget +alias wpwa='wp widget add' +alias wpwda='wp widget deactivate' +alias wpwd='wp widget delete' +alias wpwl='wp widget list' +alias wpwm='wp widget move' +alias wpwu='wp widget update' From 961ca143b81fe5d15f67bd3a61fe174e41e155b5 Mon Sep 17 00:00:00 2001 From: Carlos Chacin Date: Fri, 1 Aug 2014 01:59:45 -0400 Subject: [PATCH 12/62] TomEE maven plugin + integration-test in common life-cycle --- plugins/mvn/mvn.plugin.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index a70625fcf..0c4f77162 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -64,7 +64,7 @@ alias mvns='mvn site' function listMavenCompletions { reply=( # common lifecycle - clean process-resources compile process-test-resources test-compile test package verify install deploy site + clean process-resources compile process-test-resources test-compile test integration-test package verify install deploy site # common plugins deploy failsafe install site surefire checkstyle javadoc jxr pmd ant antrun archetype assembly dependency enforcer gpg help release repository source eclipse idea jetty cargo jboss tomcat tomcat6 tomcat7 exec versions war ear ejb android scm buildnumber nexus repository sonar license hibernate3 liquibase flyway gwt @@ -129,6 +129,8 @@ function listMavenCompletions { tomcat6:run tomcat6:run-war tomcat6:run-war-only tomcat6:stop tomcat6:deploy tomcat6:undeploy # tomcat7 tomcat7:run tomcat7:run-war tomcat7:run-war-only tomcat7:deploy + # tomee + tomee:run tomee:run-war tomee:run-war-only tomee:stop tomee:deploy tomee:undeploy # spring-boot spring-boot:run spring-boot:repackage # exec From 4f1ee6c1eed04345c458458006a15381d35d8080 Mon Sep 17 00:00:00 2001 From: Jim Remsik Date: Fri, 1 Aug 2014 20:16:33 -0500 Subject: [PATCH 13/62] Add gap (git add --patch) --- 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 9f7819df3..44c4617fb 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -70,6 +70,7 @@ alias gss='git status -s' compdef _git gss=git-status alias ga='git add' compdef _git ga=git-add +alias gap='git add --patch' alias gm='git merge' compdef _git gm=git-merge alias grh='git reset HEAD' From 397a9f7b7bfd88678c5b10d2c3e96c0768677434 Mon Sep 17 00:00:00 2001 From: Adam Poskitt Date: Sat, 2 Aug 2014 11:43:32 +0100 Subject: [PATCH 14/62] Update README.textile --- README.textile | 84 +++++++++++++++++++++++++------------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/README.textile b/README.textile index 5900c95d8..09cff2135 100644 --- a/README.textile +++ b/README.textile @@ -1,111 +1,111 @@ !https://s3.amazonaws.com/ohmyzsh/oh-my-zsh-logo.png! -oh-my-zsh is an open source, community-driven framework for managing your ZSH configuration. It comes bundled with a ton of helpful functions, helpers, plugins, themes, and few things that make you shout... +@oh-my-zsh@ is an open source, community-driven framework for managing your "Zsh":http://www.zsh.org/ configuration. + +It comes bundled with a ton of helpful functions, helpers, plugins, themes, and a few things that make you shout… bq. "OH MY ZSHELL!" h2. Setup -@oh-my-zsh@ should work with any recent release of "zsh":http://www.zsh.org/, the minimum recommended version is 4.3.9. -If not already, install zsh using the command line first. +@oh-my-zsh@ should work with any recent release of "Zsh":http://www.zsh.org/. The minimum recommended version is *4.3.9*. -h3. The automatic installer... (do you trust me?) +If not already installed, you can install "Zsh":http://www.zsh.org/ using the command-line. -You can install this via the command line with either @curl@ or @wget@. +h3. The automatic installer… do you trust me? -h4. via @curl@ +You can install this via the command-line with either @curl@ or @wget@. + +h4. via @curl@: @curl -L http://install.ohmyz.sh | sh@ -h4. via @wget@ +h4. via @wget@: @wget --no-check-certificate http://install.ohmyz.sh -O - | sh@ -h4. Optional: change the install directory +h4. *Optionally*, change the install directory: The default location is @~/.oh-my-zsh@ (hidden in your home directory). -You can change the install directory with the ZSH environment variable, either -by running @export ZSH=/your/path@ before installing, or setting it before the -end of the install pipeline like this: +You can change the install directory with the @ZSH@ environment variable, either by running @export ZSH=/your/path@ before installing, or by setting it before the end of the install pipeline like this: @curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | ZSH=~/.dotfiles/zsh sh@ - h3. The manual way -1. Clone the repository +1. Clone the repository: - @git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@ +@git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@ -2. *OPTIONAL* Backup your existing @~/.zshrc@ file +2. *Optionally*, backup your existing @~/.zshrc@ file: - @cp ~/.zshrc ~/.zshrc.orig@ +@cp ~/.zshrc ~/.zshrc.orig@ -3. Create a new zsh config by copying the zsh template we've provided. +3. Create a new "Zsh":http://www.zsh.org/ config file by copying the "Zsh":http://www.zsh.org/ template we've provided: - @cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@ +@cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@ -4. Set zsh as your default shell: +4. Set "Zsh":http://www.zsh.org/ as your default shell: - @chsh -s /bin/zsh@ +@chsh -s /bin/zsh@ -5. Start / restart zsh (open a new terminal is easy enough...) +5. Start or restart "Zsh":http://www.zsh.org/ by opening a new command-line window. h3. Problems? -You _might_ need to modify your @PATH@ in @~/.zshrc@ if you're not able to find some commands after switching to _Oh My Zsh_. +You _might_ need to modify your @PATH@ in @~/.zshrc@ if you're not able to find some commands after switching to @oh-my-zsh@. -If you installed manually or changed the install location, check ZSH in @~/.zshrc@ +If you installed manually or changed the install location, check the @ZSH@ environment variable in @~/.zshrc@. h2. Usage -* enable the plugins you want in your @~/.zshrc@ (take a look at the @plugins/@ directory and the "wiki":https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins to see what's possible) +* enable the plugins you want in your @~/.zshrc@ (take a look at the @plugins/@ directory and the "wiki":https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins to see what's available) ** example: @plugins=(git osx ruby)@ -* Theme support: Change the @ZSH_THEME@ environment variable in @~/.zshrc@. -** Take a look at the "current themes":https://wiki.github.com/robbyrussell/oh-my-zsh/themes that come bundled with _Oh My Zsh_. -* much much more... take a look at @lib/@ what _Oh My Zsh_ offers... +* theme support: change the @ZSH_THEME@ environment variable in @~/.zshrc@ +** take a look at the @themes/@ directory and the "wiki":https://wiki.github.com/robbyrussell/oh-my-zsh/themes to see what comes bundled with @oh-my-zsh@ +* & much, much more… take a look at the @lib/@ directory to see what @oh-my-zsh@ has to offer… h2. Useful -the "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty tasty for tips. +The "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty useful for tips. h3. Customization -If you want to override any of the default behavior, just add a new file (ending in @.zsh@) into the @custom/@ directory. -If you have many functions which go well together you can put them as a @*.plugin.zsh@ file in the @custom/plugins/@ directory and then enable this plugin. -If you would like to override the functionality of a plugin distributed with oh-my-zsh, create a plugin of the same name in the @custom/plugins/@ directory and it will be loaded instead of the one in @plugins/@. +If you want to override any of the default behaviors, just add a new file (ending in @.zsh@) in the @custom/@ directory. + +If you have many functions that go well together, you can put them as a @*.plugin.zsh@ file in the @custom/plugins/@ directory and then enable this plugin (see '"Usage":https://github.com/robbyrussell/oh-my-zsh#usage' above). + +If you would like to override the functionality of a plugin distributed with @oh-my-zsh@, create a plugin of the same name in the @custom/plugins/@ directory and it will be loaded instead of the one in @plugins/@. h3. Updates -By default you will be prompted to check for updates. If you would like oh-my-zsh to automatically update itself without prompting you, set the following in your @~/.zshrc@ +By default you will be prompted to check for upgrades. If you would like @oh-my-zsh@ to automatically upgrade itself without prompting you, set the following in your @~/.zshrc@: @DISABLE_UPDATE_PROMPT=true@ -To disable updates entirely, put this in your @~/.zshrc@ +To disable upgrades entirely, set the following in your @~/.zshrc@: @DISABLE_AUTO_UPDATE=true@ -To upgrade directly from the command line, just run @upgrade_oh_my_zsh@ +To upgrade directly from the command-line, just run @upgrade_oh_my_zsh@. h3. Uninstalling -If you want to uninstall it, just run @uninstall_oh_my_zsh@ from the command line and it'll remove itself and revert you to bash (or your previous zsh config). +If you want to uninstall @oh-my-zsh@, just run @uninstall_oh_my_zsh@ from the command-line and it'll remove itself and revert you to @bash@ (or your previous "Zsh":http://www.zsh.org/ configuration). h2. Help out! -I'm far from being a zsh-expert and suspect there are many ways to improve. If you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests! +I'm far from being a "Zsh":http://www.zsh.org/ expert and suspect there are many ways to improve – if you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests! -h3. (Don't) Send us your theme! (for now) +h3. (Don't) send us your theme (for now)! --I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory.- +-I'm hoping to collect a bunch of themes – you can see existing ones in the @themes/@ directory.- -We have enough themes for the time being. Please fork the project and add on in there, you can let people know how to grab it from there. +We have enough themes for the time being. Please fork the project and add on in there – you can let people know how to grab it from there. h2. Contributors -This project wouldn't exist without all of our awesome users and contributors. - -* "View our growing list of contributors":https://github.com/robbyrussell/oh-my-zsh/contributors +This project wouldn't exist without all of our awesome users and contributors: "view our growing list of contributors":https://github.com/robbyrussell/oh-my-zsh/contributors Thank you so much! From fdb30392b15ef0b7edd6d670340d1ba390f4a7b8 Mon Sep 17 00:00:00 2001 From: Adam Poskitt Date: Mon, 4 Aug 2014 15:10:11 +0100 Subject: [PATCH 15/62] Update half-life.zsh-theme Add spaces before bullet-points to more easily distinguish them from one another and the rest of the prompt when using smaller font-sizes and do not add a blank line prior to prompt output; if there's a desire for spacing, one can use their terminal's line-height to achieve this. --- themes/half-life.zsh-theme | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/themes/half-life.zsh-theme b/themes/half-life.zsh-theme index c8d09ce47..1bf4c7432 100644 --- a/themes/half-life.zsh-theme +++ b/themes/half-life.zsh-theme @@ -51,8 +51,8 @@ zstyle ':vcs_info:*:prompt:*' check-for-changes true PR_RST="%{${reset_color}%}" FMT_BRANCH=" on %{$turquoise%}%b%u%c${PR_RST}" FMT_ACTION=" performing a %{$limegreen%}%a${PR_RST}" -FMT_UNSTAGED="%{$orange%}●" -FMT_STAGED="%{$limegreen%}●" +FMT_UNSTAGED="%{$orange%} ●" +FMT_STAGED="%{$limegreen%} ●" zstyle ':vcs_info:*:prompt:*' unstagedstr "${FMT_UNSTAGED}" zstyle ':vcs_info:*:prompt:*' stagedstr "${FMT_STAGED}" @@ -83,7 +83,7 @@ function steeef_precmd { # check for untracked files or updated submodules, since vcs_info doesn't if [[ ! -z $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then PR_GIT_UPDATE=1 - FMT_BRANCH="${PM_RST} on %{$turquoise%}%b%u%c%{$hotpink%}●${PR_RST}" + FMT_BRANCH="${PM_RST} on %{$turquoise%}%b%u%c%{$hotpink%} ●${PR_RST}" else FMT_BRANCH="${PM_RST} on %{$turquoise%}%b%u%c${PR_RST}" fi @@ -95,5 +95,4 @@ function steeef_precmd { } add-zsh-hook precmd steeef_precmd -PROMPT=$' -%{$purple%}%n%{$reset_color%} in %{$limegreen%}%~%{$reset_color%}$(rvm-prompt " with%{$fg[red]%} " v g "%{$reset_color%}")$vcs_info_msg_0_%{$orange%} λ%{$reset_color%} ' +PROMPT=$'%{$purple%}%n%{$reset_color%} in %{$limegreen%}%~%{$reset_color%}$(rvm-prompt " with%{$fg[red]%} " v g "%{$reset_color%}")$vcs_info_msg_0_%{$orange%} λ%{$reset_color%} ' From 89f1d94a3052e2eabd3e86b856eada8e51fc65b4 Mon Sep 17 00:00:00 2001 From: Frederik Mogensen Date: Sun, 7 Aug 2011 21:43:32 +0200 Subject: [PATCH 16/62] Added autocompleting plugin for Android Debug Bridge (adb). --- plugins/adb/_adb | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 plugins/adb/_adb diff --git a/plugins/adb/_adb b/plugins/adb/_adb new file mode 100644 index 000000000..1efcb9eb0 --- /dev/null +++ b/plugins/adb/_adb @@ -0,0 +1,37 @@ +#compdef adb +#autoload + +# in order to make this work, you will need to have the android adb tools + +# adb zsh completion, based on homebrew completion + +local -a _1st_arguments +_1st_arguments=( +'bugreport:return all information from the device that should be included in a bug report.' +'connect:connect to a device via TCP/IP Port 5555 is default.' +'devices:list all connected devices' +'disconnect:disconnect from a TCP/IP device. Port 5555 is default.' +'emu:run emulator console command' +'forward:forward socket connections' +'help:show the help message' +'install:push this package file to the device and install it' +'jdwp:list PIDs of processes hosting a JDWP transport' +'logcat:View device log' +'pull:copy file/dir from device' +'push:copy file/dir to device' +'shell:run remote shell interactively' +'sync:copy host->device only if changed (-l means list but dont copy)' +'uninstall:remove this app package from the device' +'version:show version num' +) + +local expl +local -a pkgs installed_pkgs + +_arguments \ + '*:: :->subcmds' && return 0 + +if (( CURRENT == 1 )); then + _describe -t commands "adb subcommand" _1st_arguments + return +fi From 8ad9122ba49bb0a41ca7dbad03cf5438477cc283 Mon Sep 17 00:00:00 2001 From: Frederik Mogensen Date: Tue, 3 Jan 2012 17:12:22 +0100 Subject: [PATCH 17/62] Added _files to complete all arguments following the first as files --- plugins/adb/_adb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/adb/_adb b/plugins/adb/_adb index 1efcb9eb0..4c998172d 100644 --- a/plugins/adb/_adb +++ b/plugins/adb/_adb @@ -35,3 +35,5 @@ if (( CURRENT == 1 )); then _describe -t commands "adb subcommand" _1st_arguments return fi + +_files From 78a7c0c6aebc6415040464c704f64bce0c72d049 Mon Sep 17 00:00:00 2001 From: Celso Miranda Date: Sat, 9 Aug 2014 01:04:28 +0100 Subject: [PATCH 18/62] Add support for local aur databases With these simple changes the plugin checks for the local AUR database and updates the aliases so it can update it when you issue a `pacupd` or `yaupd`. --- plugins/archlinux/archlinux.plugin.zsh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index bffe9657a..22d9f0970 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -21,10 +21,14 @@ if [[ -x `which yaourt` ]]; then alias yalst='yaourt -Qe' # List installed packages, even those installed from AUR (they're tagged as "local") alias yaorph='yaourt -Qtd' # Remove orphans using yaourt # Additional yaourt alias examples - if [[ -x `which abs` ]]; then + if [[ -x `which abs` && -x `which aur` '']]; then + alias yaupd='yaourt -Sy && sudo abs && sudo aur' # Update and refresh the local package, ABS and AUR databases against repositories + elif [[ -x `which abs` ]]; then alias yaupd='yaourt -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories + elif [[ -x `which aur` ]]; then + alias yaupd='yaourt -Sy && sudo aur' # Update and refresh the local package and AUR databases against repositories else - alias yaupd='yaourt -Sy' # Update and refresh the local package and ABS databases against repositories + alias yaupd='yaourt -Sy' # Update and refresh the local package database against repositories fi alias yainsd='yaourt -S --asdeps' # Install given package(s) as dependencies of another package alias yamir='yaourt -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist @@ -45,10 +49,14 @@ alias pacreps='pacman -Ss' # Search for package(s) in the repositori alias pacloc='pacman -Qi' # Display information about a given package in the local database alias paclocs='pacman -Qs' # Search for package(s) in the local database # Additional pacman alias examples -if [[ -x `which abs` ]]; then - alias pacupd='sudo pacman -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories +if [[ -x `which abs` && -x `which aur` ]]; then + alias pacupd='sudo pacman -Sy && sudo abs && sudo aur' # Update and refresh the local package, ABS and AUR databases against repositories +elif [[ -x `which abs` ]]; then + alias pacupd='sudo pacman -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories +elif [[ -x `which aur` ]]; then + alias pacupd='sudo pacman -Sy && sudo aur' # Update and refresh the local package and AUR databases against repositories else - alias pacupd='sudo pacman -Sy' # Update and refresh the local package and ABS databases against repositories + alias pacupd='sudo pacman -Sy' # Update and refresh the local package database against repositories fi alias pacinsd='sudo pacman -S --asdeps' # Install given package(s) as dependencies of another package alias pacmir='sudo pacman -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist From 7d208be2a147657d6d8e936e3f03c26b3a936ac8 Mon Sep 17 00:00:00 2001 From: Celso Miranda Date: Sat, 9 Aug 2014 01:09:06 +0100 Subject: [PATCH 19/62] bugfix: two wild apostrophes oops --- plugins/archlinux/archlinux.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index 22d9f0970..059884c27 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -21,7 +21,7 @@ if [[ -x `which yaourt` ]]; then alias yalst='yaourt -Qe' # List installed packages, even those installed from AUR (they're tagged as "local") alias yaorph='yaourt -Qtd' # Remove orphans using yaourt # Additional yaourt alias examples - if [[ -x `which abs` && -x `which aur` '']]; then + if [[ -x `which abs` && -x `which aur` ]]; then alias yaupd='yaourt -Sy && sudo abs && sudo aur' # Update and refresh the local package, ABS and AUR databases against repositories elif [[ -x `which abs` ]]; then alias yaupd='yaourt -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories From 99e74b04981b2eb66714bf68245115520bcd25f0 Mon Sep 17 00:00:00 2001 From: Cherry NG Date: Sat, 9 Aug 2014 21:40:56 +0800 Subject: [PATCH 20/62] rounding to emoji clock --- plugins/emoji-clock/emoji-clock.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/emoji-clock/emoji-clock.plugin.zsh b/plugins/emoji-clock/emoji-clock.plugin.zsh index 7351a02ec..a69446e3c 100644 --- a/plugins/emoji-clock/emoji-clock.plugin.zsh +++ b/plugins/emoji-clock/emoji-clock.plugin.zsh @@ -8,8 +8,8 @@ # ----------------------------------------------------------------------------- function emoji-clock() { - hour=$(date '+%I') - minutes=$(date '+%M') + hour=$(date -v '+15M' '+%I') + minutes=$(date -v '+15M' '+%M') case $hour in 01) clock="🕐"; [ $minutes -ge 30 ] && clock="🕜";; 02) clock="🕑"; [ $minutes -ge 30 ] && clock="🕝";; From 45abe764e55a6c201acb3bf8e602f53e5d5574f0 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 9 Aug 2014 12:26:35 -0300 Subject: [PATCH 21/62] Inclusion of aliases for sign git commits and tags --- plugins/git/git.plugin.zsh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 9f7819df3..51a09a053 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -77,6 +77,18 @@ alias grhh='git reset HEAD --hard' alias gclean='git reset --hard && git clean -dfx' alias gwc='git whatchanged -p --abbrev-commit --pretty=medium' +# Sign and verify commits with GPG +alias gcs='git commit -S' +compdef _git gcs=git-commit +alias gsps='git show --pretty=short --show-signature' +compdef _git gsps=git-show + +# Sign and verify tags with GPG +alias gts='git tag -s' +compdef _git gts=git-tag +alias gvt='git verify-tag' +compdef _git gvt=git verify-tag + #remove the gf alias #alias gf='git ls-files | grep' From 9a0196dbf72521319a0fa0db4ae84603c2c79868 Mon Sep 17 00:00:00 2001 From: lundberg Date: Sun, 10 Aug 2014 12:01:47 -0700 Subject: [PATCH 22/62] New alias for git plugin: gbr == git branch --remote --- 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 9f7819df3..cef7926db 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -51,6 +51,7 @@ alias gb='git branch' compdef _git gb=git-branch alias gba='git branch -a' compdef _git gba=git-branch +alias gbr='git branch --remote' alias gcount='git shortlog -sn' compdef gcount=git alias gcl='git config --list' From df1b0b328983dba57b4cea123b5a05c24493ae8f Mon Sep 17 00:00:00 2001 From: Tom Cammann Date: Tue, 19 Aug 2014 15:42:39 +0100 Subject: [PATCH 23/62] Update jira plugin to allow lookup of issues Plugin now supports lookup of tickets by assignee and reporter --- plugins/jira/jira.plugin.zsh | 41 ++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh index 3d510e430..a6d08410f 100644 --- a/plugins/jira/jira.plugin.zsh +++ b/plugins/jira/jira.plugin.zsh @@ -26,7 +26,7 @@ open_jira_issue () { jira_url=$JIRA_URL else echo "JIRA url is not specified anywhere." - return 0 + return 1 fi if [ -f .jira-prefix ]; then @@ -39,7 +39,9 @@ open_jira_issue () { if [ -z "$1" ]; then echo "Opening new issue" - $open_cmd "$jira_url/secure/CreateIssue!default.jspa" + $open_cmd "${jira_url}/secure/CreateIssue!default.jspa" + elif [[ "$1" = "assigned" || "$1" = "reported" ]]; then + jira_query $@ else echo "Opening issue #$1" if [[ "x$JIRA_RAPID_BOARD" = "xtrue" ]]; then @@ -50,4 +52,39 @@ open_jira_issue () { fi } +jira_name () { + if [[ -z "$1" ]]; then + if [[ "x${JIRA_NAME}" != "x" ]]; then + jira_name=${JIRA_NAME} + else + echo "JIRA_NAME not specified" + return 1 + fi + else + jira_name=$@ + fi +} + +jira_query () { + verb="$1" + if [[ "${verb}" = "reported" ]]; then + lookup=reporter + preposition=by + elif [[ "${verb}" = "assigned" ]]; then + lookup=assignee + preposition=to + else + echo "not a valid lookup $verb" + return 1 + fi + shift 1 + jira_name $@ + if [[ $? = 1 ]]; then + return 1 + fi + echo "Browsing issues ${verb} ${preposition} ${jira_name}" + $open_cmd "${jira_url}/secure/IssueNavigator.jspa?reset=true&jqlQuery=${lookup}+%3D+%22${jira_name}%22+AND+resolution+%3D+unresolved+ORDER+BY+priority+DESC%2C+created+ASC" +} + alias jira='open_jira_issue' + From eee7345f1f01df5f66151bc5bf34d8e2110224aa Mon Sep 17 00:00:00 2001 From: Alex Shadrin Date: Wed, 20 Aug 2014 13:57:28 +0300 Subject: [PATCH 24/62] Resets the font colour to original --- themes/fino.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/fino.zsh-theme b/themes/fino.zsh-theme index 35e6e02c1..411dec9b9 100644 --- a/themes/fino.zsh-theme +++ b/themes/fino.zsh-theme @@ -35,7 +35,7 @@ local prompt_char='$(prompt_char)' PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}${current_dir}%{$reset_color%}${git_info} %{$FG[239]%}using%{$FG[243]%}${ruby_env} -╰─${prompt_char} " +╰─${prompt_char}%{$reset_color%} " ZSH_THEME_GIT_PROMPT_PREFIX=" %{$FG[239]%}on%{$reset_color%} %{$fg[255]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" From dac2a6e27a23071226495bfee54b390135cb20b6 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Wed, 20 Aug 2014 23:52:05 +0200 Subject: [PATCH 25/62] Replace /usr/bin/env with env Some environments (such as Android) does not have /usr/bin. --- lib/functions.zsh | 4 ++-- oh-my-zsh.sh | 2 +- tools/check_for_upgrade.sh | 2 +- tools/install.sh | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/functions.zsh b/lib/functions.zsh index fda84a953..17f5f9cbf 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -3,11 +3,11 @@ function zsh_stats() { } function uninstall_oh_my_zsh() { - /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/uninstall.sh + env ZSH=$ZSH /bin/sh $ZSH/tools/uninstall.sh } function upgrade_oh_my_zsh() { - /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh + env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh } function take() { diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index c217b91bb..a90b3e98a 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -1,6 +1,6 @@ # Check for updates on initial load... if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then - /usr/bin/env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $ZSH/tools/check_for_upgrade.sh + env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $ZSH/tools/check_for_upgrade.sh fi # Initializes Oh My Zsh diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index 8b8ecae03..35e074297 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -9,7 +9,7 @@ function _update_zsh_update() { } function _upgrade_zsh() { - /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh + env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh # update the zsh file _update_zsh_update } diff --git a/tools/install.sh b/tools/install.sh index fc7ad70cf..7efab10b9 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -10,7 +10,7 @@ if [ -d "$ZSH" ]; then fi echo "\033[0;34mCloning Oh My Zsh...\033[0m" -hash git >/dev/null 2>&1 && /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git $ZSH || { +hash git >/dev/null 2>&1 && env git clone https://github.com/robbyrussell/oh-my-zsh.git $ZSH || { echo "git not installed" exit } @@ -43,5 +43,5 @@ echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m echo "\033[0;32m"' /____/ ....is now installed!'"\033[0m" echo "\n\n \033[0;32mPlease look over the ~/.zshrc file to select plugins, themes, and options.\033[0m" echo "\n\n \033[0;32mp.s. Follow us at http://twitter.com/ohmyzsh.\033[0m" -/usr/bin/env zsh +env zsh . ~/.zshrc From 91ba6d98875c70d0736fd3eecd0ee4aae52cdc74 Mon Sep 17 00:00:00 2001 From: Mathieu Comandon Date: Thu, 21 Aug 2014 12:47:48 +0200 Subject: [PATCH 26/62] Don't try running chsh if user already runs zsh --- tools/install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/install.sh b/tools/install.sh index fc7ad70cf..fc0a9fa64 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -32,8 +32,10 @@ sed -i -e "/export PATH=/ c\\ export PATH=\"$PATH\" " ~/.zshrc -echo "\033[0;34mTime to change your default shell to zsh!\033[0m" -chsh -s `which zsh` +if [ "$SHELL" != "$(which zsh)" ]; then + echo "\033[0;34mTime to change your default shell to zsh!\033[0m" + chsh -s `which zsh` +fi echo "\033[0;32m"' __ __ '"\033[0m" echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" From 5d6c73d7d38930443bdc4357c337e0baf7d5b5fb Mon Sep 17 00:00:00 2001 From: DariusPHP Date: Fri, 22 Aug 2014 10:21:38 +0300 Subject: [PATCH 27/62] #git plugin git diff-tree --name-only added --- plugins/git/git.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 9f7819df3..a76bb1cdf 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -7,6 +7,8 @@ alias gd='git diff' compdef _git gd=git-diff alias gdc='git diff --cached' compdef _git gdc=git-diff +alias gdt='git diff-tree --no-commit-id --name-only -r' +compdef _git gdc=git diff-tree --no-commit-id --name-only -r alias gl='git pull' compdef _git gl=git-pull alias gup='git pull --rebase' From dc9e1764cfd0987f104f57bac0b974e0941f1e42 Mon Sep 17 00:00:00 2001 From: Jingwen Owen Ou Date: Fri, 22 Aug 2014 15:59:17 -0700 Subject: [PATCH 28/62] Fix missing add-zsh-hook In older version of zsh, `add-zsh-hook` is not available, causing issues like: ``` /Users/hugo/.oh-my-zsh/lib/termsupport.zsh:32: add-zsh-hook: function definition file not found /Users/hugo/.oh-my-zsh/lib/termsupport.zsh:33: add-zsh-hook: function definition file not found ``` See https://github.com/robbyrussell/oh-my-zsh/issues/748. This patch pulls in the changes suggested in https://github.com/robbyrussell/oh-my-zsh/issues/748#issuecomment-37862691 by @mcornella and I have tested it on RHEL 5. --- lib/termsupport.zsh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 9c0a430fb..9d6681603 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -34,6 +34,5 @@ function omz_termsupport_preexec { title '$CMD' '%100>...>$LINE%<<' } -autoload -U add-zsh-hook -add-zsh-hook precmd omz_termsupport_precmd -add-zsh-hook preexec omz_termsupport_preexec +precmd_functions+=(omz_termsupport_precmd) +preexec_functions+=(omz_termsupport_preexec) From ac053f4211ef2da6b66bd148a930cfdddd12991f Mon Sep 17 00:00:00 2001 From: sachin21 Date: Sun, 24 Aug 2014 00:50:02 +0900 Subject: [PATCH 29/62] This alias is conflict cause --- lib/aliases.zsh | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/aliases.zsh b/lib/aliases.zsh index 3044c9660..aae865046 100644 --- a/lib/aliases.zsh +++ b/lib/aliases.zsh @@ -30,7 +30,6 @@ alias lsa='ls -lah' alias l='ls -lah' alias ll='ls -lh' alias la='ls -lAh' -alias sl=ls # often screw this up alias afind='ack-grep -il' From ee33cee83e78b53ca200b5647b024bcd93f8ee3d Mon Sep 17 00:00:00 2001 From: Igor Zoriy Date: Tue, 26 Aug 2014 01:05:13 +0700 Subject: [PATCH 30/62] Added 'uninstall' command to brew completion --- plugins/brew/_brew | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/brew/_brew b/plugins/brew/_brew index 9eb3bb557..40442a1d3 100644 --- a/plugins/brew/_brew +++ b/plugins/brew/_brew @@ -50,6 +50,7 @@ _1st_arguments=( 'server:start a local web app that lets you browse formulae (requires Sinatra)' 'services:small wrapper around `launchctl` for supported formulae' 'tap:tap a new formula repository from GitHub, or list existing taps' + 'uninstall:uninstall a formula' 'unlink:unlink a formula' 'unpin:unpin specified formulae' 'untap:remove a tapped repository' From e20ce81c6663e354f9ef29618e7149800b9a3b26 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Tue, 26 Aug 2014 08:34:17 -0500 Subject: [PATCH 31/62] Adding BBEdit plugin --- plugins/bbedit/bbedit.plugin.zsh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 plugins/bbedit/bbedit.plugin.zsh diff --git a/plugins/bbedit/bbedit.plugin.zsh b/plugins/bbedit/bbedit.plugin.zsh new file mode 100644 index 000000000..6eec10f21 --- /dev/null +++ b/plugins/bbedit/bbedit.plugin.zsh @@ -0,0 +1,21 @@ +alias bbpb='pbpaste | bbedit --clean --view-top' + +alias bbd=bbdiff + +# +# If the bb command is called without an argument, launch BBEdit +# If bb is passed a directory, cd to it and open it in BBEdit +# If bb is passed a file, open it in BBEdit +# +function bb() { + if [[ -z $1 ]] + then + bbedit --launch + else + bbedit $1 + if [[ -d $1 ]] + then + cd $1 + fi + fi +} From 9eb2118c556b81e4eb0965d3e4bc024e35687aba Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Tue, 26 Aug 2014 08:36:16 -0500 Subject: [PATCH 32/62] Adding Marked 2 plugin --- plugins/marked/marked.plugin.zsh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 plugins/marked/marked.plugin.zsh diff --git a/plugins/marked/marked.plugin.zsh b/plugins/marked/marked.plugin.zsh new file mode 100644 index 000000000..8c014372b --- /dev/null +++ b/plugins/marked/marked.plugin.zsh @@ -0,0 +1,12 @@ +# +# If marked is called without an argument, open Marked +# If marked is passed a file, open it in Marked +# +function marked() { + if [ $1 ] + then + open -a "marked 2.app" $1 + else + open -a "marked 2.app" + fi +} From 325c18736e82d0688f7437cefff23910ebd7cedd Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Tue, 26 Aug 2014 08:37:04 -0500 Subject: [PATCH 33/62] Adding Textastic plugin --- plugins/textastic/textastic.plugin.zsh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 plugins/textastic/textastic.plugin.zsh diff --git a/plugins/textastic/textastic.plugin.zsh b/plugins/textastic/textastic.plugin.zsh new file mode 100644 index 000000000..c34162139 --- /dev/null +++ b/plugins/textastic/textastic.plugin.zsh @@ -0,0 +1,17 @@ +# +# If the tt command is called without an argument, launch Textastic +# If tt is passed a directory, cd to it and open it in Textastic +# If tt is passed a file, open it in Textastic +# +function tt() { + if [[ -z $1 ]] + then + open -a "textastic.app" + else + open -a "textastic.app" $1 + if [[ -d $1 ]] + then + cd $1 + fi + fi +} From 362f2a56d276aebfb8da4e3244994f69899bbdbd Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Wed, 27 Aug 2014 08:27:31 -0500 Subject: [PATCH 34/62] Adding quotes around $1 --- plugins/textastic/textastic.plugin.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/textastic/textastic.plugin.zsh b/plugins/textastic/textastic.plugin.zsh index c34162139..f5901eae2 100644 --- a/plugins/textastic/textastic.plugin.zsh +++ b/plugins/textastic/textastic.plugin.zsh @@ -4,14 +4,14 @@ # If tt is passed a file, open it in Textastic # function tt() { - if [[ -z $1 ]] + if [[ -z "$1" ]] then open -a "textastic.app" else - open -a "textastic.app" $1 - if [[ -d $1 ]] + open -a "textastic.app" "$1" + if [[ -d "$1" ]] then - cd $1 + cd "$1" fi fi } From 9be81015d0fcb7864be9cdfe550aeee20c52bf7a Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Wed, 27 Aug 2014 08:31:18 -0500 Subject: [PATCH 35/62] Adding quotes around $1 --- plugins/marked/marked.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/marked/marked.plugin.zsh b/plugins/marked/marked.plugin.zsh index 8c014372b..56863ade5 100644 --- a/plugins/marked/marked.plugin.zsh +++ b/plugins/marked/marked.plugin.zsh @@ -3,9 +3,9 @@ # If marked is passed a file, open it in Marked # function marked() { - if [ $1 ] + if [ "$1" ] then - open -a "marked 2.app" $1 + open -a "marked 2.app" "$1" else open -a "marked 2.app" fi From 1b4d4266131eb760fc0cc25aab847a9c08d1c6de Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Wed, 27 Aug 2014 08:34:17 -0500 Subject: [PATCH 36/62] Adding quotes around $1 --- plugins/bbedit/bbedit.plugin.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/bbedit/bbedit.plugin.zsh b/plugins/bbedit/bbedit.plugin.zsh index 6eec10f21..fe9e72c65 100644 --- a/plugins/bbedit/bbedit.plugin.zsh +++ b/plugins/bbedit/bbedit.plugin.zsh @@ -8,14 +8,14 @@ alias bbd=bbdiff # If bb is passed a file, open it in BBEdit # function bb() { - if [[ -z $1 ]] + if [[ -z "$1" ]] then bbedit --launch else - bbedit $1 - if [[ -d $1 ]] + bbedit "$1" + if [[ -d "$1" ]] then - cd $1 + cd "$1" fi fi } From 1aadd63cfc98987c42033aeb4d7b826abf1f49ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 17 Jul 2014 13:46:06 +0200 Subject: [PATCH 37/62] Add CONTRIBUTING.md file general structure --- CONTRIBUTING.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..ae8865b35 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,26 @@ +# CONTRIBUTING GUIDELINE + +1. [Luke, use the search](#luke-use-the-search) +2. [You have a problem](#you-have-a-problem) +3. [You have a solution](#you-have-a-solution) + +**BONUS:** [You have free time to volunteer](#you-have-free-time-to-volunteer) + +## LUKE, USE THE SEARCH + +May the experiences of other people be with you + + +## YOU HAVE A PROBLEM + +See point 1, then look at FAQ or Troubleshooting wiki pages (first we'll have to make them) + + +## YOU HAVE A SOLUTION + +See point 1, then go ahead (unless your solution is yet another theme) + + +## YOU HAVE FREE TIME TO VOLUNTEER + +Cool! From 1e2abe5d4e1cbf29b1630292ec3eb32cb993f49e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 4 Aug 2014 23:04:53 +0200 Subject: [PATCH 38/62] Categories of issues in oh-my-zsh (work-in-progress) --- CONTRIBUTING.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ae8865b35..9964c380d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,4 +23,20 @@ See point 1, then go ahead (unless your solution is yet another theme) ## YOU HAVE FREE TIME TO VOLUNTEER -Cool! +Cool! Please have a look at the list below to understand how oh-my-zsh categorizes its issues. + +Classification of issues and + +- Bugs, which may be: + - Specific of zsh \* + - Regressions, in which we should summon the author of the offending commit once it is located + +- Feature requests + +- Helpdesk, which may be: + - Specific of zsh \* + - Everything else + +\* In the case of bugs, I see the benefit in going through the trouble of responding to that. After all, oh-my-zsh should be the missing link that makes zsh perfect, and hunting down an upstream bug can lead to a submitted PR. +In the case of helpdesk, minimal response should be done. That is, provide a link to the wiki with the relevant information, or +add it to the FAQ of the wiki and point to it afterwards. From 25a3244353076cbffc8ddb2ee592b94b17383694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Santiago=20Borraz=C3=A1s?= Date: Sat, 8 Dec 2012 15:31:13 -0300 Subject: [PATCH 39/62] Added a link to the file's license and added the commiter as plugin maintaner. --- plugins/pass/_pass | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/pass/_pass b/plugins/pass/_pass index d8ec38828..f03aa0169 100644 --- a/plugins/pass/_pass +++ b/plugins/pass/_pass @@ -4,10 +4,13 @@ # Copyright (C) 2012: # Johan Venant # Brian Mattern -# Jason A. Donenfeld . -# Santiago Borrazás +# Jason A. Donenfeld # All Rights Reserved. -# This file is licensed under the GPLv2+. Please see COPYING for more information. +# +# This file is licensed under the GPLv2+. +# Please visit http://git.zx2c4.com/password-store/tree/COPYING for more information. +# +# Oh my zsh plugin maintainer: Santiago Borrazás _pass () { From 17dd5792b4a34e65311fda6ab469b98f31cf30df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 26 Jul 2014 23:23:13 +0200 Subject: [PATCH 40/62] Update pass completion to upstream Conflicts: plugins/pass/_pass --- plugins/pass/_pass | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/plugins/pass/_pass b/plugins/pass/_pass index f03aa0169..9c4b669bd 100644 --- a/plugins/pass/_pass +++ b/plugins/pass/_pass @@ -1,10 +1,10 @@ #compdef pass #autoload -# Copyright (C) 2012: +# Copyright (C) 2012 - 2014: # Johan Venant # Brian Mattern -# Jason A. Donenfeld +# Jason A. Donenfeld . # All Rights Reserved. # # This file is licensed under the GPLv2+. @@ -26,8 +26,8 @@ _pass () { case "${cmd}" in init) _arguments : \ - "-r[re-encrypt existing passwords]" \ - "--reencrypt[re-encrypt existing passwords]" + "-p[gpg-id will only be applied to this subfolder]" \ + "--path[gpg-id will only be applied to this subfolder]" _pass_complete_keys ;; ls|list|edit) @@ -46,9 +46,19 @@ _pass () { "-n[don't include symbols in password]" \ "--no-symbols[don't include symbols in password]" \ "-c[copy password to the clipboard]" \ - "--clip[copy password to the clipboard]" + "--clip[copy password to the clipboard]" \ + "-f[force overwrite]" \ + "--force[force overwrite]" \ + "-i[replace first line]" \ + "--in-place[replace first line]" _pass_complete_entries_with_subdirs ;; + cp|copy|mv|rename) + _arguments : \ + "-f[force rename]" \ + "--force[force rename]" + _pass_complete_entries_with_subdirs + ;; rm) _arguments : \ "-f[force deletion]" \ @@ -78,10 +88,14 @@ _pass () { subcommands=( "init:Initialize new password storage" "ls:List passwords" + "find:Find password files or directories based on pattern" + "grep:Search inside decrypted password files for matching pattern" "show:Decrypt and print a password" "insert:Insert a new password" "generate:Generate a new password using pwgen" "edit:Edit a password with \$EDITOR" + "mv:Rename the password" + "cp:Copy the password" "rm:Remove the password" "git:Call git on the password store" "version:Output version information" @@ -104,7 +118,7 @@ _pass_cmd_show () { _pass_complete_entries_helper () { local IFS=$'\n' local prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}" - _values -C 'passwords' $(find -L "$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}/\{0,1\}##" -e 's#\.gpg##' | sort) } _pass_complete_entries_with_subdirs () { From 142a6c7fd5bcda6c45c25aca582972a7d4e1da85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 26 Jul 2014 23:26:12 +0200 Subject: [PATCH 41/62] Fix pass zsh completion and autoloading When autocompleting from `pass ', sometimes the following errors appear: _values:compvalues:10: not enough arguments find: `/home/user/.password-store': No such file or directory _values:compvalues:10: not enough arguments find: `/home/user/.password-store': No such file or directory The `_values' error happens when there is no password-store folder *or* there are no passwords in pass; the `find' error only when there is no password-store folder. We can trace it back to line 108, which contains the only `_values' statement that is executed when we autocomplete from pass. We confirm this by following the trail of execution, which is _pass -> _pass_cmd_show -> _pass_complete_entries -> -> _pass_complete_entries_helper If we try running the command inside `$()' on line 104, we see that it returns nothing and the output is blank. This means that `_values' only receives 1 of its 2 mandatory parameters, therefore the above error is triggered (not enough arguments). That is unless we don't have a password-store folder, in which case the `find: [...] no such file or directory' error is *also* triggered. We solve the first error by supplying a default value of "" if the command outputs nothing, using the zsh construct ${var:-else}. We solve the second error by redirecting the find command's stderr output to /dev/null, so the error is effectively suppressed. * * * * This patch also fixes the first tab completion, which currently only loads the completion function definition. We do this by adding a `_pass' statement at the end of the file, which runs the `_pass' completion function after loading its definition. This is the standard way an autoloaded function works; for other examples look at zsh's official completion files. --- plugins/pass/_pass | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/pass/_pass b/plugins/pass/_pass index 9c4b669bd..7a9b1f955 100644 --- a/plugins/pass/_pass +++ b/plugins/pass/_pass @@ -118,7 +118,7 @@ _pass_cmd_show () { _pass_complete_entries_helper () { local IFS=$'\n' local prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}" - _values -C 'passwords' $(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' | sort) + _values -C 'passwords' ${$(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print 2>/dev/null | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' | sort):-""} } _pass_complete_entries_with_subdirs () { @@ -134,3 +134,5 @@ _pass_complete_keys () { # Extract names and email addresses from gpg --list-keys _values 'gpg keys' $(gpg2 --list-secret-keys --with-colons | cut -d : -f 10 | sort -u | sed '/^$/d') } + +_pass From cd98283a92a5b2726e3164653e6b8c674eeedb92 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Fri, 29 Aug 2014 10:40:08 +0200 Subject: [PATCH 42/62] tmuxinator completion update: Current completion plugin isn't up to date and #2075 PR, which is also the completion plugin on the official tmuxinator repository, doesn't work. Thus this should do the trick for the moment. Also suppressed an error when no completion is available --- plugins/tmuxinator/_tmuxinator | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/tmuxinator/_tmuxinator b/plugins/tmuxinator/_tmuxinator index cd227b7df..e4f8b6ce0 100644 --- a/plugins/tmuxinator/_tmuxinator +++ b/plugins/tmuxinator/_tmuxinator @@ -11,10 +11,12 @@ _arguments -C \ case $state in cmds) _values "tmuxinator command" \ + "new[create a new project file and open it in your editor]" \ "start[start a tmux session using project's tmuxinator config]" \ "open[create a new project file and open it in your editor]" \ "copy[copy source_project project file to a new project called new_project]" \ "delete[deletes the project called project_name]" \ + "debug[output the shell commands generated by a projet]" \ "implode[deletes all existing projects!]" \ "list[list all existing projects]" \ "doctor[look for problems in your configuration]" \ @@ -24,9 +26,9 @@ case $state in ;; args) case $line[1] in - start|open|copy|delete) + start|open|copy|delete|debug) _configs=(`find ~/.tmuxinator -name \*.yml | cut -d/ -f5 | sed s:.yml::g`) - _values 'configs' $_configs + [[ -n "$_configs" ]] && _values 'configs' $_configs ret=0 ;; esac From f49220732904ed254400f14e621ea5ebe9e4a5f5 Mon Sep 17 00:00:00 2001 From: "Douglas S.D. Hall" Date: Sat, 30 Aug 2014 17:20:28 +0100 Subject: [PATCH 43/62] Amended to source the original aws_zsh_completer.sh rather than the mangled version installed into $(brew-prefix)/bin if using homebrew installed awscli on OSX. This was discussed here - https://github.com/Homebrew/homebrew/issues/30268 --- plugins/aws/aws.plugin.zsh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index 3f7fb1995..8b57d7db1 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -1,3 +1,11 @@ +_homebrew-installed() { + type brew &> /dev/null +} + +_awscli-homebrew-installed() { + brew --prefix awscli &> /dev/null +} + export AWS_HOME=~/.aws function agp { @@ -14,4 +22,9 @@ function aws_profiles { } compctl -K aws_profiles asp -source `which aws_zsh_completer.sh` + +if _homebrew-installed && _awscli-homebrew-installed ; then + source $(brew --prefix)/opt/awscli/libexec/bin/aws_zsh_completer.sh +else + source `which aws_zsh_completer.sh` +fi From 14f055d0bb737520edf6dfcf27d3e3d6e3aaa863 Mon Sep 17 00:00:00 2001 From: nervo Date: Sun, 31 Aug 2014 15:41:02 +0200 Subject: [PATCH 44/62] Add Composer's local binaries to PATH --- plugins/composer/composer.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh index 86f2ca4df..2243dd3c1 100644 --- a/plugins/composer/composer.plugin.zsh +++ b/plugins/composer/composer.plugin.zsh @@ -47,5 +47,5 @@ alias cdu='composer dump-autoload' # install composer in the current directory alias cget='curl -s https://getcomposer.org/installer | php' -# Add Composer's global binaries to PATH -export PATH=$PATH:~/.composer/vendor/bin +# Add Composer's global & local binaries to PATH +export PATH=$PATH:~/.composer/vendor/bin:./bin From a8dad6fa87867ff2629a55e26f78175635a0ad06 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Sun, 31 Aug 2014 12:55:46 -0500 Subject: [PATCH 45/62] Adding README.md --- plugins/textastic/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 plugins/textastic/README.md diff --git a/plugins/textastic/README.md b/plugins/textastic/README.md new file mode 100644 index 000000000..369c2c137 --- /dev/null +++ b/plugins/textastic/README.md @@ -0,0 +1,15 @@ +## textastic + +Plugin for Textastic, a text and code editor for Mac OS X + +### Requirements + + * [Textastic](http://www.textasticapp.com/mac.html) + +### Usage + + * If `tt` command is called without an argument, launch Textastic + + * If `tt` is passed a directory, cd to it and open it in Textastic + + * If `tt` is passed a file, open it in Textastic From d7f77f818d3f094f42e02554b3c697c0f3d26ed6 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Sun, 31 Aug 2014 12:56:23 -0500 Subject: [PATCH 46/62] Adding README.md --- plugins/bbedit/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 plugins/bbedit/README.md diff --git a/plugins/bbedit/README.md b/plugins/bbedit/README.md new file mode 100644 index 000000000..ec2b743d6 --- /dev/null +++ b/plugins/bbedit/README.md @@ -0,0 +1,20 @@ +## bbedit + +Plugin for BBEdit, an HTML and text editor for Mac OS X + +### Requirements + + * [BBEdit](http://www.barebones.com/products/bbedit/) + * [BBEdit Command-Line Tools](http://www.barebones.com/support/bbedit/cmd-line-tools.html) + +### Usage + + * If the `bb` command is called without an argument, launch BBEdit + + * If `bb` is passed a directory, cd to it and open it in BBEdit + + * If `bb` is passed a file, open it in BBEdit + + * If `bbpb` create a new BBEdit document with the contents of the clipboard + + * If `bbd` alias for BBEdit diff tool From 9bf5b90c81ce2cbde321c3d6d97d5ff6d561b83c Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Sun, 31 Aug 2014 12:57:58 -0500 Subject: [PATCH 47/62] Adding README.md and renaming plugin --- plugins/marked2/README.md | 13 +++++++++++++ .../marked2.plugin.zsh} | 0 2 files changed, 13 insertions(+) create mode 100644 plugins/marked2/README.md rename plugins/{marked/marked.plugin.zsh => marked2/marked2.plugin.zsh} (100%) diff --git a/plugins/marked2/README.md b/plugins/marked2/README.md new file mode 100644 index 000000000..101343abb --- /dev/null +++ b/plugins/marked2/README.md @@ -0,0 +1,13 @@ +## marked2 + +Plugin for Marked 2, a previewer for Markdown files on Mac OS X + +### Requirements + + * [Marked 2](http://marked2app.com) + +### Usage + + * If `marked` is called without an argument, open Marked + + * If `marked` is passed a file, open it in Marked diff --git a/plugins/marked/marked.plugin.zsh b/plugins/marked2/marked2.plugin.zsh similarity index 100% rename from plugins/marked/marked.plugin.zsh rename to plugins/marked2/marked2.plugin.zsh From 9f8d7d85c2cacce54a5839d90b93e90b22228624 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Sun, 31 Aug 2014 11:30:30 -0700 Subject: [PATCH 48/62] Adding link to the store for swag in upgrade process --- tools/upgrade.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 9a8497d96..5f0a81f1d 100644 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -9,8 +9,8 @@ then 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' + printf '\033[0;34m%s\033[1m%s\033[0m\n' 'To keep up on the latest news and updates, follow us on twitter: ' 'http://twitter.com/ohmyzsh' + printf '\033[0;34m%s\033[1m%s\033[0m\n' 'Get your Oh My Zsh swag at: ' 'http://shop.planetargon.com/' else printf '\033[0;31m%s\033[0m\n' 'There was an error updating. Try again later?' fi - From 671bd0cf4f0face60883a2b476e75e6364d0154e Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Sun, 31 Aug 2014 11:32:07 -0700 Subject: [PATCH 49/62] Link to swag in installer... shameless profiting --- tools/install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/install.sh b/tools/install.sh index 7efab10b9..3ff897a01 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -43,5 +43,6 @@ echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m echo "\033[0;32m"' /____/ ....is now installed!'"\033[0m" echo "\n\n \033[0;32mPlease look over the ~/.zshrc file to select plugins, themes, and options.\033[0m" echo "\n\n \033[0;32mp.s. Follow us at http://twitter.com/ohmyzsh.\033[0m" +echo "\n\n \033[0;32mp.p.s. Get stickers and t-shirts at http://shop.planetargon.com.\033[0m" env zsh . ~/.zshrc From 65f97a66c7fa2979ba454e9bcc578854912721d9 Mon Sep 17 00:00:00 2001 From: Tobias Preuss Date: Sun, 31 Aug 2014 21:42:49 +0200 Subject: [PATCH 50/62] Add README.md for adb-autocompletion plugin. --- plugins/adb/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 plugins/adb/README.md diff --git a/plugins/adb/README.md b/plugins/adb/README.md new file mode 100644 index 000000000..075beec0e --- /dev/null +++ b/plugins/adb/README.md @@ -0,0 +1,8 @@ +# adb autocomplete plugin + +* Adds autocomplete options for all adb commands. + + +## Requirements + +In order to make this work, you will need to have the Android adb tools set up in your path. From e7fdb028b52505947c7c3eb088586590f5b0b8cd Mon Sep 17 00:00:00 2001 From: Michael Stucki Date: Sun, 31 Aug 2014 23:50:59 +0200 Subject: [PATCH 51/62] Improve support for Vagrant VM definitions --- plugins/vagrant/_vagrant | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant index 9ddfa1be7..f842b4fbb 100644 --- a/plugins/vagrant/_vagrant +++ b/plugins/vagrant/_vagrant @@ -56,7 +56,7 @@ __box_list () __vm_list () { - _wanted application expl 'command' compadd $(command grep Vagrantfile -oe '^[^#]*\.vm\.define *:\([a-zA-Z0-9]\+\)' 2>/dev/null | cut -d: -f2) + _wanted application expl 'command' compadd $(command grep Vagrantfile -oe '^[^#]*\.vm\.define *[:"]\([a-zA-Z0-9_-]\+\)' 2>/dev/null | awk '{print substr($2, 2)}') } __vagrant-box () From 2b83accbf8d8668f4b46e449087317dc90a43873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C3=96zg=C3=BCr?= Date: Mon, 1 Sep 2014 04:14:03 +0300 Subject: [PATCH 52/62] Use the library function for ruby prompt Not everyone uses rvm and the library has already got a function for this. --- themes/half-life.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/half-life.zsh-theme b/themes/half-life.zsh-theme index 1bf4c7432..942affa94 100644 --- a/themes/half-life.zsh-theme +++ b/themes/half-life.zsh-theme @@ -95,4 +95,4 @@ function steeef_precmd { } add-zsh-hook precmd steeef_precmd -PROMPT=$'%{$purple%}%n%{$reset_color%} in %{$limegreen%}%~%{$reset_color%}$(rvm-prompt " with%{$fg[red]%} " v g "%{$reset_color%}")$vcs_info_msg_0_%{$orange%} λ%{$reset_color%} ' +PROMPT=$'%{$purple%}%n%{$reset_color%} in %{$limegreen%}%~%{$reset_color%}$(ruby_prompt_info " with%{$fg[red]%} " v g "%{$reset_color%}")$vcs_info_msg_0_%{$orange%} λ%{$reset_color%} ' From 9c1255d358fa98397ce20370fa3843199c663990 Mon Sep 17 00:00:00 2001 From: Letian Zhang Date: Mon, 1 Sep 2014 09:49:31 +0800 Subject: [PATCH 53/62] fix missing add-zsh-hook in pygmalion.zsh-theme Fix "command not found: add-zsh-hook" since #3053 removes `autoload -U add-zsh-hook` --- themes/pygmalion.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/pygmalion.zsh-theme b/themes/pygmalion.zsh-theme index 654e0fc37..5f5fe7f9a 100644 --- a/themes/pygmalion.zsh-theme +++ b/themes/pygmalion.zsh-theme @@ -12,7 +12,7 @@ prompt_setup_pygmalion(){ base_prompt_nocolor=$(echo "$base_prompt" | perl -pe "s/%\{[^}]+\}//g") post_prompt_nocolor=$(echo "$post_prompt" | perl -pe "s/%\{[^}]+\}//g") - add-zsh-hook precmd prompt_pygmalion_precmd + precmd_functions+=(prompt_pygmalion_precmd) } prompt_pygmalion_precmd(){ From f0d5cfdc33561a16e26e9db2b2dbb9141eabe5c1 Mon Sep 17 00:00:00 2001 From: AJ Henriques Date: Sun, 31 Aug 2014 20:30:42 -0700 Subject: [PATCH 54/62] add git difftool alias (gdt) --- 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 4b5ddf44c..bb1978f78 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -18,6 +18,7 @@ compdef _git gp=git-push alias gd='git diff' gdv() { git diff -w "$@" | view - } compdef _git gdv=git-diff +alias gdt='git difftool' alias gc='git commit -v' compdef _git gc=git-commit alias gc!='git commit -v --amend' From b8e10ca16d1caa55e3e6759b9130e32629986d98 Mon Sep 17 00:00:00 2001 From: Joshua Medeski Date: Sun, 31 Aug 2014 23:33:43 -0500 Subject: [PATCH 55/62] add wp-cli plugin readme --- plugins/wp-cli/README.md | 105 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 plugins/wp-cli/README.md diff --git a/plugins/wp-cli/README.md b/plugins/wp-cli/README.md new file mode 100644 index 000000000..6dda07d17 --- /dev/null +++ b/plugins/wp-cli/README.md @@ -0,0 +1,105 @@ +# WP-CLI + +**Maintainer:** [joshmedeski](https://github.com/joshmedeski) + +WordPress Command Line Interface (http://wp-cli.org/) + +WP-CLI is a set of command-line tools for managing WordPress installations. You can update plugins, set up multisite installs and much more, without using a web browser. + +## List of Aliases + +### Core +- wpcc='wp core config' +- wpcd='wp core download' +- wpci='wp core install' +- wpcii='wp core is-installed' +- wpcmc='wp core multisite-convert' +- wpcmi='wp core multisite-install' +- wpcu='wp core update' +- wpcudb='wp core update-db' +- wpcvc='wp core verify-checksums' + +### Cron +- wpcre='wp cron event' +- wpcrs='wp cron schedule' +- wpcrt='wp cron test' + +### Menu +- wpmc='wp menu create' +- wpmd='wp menu delete' +- wpmi='wp menu item' +- wpml='wp menu list' +- wpmlo='wp menu location' + +### Plugin +- wppa='activate' +- wppda='deactivate' +- wppd='delete' +- wppg='get' +- wppi='install' +- wppis='is-installed' +- wppl='list' +- wppp='path' +- wpps='search' +- wppst='status' +- wppt='toggle' +- wppu='uninstall' +- wppu='update' + +### Post +- wppoc='wp post create' +- wppod='wp post delete' +- wppoe='wp post edit' +- wppogen='wp post generate' +- wppog='wp post get' +- wppol='wp post list' +- wppom='wp post meta' +- wppou='wp post update' +- wppou='wp post url' + +### Sidebar +- wpsbl='wp sidebar list' + +### Theme +- wpta='wp theme activate' +- wptd='wp theme delete' +- wptdis='wp theme disable' +- wpte='wp theme enable' +- wptg='wp theme get' +- wpti='wp theme install' +- wptis='wp theme is-installed' +- wptl='wp theme list' +- wptm='wp theme mod' +- wptp='wp theme path' +- wpts='wp theme search' +- wptst='wp theme status' +- wptu='wp theme updatet' + +### User +- wpuac='wp user add-cap' +- wpuar='wp user add-role' +- wpuc='wp user create' +- wpud='wp user delete' +- wpugen='wp user generate' +- wpug='wp user get' +- wpui='wp user import-csv' +- wpul='wp user list' +- wpulc='wp user list-caps' +- wpum='wp user meta' +- wpurc='wp user remove-cap' +- wpurr='wp user remove-role' +- wpusr='wp user set-role' +- wpuu='wp user update' + +### Widget +- wpwa='wp widget add' +- wpwda='wp widget deactivate' +- wpwd='wp widget delete' +- wpwl='wp widget list' +- wpwm='wp widget move' +- wpwu='wp widget update' + +The entire list of wp-cli commands can be found here: http://wp-cli.org/commands/ + +I only included the commands that are most used. Please feel free to contribute to this project if you want more commands. + From 39fb6c9d35a555674de36ea02a4ae4c226c387a4 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Mon, 1 Sep 2014 12:59:47 +0200 Subject: [PATCH 56/62] Revert "Add a CONTRIBUTING file to instruct people on issues and pull requests" --- CONTRIBUTING.md | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 9964c380d..000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,42 +0,0 @@ -# CONTRIBUTING GUIDELINE - -1. [Luke, use the search](#luke-use-the-search) -2. [You have a problem](#you-have-a-problem) -3. [You have a solution](#you-have-a-solution) - -**BONUS:** [You have free time to volunteer](#you-have-free-time-to-volunteer) - -## LUKE, USE THE SEARCH - -May the experiences of other people be with you - - -## YOU HAVE A PROBLEM - -See point 1, then look at FAQ or Troubleshooting wiki pages (first we'll have to make them) - - -## YOU HAVE A SOLUTION - -See point 1, then go ahead (unless your solution is yet another theme) - - -## YOU HAVE FREE TIME TO VOLUNTEER - -Cool! Please have a look at the list below to understand how oh-my-zsh categorizes its issues. - -Classification of issues and - -- Bugs, which may be: - - Specific of zsh \* - - Regressions, in which we should summon the author of the offending commit once it is located - -- Feature requests - -- Helpdesk, which may be: - - Specific of zsh \* - - Everything else - -\* In the case of bugs, I see the benefit in going through the trouble of responding to that. After all, oh-my-zsh should be the missing link that makes zsh perfect, and hunting down an upstream bug can lead to a submitted PR. -In the case of helpdesk, minimal response should be done. That is, provide a link to the wiki with the relevant information, or -add it to the FAQ of the wiki and point to it afterwards. From a910aef0c4e33868d25e3410f1e8f8c9844b55c8 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Mon, 1 Sep 2014 13:01:01 +0200 Subject: [PATCH 57/62] Revert "Add Composer's local binaries to PATH" --- plugins/composer/composer.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh index 2243dd3c1..86f2ca4df 100644 --- a/plugins/composer/composer.plugin.zsh +++ b/plugins/composer/composer.plugin.zsh @@ -47,5 +47,5 @@ alias cdu='composer dump-autoload' # install composer in the current directory alias cget='curl -s https://getcomposer.org/installer | php' -# Add Composer's global & local binaries to PATH -export PATH=$PATH:~/.composer/vendor/bin:./bin +# Add Composer's global binaries to PATH +export PATH=$PATH:~/.composer/vendor/bin From ed6c2c9106cdaf570da6f7a260c41ca1c4b4ed2a Mon Sep 17 00:00:00 2001 From: Philipp Wahala Date: Wed, 3 Sep 2014 11:13:21 +0200 Subject: [PATCH 58/62] Symfony2 plugin use first console found --- plugins/symfony2/symfony2.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh index c8c102eee..fcb811fa5 100644 --- a/plugins/symfony2/symfony2.plugin.zsh +++ b/plugins/symfony2/symfony2.plugin.zsh @@ -1,7 +1,7 @@ # Symfony2 basic command completion _symfony_console () { - echo "php $(find . -maxdepth 2 -mindepth 1 -name 'console')" + echo "php $(find . -maxdepth 2 -mindepth 1 -name 'console' | head -n 1)" } _symfony2_get_command_list () { From 677d8b1a21c4b1d8cffef4cbfa259797a11f338a Mon Sep 17 00:00:00 2001 From: Philipp Wahala Date: Wed, 3 Sep 2014 11:36:22 +0200 Subject: [PATCH 59/62] Symfony2 plugin look for files only --- plugins/symfony2/symfony2.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh index fcb811fa5..2783cd387 100644 --- a/plugins/symfony2/symfony2.plugin.zsh +++ b/plugins/symfony2/symfony2.plugin.zsh @@ -1,7 +1,7 @@ # Symfony2 basic command completion _symfony_console () { - echo "php $(find . -maxdepth 2 -mindepth 1 -name 'console' | head -n 1)" + echo "php $(find . -maxdepth 2 -mindepth 1 -name 'console' -type f | head -n 1)" } _symfony2_get_command_list () { From 8d2dd8cc6a530e79ffdf307d444cb15430004efa Mon Sep 17 00:00:00 2001 From: Philipp Wahala Date: Wed, 3 Sep 2014 11:58:52 +0200 Subject: [PATCH 60/62] Symfony2 plugin autocomplete for app/console and bin/console --- plugins/symfony2/symfony2.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh index 2783cd387..8df22e9ad 100644 --- a/plugins/symfony2/symfony2.plugin.zsh +++ b/plugins/symfony2/symfony2.plugin.zsh @@ -13,6 +13,8 @@ _symfony2 () { } compdef _symfony2 '`_symfony_console`' +compdef _symfony2 'app/console' +compdef _symfony2 'bin/console' compdef _symfony2 sf #Alias From ae901fa0d5163728de3dde787071df0e2fcf47d5 Mon Sep 17 00:00:00 2001 From: Michael Stucki Date: Tue, 11 Jun 2013 13:51:17 +0200 Subject: [PATCH 61/62] Support dynamically defined Vagrant machines --- plugins/vagrant/_vagrant | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant index f842b4fbb..0c82acd42 100644 --- a/plugins/vagrant/_vagrant +++ b/plugins/vagrant/_vagrant @@ -57,6 +57,7 @@ __box_list () __vm_list () { _wanted application expl 'command' compadd $(command grep Vagrantfile -oe '^[^#]*\.vm\.define *[:"]\([a-zA-Z0-9_-]\+\)' 2>/dev/null | awk '{print substr($2, 2)}') + _wanted application expl 'command' compadd $(command ls .vagrant/machines/ 2>/dev/null) } __vagrant-box () From 5e2591317810dba5d61f085faaf4e3050f90559c Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 4 Sep 2014 12:53:43 +0200 Subject: [PATCH 62/62] Revert "Exit early from git plugin if not in git repo." --- plugins/git/git.plugin.zsh | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index bb1978f78..bf7cd1ac9 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -125,14 +125,12 @@ alias gsd='git svn dcommit' # Usage example: git pull origin $(current_branch) # function current_branch() { - if [ ! -d .git ]; then return; fi ref=$(git symbolic-ref HEAD 2> /dev/null) || \ ref=$(git rev-parse --short HEAD 2> /dev/null) || return echo ${ref#refs/heads/} } function current_repository() { - if [ ! -d .git ]; then return; fi ref=$(git symbolic-ref HEAD 2> /dev/null) || \ ref=$(git rev-parse --short HEAD 2> /dev/null) || return echo $(git remote -v | cut -d':' -f 2)