From fdb3c0e68d36d20d1b75163755d568d42def5ac1 Mon Sep 17 00:00:00 2001 From: Anton Eicher Date: Wed, 19 Dec 2012 07:22:03 -0800 Subject: [PATCH 001/488] 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 9674a96b5bc296a767c2560757626bf2bc3a9ad3 Mon Sep 17 00:00:00 2001 From: Frank Louwers Date: Wed, 13 Feb 2013 12:02:36 +0100 Subject: [PATCH 002/488] [pj-plugin] delete ugly ls -l | awk print $9 thing to use something not depending on date format + add support for projects with spaces in them --- plugins/pj/pj.plugin.zsh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/plugins/pj/pj.plugin.zsh b/plugins/pj/pj.plugin.zsh index ba3765b83..b98bfec34 100644 --- a/plugins/pj/pj.plugin.zsh +++ b/plugins/pj/pj.plugin.zsh @@ -18,8 +18,11 @@ function pj() { file=$1 if [[ "open" == "$file" ]] then - file=$2 + shift + file=$* cmd=(${(s: :)EDITOR}) + else + file=$* fi for project in $PROJECT_PATHS; do @@ -36,7 +39,14 @@ function pj() { alias pjo="pj open" function _pj () { - compadd `/bin/ls -l $PROJECT_PATHS 2>/dev/null | awk '{ print $9 }'` + # might be possible to improve this using glob, without the basename trick + typeset -a projects + foreach i ($PROJECT_PATHS/*) + do + projects+=`basename $i` + done + + _arguments '*:file:($projects)' } compdef _pj pj From df67f2ee30dbad61117e1886b0a4de326cb6daf7 Mon Sep 17 00:00:00 2001 From: Frank Louwers Date: Wed, 13 Feb 2013 13:39:47 +0100 Subject: [PATCH 003/488] [pj-plugin] avoid using basename. migth be (a lot?) faster --- plugins/pj/pj.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/pj/pj.plugin.zsh b/plugins/pj/pj.plugin.zsh index b98bfec34..dac561189 100644 --- a/plugins/pj/pj.plugin.zsh +++ b/plugins/pj/pj.plugin.zsh @@ -43,7 +43,7 @@ function _pj () { typeset -a projects foreach i ($PROJECT_PATHS/*) do - projects+=`basename $i` + projects+=(${i##*/}) done _arguments '*:file:($projects)' From 7fb17127c7ef2ff11240af5c42430ae3ae1c0369 Mon Sep 17 00:00:00 2001 From: Dmitri Akatov Date: Wed, 24 Jul 2013 14:30:12 -0700 Subject: [PATCH 004/488] carton completion plugin --- plugins/carton/carton.plugin.zsh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 plugins/carton/carton.plugin.zsh diff --git a/plugins/carton/carton.plugin.zsh b/plugins/carton/carton.plugin.zsh new file mode 100644 index 000000000..23868b09c --- /dev/null +++ b/plugins/carton/carton.plugin.zsh @@ -0,0 +1,6 @@ +if which carton &> /dev/null +then + source $(dirname $(which carton))/../etc/carton_completion.zsh +else + print "zsh carton plugin: carton not found" +fi From 55c90b1d6cbda581f9ccd41ea1c8da15da98d5ee Mon Sep 17 00:00:00 2001 From: Dmitri Akatov Date: Fri, 26 Jul 2013 20:00:45 -0700 Subject: [PATCH 005/488] grunt completion courtesy of @yonchu: https://github.com/yonchu/grunt-zsh-completion --- plugins/grunt/grunt.plugin.zsh | 253 +++++++++++++++++++++++++++++++++ 1 file changed, 253 insertions(+) create mode 100644 plugins/grunt/grunt.plugin.zsh diff --git a/plugins/grunt/grunt.plugin.zsh b/plugins/grunt/grunt.plugin.zsh new file mode 100644 index 000000000..48f6cb5a2 --- /dev/null +++ b/plugins/grunt/grunt.plugin.zsh @@ -0,0 +1,253 @@ +#compdef grunt +# ----------------------------------------------------------------------------- +# _grunt +# +# Completion script for grunt. +# - https://github.com/gruntjs/grunt +# - https://github.com/gruntjs/grunt-cli +# +# ----------------------------------------------------------------------------- +# +# Version : 0.1.0 +# Author : Yonchu +# License : MIT License +# Repository : https://github.com/yonchu/grunt-zsh-completion +# Last Change : 22 Jul 2013. +# +# Copyright (c) 2013 Yonchu. +# +# ----------------------------------------------------------------------------- +# USAGE +# ----- +# +# Enable caching: +# +# If you want to use the cache, set the followings in your .zshrc: +# +# zstyle ':completion:*' use-cache yes +# +# +# Settings: +# +# - Show grunt file path: +# zstyle ':completion::complete:grunt::options:' show_grunt_path yes +# +# - Cache expiration days (default: 7): +# zstyle ':completion::complete:grunt::options:' expire 1 +# +# - Not update options cache if target gruntfile is changed. +# zstyle ':completion::complete:grunt::options:' no_update_options yes +# +# Note that if you change the zstyle settings, +# you should delete the cache file and restart zsh. +# +# $ rm ~/.zcompcache/grunt +# $ exec zsh +# +# ----------------------------------------------------------------------------- + +function _grunt() { + local curcontext="$curcontext" update_policy state + local show_grunt_path update_msg gruntfile opts tasks + + # Setup cache-policy. + zstyle -s ":completion:${curcontext}:" cache-policy update_policy + if [[ -z $update_policy ]]; then + zstyle ":completion:${curcontext}:" cache-policy __grunt_caching_policy + fi + + # Check show_path option. + zstyle -b ":completion:${curcontext}:options:" show_grunt_path show_grunt_path + + # Get current gruntfile. + gruntfile=$(__grunt_get_gruntfile) + + # Initialize opts and tasks. + opts=() + tasks=() + + # Add help options. + opts+=('(- 1 *)'{-h,--help}'[Display this help text.]') + + ## Complete without gruntfile. + if [[ ! -f $gruntfile ]]; then + _arguments "${opts[@]}" + return + fi + + ## Complete with gruntfile. + # Retrieve cache. + if ! __grunt_update_cache "$gruntfile"; then + update_msg=' (cache updated)' + fi + + # Make optioins completion. + if [[ ${#__grunt_opts} -gt 0 ]]; then + opts+=("${__grunt_opts[@]}") + fi + + # Complete arguments. + _arguments \ + "${opts[@]}" \ + '*: :->tasks' \ + && return + + case $state in + tasks) + if [[ $show_grunt_path == 'yes' ]]; then + update_msg="$update_msg: ${${gruntfile/#$HOME/~}%/}" + fi + # Make tasks completion. + if [[ ${#__grunt_tasks} -gt 0 ]]; then + tasks+=("${__grunt_tasks[@]}") + _describe -t grunt-task "$verbose grunt task$update_msg" tasks || return 1 + fi + ;; + esac + + return 0 +} + +# Cache policy: +# The cache file name: grunt +# The cache variable name: __grunt_version __grunt_gruntfile __grunt_opts __grunt_tasks +function __grunt_update_cache() { + # TODO + local version='0.1.0' + local is_updating=0 + local gruntfile="$1" + local grunt_info no_update_options cache_path + + # Check no_update_options option. + zstyle -b ":completion:${curcontext}:options:" no_update_options no_update_options + + + if ! ( (( $+__grunt_gruntfile )) \ + && (( $+__grunt_opts )) \ + && (( $+__grunt_tasks )) ) \ + && ! _retrieve_cache 'grunt'; then + is_updating=1 + fi + + if [[ $gruntfile != $__grunt_gruntfile ]]; then + # Except for --help options. + __grunt_gruntfile=$gruntfile + if [[ $no_update_options == 'yes' ]]; then + if [[ $PREFIX == ${PREFIX#-} ]]; then + # Not options completions. + is_updating=1 + elif [[ ${#__grunt_opts} -lt 2 ]]; then + is_updating=1 + else + unset __grunt_gruntfile + fi + else + is_updating=1 + fi + else + if [[ $PREFIX != ${PREFIX#-} && ${#__grunt_opts} -gt 1 ]]; then + unset __grunt_gruntfile + fi + fi + + if _cache_invalid 'grunt'; then + is_updating=1 + fi + + # Check _grunt version. + if [[ $__grunt_version != $version ]]; then + is_updating=1 + fi + + if [[ $is_updating -ne 0 ]]; then + # Update caceh. + __grunt_version=$version + __grunt_gruntfile=$gruntfile + is_updating=1 + grunt_info=$(grunt --help --no-color --gruntfile "$__grunt_gruntfile" 2>/dev/null) + __grunt_opts=(${(f)"$(__grunt_get_opts "$grunt_info")"}) + __grunt_tasks=(${(f)"$(__grunt_get_tasks "$grunt_info")"}) + _store_cache 'grunt' __grunt_version __grunt_gruntfile __grunt_opts __grunt_tasks + fi + return $is_updating +} + +function __grunt_get_tasks() { + echo -E "$1" \ + | grep 'Available tasks' -A 100 \ + | grep '^ ' \ + | sed -e 's/^[[:blank:]]*//' -e 's/[[:blank:]]*$//' \ + | sed -e 's/ /:/' +} + +function __grunt_get_opts() { + local opt_hunk opt_sep opt_num line opt + opt_hunk=$(echo -E "$1" \ + | grep 'Options$' -A 100 \ + | sed '1 d' \ + | sed -e 's/[[:blank:]]*$//' \ + ) + + opt_sep=() + opt_hunk=(${(f)opt_hunk}) + opt_num=0 + for line in "$opt_hunk[@]"; do + opt=$(echo -E "$line" | sed -e 's/^[[:blank:]]*//') + if [[ $line == $opt ]]; then + break + fi + if [[ $opt != ${opt#-} ]]; then + # Start with - + (( opt_num++ )) + opt=$(echo -E "$opt" | sed 's/^\(\(--[^ ]*\)\(, \(-[^ ]*\)\)*\) */\2\\t\4\\\t/') + fi + opt_sep[$opt_num]=("${opt_sep[$opt_num]}${opt}") + done + + for line in "$opt_sep[@]"; do + opt=(${(s:\t:)line}) + if [[ ${opt[1]} == '--help' ]]; then + continue + fi + if [[ ${#opt} -eq 2 ]]; then + echo -E "(${opt[1]})${opt[1]}[${opt[2]}]" + else + echo -E "(${opt[1]},${opt[2]})${opt[1]}[${opt[3]}]" + echo -E "(${opt[1]},${opt[2]})${opt[2]}[${opt[3]}]" + fi + done +} + +function __grunt_get_gruntfile() { + local gruntfile + local curpath="$PWD" + while [ "$curpath" ]; do + for gruntfile in "$curpath/"{G,g}runtfile.{js,coffee}; do + if [[ -e "$gruntfile" ]]; then + echo "$gruntfile" + return + fi + done + curpath=${curpath%/*} + done + return 1 +} + +function __grunt_caching_policy() { + # Returns status zero if the completions cache needs rebuilding. + + # Rebuild if .agignore more recent than cache. + if [[ -f $__grunt_gruntfile && $__grunt_gruntfile -nt $1 ]]; then + # Invalid cache because gruntfile is old. + return 0 + fi + + local -a oldp + local expire + zstyle -s ":completion:${curcontext}:options:" expire expire || expire=7 + # Rebuild if cache is more than $expire days. + oldp=( "$1"(Nm+$expire) ) + (( $#oldp )) +} + +compdef _grunt grunt From 1af012d4991a36bfb0e2def3e67f5a0e56fc49e4 Mon Sep 17 00:00:00 2001 From: Dmitri Akatov Date: Tue, 6 Aug 2013 13:28:52 -0700 Subject: [PATCH 006/488] carton was renamed to cask --- plugins/carton/carton.plugin.zsh | 6 ------ plugins/cask/cask.plugin.zsh | 5 +++++ 2 files changed, 5 insertions(+), 6 deletions(-) delete mode 100644 plugins/carton/carton.plugin.zsh create mode 100644 plugins/cask/cask.plugin.zsh diff --git a/plugins/carton/carton.plugin.zsh b/plugins/carton/carton.plugin.zsh deleted file mode 100644 index 23868b09c..000000000 --- a/plugins/carton/carton.plugin.zsh +++ /dev/null @@ -1,6 +0,0 @@ -if which carton &> /dev/null -then - source $(dirname $(which carton))/../etc/carton_completion.zsh -else - print "zsh carton plugin: carton not found" -fi diff --git a/plugins/cask/cask.plugin.zsh b/plugins/cask/cask.plugin.zsh new file mode 100644 index 000000000..c55862924 --- /dev/null +++ b/plugins/cask/cask.plugin.zsh @@ -0,0 +1,5 @@ +if which cask &> /dev/null; then + source $(dirname $(which cask))/../etc/cask_completion.zsh +else + print "zsh cask plugin: cask not found" +fi From a7c88c988a4be02b8883c06e57c6eb290c8fcb21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A4ntz=20Miccoli?= Date: Sun, 15 Sep 2013 23:16:11 +0200 Subject: [PATCH 007/488] Removed comments and other elements that might appear in the phing -l output. The current version doesn't work at all on my environment (OSX 10.7) --- plugins/phing/phing.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/phing/phing.plugin.zsh b/plugins/phing/phing.plugin.zsh index 795f1db85..9af03af24 100644 --- a/plugins/phing/phing.plugin.zsh +++ b/plugins/phing/phing.plugin.zsh @@ -7,7 +7,7 @@ _phing_does_target_list_need_generating () { _phing () { if [ -f build.xml ]; then if _phing_does_target_list_need_generating; then - phing -l |grep -v ":$" |grep -v "^-*$" > .phing_targets + phing -l|grep -v "\[property\]"|grep -v "Buildfile"|sed 1d|grep -v ":$" |grep -v "^\-*$"|awk '{print $1}' > .phing_targets fi compadd `cat .phing_targets` fi From 244533320062afd470e4aa6aab92e1532cf2fec3 Mon Sep 17 00:00:00 2001 From: Rimenes Ribeiro Date: Tue, 24 Sep 2013 15:20:52 -0300 Subject: [PATCH 008/488] Add reload and status alises to postgres --- plugins/postgres/postgres.plugin.zsh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/postgres/postgres.plugin.zsh b/plugins/postgres/postgres.plugin.zsh index cdd142e92..c2dbef244 100644 --- a/plugins/postgres/postgres.plugin.zsh +++ b/plugins/postgres/postgres.plugin.zsh @@ -1,6 +1,8 @@ -# Aliases to stop, start and restart Postgres -# Paths noted below are for Postgress installed via Homebrew on OSX +# Aliases to control Postgres +# Paths noted below are for Postgres installed via Homebrew on OSX alias startpost='pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start' alias stoppost='pg_ctl -D /usr/local/var/postgres stop -s -m fast' -alias restartpost='stoppost && sleep 1 && startpost' \ No newline at end of file +alias restartpost='stoppost && sleep 1 && startpost' +alias reloadpost='pg_ctl reload -D /usr/local/var/postgres -s' +alias statuspost='pg_ctl status -D /usr/local/var/postgres -s' \ No newline at end of file From d608fbfc7fcabf9994f8064e67670e69130d2ee1 Mon Sep 17 00:00:00 2001 From: Riyad Preukschas Date: Tue, 15 Oct 2013 14:34:03 +0200 Subject: [PATCH 009/488] Make the virtualenv plugin themable --- plugins/virtualenv/virtualenv.plugin.zsh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/virtualenv/virtualenv.plugin.zsh b/plugins/virtualenv/virtualenv.plugin.zsh index 8e06450b1..e250eb63e 100644 --- a/plugins/virtualenv/virtualenv.plugin.zsh +++ b/plugins/virtualenv/virtualenv.plugin.zsh @@ -1,7 +1,6 @@ function virtualenv_prompt_info(){ - if [[ -n $VIRTUAL_ENV ]]; then - printf "%s[%s] " "%{${fg[yellow]}%}" ${${VIRTUAL_ENV}:t} - fi + [[ -n ${VIRTUAL_ENV} ]] || return + echo "${ZSH_THEME_VIRTUALENV_PREFIX:=[}${VIRTUAL_ENV:t}${ZSH_THEME_VIRTUALENV_SUFFIX:=]}" } # disables prompt mangling in virtual_env/bin/activate From 9b811fb625c03c30a766191cdf65a1c7c1fd96b2 Mon Sep 17 00:00:00 2001 From: Michael Orr Date: Fri, 6 Dec 2013 17:31:35 -0500 Subject: [PATCH 010/488] accidentally blew away a git config setting used for another purpose, renaming in order to distinguish --- lib/git.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git.zsh b/lib/git.zsh index 305a77aff..a1396653b 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -13,7 +13,7 @@ parse_git_dirty() { local SUBMODULE_SYNTAX='' local GIT_STATUS='' local CLEAN_MESSAGE='nothing to commit (working directory clean)' - if [[ "$(command git config --get oh-my-zsh.hide-status)" != "1" ]]; then + if [[ "$(command git config --get oh-my-zsh.hide-dirty)" != "1" ]]; then if [[ $POST_1_7_2_GIT -gt 0 ]]; then SUBMODULE_SYNTAX="--ignore-submodules=dirty" fi From 00b2cc653421c1465f7596f22c19d21f42aa0396 Mon Sep 17 00:00:00 2001 From: Andrew Dwyer Date: Sat, 21 Dec 2013 11:17:05 +1030 Subject: [PATCH 011/488] New plugin for the n98-magerun Magento command line tool --- plugins/n98-magerun/n98-magerun.plugin.zsh | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 plugins/n98-magerun/n98-magerun.plugin.zsh diff --git a/plugins/n98-magerun/n98-magerun.plugin.zsh b/plugins/n98-magerun/n98-magerun.plugin.zsh new file mode 100755 index 000000000..e4b0d6885 --- /dev/null +++ b/plugins/n98-magerun/n98-magerun.plugin.zsh @@ -0,0 +1,25 @@ +# ------------------------------------------------------------------------------ +# FILE: n98-magerun.plugin.zsh +# DESCRIPTION: oh-my-zsh n98-magerun plugin file. Adapted from composer plugin +# AUTHOR: Andrew Dwyer (andrewrdwyer at gmail dot com) +# VERSION: 1.0.0 +# ------------------------------------------------------------------------------ + +# n98-magerun basic command completion +_n98_magerun_get_command_list () { + n98-magerun.phar --no-ansi | sed "1,/Available commands/d" | awk '/^\s+[a-z]+/ { print $1 }' +} + +_n98_magerun () { + compadd `_n98_magerun_get_command_list` +} + +compdef _n98_magerun n98-magerun.phar + +# Aliases +alias n98-magerun='n98-magerun.phar' +alias mage='n98-magerun.phar' +alias magefl='n98-magerun.phar cache:flush' + +# Install n98-magerun into the current directory +alias mage-get='wget https://raw.github.com/netz98/n98-magerun/master/n98-magerun.phar' From 3976b93f3931a7ebc913576015ff395dcd495d95 Mon Sep 17 00:00:00 2001 From: Daniel Farrell Date: Sun, 23 Mar 2014 15:59:35 -0400 Subject: [PATCH 012/488] Fixed which output at each new shell creation --- themes/gallois.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme index f1057a9a9..f31d21958 100644 --- a/themes/gallois.zsh-theme +++ b/themes/gallois.zsh-theme @@ -18,7 +18,7 @@ else if which rbenv &> /dev/null; then RPS1='$(git_custom_status)%{$fg[red]%}[`rbenv version | sed -e "s/ (set.*$//"`]%{$reset_color%} $EPS1' else - if [[ -n `which chruby_prompt_info` && -n `chruby_prompt_info` ]]; then + if [[ -n `which chruby_prompt_info &> /dev/null` && -n `chruby_prompt_info` ]]; then RPS1='$(git_custom_status)%{$fg[red]%}[`chruby_prompt_info`]%{$reset_color%} $EPS1' else RPS1='$(git_custom_status) $EPS1' From b2ce306c4f49ebb1ef2bde5b86d553ce6ea674aa Mon Sep 17 00:00:00 2001 From: Daniel Farrell Date: Tue, 25 Mar 2014 23:37:28 -0400 Subject: [PATCH 013/488] Simplified gallois RPS1 setup using some helpful scripts --- themes/gallois.zsh-theme | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme index f31d21958..d383ed583 100644 --- a/themes/gallois.zsh-theme +++ b/themes/gallois.zsh-theme @@ -11,19 +11,11 @@ git_custom_status() { fi } -#RVM and git settings -if [[ -s ~/.rvm/scripts/rvm ]] ; then - RPS1='$(git_custom_status)%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1' -else - if which rbenv &> /dev/null; then - RPS1='$(git_custom_status)%{$fg[red]%}[`rbenv version | sed -e "s/ (set.*$//"`]%{$reset_color%} $EPS1' - else - if [[ -n `which chruby_prompt_info &> /dev/null` && -n `chruby_prompt_info` ]]; then - RPS1='$(git_custom_status)%{$fg[red]%}[`chruby_prompt_info`]%{$reset_color%} $EPS1' - else - RPS1='$(git_custom_status) $EPS1' - fi - fi -fi +# RVM component of prompt +ZSH_THEME_RVM_PROMPT_PREFIX="%{$fg[red]%}[" +ZSH_THEME_RVM_PROMPT_SUFFIX="]%{$reset_color%}" + +# Combine it all into a final right-side prompt +RPS1='$(git_custom_status)$(ruby_prompt_info) $EPS1' PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b ' From b2ea7d3ec12152ab4d864c27c33d8b9396c68858 Mon Sep 17 00:00:00 2001 From: Stanislav Schultz Date: Fri, 28 Mar 2014 20:25:13 +0300 Subject: [PATCH 014/488] Add Ruby 2.1.1 support to rvm plugin --- plugins/rvm/rvm.plugin.zsh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/rvm/rvm.plugin.zsh b/plugins/rvm/rvm.plugin.zsh index 3bde154df..ad23e18d7 100644 --- a/plugins/rvm/rvm.plugin.zsh +++ b/plugins/rvm/rvm.plugin.zsh @@ -6,6 +6,7 @@ alias gemsets='rvm gemset list' local ruby18='ruby-1.8.7' local ruby19='ruby-1.9.3' local ruby20='ruby-2.0.0' +local ruby21='ruby-2.1.1' function rb18 { if [ -z "$1" ]; then @@ -40,6 +41,17 @@ function rb20 { _rb20() {compadd `ls -1 $rvm_path/gems | grep "^$ruby20@" | sed -e "s/^$ruby20@//" | awk '{print $1}'`} compdef _rb20 rb20 +function rb21 { + if [ -z "$1" ]; then + rvm use "$ruby21" + else + rvm use "$ruby21@$1" + fi +} + +_rb21() {compadd `ls -1 $rvm_path/gems | grep "^$ruby21@" | sed -e "s/^$ruby21@//" | awk '{print $1}'`} +compdef _rb21 rb21 + function rvm-update { rvm get head } From 6a5c8fb81b369566ed0f5e408dab7a7213354ade Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Mon, 21 Apr 2014 21:11:49 -0500 Subject: [PATCH 015/488] gitfast: update to upstream v1.9.2 Signed-off-by: Felipe Contreras --- plugins/gitfast/_git | 10 +++++- plugins/gitfast/git-completion.bash | 47 ++++++++++++++++++++--------- plugins/gitfast/git-prompt.sh | 15 +++++++-- 3 files changed, 53 insertions(+), 19 deletions(-) diff --git a/plugins/gitfast/_git b/plugins/gitfast/_git index fac5e711e..6b7796857 100644 --- a/plugins/gitfast/_git +++ b/plugins/gitfast/_git @@ -30,10 +30,10 @@ if [ -z "$script" ]; then local -a locations local e locations=( + $(dirname ${funcsourcetrace[1]%:*})/git-completion.bash '/etc/bash_completion.d/git' # fedora, old debian '/usr/share/bash-completion/completions/git' # arch, ubuntu, new debian '/usr/share/bash-completion/git' # gentoo - $(dirname ${funcsourcetrace[1]%:*})/git-completion.bash ) for e in $locations; do test -f $e && script="$e" && break @@ -76,6 +76,14 @@ __gitcomp_nl () compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0 } +__gitcomp_nl_append () +{ + emulate -L zsh + + local IFS=$'\n' + compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0 +} + __gitcomp_file () { emulate -L zsh diff --git a/plugins/gitfast/git-completion.bash b/plugins/gitfast/git-completion.bash index 5da920ecd..9525343fc 100644 --- a/plugins/gitfast/git-completion.bash +++ b/plugins/gitfast/git-completion.bash @@ -1,5 +1,3 @@ -#!bash -# # bash/zsh completion support for core Git. # # Copyright (C) 2006,2007 Shawn O. Pearce @@ -180,9 +178,9 @@ _get_comp_words_by_ref () } fi -__gitcompadd () +__gitcompappend () { - local i=0 + local i=${#COMPREPLY[@]} for x in $1; do if [[ "$x" == "$3"* ]]; then COMPREPLY[i++]="$2$x$4" @@ -190,6 +188,12 @@ __gitcompadd () done } +__gitcompadd () +{ + COMPREPLY=() + __gitcompappend "$@" +} + # Generates completion reply, appending a space to possible completion words, # if necessary. # It accepts 1 to 4 arguments: @@ -220,6 +224,14 @@ __gitcomp () esac } +# Variation of __gitcomp_nl () that appends to the existing list of +# completion candidates, COMPREPLY. +__gitcomp_nl_append () +{ + local IFS=$'\n' + __gitcompappend "$1" "${2-}" "${3-$cur}" "${4- }" +} + # Generates completion reply from newline-separated possible completion words # by appending a space to all of them. # It accepts 1 to 4 arguments: @@ -231,8 +243,8 @@ __gitcomp () # appended. __gitcomp_nl () { - local IFS=$'\n' - __gitcompadd "$1" "${2-}" "${3-$cur}" "${4- }" + COMPREPLY=() + __gitcomp_nl_append "$@" } # Generates completion reply with compgen from newline-separated possible @@ -673,7 +685,6 @@ __git_list_porcelain_commands () index-pack) : plumbing;; init-db) : deprecated;; local-fetch) : plumbing;; - lost-found) : infrequent;; ls-files) : plumbing;; ls-remote) : plumbing;; ls-tree) : plumbing;; @@ -687,14 +698,12 @@ __git_list_porcelain_commands () pack-refs) : plumbing;; parse-remote) : plumbing;; patch-id) : plumbing;; - peek-remote) : plumbing;; prune) : plumbing;; prune-packed) : plumbing;; quiltimport) : import;; read-tree) : plumbing;; receive-pack) : plumbing;; remote-*) : transport;; - repo-config) : deprecated;; rerere) : plumbing;; rev-list) : plumbing;; rev-parse) : plumbing;; @@ -707,7 +716,6 @@ __git_list_porcelain_commands () ssh-*) : transport;; stripspace) : plumbing;; symbolic-ref) : plumbing;; - tar-tree) : deprecated;; unpack-file) : plumbing;; unpack-objects) : plumbing;; update-index) : plumbing;; @@ -901,7 +909,7 @@ _git_add () esac # XXX should we check for --update and --all options ? - __git_complete_index_file "--others --modified" + __git_complete_index_file "--others --modified --directory --no-empty-directory" } _git_archive () @@ -1063,7 +1071,7 @@ _git_clean () esac # XXX should we check for -x option ? - __git_complete_index_file "--others" + __git_complete_index_file "--others --directory" } _git_clone () @@ -1188,7 +1196,7 @@ _git_diff () __git_complete_revlist_file } -__git_mergetools_common="diffuse ecmerge emerge kdiff3 meld opendiff +__git_mergetools_common="diffuse diffmerge ecmerge emerge kdiff3 meld opendiff tkdiff vimdiff gvimdiff xxdiff araxis p4merge bc3 codecompare " @@ -1491,6 +1499,12 @@ _git_mergetool () _git_merge_base () { + case "$cur" in + --*) + __gitcomp "--octopus --independent --is-ancestor --fork-point" + return + ;; + esac __gitcomp_nl "$(__git_refs)" } @@ -1623,7 +1637,7 @@ _git_rebase () --preserve-merges --stat --no-stat --committer-date-is-author-date --ignore-date --ignore-whitespace --whitespace= - --autosquash + --autosquash --fork-point --no-fork-point " return @@ -1833,6 +1847,7 @@ _git_config () branch.*) local pfx="${cur%.*}." cur_="${cur#*.}" __gitcomp_nl "$(__git_heads)" "$pfx" "$cur_" "." + __gitcomp_nl_append $'autosetupmerge\nautosetuprebase\n' "$pfx" "$cur_" return ;; guitool.*.*) @@ -1875,6 +1890,7 @@ _git_config () remote.*) local pfx="${cur%.*}." cur_="${cur#*.}" __gitcomp_nl "$(__git_remotes)" "$pfx" "$cur_" "." + __gitcomp_nl_append "pushdefault" "$pfx" "$cur_" return ;; url.*.*) @@ -1997,6 +2013,7 @@ _git_config () fetch.unpackLimit format.attach format.cc + format.coverLetter format.headers format.numbered format.pretty @@ -2580,7 +2597,7 @@ if [[ -n ${ZSH_VERSION-} ]]; then --*=*|*.) ;; *) c="$c " ;; esac - array[$#array+1]="$c" + array[${#array[@]}+1]="$c" done compset -P '*[=:]' compadd -Q -S '' -p "${2-}" -a -- array && _ret=0 diff --git a/plugins/gitfast/git-prompt.sh b/plugins/gitfast/git-prompt.sh index a81ef5a48..7b732d2ae 100644 --- a/plugins/gitfast/git-prompt.sh +++ b/plugins/gitfast/git-prompt.sh @@ -60,6 +60,7 @@ # of values: # # verbose show number of commits ahead/behind (+/-) upstream +# name if verbose, then also show the upstream abbrev name # legacy don't use the '--count' option available in recent # versions of git-rev-list # git always compare HEAD to @{upstream} @@ -84,13 +85,17 @@ # the colored output of "git status -sb" and are available only when # using __git_ps1 for PROMPT_COMMAND or precmd. +# check whether printf supports -v +__git_printf_supports_v= +printf -v __git_printf_supports_v -- '%s' yes >/dev/null 2>&1 + # stores the divergence from upstream in $p # used by GIT_PS1_SHOWUPSTREAM __git_ps1_show_upstream () { local key value local svn_remote svn_url_pattern count n - local upstream=git legacy="" verbose="" + local upstream=git legacy="" verbose="" name="" svn_remote=() # get some config options from git-config @@ -106,7 +111,7 @@ __git_ps1_show_upstream () ;; svn-remote.*.url) svn_remote[$((${#svn_remote[@]} + 1))]="$value" - svn_url_pattern+="\\|$value" + svn_url_pattern="$svn_url_pattern\\|$value" upstream=svn+git # default upstream is SVN if available, else git ;; esac @@ -118,6 +123,7 @@ __git_ps1_show_upstream () git|svn) upstream="$option" ;; verbose) verbose=1 ;; legacy) legacy=1 ;; + name) name=1 ;; esac done @@ -200,6 +206,9 @@ __git_ps1_show_upstream () *) # diverged from upstream p=" u+${count#* }-${count% *}" ;; esac + if [[ -n "$count" && -n "$name" ]]; then + p="$p $(git rev-parse --abbrev-ref "$upstream" 2>/dev/null)" + fi fi } @@ -433,7 +442,7 @@ __git_ps1 () local gitstring="$c${b##refs/heads/}${f:+$z$f}$r$p" if [ $pcmode = yes ]; then - if [[ -n ${ZSH_VERSION-} ]]; then + if [ "${__git_printf_supports_v-}" != yes ]; then gitstring=$(printf -- "$printf_format" "$gitstring") else printf -v gitstring -- "$printf_format" "$gitstring" From 5918d9100b294beb490cbd5f1f15fe2b064d9e62 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Mon, 21 Apr 2014 21:13:06 -0500 Subject: [PATCH 016/488] gitfast: back-port prompt fix Signed-off-by: Felipe Contreras --- plugins/gitfast/git-prompt.sh | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/plugins/gitfast/git-prompt.sh b/plugins/gitfast/git-prompt.sh index 7b732d2ae..54489080f 100644 --- a/plugins/gitfast/git-prompt.sh +++ b/plugins/gitfast/git-prompt.sh @@ -259,6 +259,13 @@ __git_ps1_colorize_gitstring () r="$c_clear$r" } +eread () +{ + f="$1" + shift + test -r "$f" && read "$@" <"$f" +} + # __git_ps1 accepts 0 or 1 arguments (i.e., format string) # when called from PS1 using command substitution # in this mode it prints text to add to bash PS1 prompt (includes branch name) @@ -321,9 +328,9 @@ __git_ps1 () local step="" local total="" if [ -d "$g/rebase-merge" ]; then - read b 2>/dev/null <"$g/rebase-merge/head-name" - read step 2>/dev/null <"$g/rebase-merge/msgnum" - read total 2>/dev/null <"$g/rebase-merge/end" + eread "$g/rebase-merge/head-name" b + eread "$g/rebase-merge/msgnum" step + eread "$g/rebase-merge/end" total if [ -f "$g/rebase-merge/interactive" ]; then r="|REBASE-i" else @@ -331,10 +338,10 @@ __git_ps1 () fi else if [ -d "$g/rebase-apply" ]; then - read step 2>/dev/null <"$g/rebase-apply/next" - read total 2>/dev/null <"$g/rebase-apply/last" + eread "$g/rebase-apply/next" step + eread "$g/rebase-apply/last" total if [ -f "$g/rebase-apply/rebasing" ]; then - read b 2>/dev/null <"$g/rebase-apply/head-name" + eread "$g/rebase-apply/head-name" b r="|REBASE" elif [ -f "$g/rebase-apply/applying" ]; then r="|AM" @@ -358,7 +365,7 @@ __git_ps1 () b="$(git symbolic-ref HEAD 2>/dev/null)" else local head="" - if ! read head 2>/dev/null <"$g/HEAD"; then + if ! eread "$g/HEAD" head; then if [ $pcmode = yes ]; then PS1="$ps1pc_start$ps1pc_end" fi From 73bf940c34fe359c27031a1144237ccaad7d2b9b Mon Sep 17 00:00:00 2001 From: Nicolas Brousse Date: Wed, 23 Apr 2014 19:44:59 +0200 Subject: [PATCH 017/488] Update brew.plugin.zsh --- plugins/brew/brew.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh index c2e95884e..f9497aefb 100644 --- a/plugins/brew/brew.plugin.zsh +++ b/plugins/brew/brew.plugin.zsh @@ -1 +1,2 @@ alias brews='brew list -1' +alias bubu="brew update && brew upgrade" From 33ef34baa5f703ee7fcc502eabed4f1ab968127e Mon Sep 17 00:00:00 2001 From: Mitchel Humpherys Date: Tue, 7 Jan 2014 12:47:58 -0800 Subject: [PATCH 018/488] Fix gmt compdef Fix typo: gm -> gmt --- plugins/git/git.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 9f7819df3..c579d1e82 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -82,7 +82,7 @@ alias gwc='git whatchanged -p --abbrev-commit --pretty=medium' alias gpoat='git push origin --all && git push origin --tags' alias gmt='git mergetool --no-prompt' -compdef _git gm=git-mergetool +compdef _git gmt=git-mergetool alias gg='git gui citool' alias gga='git gui citool --amend' From 236c8de7f31a71878279ed2421bd2547ab3cdd03 Mon Sep 17 00:00:00 2001 From: Ingo Renner Date: Tue, 6 May 2014 10:45:26 -0700 Subject: [PATCH 019/488] [FEATURE] Support Vagrant 1.6 version command Vagrant 1.6 introduces a couple new commands, including the `version` command. The `version` command shows the currently installed version information and also checks for new updates available. --- plugins/vagrant/_vagrant | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant index 9af8cb036..f9aef0880 100644 --- a/plugins/vagrant/_vagrant +++ b/plugins/vagrant/_vagrant @@ -19,6 +19,7 @@ _1st_arguments=( 'status:Shows the status of the current Vagrant environment.' 'suspend:Suspends the currently running vagrant environment' 'up:Creates the vagrant environment' + 'version:Prints the currently installed Vagrant version and checks for new updates' '--help:[TASK] Describe available tasks or one specific task' '--version:Prints the Vagrant version information' ) From 38fe100efe9b7d4df87746818bae508c4c00d4a6 Mon Sep 17 00:00:00 2001 From: Ingo Renner Date: Tue, 6 May 2014 10:46:55 -0700 Subject: [PATCH 020/488] [FEATURE] Support Vagrant Share Vagrant 1.5 introduced Vagrant Share to allow remote access to a Vagrant environment. This adds support for the `share` and `connect` commands. --- plugins/vagrant/_vagrant | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant index f9aef0880..7bdfb0f1c 100644 --- a/plugins/vagrant/_vagrant +++ b/plugins/vagrant/_vagrant @@ -6,6 +6,7 @@ local -a _1st_arguments _1st_arguments=( 'box:Box commands' + 'connect:Connects to a shared, remote Vagrant environment' 'destroy:Destroys the vagrant environment' 'halt:Halts the currently running vagrant environment' 'init:[box_name] [box_url] Initializes current folder for Vagrant usage' @@ -14,6 +15,7 @@ _1st_arguments=( 'provision:Run the provisioner' 'reload:Reload the vagrant environment' 'resume:Resumes a suspend vagrant environment' + 'share:Shares the Vagrant environment and allows remote access' 'ssh:SSH into the currently running environment' 'ssh-config:outputs .ssh/config valid syntax for connecting to this environment via ssh.' 'status:Shows the status of the current Vagrant environment.' From 7f8ee9aabe5f551a83babd4083ab6490cd324bda Mon Sep 17 00:00:00 2001 From: Ingo Renner Date: Tue, 6 May 2014 10:48:49 -0700 Subject: [PATCH 021/488] [FEATURE] Support Vagrant Cloud commands Vagrant 1.5 added Vagrant Cloud to share boxes. Some boxes may be protected, the `login` command allows to access those protected boxes from Vagrant Cloud. --- plugins/vagrant/_vagrant | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant index 7bdfb0f1c..a590b0621 100644 --- a/plugins/vagrant/_vagrant +++ b/plugins/vagrant/_vagrant @@ -10,6 +10,7 @@ _1st_arguments=( 'destroy:Destroys the vagrant environment' 'halt:Halts the currently running vagrant environment' 'init:[box_name] [box_url] Initializes current folder for Vagrant usage' + 'login:Authenticates against a Vagrant Cloud server to access protected boxes' 'package:Packages a vagrant environment for distribution' 'plugin:Plugin commands' 'provision:Run the provisioner' From 30d9952b6235694cb7fa370fcefebac623d48ce6 Mon Sep 17 00:00:00 2001 From: Ingo Renner Date: Tue, 6 May 2014 10:53:12 -0700 Subject: [PATCH 022/488] [FEATURE] Support vagrant global-status Vagrant 1.6 introduced the `global-status` command which allows to get a quick overview of all active Vagrant environments for the currently logged in user. --- plugins/vagrant/_vagrant | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant index a590b0621..93d6c57b1 100644 --- a/plugins/vagrant/_vagrant +++ b/plugins/vagrant/_vagrant @@ -8,6 +8,7 @@ _1st_arguments=( 'box:Box commands' 'connect:Connects to a shared, remote Vagrant environment' 'destroy:Destroys the vagrant environment' + 'global-status:Reports the status of all active Vagrant environments on the system.' 'halt:Halts the currently running vagrant environment' 'init:[box_name] [box_url] Initializes current folder for Vagrant usage' 'login:Authenticates against a Vagrant Cloud server to access protected boxes' From 8ed800510262157adab151cad12959095a5a1b62 Mon Sep 17 00:00:00 2001 From: Ingo Renner Date: Thu, 15 May 2014 12:26:39 -0700 Subject: [PATCH 023/488] Improve consistency, remove dots at end of command descriptions --- plugins/vagrant/_vagrant | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant index 93d6c57b1..14f8b965c 100644 --- a/plugins/vagrant/_vagrant +++ b/plugins/vagrant/_vagrant @@ -8,7 +8,7 @@ _1st_arguments=( 'box:Box commands' 'connect:Connects to a shared, remote Vagrant environment' 'destroy:Destroys the vagrant environment' - 'global-status:Reports the status of all active Vagrant environments on the system.' + 'global-status:Reports the status of all active Vagrant environments on the system' 'halt:Halts the currently running vagrant environment' 'init:[box_name] [box_url] Initializes current folder for Vagrant usage' 'login:Authenticates against a Vagrant Cloud server to access protected boxes' @@ -19,8 +19,8 @@ _1st_arguments=( 'resume:Resumes a suspend vagrant environment' 'share:Shares the Vagrant environment and allows remote access' 'ssh:SSH into the currently running environment' - 'ssh-config:outputs .ssh/config valid syntax for connecting to this environment via ssh.' - 'status:Shows the status of the current Vagrant environment.' + 'ssh-config:outputs .ssh/config valid syntax for connecting to this environment via ssh' + 'status:Shows the status of the current Vagrant environment' 'suspend:Suspends the currently running vagrant environment' 'up:Creates the vagrant environment' 'version:Prints the currently installed Vagrant version and checks for new updates' From 2c19c0e59e6a3fd1f844ee6f5f883e199a3c1adc Mon Sep 17 00:00:00 2001 From: ncanceill Date: Sat, 24 May 2014 08:31:59 +0200 Subject: [PATCH 024/488] typo, fixes #1806 --- plugins/ssh-agent/ssh-agent.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index 2fb8d5462..610ad34dc 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -1,7 +1,7 @@ # # INSTRUCTIONS # -# To enabled agent forwarding support add the following to +# To enable agent forwarding support add the following to # your .zshrc file: # # zstyle :omz:plugins:ssh-agent agent-forwarding on From 0b4bf905f50191c885315eec5536a973ea96b4cf Mon Sep 17 00:00:00 2001 From: Tony Date: Fri, 23 May 2014 22:06:30 -0400 Subject: [PATCH 025/488] Minor markup edits --- README.textile | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.textile b/README.textile index 4325c91eb..28bab6b2c 100644 --- a/README.textile +++ b/README.textile @@ -10,22 +10,22 @@ h2. Setup h3. The automatic installer... (do you trust me?) -You can install this via the command line with either `curl` or `wget`. +You can install this via the command line with either @curl@ or @wget@. -h4. via `curl` +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 -The default location is `~/.oh-my-zsh` (hidden in your home 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 +by running @export ZSH=/your/path@ before installing, or 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@ @@ -37,7 +37,7 @@ h3. The manual way @git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@ -2. *OPTIONAL* Backup your existing ~/.zshrc file +2. *OPTIONAL* Backup your existing @~/.zshrc@ file @cp ~/.zshrc ~/.zshrc.orig@ @@ -53,9 +53,9 @@ h3. The manual way 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 ZSH in @~/.zshrc@ h2. Usage @@ -72,16 +72,16 @@ the "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty tasty fo 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 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/@. 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 updates. If you would like oh-my-zsh to automatically update 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 updates entirely, put this in your @~/.zshrc@ @DISABLE_AUTO_UPDATE=true@ From 8355233f7fc055d8446c7ebf50569202fa5bd1f5 Mon Sep 17 00:00:00 2001 From: Trevor Strieber Date: Thu, 8 May 2014 14:19:37 -0400 Subject: [PATCH 026/488] Fixing typo. --- plugins/colorize/colorize.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/colorize/colorize.plugin.zsh b/plugins/colorize/colorize.plugin.zsh index 0696607d9..dc0947d4f 100644 --- a/plugins/colorize/colorize.plugin.zsh +++ b/plugins/colorize/colorize.plugin.zsh @@ -1,4 +1,4 @@ -# Plugin for highligthing file content +# Plugin for highlighting file content # Plugin highlights file content based on the filename extension. # If no highlighting method supported for given extension then it tries # guess it by looking for file content. @@ -25,4 +25,4 @@ colorize_via_pygmentize() { pygmentize -g "$FNAME" fi done -} \ No newline at end of file +} From 9590b96b3f0dc8e2f4a87b632ff59eab28a0081e Mon Sep 17 00:00:00 2001 From: Adam Luikart Date: Mon, 6 Feb 2012 12:22:07 -0600 Subject: [PATCH 027/488] Write the update file even if `CLOBBER` is unset. --- tools/check_for_upgrade.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index 0f8c9c391..5c8ce3a50 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -5,7 +5,7 @@ function _current_epoch() { } function _update_zsh_update() { - echo "LAST_EPOCH=$(_current_epoch)" > ~/.zsh-update + echo "LAST_EPOCH=$(_current_epoch)" >! ~/.zsh-update } function _upgrade_zsh() { From c1f5a1792be3f11f9b298a11232bc5913c8b71a2 Mon Sep 17 00:00:00 2001 From: Brian Hartvigsen Date: Thu, 13 Feb 2014 17:33:27 -0700 Subject: [PATCH 028/488] This is already done in lib/theme-and-appearance.zsh and supports Darwin/BSD/etc --- plugins/common-aliases/common-aliases.plugin.zsh | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/common-aliases/common-aliases.plugin.zsh b/plugins/common-aliases/common-aliases.plugin.zsh index b19650fee..0ee17014b 100644 --- a/plugins/common-aliases/common-aliases.plugin.zsh +++ b/plugins/common-aliases/common-aliases.plugin.zsh @@ -3,7 +3,6 @@ # # ls, the common ones I use a lot shortened for rapid fire usage -alias ls='ls --color' #I like color alias l='ls -lFh' #size,show type,human readable alias la='ls -lAFh' #long list,show almost all,show type,human readable alias lr='ls -tRFh' #sorted by date,recursive,show type,human readable From 5e601d6515f9ee51c733aea71acf6757066943e2 Mon Sep 17 00:00:00 2001 From: Brian Hartvigsen Date: Thu, 13 Feb 2014 17:41:38 -0700 Subject: [PATCH 029/488] Fix dud alias. Switch --max-depth for just -d As far as I can tell (tested on Linux & Darwin, BSD man page seems to agree), `-d` is pretty univerally accepted as the depth argument. So instead of doing a test, we can just use -d and call it a day. --- plugins/common-aliases/common-aliases.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/common-aliases/common-aliases.plugin.zsh b/plugins/common-aliases/common-aliases.plugin.zsh index 0ee17014b..228a39da0 100644 --- a/plugins/common-aliases/common-aliases.plugin.zsh +++ b/plugins/common-aliases/common-aliases.plugin.zsh @@ -38,7 +38,7 @@ alias -g NE="2> /dev/null" alias -g NUL="> /dev/null 2>&1" alias -g P="2>&1| pygmentize -l pytb" -alias dud='du --max-depth=1 -h' +alias dud='du -d 1 -h' alias duf='du -sh *' alias fd='find . -type d -name' alias ff='find . -type f -name' From 8d976e02b1da43ec74c1ca6f50584eed566ff73a Mon Sep 17 00:00:00 2001 From: Mark Feltner Date: Tue, 14 Jan 2014 23:13:49 -0600 Subject: [PATCH 030/488] fix(tools/check_for_upgrade): Don't source profile Reverts #2296, but mostly #1883. There is no need to source ~/.profile when this script is read. oh-my-zsh writes no configuration data in ~/.profile. If the user wishes to use data within ~/.profile, then they should source it in another place. Fixes #2315 --- tools/check_for_upgrade.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index 5c8ce3a50..c5fd0cce1 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -20,8 +20,6 @@ if [[ -z "$epoch_target" ]]; then epoch_target=13 fi -[ -f ~/.profile ] && source ~/.profile - if [ -f ~/.zsh-update ] then . ~/.zsh-update From 4c64cf4a253608022caeda0f83b6ae73b7a8513c Mon Sep 17 00:00:00 2001 From: Simon Courtois Date: Wed, 9 Apr 2014 12:32:42 +0200 Subject: [PATCH 031/488] Replacing DISABLE_CORRECTION with ENABLE_CORRECTION in zshrc template Since commands auto-correction must be explicitly enable with the ENABLE_CORRECTION envvar, this commit replaces the unaccurate example in the zshrc template. --- templates/zshrc.zsh-template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 5b2a6cf49..e08c13912 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -26,8 +26,8 @@ ZSH_THEME="robbyrussell" # Uncomment the following line to disable auto-setting terminal title. # DISABLE_AUTO_TITLE="true" -# Uncomment the following line to disable command auto-correction. -# DISABLE_CORRECTION="true" +# Uncomment the following line to enable command auto-correction. +# ENABLE_CORRECTION="true" # Uncomment the following line to display red dots whilst waiting for completion. # COMPLETION_WAITING_DOTS="true" From cd8d5c4410f96ee16a6349a0cf7bcac882e37604 Mon Sep 17 00:00:00 2001 From: Simon Courtois Date: Wed, 9 Apr 2014 18:13:19 +0200 Subject: [PATCH 032/488] Defining nocorrect aliases only when ENABLE_CORRECTION is "true" This commit move the nocorrect aliases definition so they're called only when the user set ENABLE_CORRECTION to "true" to activate commands autocorrection. --- lib/correction.zsh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/correction.zsh b/lib/correction.zsh index 47eb83b1d..35771474f 100644 --- a/lib/correction.zsh +++ b/lib/correction.zsh @@ -1,13 +1,13 @@ -alias man='nocorrect man' -alias mv='nocorrect mv' -alias mysql='nocorrect mysql' -alias mkdir='nocorrect mkdir' -alias gist='nocorrect gist' -alias heroku='nocorrect heroku' -alias ebuild='nocorrect ebuild' -alias hpodder='nocorrect hpodder' -alias sudo='nocorrect sudo' - if [[ "$ENABLE_CORRECTION" == "true" ]]; then + alias man='nocorrect man' + alias mv='nocorrect mv' + alias mysql='nocorrect mysql' + alias mkdir='nocorrect mkdir' + alias gist='nocorrect gist' + alias heroku='nocorrect heroku' + alias ebuild='nocorrect ebuild' + alias hpodder='nocorrect hpodder' + alias sudo='nocorrect sudo' + setopt correct_all fi From b64e695b35db8bf0ff01433669a3adc4ee04341c Mon Sep 17 00:00:00 2001 From: Simon Courtois Date: Wed, 9 Apr 2014 18:16:57 +0200 Subject: [PATCH 033/488] Ordering nocorrect aliases alphabetically --- lib/correction.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/correction.zsh b/lib/correction.zsh index 35771474f..3e1415a0b 100644 --- a/lib/correction.zsh +++ b/lib/correction.zsh @@ -1,12 +1,12 @@ if [[ "$ENABLE_CORRECTION" == "true" ]]; then - alias man='nocorrect man' - alias mv='nocorrect mv' - alias mysql='nocorrect mysql' - alias mkdir='nocorrect mkdir' + alias ebuild='nocorrect ebuild' alias gist='nocorrect gist' alias heroku='nocorrect heroku' - alias ebuild='nocorrect ebuild' alias hpodder='nocorrect hpodder' + alias man='nocorrect man' + alias mkdir='nocorrect mkdir' + alias mv='nocorrect mv' + alias mysql='nocorrect mysql' alias sudo='nocorrect sudo' setopt correct_all From c0b094cf859899bd78db43a4dc59a0ae6786d49d Mon Sep 17 00:00:00 2001 From: pangratz Date: Mon, 3 Feb 2014 10:35:40 +0100 Subject: [PATCH 034/488] Fix function/alias naming clash between bower and bundle plugin Since the `bower` plugin specifies a `bi` alias and `bundle` plugin specifies a `bi` function, there is a name clash when using both plugins, which results in the message "Can't 'bundle install' outside a bundled project" when trying to execute `bower`. This adresses #2486 --- plugins/bundler/bundler.plugin.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 3338d78be..8571eeda3 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -3,6 +3,7 @@ alias bl="bundle list" alias bp="bundle package" alias bo="bundle open" alias bu="bundle update" +alias bi="bundle_install" # The following is based on https://github.com/gma/bundler-exec @@ -15,7 +16,7 @@ done ## Functions -bi() { +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 From 3c485db8c73bfebf379f3e9382eb8f300b608bd8 Mon Sep 17 00:00:00 2001 From: r3dDoX Date: Sat, 24 May 2014 12:15:26 +0200 Subject: [PATCH 035/488] replaced hardcoded origin/{branch-name} with @{upstream} which gets the upstream branch since git 1.7.0 --- lib/git.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git.zsh b/lib/git.zsh index 305a77aff..3eca8a6c6 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -54,7 +54,7 @@ git_remote_status() { # Checks if there are commits ahead from remote function git_prompt_ahead() { - if $(echo "$(command git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then + if $(echo "$(command git log @{upstream}..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then echo "$ZSH_THEME_GIT_PROMPT_AHEAD" fi } From 59c8fcc712556a4c0b612898073e212877c21d60 Mon Sep 17 00:00:00 2001 From: r3dDoX Date: Sat, 24 May 2014 12:19:46 +0200 Subject: [PATCH 036/488] added new function to get number of commits ahead of remote --- lib/git.zsh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/git.zsh b/lib/git.zsh index 3eca8a6c6..d6cee37c3 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -59,6 +59,13 @@ function git_prompt_ahead() { fi } +# Gets the number of commits ahead from remote +function git_commits_ahead() { + if $(echo "$(command git log @{upstream}..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then + echo "$(command git log @{upstream}..HEAD | grep '^commit' | wc -l | tr -d ' ')" + fi +} + # Formats prompt string for current git commit short SHA function git_prompt_short_sha() { SHA=$(command git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER" From 1ad1c52797e99c1060301e55cb726e290a06d063 Mon Sep 17 00:00:00 2001 From: Sean McCann Date: Fri, 16 May 2014 11:46:48 -0400 Subject: [PATCH 037/488] Move aliases to 'custom' section of .zshrc template By convention, user-specific aliases are kept in each user's .zshrc file. The .zshrc template provided by oh-my-zsh has an area for example aliases, though these were being loaded before other aliases in libs, plugins, and themes. As a result, personal aliases could be overwritten by these other aliases as they are loaded. To make personal customization easier, the sample aliases section of the .zshrc template has been moved to the area dedicated for personal customization. This section of the configuration is processed after all other items are loaded, preventing personal aliases and exports from being inadvertently clobbered by oh-my-zsh. --- templates/zshrc.zsh-template | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index e08c13912..c77b54849 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -7,10 +7,6 @@ export ZSH=$HOME/.oh-my-zsh # time that oh-my-zsh is loaded. ZSH_THEME="robbyrussell" -# Example aliases -# alias zshconfig="mate ~/.zshrc" -# alias ohmyzsh="mate ~/.oh-my-zsh" - # Uncomment the following line to use case-sensitive completion. # CASE_SENSITIVE="true" @@ -72,3 +68,12 @@ export PATH=$HOME/bin:/usr/local/bin:$PATH # ssh # export SSH_KEY_PATH="~/.ssh/dsa_id" + +# Set personal aliases, overriding those provided by oh-my-zsh libs, +# plugins, and themes. Aliases can be placed here, though oh-my-zsh +# users are encouraged to define aliases within the ZSH_CUSTOM folder. +# For a full list of active aliases, run `alias`. +# +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" From 514693125b12d4b4cd099dcb09174f7bfd9a5b0e Mon Sep 17 00:00:00 2001 From: r3dDoX Date: Mon, 26 May 2014 10:47:51 +0200 Subject: [PATCH 038/488] added prefix/suffix variable for customizability --- lib/git.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/git.zsh b/lib/git.zsh index d6cee37c3..a52f82de0 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -62,7 +62,8 @@ function git_prompt_ahead() { # Gets the number of commits ahead from remote function git_commits_ahead() { if $(echo "$(command git log @{upstream}..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then - echo "$(command git log @{upstream}..HEAD | grep '^commit' | wc -l | tr -d ' ')" + COMMITS=$(command git log @{upstream}..HEAD | grep '^commit' | wc -l | tr -d ' ') + echo "$ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX$COMMITS$ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX" fi } From 6fc241b0d2f4690f7fd00f26eb91045a04c05fbd Mon Sep 17 00:00:00 2001 From: Frank Behrens Date: Fri, 18 Apr 2014 11:26:06 +0200 Subject: [PATCH 039/488] extract plugin will unzip *.sublime-package files --- plugins/extract/extract.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index 7352e5bad..a6e16ddf7 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -52,7 +52,7 @@ function extract() { (*.xz) unxz "$1" ;; (*.lzma) unlzma "$1" ;; (*.Z) uncompress "$1" ;; - (*.zip|*.war|*.jar) unzip "$1" -d $extract_dir ;; + (*.zip|*.war|*.jar|*.sublime-package) unzip "$1" -d $extract_dir ;; (*.rar) unrar x -ad "$1" ;; (*.7z) 7za x "$1" ;; (*.deb) From b7f51bbbdd9f0d9ff9ef59b559e91b916d53cdf1 Mon Sep 17 00:00:00 2001 From: Josh Datko Date: Tue, 27 May 2014 10:34:03 -0600 Subject: [PATCH 040/488] Adds itunes vol command. Adds itunes vol, which takes an argument from 0 to 100 to set the volume from the shell. --- plugins/osx/osx.plugin.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh index 63760b5ff..a63f0ee05 100644 --- a/plugins/osx/osx.plugin.zsh +++ b/plugins/osx/osx.plugin.zsh @@ -174,12 +174,16 @@ function itunes() { next|previous) opt="$opt track" ;; + vol) + opt="set sound volume to $1" #$1 Due to the shift + ;; ""|-h|--help) echo "Usage: itunes