From 6a5c8fb81b369566ed0f5e408dab7a7213354ade Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Mon, 21 Apr 2014 21:11:49 -0500 Subject: [PATCH 01/99] 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 fac5e711ebbb..6b7796857229 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 5da920ecd9ec..9525343fcd34 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 a81ef5a482d4..7b732d2aeba0 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 02/99] 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 7b732d2aeba0..54489080f8ae 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 8a43d358c1d433c32fd940d3ff19cfa2f3fcf20c Mon Sep 17 00:00:00 2001 From: Nico Revin Date: Fri, 1 Aug 2014 23:32:38 +0400 Subject: [PATCH 03/99] fix paclist() for non-english locales --- 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 bffe9657af9e..82c8d8a237bc 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -55,7 +55,7 @@ alias pacmir='sudo pacman -Syy' # Force refresh of all package li # https://bbs.archlinux.org/viewtopic.php?id=93683 paclist() { - sudo pacman -Qei $(pacman -Qu|cut -d" " -f 1)|awk ' BEGIN {FS=":"}/^Name/{printf("\033[1;36m%s\033[1;37m", $2)}/^Description/{print $2}' + LC_ALL=C pacman -Qei $(pacman -Qu|cut -d" " -f 1)|awk ' BEGIN {FS=":"}/^Name/{printf("\033[1;36m%s\033[1;37m", $2)}/^Description/{print $2}' } alias paclsorphans='sudo pacman -Qdt' From 95d5f2c641d698b479dc8817ed1a85dcbc965fb6 Mon Sep 17 00:00:00 2001 From: Manfred Touron Date: Thu, 13 Nov 2014 18:59:04 +0100 Subject: [PATCH 04/99] [boot2docker plugin] Initial version --- plugins/boot2docker/README.md | 6 +++ plugins/boot2docker/_boot2docker | 70 ++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 plugins/boot2docker/README.md create mode 100644 plugins/boot2docker/_boot2docker diff --git a/plugins/boot2docker/README.md b/plugins/boot2docker/README.md new file mode 100644 index 000000000000..9551e235109d --- /dev/null +++ b/plugins/boot2docker/README.md @@ -0,0 +1,6 @@ +## Boot2docker autocomplete plugin + +- Adds autocomplete options for all boot2docker commands. + + +Maintainer : Manfred Touron ([@moul](https://github.com/moul)) diff --git a/plugins/boot2docker/_boot2docker b/plugins/boot2docker/_boot2docker new file mode 100644 index 000000000000..baa08b26d89f --- /dev/null +++ b/plugins/boot2docker/_boot2docker @@ -0,0 +1,70 @@ +#compdef boot2docker + +# Boot2docker autocompletion for oh-my-zsh +# Requires: Boot2docker installed +# Author: Manfred Touron (@moul) + +local -a _1st_arguments +_1st_arguments=( + "init":"Create a new Boot2Docker VM." + "up":"Start VM from any states." + "start":"Start VM from any states." + "boot":"Start VM from any states." + "ssh":"[ssh-command] Login to VM via SSH." + "save":"Suspend VM and save state to disk." + "suspend":"Suspend VM and save state to disk." + "down":"Gracefully shutdown the VM." + "stop":"Gracefully shutdown the VM." + "halt":"Gracefully shutdown the VM." + "restart":"Gracefully reboot the VM." + "poweroff":"Forcefully power off the VM (may corrupt disk image)." + "reset":"Forcefully power cycle the VM (may corrupt disk image)." + "delete":"Delete Boot2Docker VM and its disk image." + "destroy":"Delete Boot2Docker VM and its disk image." + "config":"Show selected profile file settings." + "cfg":"Show selected profile file settings." + "info":"Display detailed information of VM." + "ip":"Display the IP address of the VM's Host-only network." + "socket":"Display the DOCKER_HOST socket to connect to." + "shellinit":"Display the shell command to set up the Docker client." + "status":"Display current state of VM." + "download":"Download Boot2Docker ISO image." + "upgrade":"Upgrade the Boot2Docker ISO image (restart if running)." + "version":"Display version information." +) + +_arguments \ + '(--basevmdk)--basevmdk[Path to VMDK to use as base for persistent partition]' \ + '(--dhcp)--dhcp[enable VirtualBox host-only network DHCP.]' \ + '(--dhcpip)--dhcpip[VirtualBox host-only network DHCP server address.]' \ + '(-s --disksize)'{-s,--disksize}'[boot2docker disk image size (in MB).]' \ + '(--dockerport)--dockerport[host Docker port (forward to port 2376 in VM). (deprecated - use with care)]' \ + '(--driver)--driver[hypervisor driver.]' \ + '(--hostip)--hostip[VirtualBox host-only network IP address.]' \ + '(--iso)--iso[path to boot2docker ISO image.]' \ + '(--iso-url)--iso-url[/api.github.com/repos/boot2docker/boot2docker/releases": source URL to provision the boot2docker ISO image.]' \ + '(--lowerip)--lowerip[VirtualBox host-only network DHCP lower bound.]' \ + '(--memory)'{-m,--memory}'[virtual machine memory size (in MB).]' \ + '(--netmask)--netmask[VirtualBox host-only network mask.]' \ + '(--no-dummy)--no-dummy[Example parameter for the dummy driver.]' \ + '(--retries)--retries[number of port knocking retries during 'start']' \ + '(--serial)--serial[try serial console to get IP address (experimental)]' \ + '(--serialfile)--serialfile[path to the serial socket/pipe.]' \ + '(--ssh)--ssh[path to SSH client utility.]' \ + '(--ssh-keygen)--ssh-keygen[path to ssh-keygen utility.]' \ + '(--sshkey)--sshkey[path to SSH key to use.]' \ + '(--sshport)--sshport[host SSH port (forward to port 22 in VM).]' \ + '(--upperip)--upperip[VirtualBox host-only network DHCP upper bound.]' \ + '(--vbm)--vbm[path to VirtualBox management utility.]' \ + '(--vbox-share)--vbox-share[(defaults to "/Users=Users" if no shares are specified; use "disable" to explicitly prevent any shares from being created) List of directories to share during "up|start|boot" via VirtualBox Guest Additions, with optional labels]' \ + '(--verbose)'{-v,--verbose}'[display verbose command invocations.]' \ + '(--vm)--vm[virtual machine name.]' \ + '(--waittime)--waittime[Time in milliseconds to wait between port knocking retries during 'start']' \ + '*:: :->subcmds' && return 0 + +#_arguments '*:: :->command' + +if (( CURRENT == 1 )); then + _describe -t commands "boot2docker command" _1st_arguments + return +fi From 663d43241cd890c2fa78040a612c6d424674c5f9 Mon Sep 17 00:00:00 2001 From: Christopher Harrison Date: Mon, 24 Nov 2014 09:56:47 +0000 Subject: [PATCH 05/99] Minor cosmetic fix to minimal theme Set the closing square-brace's FG colour to white, to match the opening brace, when the repo directory is dirty. --- themes/minimal.zsh-theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/minimal.zsh-theme b/themes/minimal.zsh-theme index a2a16031f9c8..fbd620225c7d 100644 --- a/themes/minimal.zsh-theme +++ b/themes/minimal.zsh-theme @@ -1,6 +1,6 @@ ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[white]%}[" ZSH_THEME_GIT_PROMPT_SUFFIX="" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}●%{$reset_color%}]%{$reset_color%} " +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}●%{$fg[white]%}]%{$reset_color%} " ZSH_THEME_GIT_PROMPT_CLEAN="]%{$reset_color%} " ZSH_THEME_SVN_PROMPT_PREFIX=$ZSH_THEME_GIT_PROMPT_PREFIX ZSH_THEME_SVN_PROMPT_SUFFIX=$ZSH_THEME_GIT_PROMPT_SUFFIX @@ -15,4 +15,4 @@ vcs_status() { fi } -PROMPT='%2~ $(vcs_status)»%b ' \ No newline at end of file +PROMPT='%2~ $(vcs_status)»%b ' From f1d12c598b936a54fa1fb5b9a2b8abc4b58bbc85 Mon Sep 17 00:00:00 2001 From: Neal Date: Fri, 5 Jul 2013 08:48:46 -0500 Subject: [PATCH 06/99] Add .ipsw to the extract plugin. --- plugins/extract/_extract | 2 +- plugins/extract/extract.plugin.zsh | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/extract/_extract b/plugins/extract/_extract index dca890954aaa..387b344bc8e7 100644 --- a/plugins/extract/_extract +++ b/plugins/extract/_extract @@ -3,6 +3,6 @@ _arguments \ '(-r --remove)'{-r,--remove}'[Remove archive.]' \ - "*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|rar|7z|deb)(-.)'" && return 0 + "*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|ipsw|rar|7z|deb)(-.)'" && return 0 diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index 898d3d36ecee..690126ba664d 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -23,7 +23,7 @@ function extract() { remove_archive=1 if [[ "$1" == "-r" ]] || [[ "$1" == "--remove" ]]; then - remove_archive=0 + remove_archive=0 shift fi @@ -52,7 +52,7 @@ function extract() { (*.xz) unxz "$1" ;; (*.lzma) unlzma "$1" ;; (*.Z) uncompress "$1" ;; - (*.zip|*.war|*.jar|*.sublime-package) unzip "$1" -d $extract_dir ;; + (*.zip|*.war|*.jar|*.sublime-package|*.ipsw) unzip "$1" -d $extract_dir ;; (*.rar) unrar x -ad "$1" ;; (*.7z) 7za x "$1" ;; (*.deb) @@ -64,10 +64,10 @@ function extract() { cd ..; rm *.tar.gz debian-binary cd .. ;; - (*) + (*) echo "extract: '$1' cannot be extracted" 1>&2 - success=1 - ;; + success=1 + ;; esac (( success = $success > 0 ? $success : $? )) From 8cf04ed3d7d5552bc2242a5987d46f6faf0fe2dc Mon Sep 17 00:00:00 2001 From: Alex Talker Date: Thu, 15 Jan 2015 04:13:40 +0300 Subject: [PATCH 07/99] Fix echo nothing if $SHORT_HOST doesn't exist. --- themes/candy-kingdom.zsh-theme | 2 +- themes/fino-time.zsh-theme | 2 +- themes/fino.zsh-theme | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/themes/candy-kingdom.zsh-theme b/themes/candy-kingdom.zsh-theme index 889128758515..adba1ad3932f 100644 --- a/themes/candy-kingdom.zsh-theme +++ b/themes/candy-kingdom.zsh-theme @@ -13,7 +13,7 @@ patches: Date: Tue, 21 Apr 2015 21:34:26 +0200 Subject: [PATCH 08/99] Use the newest Vundle commands Vundle changed the command names during an interface update. The old commands will be deprecated. https://github.com/gmarik/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L372-L396 --- plugins/vundle/vundle.plugin.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/vundle/vundle.plugin.zsh b/plugins/vundle/vundle.plugin.zsh index 830774fe3f81..b5f1c0bbf43e 100644 --- a/plugins/vundle/vundle.plugin.zsh +++ b/plugins/vundle/vundle.plugin.zsh @@ -13,15 +13,15 @@ function vundle-init () { function vundle () { vundle-init - vim -c "execute \"BundleInstall\" | q | q" + vim -c "execute \"PluginInstall\" | q | q" } function vundle-update () { vundle-init - vim -c "execute \"BundleInstall!\" | q | q" + vim -c "execute \"PluginInstall!\" | q | q" } function vundle-clean () { vundle-init - vim -c "execute \"BundleClean!\" | q | q" + vim -c "execute \"PluginClean!\" | q | q" } From 551d68ad11c65ece0ea2af07a58fe971795bb9e6 Mon Sep 17 00:00:00 2001 From: Matthew Ziegelbaum Date: Sat, 25 Apr 2015 16:08:26 -0400 Subject: [PATCH 09/99] Fixes gradle autocomplete. Regex did not include subproject tasks before. --- plugins/gradle/gradle.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/gradle/gradle.plugin.zsh b/plugins/gradle/gradle.plugin.zsh index 9229512f7570..14ababa9ed45 100644 --- a/plugins/gradle/gradle.plugin.zsh +++ b/plugins/gradle/gradle.plugin.zsh @@ -72,7 +72,7 @@ _gradle_tasks () { if [ in_gradle ]; then _gradle_arguments if _gradle_does_task_list_need_generating; then - gradle tasks --all | grep "^[ ]*[a-zA-Z0-9]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache + gradle tasks --all | grep "^[ ]*[a-zA-Z0-9:]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache fi compadd -X "==== Gradle Tasks ====" `cat .gradletasknamecache` fi @@ -82,7 +82,7 @@ _gradlew_tasks () { if [ in_gradle ]; then _gradle_arguments if _gradle_does_task_list_need_generating; then - gradlew tasks --all | grep "^[ ]*[a-zA-Z0-9]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache + gradlew tasks --all | grep "^[ ]*[a-zA-Z0-9:]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache fi compadd -X "==== Gradlew Tasks ====" `cat .gradletasknamecache` fi From 5c9c373cd7944b514c22c292333700bea0408203 Mon Sep 17 00:00:00 2001 From: Brian Hartvigsen Date: Tue, 28 Apr 2015 00:05:11 -0700 Subject: [PATCH 10/99] Fix minimal.zsh-theme's check for in_svn and add support for mercurial --- themes/minimal.zsh-theme | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/themes/minimal.zsh-theme b/themes/minimal.zsh-theme index a2a16031f9c8..f79e795d9089 100644 --- a/themes/minimal.zsh-theme +++ b/themes/minimal.zsh-theme @@ -6,13 +6,19 @@ ZSH_THEME_SVN_PROMPT_PREFIX=$ZSH_THEME_GIT_PROMPT_PREFIX ZSH_THEME_SVN_PROMPT_SUFFIX=$ZSH_THEME_GIT_PROMPT_SUFFIX ZSH_THEME_SVN_PROMPT_DIRTY=$ZSH_THEME_GIT_PROMPT_DIRTY ZSH_THEME_SVN_PROMPT_CLEAN=$ZSH_THEME_GIT_PROMPT_CLEAN +ZSH_THEME_HG_PROMPT_PREFIX=$ZSH_THEME_GIT_PROMPT_PREFIX +ZSH_THEME_HG_PROMPT_SUFFIX=$ZSH_THEME_GIT_PROMPT_SUFFIX +ZSH_THEME_HG_PROMPT_DIRTY=$ZSH_THEME_GIT_PROMPT_DIRTY +ZSH_THEME_HG_PROMPT_CLEAN=$ZSH_THEME_GIT_PROMPT_CLEAN vcs_status() { - if [[ ( $(whence in_svn) != "" ) && ( $(in_svn) == 1 ) ]]; then + if [[ $(whence in_svn) != "" ]] && in_svn; then svn_prompt_info + elif [[ $(whence in_hg) != "" ]] && in_hg; then + hg_prompt_info else git_prompt_info fi } -PROMPT='%2~ $(vcs_status)»%b ' \ No newline at end of file +PROMPT='%2~ $(vcs_status)»%b ' From 66052e2d07fc4e6205bf7f14adfa12d53d9ad487 Mon Sep 17 00:00:00 2001 From: Jordan Klassen Date: Wed, 29 Apr 2015 15:37:39 -0700 Subject: [PATCH 11/99] Add hyphen insensitivity --- lib/completion.zsh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/completion.zsh b/lib/completion.zsh index 4b1bb0a62485..452c0dfe7655 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -15,7 +15,12 @@ if [ "x$CASE_SENSITIVE" = "xtrue" ]; then zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' unset CASE_SENSITIVE else - zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' + if [ "x$HYPHEN_INSENSITIVE" = "xtrue" ]; then + zstyle ':completion:*' matcher-list 'm:{a-zA-Z-_}={A-Za-z_-}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' + unset HYPHEN_INSENSITIVE + else + zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' + fi fi zstyle ':completion:*' list-colors '' From 8e8cdc0502fc35844975548fa268e7ed027d00b7 Mon Sep 17 00:00:00 2001 From: Cooper Maruyama Date: Fri, 1 May 2015 01:34:20 -0700 Subject: [PATCH 12/99] Add coffeescript aliases: cf, cfc, cfp cf: compile and show output cfc: compile & copy cfp: compile from pasteboard & print --- plugins/coffee/coffee.plugin.zsh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 plugins/coffee/coffee.plugin.zsh diff --git a/plugins/coffee/coffee.plugin.zsh b/plugins/coffee/coffee.plugin.zsh new file mode 100644 index 000000000000..96393f66de3c --- /dev/null +++ b/plugins/coffee/coffee.plugin.zsh @@ -0,0 +1,13 @@ +#!/bin/zsh + +# compile a string of coffeescript and print to output +cf () { + coffee -peb $1 +} +# compile & copy to clipboard +cfc () { + cf $1 | tail -n +2 | pbcopy +} + +# compile from pasteboard & print +alias cfp='coffeeMe "$(pbpaste)"' From a315ddc075e6a6a4b9dbdcaced0fa08349597223 Mon Sep 17 00:00:00 2001 From: Cooper Maruyama Date: Fri, 1 May 2015 01:37:55 -0700 Subject: [PATCH 13/99] typofix --- plugins/coffee/coffee.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/coffee/coffee.plugin.zsh b/plugins/coffee/coffee.plugin.zsh index 96393f66de3c..be34b03c2898 100644 --- a/plugins/coffee/coffee.plugin.zsh +++ b/plugins/coffee/coffee.plugin.zsh @@ -6,7 +6,7 @@ cf () { } # compile & copy to clipboard cfc () { - cf $1 | tail -n +2 | pbcopy + cf $1 | pbcopy } # compile from pasteboard & print From 45121611fe00a27155aa4259c31761224d4ccef4 Mon Sep 17 00:00:00 2001 From: Jordan Klassen Date: Fri, 1 May 2015 15:10:45 -0700 Subject: [PATCH 14/99] Update template zshrc with HYPHEN_INSENSITIVE --- templates/zshrc.zsh-template | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 763288dfd6ea..44e8b0d1bdf1 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -10,6 +10,10 @@ ZSH_THEME="robbyrussell" # Uncomment the following line to use case-sensitive completion. # CASE_SENSITIVE="true" +# Uncomment the following line to use hyphen-insensitive completion. Case +# sensitive completion must be off. _ and - will be interchangeable. +# HYPHEN_INSENSITIVE="true" + # Uncomment the following line to disable bi-weekly auto-update checks. # DISABLE_AUTO_UPDATE="true" From 24552f02259829428c412a88729de4cfd0b7ba8b Mon Sep 17 00:00:00 2001 From: Cooper Maruyama Date: Sat, 2 May 2015 07:14:21 -0700 Subject: [PATCH 15/99] Add readme and add new alias cfpc: paste+compile+copy --- plugins/coffee/README | 31 +++++++++++++++++++++++++++++++ plugins/coffee/coffee.plugin.zsh | 3 +++ 2 files changed, 34 insertions(+) create mode 100644 plugins/coffee/README diff --git a/plugins/coffee/README b/plugins/coffee/README new file mode 100644 index 000000000000..d0e7bbe74b59 --- /dev/null +++ b/plugins/coffee/README @@ -0,0 +1,31 @@ +## Coffeescript Plugin + +This plugin provides aliases for quickly compiling and previewing your +cofeescript code. + +When writing Coffeescript it's very common to want to preview the output of a +certain snippet of code, either because you want to test the output or because +you'd like to execute it in a browser console which doesn't accept Coffeescript. + +Preview the compiled result of your coffeescript with `cf "code"` as per the +following: + +```zsh +$ cf 'if a then be else c' +if (a) { + b; +} else { + c; +} +``` + +Also provides the following aliases: + +* **cfc:** Copies the compiled JS to your clipboard. Very useful when you want + to run the code in a JS console. + +* **cfp:** Compiles from your currently copied clipboard. Useful when you want + to compile large/multi-line snippets + +* **cfpc:** Paste coffeescript from clipboard, compile to JS, then copy the + the result back to clipboard. diff --git a/plugins/coffee/coffee.plugin.zsh b/plugins/coffee/coffee.plugin.zsh index be34b03c2898..1a7bedd87fe9 100644 --- a/plugins/coffee/coffee.plugin.zsh +++ b/plugins/coffee/coffee.plugin.zsh @@ -11,3 +11,6 @@ cfc () { # compile from pasteboard & print alias cfp='coffeeMe "$(pbpaste)"' + +# compile from pasteboard and copy to clipboard +alias cfpc='cfp | pbcopy' From d80918bf981d5df3f192346b44c0c35636ee7b2b Mon Sep 17 00:00:00 2001 From: Cooper Maruyama Date: Sat, 2 May 2015 07:16:27 -0700 Subject: [PATCH 16/99] add markdown extension to README --- plugins/coffee/{README => README.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename plugins/coffee/{README => README.md} (100%) diff --git a/plugins/coffee/README b/plugins/coffee/README.md similarity index 100% rename from plugins/coffee/README rename to plugins/coffee/README.md From 83cf909ad621938d3dc64c1f28155e819e1b6ea5 Mon Sep 17 00:00:00 2001 From: Toni Ristola Date: Mon, 4 May 2015 07:47:02 +0300 Subject: [PATCH 17/99] Added aliases for docker compose --- plugins/docker-compose/README.md | 1 + plugins/docker-compose/docker-compose.plugin.zsh | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 plugins/docker-compose/README.md create mode 100644 plugins/docker-compose/docker-compose.plugin.zsh diff --git a/plugins/docker-compose/README.md b/plugins/docker-compose/README.md new file mode 100644 index 000000000000..77b98f30df1f --- /dev/null +++ b/plugins/docker-compose/README.md @@ -0,0 +1 @@ +# Docker-compose plugin for oh my zsh diff --git a/plugins/docker-compose/docker-compose.plugin.zsh b/plugins/docker-compose/docker-compose.plugin.zsh new file mode 100644 index 000000000000..08500408d7a3 --- /dev/null +++ b/plugins/docker-compose/docker-compose.plugin.zsh @@ -0,0 +1,14 @@ +# Authors: +# https://github.com/tristola +# +# Docker-compose related zsh aliases + +# Aliases ################################################################### + +alias dcup='docker-compose up' +alias dcb='docker-compose build' +alias dcrm='docker-compose rm' +alias dcps='docker-compose ps' +alias dcstop='docker-compose stop' +alias dcrestart='docker-compose restart' + From d60d4f68aa75cc21a0fc771020fdbd578b872d75 Mon Sep 17 00:00:00 2001 From: Satoshi Ohmori Date: Tue, 5 May 2015 14:27:59 +0900 Subject: [PATCH 18/99] Add alias of bundle clean --- plugins/bundler/bundler.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index ba3d3f623b36..dfff6956e8be 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -4,6 +4,7 @@ alias bp="bundle package" alias bo="bundle open" alias bu="bundle update" alias bi="bundle_install" +alias bcn="bundle clean" bundled_commands=( annotate From 03b8c199e591de73de3824fc6b366138964c1ba6 Mon Sep 17 00:00:00 2001 From: Pablo Tamarit Date: Tue, 5 May 2015 19:49:19 +0200 Subject: [PATCH 19/99] Fix 'chsh' by checking '/etc/shells' instead of using 'which' fix test for chsh in install in case $SHELL is zsh but not the last one in /etc/shells fixes #3026 fixes #3779 fixes #3780 --- tools/install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/install.sh b/tools/install.sh index bd4c55749886..c83a6f23d077 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -32,10 +32,12 @@ sed -i -e "/export PATH=/ c\\ export PATH=\"$PATH\" " ~/.zshrc -if [ "$SHELL" != "$(which zsh)" ]; then +TEST_CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)') +if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then echo "\033[0;34mTime to change your default shell to zsh!\033[0m" - chsh -s `which zsh` + chsh -s $(grep /zsh$ /etc/shells | tail -1) fi +unset TEST_CURRENT_SHELL echo "\033[0;32m"' __ __ '"\033[0m" echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" From 9a5e1a055201409ebe9e1ab97cd8c3fe52b990f5 Mon Sep 17 00:00:00 2001 From: Aleks Date: Wed, 6 May 2015 10:26:05 +0100 Subject: [PATCH 20/99] Use $EDITOR --- 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 e3830adcf956..fc19d73c3e47 100644 --- a/plugins/common-aliases/common-aliases.plugin.zsh +++ b/plugins/common-aliases/common-aliases.plugin.zsh @@ -13,7 +13,7 @@ alias lS='ls -1FSsh' alias lart='ls -1Fcart' alias lrt='ls -1Fcrt' -alias zshrc='vim ~/.zshrc' # Quick access to the ~/.zshrc file +alias zshrc='$EDITOR ~/.zshrc' # Quick access to the ~/.zshrc file alias grep='grep --color' alias sgrep='grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS} ' From 5b75cc7880de1931a0507800d90eb77ed659fa46 Mon Sep 17 00:00:00 2001 From: ncanceill Date: Fri, 12 Jul 2013 15:26:04 +0200 Subject: [PATCH 21/99] Many updates to git plugin (see #2790) --- plugins/git/README.md | 10 +- plugins/git/_git-branch | 83 ---------- plugins/git/_git-remote | 74 --------- plugins/git/git.plugin.zsh | 325 ++++++++++++++++++++----------------- 4 files changed, 183 insertions(+), 309 deletions(-) delete mode 100644 plugins/git/_git-branch delete mode 100644 plugins/git/_git-remote diff --git a/plugins/git/README.md b/plugins/git/README.md index 8462dda1cdff..76da2a8aee8a 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -1,4 +1,10 @@ ## git -**Maintainer:** [Stibbons](https://github.com/Stibbons) -This plugin adds several git aliases and increase the completion function provided by zsh +**Maintainer:** [@ncanceill](https://github.com/ncanceill) + +This plugin adds many useful aliases and functions. + +### Usage + +See the [wiki](https://github.com/robbyrussell/oh-my-zsh/wiki/Plugin:git) for a list of aliases and functions provided by the plugin. + diff --git a/plugins/git/_git-branch b/plugins/git/_git-branch deleted file mode 100644 index 6b9c1a483e92..000000000000 --- a/plugins/git/_git-branch +++ /dev/null @@ -1,83 +0,0 @@ -#compdef git-branch - -_git-branch () -{ - declare l c m d - - l='--color --no-color -r -a --all -v --verbose --abbrev --no-abbrev' - c='-l -f --force -t --track --no-track --set-upstream --contains --merged --no-merged' - m='-m -M' - d='-d -D' - - declare -a dependent_creation_args - if (( words[(I)-r] == 0 )); then - dependent_creation_args=( - "($l $m $d): :__git_branch_names" - "::start-point:__git_revisions") - fi - - declare -a dependent_deletion_args - if (( words[(I)-d] || words[(I)-D] )); then - dependent_creation_args= - dependent_deletion_args=( - '-r[delete only remote-tracking branches]') - if (( words[(I)-r] )); then - dependent_deletion_args+='*: :__git_ignore_line_inside_arguments __git_remote_branch_names' - else - dependent_deletion_args+='*: :__git_ignore_line_inside_arguments __git_branch_names' - fi - fi - - declare -a dependent_modification_args - if (( words[(I)-m] || words[(I)-M] )); then - dependent_creation_args= - dependent_modification_args=( - ':old or new branch name:__git_branch_names' - '::new branch name:__git_branch_names') - fi - - _arguments -w -S -s \ - "($c $m $d --no-color :)--color=-[turn on branch coloring]:: :__git_color_whens" \ - "($c $m $d : --color)--no-color[turn off branch coloring]" \ - "($c $m -a --all)-r[list or delete only remote-tracking branches]" \ - "($c $m $d : -r)"{-a,--all}"[list both remote-tracking branches and local branches]" \ - "($c $m $d : -v --verbose)"{-v,--verbose}'[show SHA1 and commit subject line for each head]' \ - "($c $m $d :)--abbrev=[set minimum SHA1 display-length]: :__git_guard_number length" \ - "($c $m $d :)--no-abbrev[do not abbreviate sha1s]" \ - "($l $m $d)-l[create the branch's reflog]" \ - "($l $m $d -f --force)"{-f,--force}"[force the creation of a new branch]" \ - "($l $m $d -t --track)"{-t,--track}"[set up configuration so that pull merges from the start point]" \ - "($l $m $d)--no-track[override the branch.autosetupmerge configuration variable]" \ - "($l $m $d)--set-upstream[set up configuration so that pull merges]" \ - "($l $m $d)--contains=[only list branches which contain the specified commit]: :__git_committishs" \ - "($l $m $d)--merged=[only list branches which are fully contained by HEAD]: :__git_committishs" \ - "($l $m $d)--no-merged=[do not list branches which are fully contained by HEAD]: :__git_committishs" \ - $dependent_creation_args \ - "($l $c $d -M)-m[rename a branch and the corresponding reflog]" \ - "($l $c $d -m)-M[rename a branch even if the new branch-name already exists]" \ - $dependent_modification_args \ - "($l $c $m -D)-d[delete a fully merged branch]" \ - "($l $c $m -d)-D[delete a branch]" \ - $dependent_deletion_args -} - -(( $+functions[__git_ignore_line] )) || -__git_ignore_line () { - declare -a ignored - ignored=() - ((CURRENT > 1)) && - ignored+=(${line[1,CURRENT-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH}) - ((CURRENT < $#line)) && - ignored+=(${line[CURRENT+1,-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH}) - $* -F ignored -} - -(( $+functions[__git_ignore_line_inside_arguments] )) || -__git_ignore_line_inside_arguments () { - declare -a compadd_opts - - zparseopts -D -E -a compadd_opts V: J: 1 2 n f X: M: P: S: r: R: q F: - - __git_ignore_line $* $compadd_opts -} - diff --git a/plugins/git/_git-remote b/plugins/git/_git-remote deleted file mode 100644 index 4ba62a357b88..000000000000 --- a/plugins/git/_git-remote +++ /dev/null @@ -1,74 +0,0 @@ -#compdef git-remote - -# NOTE: --track is undocumented. -# TODO: --track, -t, --master, and -m should take remote branches, I guess. -# NOTE: --master is undocumented. -# NOTE: --fetch is undocumented. -_git-remote () { - local curcontext=$curcontext state line - declare -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' && ret=0 - - case $state in - (command) - declare -a commands - - commands=( - 'add:add a new remote' - 'show:show information about a given remote' - 'prune:delete all stale tracking branches for a given remote' - 'update:fetch updates for a set of remotes' - 'rm:remove a remote from .git/config and all associated tracking branches' - 'rename:rename a remote from .git/config and update all associated tracking branches' - 'set-head:sets or deletes the default branch' - 'set-branches:changes the list of branches tracked by the named remote.' - 'set-url:changes URL remote points to.' - ) - - _describe -t commands 'sub-command' commands && ret=0 - ;; - (options) - case $line[1] in - (add) - _arguments \ - '*'{--track,-t}'[track given branch instead of default glob refspec]:branch:__git_branch_names' \ - '(--master -m)'{--master,-m}'[set the remote'\''s HEAD to point to given master branch]:branch:__git_branch_names' \ - '(--fetch -f)'{--fetch,-f}'[run git-fetch on the new remote after it has been created]' \ - ':branch name:__git_remotes' \ - ':url:_urls' && ret=0 - ;; - (show) - _arguments \ - '-n[do not contact the remote for a list of branches]' \ - ':remote:__git_remotes' && ret=0 - ;; - (prune) - _arguments \ - '(--dry-run -n)'{-n,--dry-run}'[do not actually prune, only list what would be done]' \ - ':remote:__git_remotes' && ret=0 - ;; - (update) - __git_remote-groups && ret=0 - ;; - (rm) - __git_remotes && ret=0 - ;; - (rename) - __git_remotes && ret=0 - ;; - (set-url) - _arguments \ - '*--push[manipulate push URLs]' \ - '(--add)--add[add URL]' \ - '(--delete)--delete[delete URLs]' \ - ':branch name:__git_remotes' \ - ':url:_urls' && ret=0 - ;; - - esac - ;; - esac -} diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 9da44881457b..e42e096883ec 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -1,177 +1,202 @@ +# Query/use custom command for `git`. +local git_cmd +zstyle -s ":vcs_info:git:*:-all-" "command" git_cmd +: ${git_cmd:=git} + +# +# Functions +# + +# The current branch name +# Usage example: git pull origin $(current_branch) +# Using '--quiet' with 'symbolic-ref' will not cause a fatal error (128) if +# it's not a symbolic ref, but in a Git repo. +function current_branch() { + local ref + ref=$($git_cmd symbolic-ref --quiet HEAD 2> /dev/null) + local ret=$? + if [[ $ret != 0 ]]; then + [[ $ret == 128 ]] && return # no git repo. + ref=$($git_cmd rev-parse --short HEAD 2> /dev/null) || return + fi + echo ${ref#refs/heads/} +} +# The list of remotes +function current_repository() { + if ! $git_cmd rev-parse --is-inside-work-tree &> /dev/null; then + return + fi + echo $($git_cmd remote -v | cut -d':' -f 2) +} +# Pretty log messages +function _git_log_prettily(){ + if ! [ -z $1 ]; then + git log --pretty=$1 + fi +} +# Warn if the current branch is a WIP +function work_in_progress() { + if $(git log -n 1 2>/dev/null | grep -q -c "\-\-wip\-\-"); then + echo "WIP!!" + fi +} + +# # Aliases +# (sorted alphabetically) +# + alias g='git' -compdef g=git -alias gst='git status' -compdef _git gst=git-status -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' -compdef _git gup=git-fetch -alias gp='git push' -compdef _git gp=git-push -alias gd='git diff' -gdv() { git diff -w "$@" | view - } -compdef _git gdv=git-diff -alias gdt='git difftool' + +alias ga='git add' + +alias gb='git branch' +alias gba='git branch -a' +alias gbda='git branch --merged | command grep -vE "^(\*|\s*master\s*$)" | command xargs -n 1 git branch -d' +alias gbl='git blame -b -w' +alias gbnm='git branch --no-merged' +alias gbr='git branch --remote' +alias gbs='git bisect' +alias gbsb='git bisect bad' +alias gbsg='git bisect good' +alias gbsr='git bisect reset' +alias gbss='git bisect start' + alias gc='git commit -v' -compdef _git gc=git-commit alias gc!='git commit -v --amend' -compdef _git gc!=git-commit alias gca='git commit -v -a' -compdef _git gc=git-commit alias gca!='git commit -v -a --amend' -compdef _git gca!=git-commit +alias gcan!='git commit -v -a -s --no-edit --amend' +alias gcb='git checkout -b' +alias gcf='git config --list' +alias gcl='git clone --recursive' +alias gclean='git reset --hard && git clean -dfx' +alias gcm='git checkout master' alias gcmsg='git commit -m' -compdef _git gcmsg=git-commit alias gco='git checkout' -compdef _git gco=git-checkout -alias gcm='git checkout master' -alias gr='git remote' -compdef _git gr=git-remote -alias grv='git remote -v' -compdef _git grv=git-remote -alias grmv='git remote rename' -compdef _git grmv=git-remote -alias grrm='git remote remove' -compdef _git grrm=git-remote -alias grset='git remote set-url' -compdef _git grset=git-remote -alias grup='git remote update' -compdef _git grset=git-remote -alias grbi='git rebase -i' -compdef _git grbi=git-rebase -alias grbc='git rebase --continue' -compdef _git grbc=git-rebase -alias grba='git rebase --abort' -compdef _git grba=git-rebase -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' alias gcp='git cherry-pick' -compdef _git gcp=git-cherry-pick -alias glg='git log --stat --max-count=10' -compdef _git glg=git-log -alias glgg='git log --graph --max-count=10' -compdef _git glgg=git-log -alias glgga='git log --graph --decorate --all' -compdef _git glgga=git-log -alias glo='git log --oneline --decorate --color' -compdef _git glo=git-log -alias glog='git log --oneline --decorate --color --graph' -compdef _git glog=git-log -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 gaa='git add --all' -alias gm='git merge' -compdef _git gm=git-merge -alias grh='git reset HEAD' -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' +alias gd='git diff' +alias gdc='git diff --cached' +alias gdt='git diff-tree --no-commit-id --name-only -r' +gdv() { git diff -w "$@" | view - } +compdef _git gdv=git-diff +alias gdw='git diff --word-diff' -alias gpoat='git push origin --all && git push origin --tags' -alias gmt='git mergetool --no-prompt' -compdef _git gmt=git-mergetool +alias gf='git fetch' +alias gfa='git fetch --all --prune' +function gfg() { git ls-files | grep $@ } +compdef gfg=grep +alias gfo='git fetch origin' alias gg='git gui citool' alias gga='git gui citool --amend' -alias gk='gitk --all --branches' - -alias gsts='git stash show --text' -alias gsta='git stash' -alias gstp='git stash pop' -alias gstd='git stash drop' - -# Will cd into the top of the current repository -# or submodule. -alias grt='cd $(git rev-parse --show-toplevel || echo ".")' +ggf() { +[[ "$#" != 1 ]] && b="$(current_branch)" +git push --force origin "${b:=$1}" +} +compdef _git ggf=git-checkout +ggl() { +[[ "$#" != 1 ]] && b="$(current_branch)" +git pull origin "${b:=$1}" +} +compdef _git ggl=git-checkout +ggp() { +[[ "$#" != 1 ]] && b="$(current_branch)" +git push origin "${b:=$1}" +} +compdef _git ggp=git-checkout +ggpnp() { +ggl "$1" && ggp "$1" +} +compdef _git ggpnp=git-checkout +alias ggsup='git branch --set-upstream-to=origin/$(current_branch)' +ggu() { +[[ "$#" != 1 ]] && b="$(current_branch)" +git pull --rebase origin "${b:=$1}" +} +compdef _git ggu=git-checkout -# Git and svn mix +alias gignore='git update-index --assume-unchanged' +alias gignored='git ls-files -v | grep "^[[:lower:]]"' alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' compdef git-svn-dcommit-push=git -alias gsr='git svn rebase' -alias gsd='git svn dcommit' -# -# Will return the current branch name -# Usage example: git pull origin $(current_branch) -# -function current_branch() { - 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() { - 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) -} - -# these aliases take advantage of the previous function -alias ggpull='git pull origin $(current_branch)' -compdef ggpull=git -alias ggpur='git pull --rebase origin $(current_branch)' -compdef ggpur=git -alias ggpush='git push origin $(current_branch)' -compdef ggpush=git -alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)' -compdef ggpnp=git +alias gk='\gitk --all --branches' +compdef _git gk='gitk' +alias gke='\gitk --all $(git log -g --pretty=format:%h)' +compdef _git gke='gitk' -# Pretty log messages -function _git_log_prettily(){ - if ! [ -z $1 ]; then - git log --pretty=$1 - fi -} +alias gl='git pull' +alias glg='git log --stat --color' +alias glgp='git log --stat --color -p' +alias glgg='git log --graph --color' +alias glgga='git log --graph --decorate --all' +alias glgm='git log --graph --max-count=10' +alias glo='git log --oneline --decorate --color' +alias glol="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" +alias glola="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --all" +alias glog='git log --oneline --decorate --color --graph' alias glp="_git_log_prettily" compdef _git glp=git-log -# Work In Progress (wip) -# These features allow to pause a branch development and switch to another one (wip) -# When you want to go back to work, just unwip it -# -# This function return a warning if the current branch is a wip -function work_in_progress() { - if $(git log -n 1 2>/dev/null | grep -q -c "\-\-wip\-\-"); then - echo "WIP!!" - fi -} -# these alias commit and uncomit wip branches -alias gwip='git add -A; git ls-files --deleted -z | xargs -r0 git rm; git commit -m "--wip--"' -alias gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1' +alias gm='git merge' +alias gmom='git merge origin/master' +alias gmt='git mergetool --no-prompt' +alias gmtvim='git mergetool --no-prompt --tool=vimdiff' +alias gmum='git merge upstream/master' + +alias gp='git push' +alias gpd='git push --dry-run' +alias gpoat='git push origin --all && git push origin --tags' +compdef _git gpoat=git-push +alias gpu='git push upstream' +alias gpv='git push -v' + +alias gr='git remote' +alias gra='git remote add' +alias grb='git rebase' +alias grba='git rebase --abort' +alias grbc='git rebase --continue' +alias grbi='git rebase -i' +alias grbm='git rebase master' +alias grbs='git rebase --skip' +alias grh='git reset HEAD' +alias grhh='git reset HEAD --hard' +alias grmv='git remote rename' +alias grrm='git remote remove' +alias grset='git remote set-url' +alias grt='cd $(git rev-parse --show-toplevel || echo ".")' +alias gru='git reset --' +alias grup='git remote update' +alias grv='git remote -v' + +alias gsb='git status -sb' +alias gsd='git svn dcommit' +alias gsi='git submodule init' +alias gsps='git show --pretty=short --show-signature' +alias gsr='git svn rebase' +alias gss='git status -s' +alias gst='git status' +alias gsta='git stash' +alias gstaa='git stash apply' +alias gstd='git stash drop' +alias gstl='git stash list' +alias gstp='git stash pop' +alias gsts='git stash show --text' +alias gsu='git submodule update' + +alias gts='git tag -s' -# these alias ignore changes to file -alias gignore='git update-index --assume-unchanged' alias gunignore='git update-index --no-assume-unchanged' -# list temporarily ignored files -alias gignored='git ls-files -v | grep "^[[:lower:]]"' +alias gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1' +alias gup='git pull --rebase' +alias gupv='git pull --rebase -v' + +alias gvt='git verify-tag' + +alias gwch='git whatchanged -p --abbrev-commit --pretty=medium' +alias gwip='git add -A; git rm $(git ls-files --deleted); git commit -m "--wip--"' From 4d0aca48dace8cc4952aeb3c266837b993133a1c Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Sat, 9 May 2015 18:46:54 -0300 Subject: [PATCH 22/99] Differing upgrade and safe-upgrade Improving with "safe-upgrade" for aptitude and "upgrade" for apt-get --- plugins/debian/debian.plugin.zsh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh index 6e45e0521635..31a772d604be 100644 --- a/plugins/debian/debian.plugin.zsh +++ b/plugins/debian/debian.plugin.zsh @@ -9,8 +9,10 @@ # You can just set apt_pref='apt-get' to override it. if [[ -e $( which -p aptitude 2>&1 ) ]]; then apt_pref='aptitude' + apt_upgr='safe-upgrade' else apt_pref='apt-get' + apt_upgr='upgrade' fi # Use sudo by default if it's installed @@ -45,10 +47,10 @@ if [[ $use_sudo -eq 1 ]]; then alias abd='sudo $apt_pref build-dep' alias ac='sudo $apt_pref clean' alias ad='sudo $apt_pref update' - alias adg='sudo $apt_pref update && sudo $apt_pref upgrade' + alias adg='sudo $apt_pref update && sudo $apt_pref $apt_upgr' alias adu='sudo $apt_pref update && sudo $apt_pref dist-upgrade' alias afu='sudo apt-file update' - alias ag='sudo $apt_pref upgrade' + alias ag='sudo $apt_pref $apt_upgr' alias ai='sudo $apt_pref install' # Install all packages given on the command line while using only the first word of each line: # acs ... | ail @@ -80,10 +82,10 @@ else } alias ac='su -ls \'$apt_pref clean\' root' alias ad='su -lc \'$apt_pref update\' root' - alias adg='su -lc \'$apt_pref update && aptitude safe-upgrade\' root' + alias adg='su -lc \'$apt_pref update && aptitude $apt_upgr\' root' alias adu='su -lc \'$apt_pref update && aptitude dist-upgrade\' root' alias afu='su -lc "apt-file update"' - alias ag='su -lc \'$apt_pref safe-upgrade\' root' + alias ag='su -lc \'$apt_pref $apt_upgr\' root' ai() { cmd="su -lc 'aptitude -P install $@' root" print "$cmd" @@ -136,7 +138,7 @@ apt_pref_compdef abd "build-dep" apt_pref_compdef ac "clean" apt_pref_compdef ad "update" apt_pref_compdef afu "update" -apt_pref_compdef ag "upgrade" +apt_pref_compdef ag "$apt_upgr" apt_pref_compdef ai "install" apt_pref_compdef ail "install" apt_pref_compdef ap "purge" From 6504a2d386570213a3a1b1e9b371622b1f74ab2f Mon Sep 17 00:00:00 2001 From: Jad Bitar Date: Tue, 12 May 2015 13:23:05 -0400 Subject: [PATCH 23/99] Add CakePHP3 plugin --- plugins/cakephp3/cakephp3.plugin.zsh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 plugins/cakephp3/cakephp3.plugin.zsh diff --git a/plugins/cakephp3/cakephp3.plugin.zsh b/plugins/cakephp3/cakephp3.plugin.zsh new file mode 100644 index 000000000000..28d5af2ea5c1 --- /dev/null +++ b/plugins/cakephp3/cakephp3.plugin.zsh @@ -0,0 +1,19 @@ +# CakePHP 3 basic command completion +_cakephp3_get_command_list () { + cakephp3commands=($(bin/cake completion commands));printf "%s\n" "${cakephp3commands[@]}" +} + +_cakephp3 () { + if [ -f bin/cake ]; then + compadd `_cakephp3_get_command_list` + fi +} + +compdef _cakephp3 bin/cake +compdef _cakephp3 cake + +#Alias +alias c3='bin/cake' + +alias c3cache='bin/cake orm_cache clear' +alias c3migrate='bin/cake migrations migrate' From 7b478d75a3a0db466e78b6e46a0e468d64354618 Mon Sep 17 00:00:00 2001 From: epelletier Date: Thu, 21 May 2015 17:34:24 +0200 Subject: [PATCH 24/99] Detect the .venv in any parent directory of the current directory --- plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh index 5faa1a823aa7..b3a3b56d5b5f 100644 --- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh +++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh @@ -29,8 +29,11 @@ if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then if [ ! $WORKON_CWD ]; then WORKON_CWD=1 # Check if this is a Git repo - PROJECT_ROOT=`git rev-parse --show-toplevel 2> /dev/null` - if (( $? != 0 )); then + PROJECT_ROOT=`pwd` + while [[ "$PROJECT_ROOT" != "/" && ! -e "$PROJECT_ROOT/.venv" ]]; do + PROJECT_ROOT=`realpath $PROJECT_ROOT/..` + done + if [[ "$PROJECT_ROOT" == "/" ]]; then PROJECT_ROOT="." fi # Check for virtualenv name override From 743be91b207d4617e68b04a43311438652cec63d Mon Sep 17 00:00:00 2001 From: Xin Li Date: Thu, 21 May 2015 12:34:04 -0700 Subject: [PATCH 25/99] Don't leak extendedglob to global environment. --- plugins/history-substring-search/history-substring-search.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/history-substring-search/history-substring-search.zsh b/plugins/history-substring-search/history-substring-search.zsh index 22f03dd6d8bf..65f0750db5ac 100644 --- a/plugins/history-substring-search/history-substring-search.zsh +++ b/plugins/history-substring-search/history-substring-search.zsh @@ -175,7 +175,6 @@ fi # implementation details #----------------------------------------------------------------------------- -setopt extendedglob zmodload -F zsh/parameter # @@ -284,6 +283,7 @@ if [[ $+functions[_zsh_highlight] -eq 0 ]]; then fi function _history-substring-search-begin() { + setopt localoptions extendedglob _history_substring_search_move_cursor_eol=false _history_substring_search_query_highlight= @@ -350,6 +350,7 @@ function _history-substring-search-begin() { } function _history-substring-search-end() { + setopt localoptions extendedglob _history_substring_search_result=$BUFFER # move the cursor to the end of the command line From 0c8cb11d44d4ed4f458907cc19a0896416590587 Mon Sep 17 00:00:00 2001 From: GunfighterJ Date: Mon, 25 May 2015 16:02:26 -0500 Subject: [PATCH 26/99] Add sublime text 3 paths to check list --- plugins/sublime/sublime.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh index 38a7596fd918..ef76826cf7d2 100644 --- a/plugins/sublime/sublime.plugin.zsh +++ b/plugins/sublime/sublime.plugin.zsh @@ -8,6 +8,8 @@ if [[ $('uname') == 'Linux' ]]; then "/usr/bin/sublime_text" "/usr/local/bin/sublime_text" "/usr/bin/subl" + "/opt/sublime_text_3/sublime_text" + "/usr/bin/subl3" ) for _sublime_path in $_sublime_linux_paths; do if [[ -a $_sublime_path ]]; then From 7416018d1c51ae2ff008538c98e6f9b19b752bc5 Mon Sep 17 00:00:00 2001 From: Nicolas Brousse Date: Sun, 31 May 2015 19:34:01 +0200 Subject: [PATCH 27/99] Create new aliases for homebrew plugin --- plugins/brew/brew.plugin.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh index 42fb80c9a491..5b5847328bb6 100644 --- a/plugins/brew/brew.plugin.zsh +++ b/plugins/brew/brew.plugin.zsh @@ -1,2 +1,4 @@ alias brews='brew list -1' -alias bubu="brew update && brew upgrade && brew cleanup" +alias bubo='brew update && brew outdated' +alias bubc='brew upgrade && brew cleanup' +alias bubu='bubo && bubc' From 7f232f69fe8140a919759ea3b0811a71247f11e1 Mon Sep 17 00:00:00 2001 From: william Date: Tue, 2 Jun 2015 14:43:38 -0600 Subject: [PATCH 28/99] Respect $ZSH_CACHE_DIR when creating fasd's cache --- plugins/fasd/fasd.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/fasd/fasd.plugin.zsh b/plugins/fasd/fasd.plugin.zsh index 8ad43fc23301..472ab2b0f6b6 100644 --- a/plugins/fasd/fasd.plugin.zsh +++ b/plugins/fasd/fasd.plugin.zsh @@ -1,5 +1,5 @@ if [ $commands[fasd] ]; then # check if fasd is installed - fasd_cache="$HOME/.fasd-init-cache" + fasd_cache="${ZSH_CACHE_DIR}/fasd-init-cache" if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then fasd --init auto >| "$fasd_cache" fi From cc639287d2fbb3e5b032a70b2f5fb671ee9e95ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 28 Feb 2015 13:31:54 +0100 Subject: [PATCH 29/99] Round 3 of batch-closing obsolete issues From cffeefde903149df8ef48224fedf5205cb2497c3 Mon Sep 17 00:00:00 2001 From: Lucas Braun Date: Thu, 4 Jun 2015 11:00:21 -0400 Subject: [PATCH 30/99] Add installation instructions to README Update README formatting --- plugins/zeus/README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/plugins/zeus/README.md b/plugins/zeus/README.md index 8964eaaec664..451880049f19 100644 --- a/plugins/zeus/README.md +++ b/plugins/zeus/README.md @@ -42,12 +42,15 @@ * `zsw` aliases `rm .zeus.sock` * `zweep` aliases `rm .zeus.sock` -`zdbr` aliases `zeus rake db:reset db:test:prepare` -`zdbreset` aliases `zeus rake db:reset db:test:prepare` +* `zdbr` aliases `zeus rake db:reset db:test:prepare` +* `zdbreset` aliases `zeus rake db:reset db:test:prepare` -`zdbm` aliases `zeus rake db:migrate db:test:prepare` -`zdbmigrate` aliases `zeus rake db:migrate db:test:prepare` +* `zdbm` aliases `zeus rake db:migrate db:test:prepare` +* `zdbmigrate` aliases `zeus rake db:migrate db:test:prepare` -`zdbc` aliases `zeus rake db:create` +* `zdbc` aliases `zeus rake db:create` -`zdbcm` aliases `zeus rake db:create db:migrate db:test:prepare` +* `zdbcm` aliases `zeus rake db:create db:migrate db:test:prepare` + +## Installation +Add zeus to the plugins line of your `.zshconfig` file (e.g. `plugins=(rails git zeus)`) From 3a77433cea136ff9d9a383866f191f66169468c9 Mon Sep 17 00:00:00 2001 From: Manfred Touron Date: Tue, 9 Jun 2015 11:29:37 +0200 Subject: [PATCH 31/99] Add new boot2docker options --- plugins/boot2docker/_boot2docker | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/boot2docker/_boot2docker b/plugins/boot2docker/_boot2docker index baa08b26d89f..3116bd14c3e7 100644 --- a/plugins/boot2docker/_boot2docker +++ b/plugins/boot2docker/_boot2docker @@ -35,11 +35,14 @@ _1st_arguments=( _arguments \ '(--basevmdk)--basevmdk[Path to VMDK to use as base for persistent partition]' \ + '(--cpus)'{-c,--cpus}'[number of CPUs for boot2docker.]' \ + '(--clobber)--clobber[overwrite Docker client binary on boot2docker upgrade]' \ '(--dhcp)--dhcp[enable VirtualBox host-only network DHCP.]' \ '(--dhcpip)--dhcpip[VirtualBox host-only network DHCP server address.]' \ '(-s --disksize)'{-s,--disksize}'[boot2docker disk image size (in MB).]' \ '(--dockerport)--dockerport[host Docker port (forward to port 2376 in VM). (deprecated - use with care)]' \ '(--driver)--driver[hypervisor driver.]' \ + '(--force-upgrade-download)--force-upgrade-download[always download on boot2docker upgrade, never skip.]' \ '(--hostip)--hostip[VirtualBox host-only network IP address.]' \ '(--iso)--iso[path to boot2docker ISO image.]' \ '(--iso-url)--iso-url[/api.github.com/repos/boot2docker/boot2docker/releases": source URL to provision the boot2docker ISO image.]' \ From 5770ad51f963af7b75af03fabc691492137277ef Mon Sep 17 00:00:00 2001 From: Werner Buck Date: Tue, 9 Jun 2015 16:52:40 +0200 Subject: [PATCH 32/99] Set AWS_PROFILE and use existing RPROMPT --- plugins/aws/aws.plugin.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index 0ae18dd561f9..6d93d530da84 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -13,7 +13,8 @@ function agp { } function asp { export AWS_DEFAULT_PROFILE=$1 - export RPROMPT="" + export AWS_PROFILE=$1 + export RPROMPT="$RPROMPT" } function aws_profiles { reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/')) From b7d041c627ab9e40c08a51932afe2d61e840de09 Mon Sep 17 00:00:00 2001 From: Rodrigo Argumedo Date: Tue, 9 Jun 2015 13:41:34 -0600 Subject: [PATCH 33/99] Add rdrs method to reset the database(s) --- plugins/rails/rails.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh index 5ed96f8cddf6..d3b51d8af3a0 100644 --- a/plugins/rails/rails.plugin.zsh +++ b/plugins/rails/rails.plugin.zsh @@ -50,6 +50,7 @@ alias rdr='rake db:rollback' alias rdc='rake db:create' alias rds='rake db:seed' alias rdd='rake db:drop' +alias rdrs='rake db:reset' alias rdtc='rake db:test:clone' alias rdtp='rake db:test:prepare' alias rdmtc='rake db:migrate db:test:clone' From 6a1b8320fe9f087179c9ebf092bd17a782127d96 Mon Sep 17 00:00:00 2001 From: HeroCC Date: Mon, 20 Apr 2015 11:24:05 -0400 Subject: [PATCH 34/99] No input for Update Check defaults to Yes --- tools/check_for_upgrade.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index b2b356e0cb95..5afd83c1e18d 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -41,10 +41,9 @@ then then _upgrade_zsh else - echo "[Oh My Zsh] Would you like to check for updates?" - echo "Type Y to update oh-my-zsh: \c" + echo "[Oh My Zsh] Would you like to check for updates? [Y/n]: \c" read line - if [ "$line" = Y ] || [ "$line" = y ]; then + if [ "$line" = Y ] || [ "$line" = y ] || [ -z "$line" ]; then _upgrade_zsh else _update_zsh_update From a2f782e5f3fd3d65dfb34b7f22ec68234b2774a3 Mon Sep 17 00:00:00 2001 From: Alexandre Joly Date: Wed, 21 May 2014 09:55:26 +0200 Subject: [PATCH 35/99] updated the command list to the latest cocoapod version (0.33.0) version bumped --- plugins/pod/_pod | 273 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 248 insertions(+), 25 deletions(-) diff --git a/plugins/pod/_pod b/plugins/pod/_pod index 8c0f4460f732..eb7be52e9238 100644 --- a/plugins/pod/_pod +++ b/plugins/pod/_pod @@ -3,29 +3,31 @@ # ----------------------------------------------------------------------------- # FILE: _pod -# DESCRIPTION: Cocoapods (0.27.1) autocomplete plugin for Oh-My-Zsh +# DESCRIPTION: Cocoapods (0.33.0) autocomplete plugin for Oh-My-Zsh # http://cocoapods.org # AUTHOR: Alexandre Joly (alexandre.joly@mekanics.ch) # GITHUB: https://github.com/mekanics # TWITTER: @jolyAlexandre -# VERSION: 0.0.3 -# LICENSE: MIT +# VERSION: 0.0.4 # ----------------------------------------------------------------------------- local -a _1st_arguments _1st_arguments=( - 'help:Show help for the given command' - 'init:Generate a Podfile for the current directory' + 'help:Show help for the given command.' + 'init:Generate a Podfile for the current directory.' 'install:Install project dependencies' 'ipc:Inter-process communication' + 'lib:Develop pods' 'list:List pods' 'outdated:Show outdated project dependencies' - 'podfile-info:Shows information on installed Pods' - 'push:Push new specifications to a spec-repo' + 'plugins:Show available CocoaPods plugins' + 'push:Temporary alias for the `pod repo push` command' 'repo:Manage spec-repositories' 'search:Searches for pods' 'setup:Setup the CocoaPods environment' 'spec:Manage pod specs' + 'trunk:Interact with trunk.cocoapods.org' + 'try:Try a Pod!' 'update:Update outdated project dependencies' ) @@ -33,6 +35,7 @@ local -a _repo_arguments _repo_arguments=( 'add:Add a spec repo' 'lint:Validates all specs in a repo' + 'push:Push new specifications to a spec-repo' 'remove:Remove a spec repo.' 'update:Update a spec repo' ) @@ -51,24 +54,56 @@ _ipc_arguments=( 'list:Lists the specifications know to CocoaPods' 'podfile:Converts a Podfile to YAML' 'repl:The repl listens to commands on standard input' - 'spec:Converts a podspec to YAML' + 'spec:Converts a podspec to JSON' 'update-search-index:Updates the search index' ) +local -a _lib_arguments +_lib_arguments=( + 'create:Creates a new Pod' + 'lint:Validates a Pod' +) + +local -a _plugins_arguments +_plugins_arguments=( + 'create:Creates a new plugin' + 'list:List all known plugins' + 'search:Search for known plugins' +) + local -a _list_arguments _list_arguments=( 'new:Lists pods introduced in the master spec-repo since the last check' ) +local -a _trunk_arguments +_trunk_arguments=( + 'add-owner:Add an owner to a pod' + 'me:Display information about your sessions' + 'push:Publish a podspec' + 'register:Manage sessions' +) + +local -a _trunk_me_arguments +_trunk_me_arguments=( + 'clean-sessions:Remove sessions' +) + local -a _inherited_options _inherited_options=( '(--silent)--silent[Show nothing]' \ - '(--version)--version[Show the version of CocoaPods]' \ - '(--no-color)--no-color[Show output without color]' \ '(--verbose)--verbose[Show more debugging information]' \ + '(--no-ansi)--no-ansi[Show output without ANSI codes]' \ '(--help)--help[Show help banner of specified command]' ) +local -a _root_options +_root_options=( + '(--version)--version[Show the version of CocoaPods]' \ + '(--completion-script)--completion-script[Print the auto-completion script]' + +) + local -a _install_options _install_options=( '(--no-clean)--no-clean[Leave SCM dirs like `.git` and `.svn` intact after downloading]' \ @@ -76,6 +111,15 @@ _install_options=( '(--no-repo-update)--no-repo-update[Skip running `pod repo update` before install]' ) +local -a _lib_lint_options +_lib_lint_options=( + '(--quick)--quick[Lint skips checks that would require to download and build the spec]' \ + '(--only-errors)--only-errors[Lint validates even if warnings are present]' \ + '(--subspec=NAME)--subspec=[Lint validates only the given subspec]' \ + '(--no-subspecs)--no-subspecs[Lint skips validation of subspecs]' \ + '(--no-clean)--no-clean[Lint leaves the build directory intact for inspection]' +) + local -a _update_options _update_options=( '(--no-clean)--no-clean[Leave SCM dirs like `.git` and `.svn intact after downloading]' \ @@ -93,7 +137,8 @@ _search_options=( '(--full)--full[Search by name, summary, and description]' \ '(--stats)--stats[Show additional stats (like GitHub watchers and forks)]' \ '(--ios)--ios[Restricts the search to Pods supported on iOS]' \ - '(--osx)--osx[Restricts the search to Pods supported on OS X]' + '(--osx)--osx[Restricts the search to Pods supported on OS X]' \ + '(--web)--web[Searches on cocoapods.org]' ) local -a _list_options @@ -101,20 +146,23 @@ _list_options=( '(--update)--update[Run `pod repo update` before listing]' ) -local -a _podfile_info_options -_podfile_info_options=( - '(--all)--all[Show information about all Pods with dependencies that are used in a project]' \ - '(--md)--md[Output information in Markdown format]' \ - '*:script or directory:_files' +local -a _plugins_search_options +_plugins_search_options=( + '(--full)--full[Search by name, author, and description]' ) -local -a _push_options -_push_options=( +local -a _repo_push_options +_repo_push_options=( '(--allow-warnings)--allow-warnings[Allows pushing even if there are warnings]' \ '(--local-only)--local-only[Does not perform the step of pushing REPO to its remote]' \ '*:script or directory:_files' ) +local -a _repo_add_options +_repo_add_options=( + '(--shallow)--shallow[Create a shallow clone (fast clone, but no push capabilities)]' +) + local -a _repo_lint_options _repo_lint_options=( '(--only-errors)--only-errors[Lint presents only the errors]' @@ -122,6 +170,7 @@ _repo_lint_options=( local -a _setup_options _setup_options=( + '(--no-shallow)--no-shallow[Clone full history so push will work]' '(--push)--push[Use this option to enable push access once granted]' ) @@ -129,6 +178,8 @@ local -a _spec_lint_options _spec_lint_options=( '(--quick)--quick[Lint skips checks that would require to download and build the spec]' \ '(--only-errors)--only-errors[Lint validates even if warnings are present]' \ + '(--subspec=NAME)--subspec=[Lint validates only the given subspec]' \ + '(--no-subspecs)--no-subspecs[Lint skips validation of subspecs]' \ '(--no-clean)--no-clean[Lint leaves the build directory intact for inspection]' \ '*:script or directory:_files' ) @@ -148,6 +199,11 @@ _spec_edit_options=( '(--show-all)--show-all[Pick which spec to edit from all available versions of the given podspec]' ) +local -a _trunk_register_options +_trunk_register_options=( + '(--description=DESCRIPTION)--description=[An arbitrary description to easily identify your session later on.]' +) + __first_command_list () { @@ -192,9 +248,17 @@ __pod-repo() { ':feature:__repo_list' ;; + (push) + _arguments \ + $_inherited_options \ + $_repo_push_options \ + ':feature:__repo_list' + ;; + (add) _arguments \ - $_inherited_options + $_inherited_options \ + $_repo_add_options (remove) _arguments \ @@ -211,6 +275,7 @@ __pod-spec() { typeset -A opt_args _arguments -C \ + $_inherited_options \ ':command:->command' \ '*::options:->options' @@ -278,6 +343,145 @@ __pod-ipc() { esac } +__pod-lib() { + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + _describe -t commands "pod lib" _lib_arguments + return + ;; + + (options) + case $line[1] in + (create) + _arguments \ + $_inherited_options + ;; + + (lint) + _arguments \ + $_inherited_options \ + $_lib_lint_options + ;; + esac + return + ;; + esac +} + +__pod-plugins() { + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + $_inherited_options \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + _describe -t commands "pod plugins" _plugins_arguments + return + ;; + + (options) + case $line[1] in + (create) + _arguments \ + $_inherited_options + ;; + + (list) + _arguments \ + $_inherited_options + ;; + + (search) + _arguments \ + $_inherited_options \ + $_plugins_search_options + ;; + esac + return + ;; + esac +} + +__pod-trunk() { + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + $_inherited_options \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + _describe -t commands "pod trunk" _trunk_arguments + return + ;; + + (options) + case $line[1] in + (add-owner) + _arguments \ + $_inherited_options + ;; + + (me) + __pod-trunk-me + ;; + + (push) + _arguments \ + $_inherited_options + ;; + + (register) + _arguments \ + $_inherited_options \ + $_trunk_register_options + ;; + esac + return + ;; + esac +} + +__pod-trunk-me() { + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + $_inherited_options \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + _describe -t commands "pod trunk me" _trunk_me_arguments + return + ;; + + (options) + case $line[1] in + (clean-sessions) + _arguments \ + $_inherited_options + ;; + esac + return + ;; + esac +} + __pod-list() { local curcontext="$curcontext" state line typeset -A opt_args @@ -314,6 +518,9 @@ _arguments -C \ case $state in (command) _describe -t commands "pod" _1st_arguments + _arguments \ + $_inherited_options \ + $_root_options return ;; @@ -325,10 +532,15 @@ case $state in ':help:__first_command_list' ;; + (init) + _arguments \ + $_inherited_options + ;; + (push) _arguments \ $_inherited_options \ - $_push_options \ + $_repo_push_options \ ':repo:__repo_list' ;; @@ -344,6 +556,10 @@ case $state in __pod-ipc ;; + (lib) + __pod-lib + ;; + (list) __pod-list ;; @@ -366,16 +582,23 @@ case $state in $_outdated_options ;; - (search) + (plugins) + __pod-plugins + ;; + + (trunk) + __pod-trunk + ;; + + (try) _arguments \ - $_inherited_options \ - $_search_options + $_inherited_options ;; - (podfile-info) + (search) _arguments \ $_inherited_options \ - $_podfile_info_options + $_search_options ;; (setup) From d686f8a8d0aa4ee42be6a9663c05374344e2c649 Mon Sep 17 00:00:00 2001 From: Alexandre Joly Date: Wed, 28 May 2014 16:16:30 +0200 Subject: [PATCH 36/99] generate with 'pod --completion-script' /cc thx to @ajmccall version bumped --- plugins/pod/_pod | 1246 ++++++++++++++++++++++++---------------------- 1 file changed, 658 insertions(+), 588 deletions(-) diff --git a/plugins/pod/_pod b/plugins/pod/_pod index eb7be52e9238..508a47102746 100644 --- a/plugins/pod/_pod +++ b/plugins/pod/_pod @@ -1,612 +1,682 @@ #compdef pod #autoload +# setopt XTRACE VERBOSE +# vim: ft=zsh sw=2 ts=2 et + # ----------------------------------------------------------------------------- # FILE: _pod -# DESCRIPTION: Cocoapods (0.33.0) autocomplete plugin for Oh-My-Zsh +# DESCRIPTION: Cocoapods (0.33.1) autocomplete plugin for Oh-My-Zsh # http://cocoapods.org +# Generated with `pod --completion-script # AUTHOR: Alexandre Joly (alexandre.joly@mekanics.ch) # GITHUB: https://github.com/mekanics # TWITTER: @jolyAlexandre -# VERSION: 0.0.4 +# VERSION: 0.0.5 # ----------------------------------------------------------------------------- -local -a _1st_arguments -_1st_arguments=( - 'help:Show help for the given command.' - 'init:Generate a Podfile for the current directory.' - 'install:Install project dependencies' - 'ipc:Inter-process communication' - 'lib:Develop pods' - 'list:List pods' - 'outdated:Show outdated project dependencies' - 'plugins:Show available CocoaPods plugins' - 'push:Temporary alias for the `pod repo push` command' - 'repo:Manage spec-repositories' - 'search:Searches for pods' - 'setup:Setup the CocoaPods environment' - 'spec:Manage pod specs' - 'trunk:Interact with trunk.cocoapods.org' - 'try:Try a Pod!' - 'update:Update outdated project dependencies' -) - -local -a _repo_arguments -_repo_arguments=( - 'add:Add a spec repo' - 'lint:Validates all specs in a repo' - 'push:Push new specifications to a spec-repo' - 'remove:Remove a spec repo.' - 'update:Update a spec repo' -) - -local -a _spec_arguments -_spec_arguments=( - 'cat:Prints a spec file' - 'create:Create spec file stub' - 'edit:Edit a spec file' - 'lint:Validates a spec file' - 'which:Prints the path of the given spec' -) - -local -a _ipc_arguments -_ipc_arguments=( - 'list:Lists the specifications know to CocoaPods' - 'podfile:Converts a Podfile to YAML' - 'repl:The repl listens to commands on standard input' - 'spec:Converts a podspec to JSON' - 'update-search-index:Updates the search index' -) - -local -a _lib_arguments -_lib_arguments=( - 'create:Creates a new Pod' - 'lint:Validates a Pod' -) - -local -a _plugins_arguments -_plugins_arguments=( - 'create:Creates a new plugin' - 'list:List all known plugins' - 'search:Search for known plugins' -) - -local -a _list_arguments -_list_arguments=( - 'new:Lists pods introduced in the master spec-repo since the last check' -) - -local -a _trunk_arguments -_trunk_arguments=( - 'add-owner:Add an owner to a pod' - 'me:Display information about your sessions' - 'push:Publish a podspec' - 'register:Manage sessions' -) - -local -a _trunk_me_arguments -_trunk_me_arguments=( - 'clean-sessions:Remove sessions' -) - -local -a _inherited_options -_inherited_options=( - '(--silent)--silent[Show nothing]' \ - '(--verbose)--verbose[Show more debugging information]' \ - '(--no-ansi)--no-ansi[Show output without ANSI codes]' \ - '(--help)--help[Show help banner of specified command]' -) - -local -a _root_options -_root_options=( - '(--version)--version[Show the version of CocoaPods]' \ - '(--completion-script)--completion-script[Print the auto-completion script]' - -) - -local -a _install_options -_install_options=( - '(--no-clean)--no-clean[Leave SCM dirs like `.git` and `.svn` intact after downloading]' \ - '(--no-integrate)--no-integrate[Skip integration of the Pods libraries in the Xcode project(s)]' \ - '(--no-repo-update)--no-repo-update[Skip running `pod repo update` before install]' -) - -local -a _lib_lint_options -_lib_lint_options=( - '(--quick)--quick[Lint skips checks that would require to download and build the spec]' \ - '(--only-errors)--only-errors[Lint validates even if warnings are present]' \ - '(--subspec=NAME)--subspec=[Lint validates only the given subspec]' \ - '(--no-subspecs)--no-subspecs[Lint skips validation of subspecs]' \ - '(--no-clean)--no-clean[Lint leaves the build directory intact for inspection]' -) - -local -a _update_options -_update_options=( - '(--no-clean)--no-clean[Leave SCM dirs like `.git` and `.svn intact after downloading]' \ - '(--no-integrate)--no-integrate[Skip integration of the Pods libraries in the Xcode project(s)]' \ - '(--no-repo-update)--no-repo-update[Skip running `pod repo update before install]' -) - -local -a _outdated_options -_outdated_options=( - '(--no-repo-update)--no-repo-update[Skip running `pod repo update` before install]' -) - -local -a _search_options -_search_options=( - '(--full)--full[Search by name, summary, and description]' \ - '(--stats)--stats[Show additional stats (like GitHub watchers and forks)]' \ - '(--ios)--ios[Restricts the search to Pods supported on iOS]' \ - '(--osx)--osx[Restricts the search to Pods supported on OS X]' \ - '(--web)--web[Searches on cocoapods.org]' -) - -local -a _list_options -_list_options=( - '(--update)--update[Run `pod repo update` before listing]' -) - -local -a _plugins_search_options -_plugins_search_options=( - '(--full)--full[Search by name, author, and description]' -) - -local -a _repo_push_options -_repo_push_options=( - '(--allow-warnings)--allow-warnings[Allows pushing even if there are warnings]' \ - '(--local-only)--local-only[Does not perform the step of pushing REPO to its remote]' \ - '*:script or directory:_files' -) - -local -a _repo_add_options -_repo_add_options=( - '(--shallow)--shallow[Create a shallow clone (fast clone, but no push capabilities)]' -) - -local -a _repo_lint_options -_repo_lint_options=( - '(--only-errors)--only-errors[Lint presents only the errors]' -) - -local -a _setup_options -_setup_options=( - '(--no-shallow)--no-shallow[Clone full history so push will work]' - '(--push)--push[Use this option to enable push access once granted]' -) - -local -a _spec_lint_options -_spec_lint_options=( - '(--quick)--quick[Lint skips checks that would require to download and build the spec]' \ - '(--only-errors)--only-errors[Lint validates even if warnings are present]' \ - '(--subspec=NAME)--subspec=[Lint validates only the given subspec]' \ - '(--no-subspecs)--no-subspecs[Lint skips validation of subspecs]' \ - '(--no-clean)--no-clean[Lint leaves the build directory intact for inspection]' \ - '*:script or directory:_files' -) - -local -a _spec_cat_options -_spec_cat_options=( - '(--show-all)--show-all[Pick from all versions of the given podspec]' -) - -local -a _spec_which_options -_spec_which_options=( - '(--show-all)--show-all[Print all versions of the given podspec]' -) - -local -a _spec_edit_options -_spec_edit_options=( - '(--show-all)--show-all[Pick which spec to edit from all available versions of the given podspec]' -) - -local -a _trunk_register_options -_trunk_register_options=( - '(--description=DESCRIPTION)--description=[An arbitrary description to easily identify your session later on.]' -) - - -__first_command_list () -{ - local expl - declare -a tasks - - tasks=(install ipc list outdated podfile-info push repo search setup spec update) - - _wanted tasks expl 'help' compadd $tasks -} - -__repo_list() { - _wanted application expl 'repo' compadd $(command ls -1 ~/.cocoapods/repos 2>/dev/null | sed -e 's/ /\\ /g') -} - -__pod-repo() { - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - _describe -t commands "pod repo" _repo_arguments - return - ;; - - (options) - case $line[1] in - (lint) - _arguments \ - $_inherited_options \ - $_repo_lint_options \ - ':feature:__repo_list' - ;; - - (update) - _arguments \ - $_inherited_options \ - ':feature:__repo_list' - ;; - - (push) - _arguments \ - $_inherited_options \ - $_repo_push_options \ - ':feature:__repo_list' - ;; - - (add) - _arguments \ - $_inherited_options \ - $_repo_add_options - - (remove) - _arguments \ - $_inherited_options \ - ':feature:__repo_list' - ;; - esac - ;; +local -a _subcommands +local -a _options + +case "$words[2]" in + help) + case "$words[3]" in + *) # pod help + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod help options" _options + ;; esac -} - -__pod-spec() { - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - $_inherited_options \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - _describe -t commands "pod spec" _spec_arguments - return - ;; - - (options) - case $line[1] in - (create) - _arguments \ - $_inherited_options - ;; - - (lint) - _arguments \ - $_inherited_options \ - $_spec_lint_options - ;; - - (cat) - _arguments \ - $_inherited_options \ - $_spec_cat_options - ;; - - (which) - _arguments \ - $_inherited_options \ - $_spec_which_options - ;; - - (edit) - _arguments \ - $_inherited_options \ - $_spec_edit_options - ;; - esac - return - ;; + ;; + ipc) + case "$words[3]" in + list) + case "$words[4]" in + *) # pod ipc list + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod ipc list options" _options + ;; + esac + ;; + podfile) + case "$words[4]" in + *) # pod ipc podfile + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod ipc podfile options" _options + ;; + esac + ;; + repl) + case "$words[4]" in + *) # pod ipc repl + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod ipc repl options" _options + ;; + esac + ;; + spec) + case "$words[4]" in + *) # pod ipc spec + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod ipc spec options" _options + ;; + esac + ;; + update-search-index) + case "$words[4]" in + *) # pod ipc update-search-index + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod ipc update-search-index options" _options + ;; + esac + ;; + *) # pod ipc + _subcommands=( + "list:Lists the specifications known to CocoaPods." + "podfile:Converts a Podfile to YAML." + "repl:The repl listens to commands on standard input." + "spec:Converts a podspec to JSON." + "update-search-index:Updates the search index." + ) + _describe -t commands "pod ipc subcommands" _subcommands + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod ipc options" _options + ;; esac -} - -__pod-ipc() { - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - _describe -t commands "pod ipc" _ipc_arguments - return - ;; - - (options) - _arguments -C \ - $_inherited_options - return - ;; + ;; + init) + case "$words[3]" in + *) # pod init + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod init options" _options + ;; esac -} - -__pod-lib() { - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - _describe -t commands "pod lib" _lib_arguments - return - ;; - - (options) - case $line[1] in - (create) - _arguments \ - $_inherited_options - ;; - - (lint) - _arguments \ - $_inherited_options \ - $_lib_lint_options - ;; - esac - return - ;; + ;; + install) + case "$words[3]" in + *) # pod install + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--no-clean:Leave SCM dirs like \`.git\` and \`.svn\` intact after downloading" + "--no-integrate:Skip integration of the Pods libraries in the Xcode project(s)" + "--no-repo-update:Skip running \`pod repo update\` before install" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod install options" _options + ;; esac -} - -__pod-plugins() { - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - $_inherited_options \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - _describe -t commands "pod plugins" _plugins_arguments - return - ;; - - (options) - case $line[1] in - (create) - _arguments \ - $_inherited_options - ;; - - (list) - _arguments \ - $_inherited_options - ;; - - (search) - _arguments \ - $_inherited_options \ - $_plugins_search_options - ;; - esac - return - ;; + ;; + lib) + case "$words[3]" in + create) + case "$words[4]" in + *) # pod lib create + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod lib create options" _options + ;; + esac + ;; + lint) + case "$words[4]" in + *) # pod lib lint + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--no-clean:Lint leaves the build directory intact for inspection" + "--no-subspecs:Lint skips validation of subspecs" + "--only-errors:Lint validates even if warnings are present" + "--quick:Lint skips checks that would require to download and build the spec" + "--silent:Show nothing" + "--subspec=NAME:Lint validates only the given subspec" + "--verbose:Show more debugging information" + ) + _describe -t options "pod lib lint options" _options + ;; + esac + ;; + *) # pod lib + _subcommands=( + "create:Creates a new Pod" + "lint:Validates a Pod" + ) + _describe -t commands "pod lib subcommands" _subcommands + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod lib options" _options + ;; esac -} - -__pod-trunk() { - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - $_inherited_options \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - _describe -t commands "pod trunk" _trunk_arguments - return - ;; - - (options) - case $line[1] in - (add-owner) - _arguments \ - $_inherited_options - ;; - - (me) - __pod-trunk-me - ;; - - (push) - _arguments \ - $_inherited_options - ;; - - (register) - _arguments \ - $_inherited_options \ - $_trunk_register_options - ;; - esac - return - ;; + ;; + list) + case "$words[3]" in + new) + case "$words[4]" in + *) # pod list new + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--update:Run \`pod repo update\` before listing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod list new options" _options + ;; + esac + ;; + *) # pod list + _subcommands=( + "new:Lists pods introduced in the master spec-repo since the last check" + ) + _describe -t commands "pod list subcommands" _subcommands + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--update:Run \`pod repo update\` before listing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod list options" _options + ;; esac -} - -__pod-trunk-me() { - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - $_inherited_options \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - _describe -t commands "pod trunk me" _trunk_me_arguments - return - ;; - - (options) - case $line[1] in - (clean-sessions) - _arguments \ - $_inherited_options - ;; + ;; + outdated) + case "$words[3]" in + *) # pod outdated + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--no-repo-update:Skip running \`pod repo update\` before install" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod outdated options" _options + ;; + esac + ;; + plugins) + case "$words[3]" in + create) + case "$words[4]" in + *) # pod plugins create + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod plugins create options" _options + ;; + esac + ;; + list) + case "$words[4]" in + *) # pod plugins list + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--verbose:Show more debugging information" + ) + _describe -t options "pod plugins list options" _options + ;; + esac + ;; + search) + case "$words[4]" in + *) # pod plugins search + _options=( + "--full:Search by name, author, and description" + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--verbose:Show more debugging information" + ) + _describe -t options "pod plugins search options" _options + ;; + esac + ;; + *) # pod plugins + _subcommands=( + "create:Creates a new plugin" + "list:List all known plugins" + "search:Search for known plugins" + ) + _describe -t commands "pod plugins subcommands" _subcommands + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod plugins options" _options + ;; + esac + ;; + push) + case "$words[3]" in + *) # pod push + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod push options" _options + ;; + esac + ;; + repo) + case "$words[3]" in + add) + case "$words[4]" in + *) # pod repo add + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--shallow:Create a shallow clone (fast clone, but no push capabilities)" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod repo add options" _options + ;; + esac + ;; + lint) + case "$words[4]" in + *) # pod repo lint + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--only-errors:Lint presents only the errors" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod repo lint options" _options + ;; + esac + ;; + push) + case "$words[4]" in + *) # pod repo push + _options=( + "--allow-warnings:Allows pushing even if there are warnings" + "--help:Show help banner of specified command" + "--local-only:Does not perform the step of pushing REPO to its remote" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod repo push options" _options + ;; + esac + ;; + remove) + case "$words[4]" in + *) # pod repo remove + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod repo remove options" _options + ;; + esac + ;; + update) + case "$words[4]" in + *) # pod repo update + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod repo update options" _options + ;; + esac + ;; + *) # pod repo + _subcommands=( + "add:Add a spec repo." + "lint:Validates all specs in a repo." + "push:Push new specifications to a spec-repo" + "remove:Remove a spec repo" + "update:Update a spec repo." + ) + _describe -t commands "pod repo subcommands" _subcommands + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod repo options" _options + ;; + esac + ;; + search) + case "$words[3]" in + *) # pod search + _options=( + "--full:Search by name, summary, and description" + "--help:Show help banner of specified command" + "--ios:Restricts the search to Pods supported on iOS" + "--no-ansi:Show output without ANSI codes" + "--osx:Restricts the search to Pods supported on OS X" + "--stats:Show additional stats (like GitHub watchers and forks)" + "--verbose:Show more debugging information" + "--web:Searches on cocoapods.org" + ) + _describe -t options "pod search options" _options + ;; + esac + ;; + setup) + case "$words[3]" in + *) # pod setup + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--no-shallow:Clone full history so push will work" + "--push:Use this option to enable push access once granted" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod setup options" _options + ;; + esac + ;; + spec) + case "$words[3]" in + cat) + case "$words[4]" in + *) # pod spec cat + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--show-all:Pick from all versions of the given podspec" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod spec cat options" _options + ;; + esac + ;; + create) + case "$words[4]" in + *) # pod spec create + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod spec create options" _options + ;; + esac + ;; + edit) + case "$words[4]" in + *) # pod spec edit + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--show-all:Pick which spec to edit from all available versions of the given podspec" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod spec edit options" _options + ;; + esac + ;; + lint) + case "$words[4]" in + *) # pod spec lint + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--no-clean:Lint leaves the build directory intact for inspection" + "--no-subspecs:Lint skips validation of subspecs" + "--only-errors:Lint validates even if warnings are present" + "--quick:Lint skips checks that would require to download and build the spec" + "--silent:Show nothing" + "--subspec=NAME:Lint validates only the given subspec" + "--verbose:Show more debugging information" + ) + _describe -t options "pod spec lint options" _options + ;; + esac + ;; + which) + case "$words[4]" in + *) # pod spec which + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--show-all:Print all versions of the given podspec" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod spec which options" _options + ;; + esac + ;; + *) # pod spec + _subcommands=( + "cat:Prints a spec file." + "create:Create spec file stub." + "edit:Edit a spec file." + "lint:Validates a spec file." + "which:Prints the path of the given spec." + ) + _describe -t commands "pod spec subcommands" _subcommands + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod spec options" _options + ;; + esac + ;; + trunk) + case "$words[3]" in + add-owner) + case "$words[4]" in + *) # pod trunk add-owner + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod trunk add-owner options" _options + ;; + esac + ;; + me) + case "$words[4]" in + clean-sessions) + case "$words[5]" in + *) # pod trunk me clean-sessions + _options=( + "--all:Removes all your sessions, except for the current one" + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod trunk me clean-sessions options" _options + ;; esac - return - ;; + ;; + *) # pod trunk me + _subcommands=( + "clean-sessions:Remove sessions" + ) + _describe -t commands "pod trunk me subcommands" _subcommands + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod trunk me options" _options + ;; + esac + ;; + push) + case "$words[4]" in + *) # pod trunk push + _options=( + "--allow-warnings:Allows push even if there are lint warnings" + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod trunk push options" _options + ;; + esac + ;; + register) + case "$words[4]" in + *) # pod trunk register + _options=( + "--description=DESCRIPTION:An arbitrary description to easily identify your session later on." + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod trunk register options" _options + ;; + esac + ;; + *) # pod trunk + _subcommands=( + "add-owner:Add an owner to a pod" + "me:Display information about your sessions" + "push:Publish a podspec" + "register:Manage sessions" + ) + _describe -t commands "pod trunk subcommands" _subcommands + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod trunk options" _options + ;; esac -} - -__pod-list() { - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - $_inherited_options \ - $_list_options \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - _describe -t commands "pod list" _list_arguments - return - ;; - - (options) - _arguments -C \ - $_inherited_options \ - $_list_options - return - ;; + ;; + try) + case "$words[3]" in + *) # pod try + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod try options" _options + ;; esac -} - -local curcontext="$curcontext" state line -typeset -A opt_args - -_arguments -C \ - $_inherited_options \ - ':command:->command' \ - '*::options:->options' - -case $state in - (command) - _describe -t commands "pod" _1st_arguments - _arguments \ - $_inherited_options \ - $_root_options - return ;; - - (options) - case $line[1] in - (help) - _arguments \ - $_inherited_options \ - ':help:__first_command_list' - ;; - - (init) - _arguments \ - $_inherited_options - ;; - - (push) - _arguments \ - $_inherited_options \ - $_repo_push_options \ - ':repo:__repo_list' - ;; - - (repo) - __pod-repo - ;; - - (spec) - __pod-spec - ;; - - (ipc) - __pod-ipc - ;; - - (lib) - __pod-lib - ;; - - (list) - __pod-list - ;; - - (install) - _arguments \ - $_inherited_options \ - $_install_options - ;; - - (update) - _arguments \ - $_inherited_options \ - $_update_options - ;; - - (outdated) - _arguments \ - $_inherited_options \ - $_outdated_options - ;; - - (plugins) - __pod-plugins - ;; - - (trunk) - __pod-trunk - ;; - - (try) - _arguments \ - $_inherited_options - ;; - - (search) - _arguments \ - $_inherited_options \ - $_search_options - ;; - - (setup) - _arguments \ - $_inherited_options \ - $_setup_options - ;; - + update) + case "$words[3]" in + *) # pod update + _options=( + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--no-clean:Leave SCM dirs like \`.git\` and \`.svn\` intact after downloading" + "--no-integrate:Skip integration of the Pods libraries in the Xcode project(s)" + "--no-repo-update:Skip running \`pod repo update\` before install" + "--silent:Show nothing" + "--verbose:Show more debugging information" + ) + _describe -t options "pod update options" _options + ;; esac ;; + *) # pod + _subcommands=( + "help:Show help for the given command." + "ipc:Inter-process communication" + "init:Generate a Podfile for the current directory." + "install:Install project dependencies" + "lib:Develop pods" + "list:List pods" + "outdated:Show outdated project dependencies" + "plugins:Show available CocoaPods plugins" + "push:Temporary alias for the \`pod repo push\` command" + "repo:Manage spec-repositories" + "search:Searches for pods" + "setup:Setup the CocoaPods environment" + "spec:Manage pod specs" + "trunk:Interact with the CocoaPods API (e.g. publishing new specs)" + "try:Try a Pod!" + "update:Update outdated project dependencies" + ) + _describe -t commands "pod subcommands" _subcommands + _options=( + "--completion-script:Print the auto-completion script" + "--help:Show help banner of specified command" + "--no-ansi:Show output without ANSI codes" + "--silent:Show nothing" + "--verbose:Show more debugging information" + "--version:Show the version of the tool" + ) + _describe -t options "pod options" _options + ;; esac From a98501d2ce76152f1601aad0d2be23fcda230c0a Mon Sep 17 00:00:00 2001 From: Mark Mendoza Date: Mon, 20 Apr 2015 01:29:16 -0700 Subject: [PATCH 37/99] Grep bug in Agnoster --- themes/agnoster.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 8c7be6e0123e..b8d0b5872230 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -126,7 +126,7 @@ prompt_hg() { if `hg st | grep -q "^\?"`; then prompt_segment red black st='±' - elif `hg st | grep -q "^(M|A)"`; then + elif `hg st | grep -q "^[MA]"`; then prompt_segment yellow black st='±' else From 3cc3084f5fadcd9fedb5f633e2e207e8150e9451 Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Wed, 18 Mar 2015 01:02:09 -0400 Subject: [PATCH 38/99] Fix typo in $VCS_CLEAN_COLOR in adben theme --- themes/adben.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/adben.zsh-theme b/themes/adben.zsh-theme index 212b823a5c95..e4774cf0ed9d 100644 --- a/themes/adben.zsh-theme +++ b/themes/adben.zsh-theme @@ -42,7 +42,7 @@ GREEN_BASE_START="${PR_RESET}${PR_GREY}>${PR_RESET}${PR_GREEN}>${PR_BRIGHT_GREEN GREEN_START_P1="${PR_RESET}${GREEN_BASE_START}${PR_RESET} " DIVISION="${PR_RESET}${PR_RED} < ${PR_RESET}" VCS_DIRTY_COLOR="${PR_RESET}${PR_YELLOW}" -Vcs_CLEAN_COLOR="${PR_RESET}${PR_GREEN}" +VCS_CLEAN_COLOR="${PR_RESET}${PR_GREEN}" VCS_SUFIX_COLOR="${PR_RESET}${PR_RED}› ${PR_RESET}" # ########## COLOR ########### # ########## SVN ########### From 45e3f623cc5c80eff68449a7db66829bc08d9a18 Mon Sep 17 00:00:00 2001 From: liuxiang Date: Wed, 25 Feb 2015 10:45:13 +0800 Subject: [PATCH 39/99] Add README for httpie plugin --- plugins/httpie/README.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 plugins/httpie/README.md diff --git a/plugins/httpie/README.md b/plugins/httpie/README.md new file mode 100644 index 000000000000..1d4ec48bdb90 --- /dev/null +++ b/plugins/httpie/README.md @@ -0,0 +1,6 @@ +## HTTPie +**Maintainer:** [lululau](https://github.com/lululau) + +This plugin adds completion for HTTPie, which is a command line HTTP client, a user-friendly cURL replacement. + +[HTTPie Homepage](http://httpie.org) From 729b19c0852b7efe7d9c63e08b676883794b90ec Mon Sep 17 00:00:00 2001 From: Wayne Date: Sun, 26 Apr 2015 03:52:00 +0800 Subject: [PATCH 40/99] Remove docker insert command Remove the docker insert command of autocomplete --- plugins/docker/_docker | 8 -------- 1 file changed, 8 deletions(-) diff --git a/plugins/docker/_docker b/plugins/docker/_docker index fd459a0cac85..e95a22bfd453 100644 --- a/plugins/docker/_docker +++ b/plugins/docker/_docker @@ -100,11 +100,6 @@ __info() { # no arguments } -__insert() { - __docker_images - _arguments '*:files:_files' -} - __inspect() { __docker_images __docker_all_containers @@ -278,7 +273,6 @@ _1st_arguments=( "images":"List images" "import":"Create a new filesystem image from the contents of a tarball" "info":"Display system-wide information" - "insert":"Insert a file in an image" "inspect":"Return low-level information on a container" "kill":"Kill a running container" "load":"Load an image from a tar archive" @@ -335,8 +329,6 @@ case "$words[1]" in __import ;; info) __info ;; - insert) - __insert ;; inspect) __inspect ;; kill) From de56943a0ee120fdc0ba9f2c3929f8bb1742e3b4 Mon Sep 17 00:00:00 2001 From: Samuel Parkinson Date: Wed, 2 Jul 2014 18:22:32 +0100 Subject: [PATCH 41/99] Improved the `_git_time_since_commit` function. Check for at least one commit using a `git log` limit of one. Improves the performance inside git repos with a large history. --- themes/avit.zsh-theme | 53 ++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/themes/avit.zsh-theme b/themes/avit.zsh-theme index a21a9c8c4cbd..65466b82f445 100644 --- a/themes/avit.zsh-theme +++ b/themes/avit.zsh-theme @@ -38,34 +38,32 @@ function _ruby_version() { # Determine the time since last commit. If branch is clean, # use a neutral color, otherwise colors will vary according to time. function _git_time_since_commit() { - if git rev-parse --git-dir > /dev/null 2>&1; then - # Only proceed if there is actually a commit. - if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then - # Get the last commit. - last_commit=$(git log --pretty=format:'%at' -1 2> /dev/null) - now=$(date +%s) - seconds_since_last_commit=$((now-last_commit)) - - # Totals - minutes=$((seconds_since_last_commit / 60)) - hours=$((seconds_since_last_commit/3600)) - - # Sub-hours and sub-minutes - days=$((seconds_since_last_commit / 86400)) - sub_hours=$((hours % 24)) - sub_minutes=$((minutes % 60)) - - if [ $hours -gt 24 ]; then - commit_age="${days}d" - elif [ $minutes -gt 60 ]; then - commit_age="${sub_hours}h${sub_minutes}m" - else - commit_age="${minutes}m" - fi - - color=$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL - echo "$color$commit_age%{$reset_color%}" +# Only proceed if there is actually a commit. + if git log -1 > /dev/null 2>&1; then + # Get the last commit. + last_commit=$(git log --pretty=format:'%at' -1 2> /dev/null) + now=$(date +%s) + seconds_since_last_commit=$((now-last_commit)) + + # Totals + minutes=$((seconds_since_last_commit / 60)) + hours=$((seconds_since_last_commit/3600)) + + # Sub-hours and sub-minutes + days=$((seconds_since_last_commit / 86400)) + sub_hours=$((hours % 24)) + sub_minutes=$((minutes % 60)) + + if [ $hours -gt 24 ]; then + commit_age="${days}d" + elif [ $minutes -gt 60 ]; then + commit_age="${sub_hours}h${sub_minutes}m" + else + commit_age="${minutes}m" fi + + color=$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL + echo "$color$commit_age%{$reset_color%}" fi } @@ -99,4 +97,3 @@ ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[grey]%}" export LSCOLORS="exfxcxdxbxegedabagacad" export LS_COLORS='di=34;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=34;46:cd=34;43:su=0;41:sg=0;46:tw=0;42:ow=0;43:' export GREP_COLOR='1;33' - From 8652fd64efe7bcf950494856fd10ef1f5627a9ea Mon Sep 17 00:00:00 2001 From: David Hartmann Date: Sun, 22 Jun 2014 03:10:53 +0200 Subject: [PATCH 42/99] added comment functionality added commenting functionality by appending 'm' after the issue key (regular JIRA shortcut) --- plugins/jira/jira.plugin.zsh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh index 4a36b882dcac..8ad60b8fecdf 100644 --- a/plugins/jira/jira.plugin.zsh +++ b/plugins/jira/jira.plugin.zsh @@ -49,6 +49,20 @@ open_jira_issue () { else $open_cmd "$jira_url/browse/$jira_prefix$1" fi + else + local addcomment='' + if [[ "$2" == "m" ]]; then + addcomment="#add-comment" + echo "Add comment to issue #$1" + else + echo "Opening issue #$1" + fi + + if [[ "x$JIRA_RAPID_BOARD" = "xtrue" ]]; then + $open_cmd "$jira_url/issues/$1$addcomment" + else + $open_cmd "$jira_url/browse/$1$addcomment" + fi fi } From a28dbc83937cbe624ec726199b4bbe7b65b2b2a0 Mon Sep 17 00:00:00 2001 From: Matthew Hager Date: Sat, 21 Feb 2015 12:33:38 -0600 Subject: [PATCH 43/99] Move custon *.zsh file sourcing up so that they can load plugins and other things that come after. --- oh-my-zsh.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index bc7a8e496642..71716f77fc2c 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -29,6 +29,11 @@ for config_file ($ZSH/lib/*.zsh); do source $config_file done +# Load all of your custom configurations from custom/ +for config_file ($ZSH_CUSTOM/*.zsh(N)); do + source $config_file +done +unset config_file is_plugin() { local base_dir=$1 @@ -72,12 +77,6 @@ for plugin ($plugins); do fi done -# Load all of your custom configurations from custom/ -for config_file ($ZSH_CUSTOM/*.zsh(N)); do - source $config_file -done -unset config_file - # Load the theme if [ "$ZSH_THEME" = "random" ]; then themes=($ZSH/themes/*zsh-theme) From 16535452829d36f5382b176216a9ad312b2be1e5 Mon Sep 17 00:00:00 2001 From: Tejas Bubane Date: Tue, 23 Dec 2014 12:48:09 +0530 Subject: [PATCH 44/99] Recognize comments by default. --- lib/misc.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/misc.zsh b/lib/misc.zsh index 0b7cb2696743..c9a8e9e8f51a 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -20,3 +20,6 @@ alias afind='ack-grep -il' if [[ -z "$LC_CTYPE" && -z "$LC_ALL" ]]; then export LC_CTYPE=${LANG%%:*} # pick the first entry from LANG fi + +# recognize comments +setopt interactivecomments From 41104f8af842cd9ba441255808053a36ef4fcd6b Mon Sep 17 00:00:00 2001 From: Andrew Purcell Date: Mon, 1 Dec 2014 12:29:59 -0800 Subject: [PATCH 45/99] Fix homebrew directory in aws plugin. Sometimes the output of ``homebrew --prefix`` and ``homebrew --prefix awscli`` don't match, and the second is the correct call. --- plugins/aws/aws.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index 0ae18dd561f9..e5e3f1236469 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -22,7 +22,7 @@ function aws_profiles { compctl -K aws_profiles asp if _homebrew-installed && _awscli-homebrew-installed ; then - _aws_zsh_completer_path=$(brew --prefix)/opt/awscli/libexec/bin/aws_zsh_completer.sh + _aws_zsh_completer_path=$(brew --prefix awscli)/libexec/bin/aws_zsh_completer.sh else _aws_zsh_completer_path=$(which aws_zsh_completer.sh) fi From 70c4a27fd6048c3213dd2f3bae21bff26005bc16 Mon Sep 17 00:00:00 2001 From: "leif.hanack" Date: Wed, 4 Jun 2014 00:37:33 +0200 Subject: [PATCH 46/99] Added a possibility to display the remote branch and the number of commits you are ahead or behind --- lib/git.zsh | 20 +++++++++++++++----- themes/strug.zsh-theme | 25 +++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 themes/strug.zsh-theme diff --git a/lib/git.zsh b/lib/git.zsh index 118841f06efc..733492ba0a62 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -36,16 +36,26 @@ git_remote_status() { ahead=$(command git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l) behind=$(command git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l) - if [ $ahead -eq 0 ] && [ $behind -gt 0 ] + if [ $ahead -gt 0 ] && [ $behind -eq 0 ] then - echo "$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE" - elif [ $ahead -gt 0 ] && [ $behind -eq 0 ] + git_remote_status="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE" + git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}" + elif [ $behind -gt 0 ] && [ $ahead -eq 0 ] then - echo "$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE" + git_remote_status="$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE" + git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}" elif [ $ahead -gt 0 ] && [ $behind -gt 0 ] then - echo "$ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE" + git_remote_status="$ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE" + git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}" fi + + if [ $ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_DETAILED ] + then + git_remote_status="$ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_PREFIX$remote$git_remote_status_detailed$ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_SUFFIX" + fi + + echo $git_remote_status fi } diff --git a/themes/strug.zsh-theme b/themes/strug.zsh-theme new file mode 100644 index 000000000000..89b56b008672 --- /dev/null +++ b/themes/strug.zsh-theme @@ -0,0 +1,25 @@ +# terminal coloring +export CLICOLOR=1 +export LSCOLORS=dxFxCxDxBxegedabagacad + +local git_branch='$(git_prompt_info)%{$reset_color%}$(git_remote_status)' + +PROMPT="%{$fg[green]%}╭─%n@%m %{$reset_color%}%{$fg[yellow]%}in %~ %{$reset_color%}${git_branch} +%{$fg[green]%}╰\$ %{$reset_color%}" + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[yellow]%}on " +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" + +ZSH_THEME_GIT_PROMPT_DIRTY="%{$reset_color%}%{$fg[red]%} ✘ %{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%} ✔ %{$reset_color%}" + +ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_DETAILED=true +ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_PREFIX="%{$fg[yellow]%}(" +ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_SUFFIX="%{$fg[yellow]%})%{$reset_color%}" + +ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE=" +" +ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR=%{$fg[green]%} + +ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE=" -" +ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR=%{$fg[red]%} + From f21a672fed1e1455c8341c972f3ba5a408726053 Mon Sep 17 00:00:00 2001 From: Sean Escriva Date: Sat, 24 May 2014 14:24:56 -0400 Subject: [PATCH 47/99] add kitchen completion plugin from @petere --- plugins/kitchen/_kitchen | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 plugins/kitchen/_kitchen diff --git a/plugins/kitchen/_kitchen b/plugins/kitchen/_kitchen new file mode 100644 index 000000000000..54105b61ac40 --- /dev/null +++ b/plugins/kitchen/_kitchen @@ -0,0 +1,41 @@ +# author: Peter Eisentraut +# source: https://gist.github.com/petere/10307599 +# compdef kitchen + +_kitchen() { + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments '1: :->cmds'\ + '2: :->args' + + case $state in + cmds) + _arguments "1:Commands:(console converge create destroy diagnose driver help init list login setup test verify version)" + ;; + args) + case $line[1] in + converge|create|destroy|diagnose|list|setup|test|verify) + compadd "$@" all + _kitchen_instances + ;; + login) + _kitchen_instances + ;; + esac + ;; + esac +} + +_kitchen_instances() { + if [[ $_kitchen_instances_cache_dir != $PWD ]]; then + unset _kitchen_instances_cache + fi + if [[ ${+_kitchen_instances_cache} -eq 0 ]]; then + _kitchen_instances_cache=(${(f)"$(bundle exec kitchen list -b 2>/dev/null || kitchen list -b 2>/dev/null)"}) + _kitchen_instances_cache_dir=$PWD + fi + compadd -a _kitchen_instances_cache +} + +_kitchen "$@" From 2d40cc0bb315a92368e35c15c92f955bd901c7c3 Mon Sep 17 00:00:00 2001 From: Adam Lindberg Date: Wed, 16 Apr 2014 10:34:45 +0200 Subject: [PATCH 48/99] Add git_prompt_behind and git_prompt_exists This adds two new theme functions for git: * `git_prompt_behind` works in a identical fashion to `git_prompt_ahead` and will output a format variable (`ZSH_THEME_GIT_PROMPT_BEHIND`) if the branch is behind. * `git_prompt_remote` will output one format variable if the branch exists on remote (`ZSH_THEME_GIT_PROMPT_REMOTE_EXISTS`), and another if the branch is unpublished (`ZSH_THEME_GIT_PROMPT_REMOTE_MISSING`). The old `git_prompt_ahead` has been changed. Using git log is subject to formatting in .gitconfig, which can be overridden and will break this function. Relying on rev-list is much more stable. --- lib/git.zsh | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/lib/git.zsh b/lib/git.zsh index 733492ba0a62..caa7e6329132 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -59,13 +59,6 @@ git_remote_status() { fi } -# Checks if there are commits ahead from remote -function git_prompt_ahead() { - if $(echo "$(command git log @{upstream}..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then - echo "$ZSH_THEME_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 @@ -74,6 +67,29 @@ function git_commits_ahead() { fi } +# Outputs if current branch is ahead of remote +function git_prompt_ahead() { + if [[ -n "$(command git rev-list origin/$(current_branch)..HEAD 2> /dev/null)" ]]; then + echo "$ZSH_THEME_GIT_PROMPT_AHEAD" + fi +} + +# Outputs if current branch is behind remote +function git_prompt_behind() { + if [[ -n "$(command git rev-list HEAD..origin/$(current_branch) 2> /dev/null)" ]]; then + echo "$ZSH_THEME_GIT_PROMPT_BEHIND" + fi +} + +# Outputs if current branch exists on remote or not +function git_prompt_remote() { + if [[ -n "$(command git show-ref origin/$(current_branch) 2> /dev/null)" ]]; then + echo "$ZSH_THEME_GIT_PROMPT_REMOTE_EXISTS" + else + echo "$ZSH_THEME_GIT_PROMPT_REMOTE_MISSING" + 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 25df9f3998359832667db206774a18cb45153a15 Mon Sep 17 00:00:00 2001 From: Blake Watters Date: Tue, 26 Feb 2013 11:29:19 -0500 Subject: [PATCH 49/99] Disable globbing when executing `zeus rake` aliases to enable use of square brackets without escaping --- plugins/zeus/zeus.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/zeus/zeus.plugin.zsh b/plugins/zeus/zeus.plugin.zsh index 5ec9fa57941f..0c01083a5a3e 100644 --- a/plugins/zeus/zeus.plugin.zsh +++ b/plugins/zeus/zeus.plugin.zsh @@ -19,8 +19,8 @@ alias zsr='zeus server' alias zerver='zeus server' # Rake -alias zr='zeus rake' -alias zake='zeus rake' +alias zr='noglob zeus rake' +alias zake='noglob zeus rake' # Generate alias zg='zeus generate' From 2fb326513a9e2cec473cff88669da890ad4ae834 Mon Sep 17 00:00:00 2001 From: Dan Mills Date: Wed, 10 Jun 2015 15:49:47 -0700 Subject: [PATCH 50/99] Only load url-quote-magic if it is available. Partially fixes #3614 --- lib/misc.zsh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/misc.zsh b/lib/misc.zsh index 0b7cb2696743..92e336b64f61 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -1,6 +1,10 @@ -## smart urls -autoload -U url-quote-magic -zle -N self-insert url-quote-magic +## Load smart urls if available +for d in $fpath; do + if [[ -e "$d/url-quote-magic"]]; then + autoload -U url-quote-magic + zle -N self-insert url-quote-magic + fi +done ## jobs setopt long_list_jobs From 557dc09d71e489790742ed8603e929edb48fb071 Mon Sep 17 00:00:00 2001 From: UserTaken Date: Thu, 11 Jun 2015 00:21:45 -0700 Subject: [PATCH 51/99] More run and create options --- plugins/docker/_docker | 90 +++++++++++++++++++++++++++++++++--------- 1 file changed, 71 insertions(+), 19 deletions(-) diff --git a/plugins/docker/_docker b/plugins/docker/_docker index fd459a0cac85..bd494ecaa091 100644 --- a/plugins/docker/_docker +++ b/plugins/docker/_docker @@ -36,7 +36,7 @@ __docker_images() { # --------------------------- __attach() { _arguments \ - '--no-stdin[Do not attach stdin]' \ + '--no-stdin[Do not attach STDIN]' \ '--sig-proxy[Proxify all received signal to the process (even in non-tty mode)]' __docker_containers } @@ -55,6 +55,7 @@ __commit() { '(-a,--author=)'{-a,--author=}'[Author (eg. "John Hannibal Smith "]' \ '(-m,--message=)'{-m,--message=}'[Commit message]' \ '--run=[Config automatically applied when the image is run.]' + '(-p,--pause=)'{-p,--pause=}'[Pause container during commit]' \ __docker_containers } @@ -62,6 +63,48 @@ __cp() { __docker_containers } +__create() { + _arguments \ + '(-P,--publish-all=)'{-P,--publish-all=}'[Publish all exposed ports to the host interfaces]' \ + '(-a,--attach=)'{-a,--attach=}'[Attach to STDIN, STDOUT or STDERR]' \ + '--add-host=[Add a custom host-to-IP mapping]' \ + '--cap-add=[Add Linux capabilities]' \ + '--cap-drop=[Drop Linux capabilities]' \ + '(-c,--cpu-shares=)'{-c,--cpu-shares=}':[CPU shares (relative weight)]' \ + '--cidfile=[Write the container ID to the file]' \ + '--device=[Add a host device to the container]' \ + '--dns=[Set custom dns servers]' \ + '--dns-search=[Set custom DNS search domains]' \ + '(-e,--env=)'{-e,--env=}'[Set environment variables]' \ + '--env-file=[Read in a file of environment variables]' \ + '--entrypoint=[Overwrite the default entrypoint of the image]' \ + '--expose=[Expose a port from the container without publishing it to your host]' \ + '(-h,--hostname=)'{-h,--hostname=}'[Container host name]' \ + '(-i,--interactive=)'{-i,--interactive=}'[Keep STDIN open even if not attached]' \ + '--ipc=[IPC namespace to use]' \ + '(-l,--label=)'{-l,--label=}'[Set meta data on a container]' \ + '--link=[Add link to another container (name:alias)]' \ + '--log-driver=[Logging driver for the container]' \ + '--lxc-conf=[Add custom LXC options]' \ + '--mac-address=[Container MAC address (e.g. 92:d0:c6:0a:29:33)]' \ + '(-m,--memory=)'{-m,--memory=}'[Memory limit (format: , where unit = b, k, m or g)]' \ + '--net=[Set the Network mode for the container]' \ + '--name=[Assign a name to the container]' \ + '--pid=[PID namespace to use]' \ + '(-p,--publish=)'{-p,--publish=}'[Publish a container''s port to the host (format: ip:hostPort:containerPort/protocol)]' \ + '--privileged=[Give extended privileges to this container]' \ + '--restart=[Restart policy to apply when a container exits]' \ + '--security-opt=[Security Options]' \ + '--sig-proxy=[Proxify all received signal to the process (even in non-tty mode)]' \ + '(-t,--tty=)'{-t,--tty=}'[Allocate a pseudo-tty]' \ + '(-u,--user=)'{-u,--user=}'[Username or UID]' \ + '--ulimit=[Ulimit options]' \ + '(-v,--volume=)'{-v,--volume=}'[Bind mount a volume (e.g. -v /host:/container or -v /container)]' \ + '--volumes-from=[Mount volumes from the specified container(s)]' \ + '(-w,--workdir=)'{-w,--workdir=}'[Working directory inside the container]' + __docker_images +} + __diff() { __docker_containers } @@ -100,11 +143,6 @@ __info() { # no arguments } -__insert() { - __docker_images - _arguments '*:files:_files' -} - __inspect() { __docker_images __docker_all_containers @@ -185,28 +223,42 @@ __rmi() { __run() { _arguments \ '(-P,--publish-all=)'{-P,--publish-all=}'[Publish all exposed ports to the host interfaces]' \ - '(-a,--attach=)'{-a,--attach=}'[Attach to stdin, stdout or stderr.]' \ - '(-c,--cpu-shares=)'{-c,--cpu-shares=}': CPU shares (relative weight)]' \ + '(-a,--attach=)'{-a,--attach=}'[Attach to STDIN, STDOUT or STDERR]' \ + '--add-host=[Add a custom host-to-IP mapping]' \ + '--cap-add=[Add Linux capabilities]' \ + '--cap-drop=[Drop Linux capabilities]' \ + '(-c,--cpu-shares=)'{-c,--cpu-shares=}':[CPU shares (relative weight)]' \ '--cidfile=[Write the container ID to the file]' \ - '(-d,--detach=)'{-d,--detach=}'[Detached mode: Run container in the background, print new container id]' \ + '(-d,--detach=)'{-d,--detach=}'[Run container in the background, print new container id]' \ + '--device=[Add a host device to the container]' \ '--dns=[Set custom dns servers]' \ + '--dns-search=[Set custom DNS search domains]' \ '(-e,--env=)'{-e,--env=}'[Set environment variables]' \ + '--env-file=[Read in a file of environment variables]' \ '--entrypoint=[Overwrite the default entrypoint of the image]' \ '--expose=[Expose a port from the container without publishing it to your host]' \ '(-h,--hostname=)'{-h,--hostname=}'[Container host name]' \ - '(-i,--interactive=)'{-i,--interactive=}'[Keep stdin open even if not attached]' \ + '(-i,--interactive=)'{-i,--interactive=}'[Keep STDIN open even if not attached]' \ + '--ipc=[IPC namespace to use]' \ + '(-l,--label=)'{-l,--label=}'[Set meta data on a container]' \ '--link=[Add link to another container (name:alias)]' \ - '--lxc-conf=[Add custom lxc options -lxc-conf="lxc.cgroup.cpuset.cpus = 0,1"]' \ + '--log-driver=[Logging driver for the container]' \ + '--lxc-conf=[Add custom LXC options]' \ + '--mac-address=[Container MAC address (e.g. 92:d0:c6:0a:29:33)]' \ '(-m,--memory=)'{-m,--memory=}'[Memory limit (format: , where unit = b, k, m or g)]' \ - '(-n,--networking=)'{-n,--networking=}'[Enable networking for this container]' \ + '--net=[Set the Network mode for the container]' \ '--name=[Assign a name to the container]' \ - '(-p,--publish=)'{-p,--publish=}'[Publish a container''s port to the host (format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort) (use "docker port" to see the actual mapping)]' \ + '--pid=[PID namespace to use]' \ + '(-p,--publish=)'{-p,--publish=}'[Publish a container''s port to the host (format: ip:hostPort:containerPort/protocol)]' \ '--privileged=[Give extended privileges to this container]' \ + '--restart=[Restart policy to apply when a container exits]' \ '--rm=[Automatically remove the container when it exits (incompatible with -d)]' \ + '--security-opt=[Security Options]' \ '--sig-proxy=[Proxify all received signal to the process (even in non-tty mode)]' \ '(-t,--tty=)'{-t,--tty=}'[Allocate a pseudo-tty]' \ '(-u,--user=)'{-u,--user=}'[Username or UID]' \ - '(-v,--volume=)'{-v,--volume=}'[Bind mount a volume (e.g. from the host: -v /host:/container, from docker: -v /container)]' \ + '--ulimit=[Ulimit options]' \ + '(-v,--volume=)'{-v,--volume=}'[Bind mount a volume (e.g. -v /host:/container or -v /container)]' \ '--volumes-from=[Mount volumes from the specified container(s)]' \ '(-w,--workdir=)'{-w,--workdir=}'[Working directory inside the container]' __docker_images @@ -225,8 +277,8 @@ __save() { __start() { _arguments \ - '(-a,--attach=)'{-a,--attach=}'[Attach container''s stdout/stderr and forward all signals to the process]' \ - '(-i,--interactive=)'{-i,--interactive=}'[Attach container''s stdin]' + '(-a,--attach=)'{-a,--attach=}'[Attach container''s STDOUT/STDERR and forward all signals to the process]' \ + '(-i,--interactive=)'{-i,--interactive=}'[Attach container''s STDIN]' __docker_all_containers } @@ -271,6 +323,7 @@ _1st_arguments=( "build":"Build a container from a Dockerfile" "commit":"Create a new image from a container's changes" "cp":"Copy files/folders from the containers filesystem to the host path" + "create":"Create new container without running it" "diff":"Inspect changes on a container's filesystem" "events":"Get real time events from the server" "export":"Stream the contents of a container as a tar archive" @@ -278,7 +331,6 @@ _1st_arguments=( "images":"List images" "import":"Create a new filesystem image from the contents of a tarball" "info":"Display system-wide information" - "insert":"Insert a file in an image" "inspect":"Return low-level information on a container" "kill":"Kill a running container" "load":"Load an image from a tar archive" @@ -321,6 +373,8 @@ case "$words[1]" in __commit ;; cp) __cp ;; + create) + __create ;; diff) __diff ;; events) @@ -335,8 +389,6 @@ case "$words[1]" in __import ;; info) __info ;; - insert) - __insert ;; inspect) __inspect ;; kill) From a570f4b7f332d6a1f7b25e1d5fd9a3954e379065 Mon Sep 17 00:00:00 2001 From: ncanceill Date: Thu, 11 Jun 2015 11:04:54 +0200 Subject: [PATCH 52/99] git plugin: bring back olg gg aliases by popular demand, see #3972 --- plugins/git/git.plugin.zsh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index e42e096883ec..28227dcb1e26 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -104,11 +104,15 @@ ggl() { git pull origin "${b:=$1}" } compdef _git ggl=git-checkout +alias ggpull='ggl' +compdef _git ggpull=git-checkout ggp() { [[ "$#" != 1 ]] && b="$(current_branch)" git push origin "${b:=$1}" } compdef _git ggp=git-checkout +alias ggpush='ggp' +compdef _git ggpush=git-checkout ggpnp() { ggl "$1" && ggp "$1" } @@ -119,6 +123,8 @@ ggu() { git pull --rebase origin "${b:=$1}" } compdef _git ggu=git-checkout +alias ggpur='ggu' +compdef _git ggpur=git-checkout alias gignore='git update-index --assume-unchanged' alias gignored='git ls-files -v | grep "^[[:lower:]]"' From 6c29041af73fc3668f6a3256ebc7ab532a2bbba9 Mon Sep 17 00:00:00 2001 From: ncanceill Date: Thu, 11 Jun 2015 15:12:28 +0200 Subject: [PATCH 53/99] git plugin: global var for git command due to issues like #3962 until a proper plugin-loading system is implemented --- plugins/git/git.plugin.zsh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 28227dcb1e26..154a7bb9c2db 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -1,7 +1,6 @@ # Query/use custom command for `git`. -local git_cmd -zstyle -s ":vcs_info:git:*:-all-" "command" git_cmd -: ${git_cmd:=git} +zstyle -s ":vcs_info:git:*:-all-" "command" _omz_git_git_cmd +: ${_omz_git_git_cmd:=git} # # Functions @@ -13,20 +12,20 @@ zstyle -s ":vcs_info:git:*:-all-" "command" git_cmd # it's not a symbolic ref, but in a Git repo. function current_branch() { local ref - ref=$($git_cmd symbolic-ref --quiet HEAD 2> /dev/null) + ref=$($_omz_git_git_cmd symbolic-ref --quiet HEAD 2> /dev/null) local ret=$? if [[ $ret != 0 ]]; then [[ $ret == 128 ]] && return # no git repo. - ref=$($git_cmd rev-parse --short HEAD 2> /dev/null) || return + ref=$($_omz_git_git_cmd rev-parse --short HEAD 2> /dev/null) || return fi echo ${ref#refs/heads/} } # The list of remotes function current_repository() { - if ! $git_cmd rev-parse --is-inside-work-tree &> /dev/null; then + if ! $_omz_git_git_cmd rev-parse --is-inside-work-tree &> /dev/null; then return fi - echo $($git_cmd remote -v | cut -d':' -f 2) + echo $($_omz_git_git_cmd remote -v | cut -d':' -f 2) } # Pretty log messages function _git_log_prettily(){ From 6ff96dab36865ab208b08a004903338bfd405eac Mon Sep 17 00:00:00 2001 From: ncanceill Date: Thu, 11 Jun 2015 16:16:12 +0200 Subject: [PATCH 54/99] git plugin: fix error msg in gwip alias because git rm will fail when no files were deleted --- 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 154a7bb9c2db..7db43351a083 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -204,4 +204,4 @@ alias gupv='git pull --rebase -v' alias gvt='git verify-tag' alias gwch='git whatchanged -p --abbrev-commit --pretty=medium' -alias gwip='git add -A; git rm $(git ls-files --deleted); git commit -m "--wip--"' +alias gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit -m "--wip--"' From f513999a4dbfea3a15287368848a718543fcaf7b Mon Sep 17 00:00:00 2001 From: ncanceill Date: Thu, 11 Jun 2015 17:14:35 +0200 Subject: [PATCH 55/99] git plugin: make b local in gg* functions because it leaked, and led to #3991 --- plugins/git/git.plugin.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 7db43351a083..dec787a8c28b 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -94,19 +94,19 @@ alias gfo='git fetch origin' alias gg='git gui citool' alias gga='git gui citool --amend' ggf() { -[[ "$#" != 1 ]] && b="$(current_branch)" +[[ "$#" != 1 ]] && local b="$(current_branch)" git push --force origin "${b:=$1}" } compdef _git ggf=git-checkout ggl() { -[[ "$#" != 1 ]] && b="$(current_branch)" +[[ "$#" != 1 ]] && local b="$(current_branch)" git pull origin "${b:=$1}" } compdef _git ggl=git-checkout alias ggpull='ggl' compdef _git ggpull=git-checkout ggp() { -[[ "$#" != 1 ]] && b="$(current_branch)" +[[ "$#" != 1 ]] && local b="$(current_branch)" git push origin "${b:=$1}" } compdef _git ggp=git-checkout @@ -118,7 +118,7 @@ ggl "$1" && ggp "$1" compdef _git ggpnp=git-checkout alias ggsup='git branch --set-upstream-to=origin/$(current_branch)' ggu() { -[[ "$#" != 1 ]] && b="$(current_branch)" +[[ "$#" != 1 ]] && local b="$(current_branch)" git pull --rebase origin "${b:=$1}" } compdef _git ggu=git-checkout From 83c3316cf4c4f11c15b8a9df488d629cf4bc23dc Mon Sep 17 00:00:00 2001 From: DimitriSteyaert Date: Mon, 27 Apr 2015 22:26:30 +0200 Subject: [PATCH 56/99] Added the tugboat autocompletion plugin --- plugins/tugboat/_tugboat | 106 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 plugins/tugboat/_tugboat diff --git a/plugins/tugboat/_tugboat b/plugins/tugboat/_tugboat new file mode 100644 index 000000000000..6bf736920ebb --- /dev/null +++ b/plugins/tugboat/_tugboat @@ -0,0 +1,106 @@ +#compdef tugboat +#autoload + +# Tugboat zsh autocompletion + + +local -a _commands +_commands=( + 'add-key:[NAME] Upload an ssh public key.' + 'authorize:Authorize a DigitalOcean account with tugboat.' + 'create:[NAME] Create a droplet.' + 'destroy:[FUZZY_NAME] Destroy a droplet.' + 'destroy_image:[FUZZY_NAME] Destroy an image.' + 'droplets:Retrieve a list of your droplets.' + 'halt:[FUZZY_NAME] Shutdown a droplet.' + 'help:[COMMAND] Describe commands or a specific command.' + 'images:Retrieve a list of your images.' + 'info:[FUZZY_NAME] [OPTIONS] Show a droplets information.' + 'info_image:[FUZZY_NAME] [OPTIONS] Show an images information.' + 'keys:Show available SSH keys.' + 'password-reset:[FUZZY_NAME] Reset root password.' + 'rebuild:[FUZZY_NAME] [IMAGE_NAME] Rebuild a droplet.' + 'regions:Show regions.' + 'resize:[FUZZY_NAME -s, --size=N] Resize a droplet.' + 'restart:[FUZZY_NAME] Restart a droplet.' + 'sizes:Show available droplet sizes.' + 'snapshot:[SNAPSHOT_NAME] [FUZZY_NAME] [OPTIONS] Queue a snapshot of the droplet.' + 'ssh:[FUZZY_NAME] SSH into a droplet.' + 'start:[FUZZY_NAME] Start a droplet.' + 'verify:Check your DigitalOcean credentials.' + 'version:Show version.' + 'wait:[FUZZY_NAME] Wait for a droplet to reach a state.' +) + +local -a _create_arguments +_create_arguments=( + '-s:[--size=N] The size_id of the droplet' + '-i:[--image=N] The image_id of the droplet' + '-r:[--region=N] The region_id of the droplet' + '-k:[--keys=KEYS] A comma separated list of SSH key ids to add to the droplet' + '-p:[--private-networking] Enable private networking on the droplet' + '-b:[--backups-enabled] Enable backups on the droplet' + '-q:[--quiet]' +) + +__task_list () +{ + local expl + declare -a tasks + + arguments=(add-key authorize create destroy destroy_image droplets halt help images info info_image keys password-reset rebuild regions resize restart sizes snapshot ssh start verify version wait) + + _wanted tasks expl 'help' compadd $arguments +} + +__droplets_list () +{ + _wanted application expl 'command' compadd $(command tugboat droplets | cut -d " " -f1) +} + +__tugboat-create () +{ + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + _describe -t commands "gem subcommand" _create_arguments + return + ;; + esac +} + +local curcontext="$curcontext" state line +typeset -A opt_args + +_arguments -C \ + ':command:->command' \ + '*::options:->options' + +case $state in + (command) + _describe -t commands "gem subcommand" _commands + return + ;; + + (options) + case $line[1] in + (help) + _arguments ':feature:__task_list' + ;; + + (ssh) + _arguments ':feature:__droplets_list' + ;; + + (create) + _arguments ':feature:__tugboat-create' + ;; + esac + ;; +esac From 6bec3c6719f17898b6504a6189424bc23cc10c65 Mon Sep 17 00:00:00 2001 From: Matheus Cruz Rocha Date: Sat, 2 May 2015 12:59:18 -0300 Subject: [PATCH 57/99] Update history-substring-search README This Change remove the .zsh on the plugin activate example, cause with the .zsh at the end the plugin won't be activated --- plugins/history-substring-search/README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/history-substring-search/README.markdown b/plugins/history-substring-search/README.markdown index 143b813a1a1e..c154afdce90a 100644 --- a/plugins/history-substring-search/README.markdown +++ b/plugins/history-substring-search/README.markdown @@ -1,6 +1,6 @@ To activate this script, please include it the `plugins` variable within `~/.zshrc` - `plugins=(git history-substring-search.zsh)` + `plugins=(git history-substring-search)` See the "history-substring-search.zsh" file for more information: From e8ac8b9b5f82369635d719408f8b4adc5d97bcf9 Mon Sep 17 00:00:00 2001 From: Jonathan Roemer Date: Fri, 1 May 2015 17:44:50 -0400 Subject: [PATCH 58/99] Added support for detecting Sublime Text 3 on Arch Linux --- plugins/sublime/sublime.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh index 38a7596fd918..4d9979960382 100644 --- a/plugins/sublime/sublime.plugin.zsh +++ b/plugins/sublime/sublime.plugin.zsh @@ -5,6 +5,7 @@ if [[ $('uname') == 'Linux' ]]; then _sublime_linux_paths=( "$HOME/bin/sublime_text" "/opt/sublime_text/sublime_text" + "/opt/sublime_text_3/sublime_text" "/usr/bin/sublime_text" "/usr/local/bin/sublime_text" "/usr/bin/subl" From 4c409b0de918e62f9354cbc604c6ae65da611caf Mon Sep 17 00:00:00 2001 From: Paul Melnikow Date: Mon, 29 Dec 2014 14:48:24 -0500 Subject: [PATCH 59/99] sublime: Make subl a function so it can be called from functions in other modules Without this change, whether a function can invoke 'subl' depends on the order in which modules are loaded. With this change, the order doesn't matter. zsh resolves aliases at parse time not run time, which means if you invoke an alias from a function, the alias must be defined before the function. See http://stackoverflow.com/a/25532276/893113 which refers to an explanation of this limitation. For code which may be used non-interactively, the recommend workaround is to use functions instead of aliases. --- plugins/sublime/sublime.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh index 4d9979960382..3e338e4d301b 100644 --- a/plugins/sublime/sublime.plugin.zsh +++ b/plugins/sublime/sublime.plugin.zsh @@ -34,7 +34,7 @@ elif [[ "$OSTYPE" = darwin* ]]; then for _sublime_path in $_sublime_darwin_paths; do if [[ -a $_sublime_path ]]; then - alias subl="'$_sublime_path'" + subl () { "$_sublime_path" $* } alias st=subl break fi From 23ac32d34680785c678ee64a915d11e12253d206 Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Mon, 30 Mar 2015 11:23:00 +0200 Subject: [PATCH 60/99] add help link to install zsh --- README.markdown | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.markdown b/README.markdown index 9f96e315ddec..4723d3486a0e 100644 --- a/README.markdown +++ b/README.markdown @@ -15,8 +15,7 @@ To learn more, visit http://ohmyz.sh and/or follow [ohmyzsh](https://twitter.com __Disclaimer:__ _Oh My Zsh works best on Mac OS X and Linux._ * Unix-based operating system (Mac OS X or Linux) -* [Zsh](http://www.zsh.org) should be installed (v4.3.9 or more recent) - * This is commonly pre-installed. (`zsh --version` to confirm) +* [Zsh](http://www.zsh.org) should be installed (v4.3.9 or more recent). If not pre-installed (`zsh --version` to confirm), check the following instruction here: [Installing-ZSH](https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH) * `curl` or `wget` should be installed ### Basic Installation From 4ab430025c97902a28c0fa7aad45e14d0a7852e9 Mon Sep 17 00:00:00 2001 From: Kevin Ndung'u Date: Sat, 18 Apr 2015 15:47:08 +0300 Subject: [PATCH 61/99] Add git to prerequisites Resolves #3786 --- README.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/README.markdown b/README.markdown index 4723d3486a0e..31cbc810b4f0 100644 --- a/README.markdown +++ b/README.markdown @@ -17,6 +17,7 @@ __Disclaimer:__ _Oh My Zsh works best on Mac OS X and Linux._ * Unix-based operating system (Mac OS X or Linux) * [Zsh](http://www.zsh.org) should be installed (v4.3.9 or more recent). If not pre-installed (`zsh --version` to confirm), check the following instruction here: [Installing-ZSH](https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH) * `curl` or `wget` should be installed +* `git` should be installed ### Basic Installation From 563e1052c723739b25b34706a9c689b77435e5a2 Mon Sep 17 00:00:00 2001 From: Oleksandr Shybystyi Date: Mon, 4 May 2015 14:04:25 +0300 Subject: [PATCH 62/99] Added README for mercurial plugin --- plugins/mercurial/README.md | 64 +++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 plugins/mercurial/README.md diff --git a/plugins/mercurial/README.md b/plugins/mercurial/README.md new file mode 100644 index 000000000000..89e1c17431b5 --- /dev/null +++ b/plugins/mercurial/README.md @@ -0,0 +1,64 @@ +# Mercurial plugin +### Usage +Update .zshrc: + +1. Add name to the list of plugins, e.g. `plugins = (..., mercurial, ...)` + (that is pretty obvious). +2. Change PROMPT variable of current theme to contain current folder mercurial repo info: + + robbyrussel theme is used by default, so you need to modify PROMPT var + from [this file](https://github.com/robbyrussell/oh-my-zsh/blob/master/themes/robbyrussell.zsh-theme) + by adding `$(hg_prompt_info)` after `$(git_prompt_info)`, so currently it + looks next: + + ```diff + - PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' + + PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)$(hg_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' + ``` + + and put modified var at the end of **.zshrc**. +3. Initialize additional vars used in plugin. So in short put next in **.zshrc**: + + ``` + ZSH_THEME_HG_PROMPT_PREFIX="%{$fg_bold[magenta]%}hg:(%{$fg[red]%}" + ZSH_THEME_HG_PROMPT_SUFFIX="%{$reset_color%}" + ZSH_THEME_HG_PROMPT_DIRTY="%{$fg[magenta]%}) %{$fg[yellow]%}✗%{$reset_color%}" + ZSH_THEME_HG_PROMPT_CLEAN="%{$fg[magenta]%})" + ``` + +### What's inside? +#### Adds handy aliases: +###### general +* `hgc` - `hg commit` +* `hgb` - `hg branch` +* `hgba` - `hg branches` +* `hgbk` - `hg bookmarks` +* `hgco` - `hg checkout` +* `hgd` - `hg diff` +* `hged` - `hg diffmerge` + +###### pull and update +* `hgi` - `hg incoming` +* `hgl` - `hg pull -u` +* `hglr` - `hg pull --rebase` +* `hgo` - `hg outgoing` +* `hgp` - `hg push` +* `hgs` - `hg status` +* `hgsl` - `hg log --limit 20 --template "{node|short} | {date|isodatesec} | {author|user}: {desc|strip|firstline}\n"` + +###### this is the 'git commit --amend' equivalent +* `hgca` - `hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip` + +###### list unresolved files (since hg does not list unmerged files in the status command) +* `hgun` - `hg resolve --list` + +#### Displays repo branch and directory status in prompt +This is the same as git plugin does. + +**Note**: additional changes to **.zshrc** are required in order for this to +work. + +### Mantainers +[ptrv](https://github.com/ptrv) - original creator + +[oshybystyi](https://github.com/oshybystyi) - created this README and know how most of code works From fb5b83d10d5b1640fbd2035d5a7419cb5b25c32a Mon Sep 17 00:00:00 2001 From: Octavian Neamtu Date: Sat, 9 May 2015 19:12:14 -0400 Subject: [PATCH 63/99] Fixed jump pluging to display the right mark name on 'mark . ' --- plugins/jump/jump.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/jump/jump.plugin.zsh b/plugins/jump/jump.plugin.zsh index d082c11e5428..e58e7373dec6 100644 --- a/plugins/jump/jump.plugin.zsh +++ b/plugins/jump/jump.plugin.zsh @@ -13,7 +13,7 @@ jump() { } mark() { - if (( $# == 0 )); then + if [[ ( $# == 0 ) || ( "$1" == "." ) ]]; then MARK=$(basename "$PWD") else MARK="$1" From c838b9a112e1569bcc5af069d8283057f7d4208a Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Sat, 9 May 2015 17:38:34 -0300 Subject: [PATCH 64/99] Update README.markdown Updating the install instructions as proposed in: https://github.com/robbyrussell/oh-my-zsh/issues/3516#issuecomment-76506726 --- README.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.markdown b/README.markdown index 31cbc810b4f0..88ef356fde93 100644 --- a/README.markdown +++ b/README.markdown @@ -25,11 +25,11 @@ Oh My Zsh is installed by running one of the following commands in your terminal #### via curl -`curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh` +`sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"` #### via wget -`wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O - | sh` +`sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"` ## Using Oh My Zsh From af4ffe56eae27c85ed472307554fd7347966d316 Mon Sep 17 00:00:00 2001 From: Luca Stefani Date: Thu, 7 May 2015 13:24:33 +0200 Subject: [PATCH 65/99] adb: add more commands --- plugins/adb/_adb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/adb/_adb b/plugins/adb/_adb index 22089581a98f..f30f3247f1ec 100644 --- a/plugins/adb/_adb +++ b/plugins/adb/_adb @@ -16,14 +16,22 @@ _1st_arguments=( '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' +'kill-server:kill the server if it is running' +'logcat:view device log' 'pull:copy file/dir from device' 'push:copy file/dir to device' +'reboot:reboots the device, optionally into the bootloader or recovery program' +'reboot-bootloader:reboots the device into the bootloader' +'remount:remounts the partitions on the device read-write' +'root:restarts the adbd daemon with root permissions' +'sideload:push a ZIP to device and install it' 'shell:run remote shell interactively' 'sync:copy host->device only if changed (-l means list but dont copy)' -‘tcpip:restart host adb in tcpip mode’ +'start-server:ensure that there is a server running' +'tcpip:restart host adb in tcpip mode' 'uninstall:remove this app package from the device' 'version:show version num' +'wait-for-device:block until device is online' ) local expl From 980528f9fa33780499d625bbbb8ea2cada78530d Mon Sep 17 00:00:00 2001 From: Archie Date: Sat, 23 May 2015 10:22:03 -0700 Subject: [PATCH 66/99] fix typo --- oh-my-zsh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 71716f77fc2c..ec64c240f020 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -14,7 +14,7 @@ if [[ -z "$ZSH_CUSTOM" ]]; then ZSH_CUSTOM="$ZSH/custom" fi -# Set ZSH_CACHE_DIR to the path where cache files sould be created +# Set ZSH_CACHE_DIR to the path where cache files should be created # or else we will use the default cache/ if [[ -z "$ZSH_CACHE_DIR" ]]; then ZSH_CACHE_DIR="$ZSH/cache/" From 8791d7e09ea28335a60db7bd2f5c0d771d7910fc Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 9 Jun 2015 07:35:38 +0300 Subject: [PATCH 67/99] Update bgnotify.plugin.zsh Fixed error with spaces in commands --- plugins/bgnotify/bgnotify.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/bgnotify/bgnotify.plugin.zsh b/plugins/bgnotify/bgnotify.plugin.zsh index 14ca4c81726e..b70b42f98454 100755 --- a/plugins/bgnotify/bgnotify.plugin.zsh +++ b/plugins/bgnotify/bgnotify.plugin.zsh @@ -33,9 +33,9 @@ bgnotify () { if hash terminal-notifier 2>/dev/null; then #osx terminal-notifier -message "$2" -title "$1" elif hash growlnotify 2>/dev/null; then #osx growl - growlnotify -m $1 $2 + growlnotify -m "$1" "$2" elif hash notify-send 2>/dev/null; then #ubuntu! - notify-send $1 $2 + notify-send "$1" "$2" elif hash notifu 2>/dev/null; then #cygwyn support! notifu /m "$2" /p "$1" fi From 69dee6538155cb604434363ba243e540a6104fe6 Mon Sep 17 00:00:00 2001 From: asaph Date: Tue, 19 May 2015 13:24:16 -0700 Subject: [PATCH 68/99] Fixed typo in README --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index 88ef356fde93..5d4819d764fe 100644 --- a/README.markdown +++ b/README.markdown @@ -51,7 +51,7 @@ Most plugins (should! we're working on this) include a __README__, which documen ### Themes -We'll admit it. Early in the Oh My Zsh world... we may have gotten a far too theme happy. We have over one hundred themes now bundled. Most of them have [screenshots](https://wiki.github.com/robbyrussell/oh-my-zsh/themes) on the wiki. Check them out! +We'll admit it. Early in the Oh My Zsh world... we may have gotten far too theme happy. We have over one hundred themes now bundled. Most of them have [screenshots](https://wiki.github.com/robbyrussell/oh-my-zsh/themes) on the wiki. Check them out! #### Selecting a Theme From 1a4dc0d2db56c2abf5244f1fca975ea887eb6bbb Mon Sep 17 00:00:00 2001 From: Michele Bologna Date: Fri, 19 Sep 2014 12:30:24 +0200 Subject: [PATCH 69/99] Renamed 'ss' alias to 'sstat' (to avoid collision with /bin/ss). --- plugins/rails/rails.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh index 5ed96f8cddf6..52aabab72324 100644 --- a/plugins/rails/rails.plugin.zsh +++ b/plugins/rails/rails.plugin.zsh @@ -59,7 +59,7 @@ alias rn='rake notes' alias rr='rake routes' # legacy stuff -alias ss='thin --stats "/thin/stats" start' +alias sstat='thin --stats "/thin/stats" start' alias sg='ruby script/generate' alias sd='ruby script/destroy' alias sp='ruby script/plugin' From 266894c6a138eb8a248ce8aa428fcabeabd7ffa4 Mon Sep 17 00:00:00 2001 From: regagain Date: Sun, 17 May 2015 16:26:18 +0200 Subject: [PATCH 70/99] Update taskwarrior.plugin.zsh Corrected documentation to avoid confusion (see https://github.com/robbyrussell/oh-my-zsh/issues/3796) --- plugins/taskwarrior/taskwarrior.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/taskwarrior/taskwarrior.plugin.zsh b/plugins/taskwarrior/taskwarrior.plugin.zsh index c1830042eff6..5d1e6ffea23f 100644 --- a/plugins/taskwarrior/taskwarrior.plugin.zsh +++ b/plugins/taskwarrior/taskwarrior.plugin.zsh @@ -8,7 +8,7 @@ # TaskWarrior. It uses the zsh tab completion # script (_task) distributed with TaskWarrior for the completion definitions. # -# Typing task[tabtab] will give you a list of current tasks, task 66[tabtab] +# Typing task [tabtab] will give you a list of current tasks, task 66[tabtab] # gives a list of available modifications for that task, etc. ################################################################################ From 02c2b74918b237f936ea51f14b38463221ec59dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Gonz=C3=A1lez?= Date: Sat, 6 Jun 2015 21:08:59 -0400 Subject: [PATCH 71/99] Update aliases in laravel5.plugin.zsh file Some minor changes to the aliases. * removed php artisan dump-autoload since is no longer a command in laravel 5 * updated the la5routes alias to the new version of the command * added a la5vendor alias to publish assets from vendor packages --- plugins/laravel5/laravel5.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/laravel5/laravel5.plugin.zsh b/plugins/laravel5/laravel5.plugin.zsh index 2afa99317980..38454f40d560 100644 --- a/plugins/laravel5/laravel5.plugin.zsh +++ b/plugins/laravel5/laravel5.plugin.zsh @@ -15,6 +15,6 @@ compdef _laravel5 la5 #Alias alias la5='php artisan' -alias la5dump='php artisan dump-autoload' alias la5cache='php artisan cache:clear' -alias la5routes='php artisan routes' +alias la5routes='php artisan route:list' +alias la5vendor='php artisan vendor:publish' From 1f008b4113cd4586423c4ecc54f65f12e8a61145 Mon Sep 17 00:00:00 2001 From: "Mikhail S. Pobolovets" Date: Thu, 30 Apr 2015 14:03:31 +0300 Subject: [PATCH 72/99] Update Mix complition upto 1.0.4 Signed-off-by: Mikhail S. Pobolovets --- plugins/mix/_mix | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/plugins/mix/_mix b/plugins/mix/_mix index b7c982e0ac90..319932b3fbe1 100644 --- a/plugins/mix/_mix +++ b/plugins/mix/_mix @@ -1,28 +1,43 @@ -#compdef mix +#compdef mix #autoload # Elixir mix zsh completion local -a _1st_arguments _1st_arguments=( - 'archive:Archive this project into a .ez file' - 'clean:Clean generated application files' + 'app.start:Start all registered apps' + 'archive:List all archives' + 'archive.build:Archive this project into a .ez file' + 'archive.install:Install an archive locally' + 'archive.uninstall:Uninstall archives' + 'clean:Delete generated application files' + 'cmd:Executes the given command' 'compile:Compile source files' + 'compile.protocols:Consolidates all protocols in all paths' 'deps:List dependencies and their status' - "deps.clean:Remove dependencies' files" + "deps.clean:Remove the given dependencies' files" 'deps.compile:Compile dependencies' 'deps.get:Get all out of date dependencies' 'deps.unlock:Unlock the given dependencies' - 'deps.update:Update dependencies' - 'do:Executes the commands separated by comma' - 'escriptize:Generates an escript for the project' + 'deps.update:Update the given dependencies' + 'do:Executes the tasks separated by comma' + 'escript.build:Builds an escript for the project' 'help:Print help information for tasks' + 'hex:Print hex help information' + 'hex.config:Read or update hex config' + 'hex.docs:Publish docs for package' + 'hex.info:Print hex information' + 'hex.key:Hex API key tasks' + 'hex.outdated:Shows outdated hex deps for the current project' + 'hex.owner:Hex package ownership tasks' + 'hex.publish:Publish a new package version' + 'hex.search:Search for package names' + 'hex.user:Hex user tasks' + 'loadconfig:Loads and persists the given configuration' 'local:List local tasks' - 'local.install:Install a task or an archive locally' + 'local.hex:Install hex locally' 'local.rebar:Install rebar locally' - 'local.uninstall:Uninstall local tasks or archives' - 'local.hex:Install Hex locally' - 'new:Creates a new Elixir project' + 'new:Create a new Elixir project' 'run:Run the given file or expression' "test:Run a project's tests" '--help:Describe available tasks' @@ -34,7 +49,7 @@ __task_list () local expl declare -a tasks - tasks=(archive clean compile deps deps.clean deps.compile deps.get deps.unlock deps.update do escriptize help local local.install local.rebar local.uninstall new run test) + tasks=(app.start archive archive.build archive.install archive.uninstall clean cmd compile compile.protocols deps deps.clean deps.compile deps.get deps.unlock deps.update do escript.build help hex hex.config hex.docs hex.info hex.key hex.outdated hex.owner hex.publish hex.search hex.user loadconfig local local.hex local.rebar new run test) _wanted tasks expl 'help' compadd $tasks } @@ -57,7 +72,7 @@ case $state in (options) case $line[1] in (help) - _arguments ':feature:__task_list' + _arguments ':feature:__task_list' esac ;; esac From 81eec406c8186a8f15763cf21230e0f1164942c9 Mon Sep 17 00:00:00 2001 From: Michele Bologna Date: Thu, 28 May 2015 16:25:49 +0200 Subject: [PATCH 73/99] * Added header with help and information * Moved git information to left prompt, with support for: * +ZSH_THEME_GIT_PROMPT_UNTRACKED, MODIFIED, STASHED, ADDED, UPSTREAM STATUS (if applicable) * Removed right prompt * Refactored following Google's guidelines for scripts [ http://goo.gl/oJSXH2 ] * Using local variables where applicable --- themes/michelebologna.zsh-theme | 114 ++++++++++++++++++++------------ 1 file changed, 72 insertions(+), 42 deletions(-) diff --git a/themes/michelebologna.zsh-theme b/themes/michelebologna.zsh-theme index a7599c8f52ce..fec2438734af 100644 --- a/themes/michelebologna.zsh-theme +++ b/themes/michelebologna.zsh-theme @@ -1,44 +1,74 @@ -# reference colors -GREEN="%{$fg_bold[green]%}" -RED="%{$fg_bold[red]%}" -CYAN="%{$fg_bold[cyan]%}" -YELLOW="%{$fg_bold[yellow]%}" -BLUE="%{$fg_bold[blue]%}" -MAGENTA="%{$fg_bold[magenta]%}" -WHITE="%{$fg_bold[white]%}" - -COLOR_ARRAY=($GREEN $RED $CYAN $YELLOW $BLUE $MAGENTA $WHITE) - -# color reset -RESET_COLOR="%{$reset_color%}" - -# which color should be applied? -USERNAME_NORMAL_COLOR=$WHITE -USERNAME_ROOT_COLOR=$RED -HOSTNAME_NORMAL_COLOR=$BLUE -# uncomment next line if you want auto-generated hostname color -#for i in $HOST; HOSTNAME_NORMAL_COLOR=$COLOR_ARRAY[$[((#i))%7+1]] -HOSTNAME_ROOT_COLOR=$RED -HOSTNAME_COLOR=%(!.$HOSTNAME_ROOT_COLOR.$HOSTNAME_NORMAL_COLOR) -CURRENT_DIR_COLOR=$CYAN - -# zsh commands -USERNAME_COMMAND="%n" -HOSTNAME_COMMAND="%m" -CURRENT_DIR="%~" - -# output: colors + commands -USERNAME_OUTPUT="%(!..$USERNAME_NORMAL_COLOR$USERNAME_COMMAND$RESET_COLOR@)" -HOSTNAME_OUTPUT="$HOSTNAME_COLOR$HOSTNAME_COMMAND$RESET_COLOR" -CURRENT_DIR_OUTPUT="$CURRENT_DIR_COLOR$CURRENT_DIR" -LAST_COMMAND_OUTPUT="%(?.%(!.$RED.$GREEN).$YELLOW)" - -# git theming -ZSH_THEME_GIT_PROMPT_PREFIX="(" +# Michele Bologna's theme +# http://michelebologna.net +# +# This a theme for oh-my-zsh. Features a colored prompt with: +# * username@host: [jobs] [git] workdir % +# * hostname color is based on hostname characters. When using as root, the +# prompt shows only the hostname in red color. +# * [jobs], if applicable, counts the number of suspended jobs tty +# * [git], if applicable, represents the status of your git repo (more on that +# later) +# * '%' prompt will be green if last command return value is 0, yellow otherwise. +# +# git prompt is inspired by official git contrib prompt: +# https://github.com/git/git/tree/master/contrib/completion/git-prompt.sh +# and it adds: +# * the current branch +# * '%' if there are untracked files +# * '$' if there are stashed changes +# * '*' if there are modified files +# * '+' if there are added files +# * '<' if local repo is behind remote repo +# * '>' if local repo is ahead remote repo +# * '=' if local repo is equal to remote repo (in sync) +# * '<>' if local repo is diverged + +local green="%{$fg_bold[green]%}" +local red="%{$fg_bold[red]%}" +local cyan="%{$fg_bold[cyan]%}" +local yellow="%{$fg_bold[yellow]%}" +local blue="%{$fg_bold[blue]%}" +local magenta="%{$fg_bold[magenta]%}" +local white="%{$fg_bold[white]%}" +local reset="%{$reset_color%}" + +local -a color_array +color_array=($green $red $cyan $yellow $blue $magenta $white) + +local username_normal_color=$white +local username_root_color=$red +local hostname_root_color=$red + +# calculating hostname color with hostname characters +for i in `hostname`; local hostname_normal_color=$color_array[$[((#i))%7+1]] +local -a hostname_color +hostname_color=%(!.$hostname_root_color.$hostname_normal_color) + +local current_dir_color=$blue +local username_command="%n" +local hostname_command="%m" +local current_dir="%~" + +local username_output="%(!..$username_normal_color$username_command$reset@)" +local hostname_output="$hostname_color$hostname_command$reset" +local current_dir_output="$current_dir_color$current_dir$reset" +local jobs_bg="${red}fg: %j$reset" +local last_command_output="%(?.%(!.$red.$green).$yellow)" + +ZSH_THEME_GIT_PROMPT_PREFIX="" ZSH_THEME_GIT_PROMPT_SUFFIX="" -ZSH_THEME_GIT_PROMPT_DIRTY=")$RED*" -ZSH_THEME_GIT_PROMPT_CLEAN=")" +ZSH_THEME_GIT_PROMPT_DIRTY="" +ZSH_THEME_GIT_PROMPT_CLEAN="" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%%" +ZSH_THEME_GIT_PROMPT_MODIFIED="*" +ZSH_THEME_GIT_PROMPT_ADDED="+" +ZSH_THEME_GIT_PROMPT_STASHED="$" +ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE="=" +ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE=">" +ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE="<" +ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE="<>" -# wrap all together -PROMPT='$USERNAME_OUTPUT$HOSTNAME_OUTPUT:$CURRENT_DIR_OUTPUT $LAST_COMMAND_OUTPUT%#$RESET_COLOR ' -RPROMPT='%1(j.fg: [%j].) $GREEN$(git_prompt_info)$RESET_COLOR [%@]' +PROMPT='$username_output$hostname_output:$current_dir_output%1(j. [$jobs_bg].)' +PROMPT+='$(__git_ps1)' +PROMPT+=" $last_command_output%#$reset " +RPROMPT='' From 8eb31a6f9a053ea22ea88ccba3d91a4694674300 Mon Sep 17 00:00:00 2001 From: ncanceill Date: Thu, 11 Jun 2015 23:34:18 +0200 Subject: [PATCH 74/99] git plugin: fix ggpnp when called without argument also allow multiple arguments for ggp and ggl aliases --- plugins/git/git.plugin.zsh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index dec787a8c28b..5cceb8d256e2 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -99,21 +99,29 @@ git push --force origin "${b:=$1}" } compdef _git ggf=git-checkout ggl() { -[[ "$#" != 1 ]] && local b="$(current_branch)" -git pull origin "${b:=$1}" +[[ "$#" == 0 ]] && local b="$(current_branch)" +git pull origin "${b:=$1}" "${*[2,-1]}" } compdef _git ggl=git-checkout alias ggpull='ggl' compdef _git ggpull=git-checkout ggp() { -[[ "$#" != 1 ]] && local b="$(current_branch)" +if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then +git push origin "${*}" +else +[[ "$#" == 0 ]] && local b="$(current_branch)" git push origin "${b:=$1}" +fi } compdef _git ggp=git-checkout alias ggpush='ggp' compdef _git ggpush=git-checkout ggpnp() { -ggl "$1" && ggp "$1" +if [[ "$#" == 0 ]]; then +ggl && ggp +else +ggl "${*}" && ggp "${*}" +fi } compdef _git ggpnp=git-checkout alias ggsup='git branch --set-upstream-to=origin/$(current_branch)' From 3f9298514e22d6e5923f14f98b825f1688158781 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Mon, 25 May 2015 01:15:37 +0200 Subject: [PATCH 75/99] Added references to the `external themes` wiki page. --- README.markdown | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index 5d4819d764fe..3805d1eb41f6 100644 --- a/README.markdown +++ b/README.markdown @@ -67,6 +67,8 @@ To use a different theme, simple change the value to match the name of your desi Open up a new terminal window and your prompt should look something like... +In case you did not find a suitable theme for your needs, please have a look at the wiki for [more themes](https://github.com/robbyrussell/oh-my-zsh/wiki/External-themes). + ## Advanced Topics If you're the type that likes to get their hands dirty... these sections might resonate. @@ -154,7 +156,7 @@ We also need people to test out pull-requests. So take a look through [the open ### Do NOT Send Us Themes -We have (more than) enough themes for the time being. Please fork the project and add one in there – you can let people know how to grab it from there. +We have (more than) enough themes for the time being. Please add your theme to the [external themes](https://github.com/robbyrussell/oh-my-zsh/wiki/External-themes) wiki page. ## Contributors From e0ce87632d1d8ecb609bb96202a8fb3151f6be4f Mon Sep 17 00:00:00 2001 From: KhasMek Date: Fri, 8 May 2015 15:42:26 -0600 Subject: [PATCH 76/99] Plugins: apache2-macports - add README --- plugins/apache2-macports/README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 plugins/apache2-macports/README.md diff --git a/plugins/apache2-macports/README.md b/plugins/apache2-macports/README.md new file mode 100644 index 000000000000..099fc8da31db --- /dev/null +++ b/plugins/apache2-macports/README.md @@ -0,0 +1,19 @@ +## APACHE2 MACPORTS PLUGIN + + +--- + +### FEATURES + +| Alias | Function | Description | +|:--------------:|:-------------------------------------------------------------------------------|----------------------:| +| apache2restart | sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper restart | Restart apache daemon | +| apache2start | sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper start | Start apache daemon | +| apache2stop | sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper stop | Stop apache daemon | + +--- + +### CONTRIBUTORS + - Alexander Rinass (alex@rinass.net) + +--- From e5929680fdd4adb7b0942f16b58f99e1695ce8b8 Mon Sep 17 00:00:00 2001 From: KhasMek Date: Fri, 8 May 2015 13:18:06 -0600 Subject: [PATCH 77/99] Plugins: archlinux - use command -v in favor of which The command 'which' launches an external process that isn't really necessary. --- plugins/archlinux/archlinux.plugin.zsh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index 6330a2152b59..b83c24560bf8 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -2,7 +2,7 @@ # Usage is also described at https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins # Look for yaourt, and add some useful functions if we have it. -if [[ -x `which yaourt` ]]; then +if [[ -x `command -v yaourt` ]]; then upgrade () { yaourt -Syu } @@ -21,11 +21,11 @@ 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 `command -v abs` && -x `command -v 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 + elif [[ -x `command -v abs` ]]; then alias yaupd='yaourt -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories - elif [[ -x `which aur` ]]; then + elif [[ -x `command -v 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 database against repositories @@ -49,11 +49,11 @@ 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` && -x `which aur` ]]; then +if [[ -x `command -v abs` && -x `command -v 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 +elif [[ -x `command -v 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 +elif [[ -x `command -v 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 database against repositories From 0f96e8e6c20c25ba6bc78c3df425aec61bfbaa3c Mon Sep 17 00:00:00 2001 From: KhasMek Date: Fri, 8 May 2015 13:28:32 -0600 Subject: [PATCH 78/99] Plugins: archlinux - add basic README. --- plugins/archlinux/README.md | 64 +++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 plugins/archlinux/README.md diff --git a/plugins/archlinux/README.md b/plugins/archlinux/README.md new file mode 100644 index 000000000000..ad42d4cd282b --- /dev/null +++ b/plugins/archlinux/README.md @@ -0,0 +1,64 @@ +## ARCHLINUX PLUGIN + + +--- + +### FEATURES + +| Alias | Function | Description | +|:------------:|-----------------------------------------|:--------------------------------------------------------------------------------------------------------------------| +| pacin | sudo pacman -S | Install specific package(s) from the repositories | +| pacins | sudo pacman -U | Install specific package not from the repositories but from a file | +| pacinsd | sudo pacman -S --asdeps | Install given package(s) as dependencies of another package | +| pacloc | pacman -Qi | Display information about a given package in the local database | +| paclocs | pacman -Qs | Search for package(s) in the local database | +| paclsorphans | sudo pacman -Qdt' | List all orphaned packages | +| pacmir | sudo pacman -Syy | Force refresh of all package lists after updating /etc/pacman.d/mirrorlist | +| pacre | sudo pacman -R | Remove the specified package(s), retaining its configuration(s) and required dependencies | +| pacrem | sudo pacman -Rns | Remove the specified package(s), its configuration(s) and unneeded dependencies | +| pacrep | pacman -Si | Display information about a given package in the repositories | +| pacreps | pacman -Ss | Search for package(s) in the repositories | +| pacrmorphans | sudo pacman -Rs $(pacman -Qtdq)' | Delete all orphaned packages | +| pacupd | sudo pacman -Sy && sudo abs && sudo aur | Update and refresh the local package, ABS and AUR databases against repositories | +| pacupd | sudo pacman -Sy && sudo abs | Update and refresh the local package and ABS databases against repositories | +| pacupd | sudo pacman -Sy && sudo aur | Update and refresh the local package and AUR databases against repositories | +| pacupd | sudo pacman -Sy | Update and refresh the local package database against repositories | +| pacupg | sudo pacman -Syu | Synchronize with repositories before upgrading packages that are out of date on the local system. | +| yaconf | yaourt -C | Fix all configuration files with vimdiff | +| yain | yaourt -S | Install specific package(s) from the repositories | +| yains | yaourt -U | Install specific package not from the repositories but from a file | +| yainsd | yaourt -S --asdeps | Install given package(s) as dependencies of another package | +| yaloc | yaourt -Qi | Display information about a given package in the local database | +| yalocs | yaourt -Qs | Search for package(s) in the local database | +| yalst | yaourt -Qe | List installed packages, even those installed from AUR (they're tagged as "local") | +| yamir | yaourt -Syy | Force refresh of all package lists after updating /etc/pacman.d/mirrorlist | +| yaorph | yaourt -Qtd | Remove orphans using yaourt | +| yare | yaourt -R | Remove the specified package(s), retaining its configuration(s) and required dependencies | +| yarem | yaourt -Rns | Remove the specified package(s), its configuration(s) and unneeded dependencies | +| yarep | yaourt -Si | Display information about a given package in the repositories | +| yareps | yaourt -Ss | Search for package(s) in the repositories | +| yasu | yaourt --sucre | Same as yaupg, but without confirmation | +| yaupd | yaourt -Sy && sudo abs && sudo aur | Update and refresh the local package, ABS and AUR databases against repositories | +| yaupd | yaourt -Sy && sudo abs | Update and refresh the local package and ABS databases against repositories | +| yaupd | yaourt -Sy && sudo aur | Update and refresh the local package and AUR databases against repositories | +| yaupd | yaourt -Sy | Update and refresh the local package database against repositories | +| yaupg | yaourt -Syua | Synchronize with repositories before upgrading packages (AUR packages too) that are out of date on the local system | + +| Function | Description | +|----------------|:------------------------------------------------------------------------------------------------------------------| +| pacdisowned | List all disowned files in your system | +| paclist | List all installed packages with a short description - [Source](https://bbs.archlinux.org/viewtopic.php?id=93683) | +| pacmanallkeys | Get all keys for developers and trusted users | +| pacmansignkeys | | + +--- + +### CONTRIBUTORS + - Benjamin Boudreau - dreurmail@gmail.com + - Celso Miranda - contacto@celsomiranda.net + - KhasMek - Boushh@gmail.com + - Martin Putniorz - mputniorz@gmail.com + - MatthR3D - matthr3d@gmail.com + - ornicar - thibault.duplessis@gmail.com + +--- From 0e35bd4001494782fb1956acaebadf2f81c25b42 Mon Sep 17 00:00:00 2001 From: "Daniel Campoverde [alx741]" Date: Sun, 29 Mar 2015 00:12:58 -0500 Subject: [PATCH 79/99] Plugins: vi-mode: Add first README file --- plugins/vi-mode/README.md | 75 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 plugins/vi-mode/README.md diff --git a/plugins/vi-mode/README.md b/plugins/vi-mode/README.md new file mode 100644 index 000000000000..03e67cca27a3 --- /dev/null +++ b/plugins/vi-mode/README.md @@ -0,0 +1,75 @@ +vi-mode +======= +This plugin increase `vi-like` zsh functionality. + +Use `ESC` or `CTRL-[` to enter `Normal mode`. + + +History +------- + +- `ctrl-p` : Previous command in history +- `ctrl-n` : Next command in history +- `/` : Search backward in history +- `n` : Repeat the last `/` + + +Mode indicators +--------------- + +*Normal mode* is indicated with red `<<<` mark at the right prompt, when it +wasn't defined by theme. + + +Vim edition +----------- + +- `v` : Edit current command line in Vim + + +Movement +-------- + +- `$` : To the end of the line +- `^` : To the first non-blank character of the line +- `0` : To the first character of the line +- `w` : [count] words forward +- `W` : [count] WORDS forward +- `e` : Forward to the end of word [count] inclusive +- `E` : Forward to the end of WORD [count] inclusive +- `b` : [count] words backward +- `B` : [count] WORDS backward +- `t{char}` : Till before [count]'th occurrence of {char} to the right +- `T{char}` : Till before [count]'th occurrence of {char} to the left +- `f{char}` : To [count]'th occurrence of {char} to the right +- `F{char}` : To [count]'th occurrence of {char} to the left +- `;` : Repeat latest f, t, F or T [count] times +- `,` : Repeat latest f, t, F or T in opposite direction + + +Insertion +--------- + +- `i` : Insert text before the cursor +- `I` : Insert text before the first character in the line +- `a` : Append text after the cursor +- `A` : Append text at the end of the line +- `o` : Insert new command line below the current one +- `O` : Insert new command line above the current one + + +Delete and Insert +----------------- + +- `ctrl-h` : While in *Insert mode*: delete character after the cursor +- `ctrl-w` : While in *Insert mode*: delete word after the cursor +- `d{motion}` : Delete text that {motion} moves over +- `dd` : Delete line +- `D` : Delete characters under the cursor until the end of the line +- `c{motion}` : Delete {motion} text and start insert +- `cc` : Delete line and start insert +- `C` : Delete to the end of the line and start insert +- `r{char}` : Replace the character under the cursor with {char} +- `R` : Enter replace mode: Each character replaces existing one +- `x` : Delete [count] characters under and after the cursor +- `X` : Delete [count] characters before the cursor From c28b226af2dc0843ab0f05ea4abc54c4bdfd7012 Mon Sep 17 00:00:00 2001 From: CkEsc Date: Tue, 3 Mar 2015 23:03:44 +0300 Subject: [PATCH 80/99] Fix README.md for sst command --- plugins/sublime/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/sublime/README.md b/plugins/sublime/README.md index e38cf66dc0d9..e1e666f05413 100644 --- a/plugins/sublime/README.md +++ b/plugins/sublime/README.md @@ -14,4 +14,6 @@ Plugin for Sublime Text, a cross platform text and code editor, available for Li * If `st` is passed a file, open it in Sublime Text - * if `stt` command is called, it is equivalent to `st .`, opening the current folder in Sublime Text \ No newline at end of file + * If `stt` command is called, it is equivalent to `st .`, opening the current folder in Sublime Text + + * If `sst` command is called, it is like `sudo st`, opening the file or folder in Sublime Text. Useful for editing system protected files. \ No newline at end of file From a2d7d36e70abbdd1dc9b0f06e8841d4f74226195 Mon Sep 17 00:00:00 2001 From: wyldphyre Date: Fri, 27 Feb 2015 10:56:14 +0800 Subject: [PATCH 81/99] Added README.md file --- plugins/history/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 plugins/history/README.md diff --git a/plugins/history/README.md b/plugins/history/README.md new file mode 100644 index 000000000000..dd9286894ba3 --- /dev/null +++ b/plugins/history/README.md @@ -0,0 +1,15 @@ +## history + +Provides a couple of convenient aliases for using the `history` command to examine your command line history. + +### Requirements + +* None. + +### Usage + +* If `h` is called, your command history is listed. Equivalent to using `history` + +* If `hsi` is called with an argument, a **case insensitive** `grep` search is performed on your command history, looking for commands that match the argument provided + +* If `hsi` is called without an argument you will help on `grep` arguments \ No newline at end of file From 81da07602c8e99548ffbe4d110d40ea5873f20fe Mon Sep 17 00:00:00 2001 From: wyldphyre Date: Fri, 27 Feb 2015 11:05:05 +0800 Subject: [PATCH 82/99] Added README.md file for atom plugin --- plugins/atom/README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 plugins/atom/README.md diff --git a/plugins/atom/README.md b/plugins/atom/README.md new file mode 100644 index 000000000000..75d77a0ac1c3 --- /dev/null +++ b/plugins/atom/README.md @@ -0,0 +1,17 @@ +## atom + +Plugin for Atom, a cross platform text and code editor, available for Linux, Mac OS X, and Windows. + +### Requirements + + * [Atom](https://atom.io/) + +### Usage + + * If `at` command is called without an argument, launch Atom + + * If `at` is passed a directory, `cd` to it and open it in Atom + + * If `at` is passed a file, open it in Atom + + * if `att` command is called, it is equivalent to `at .`, opening the current folder in Atom From cf3fb873ec0cc0ec428e9c05dcac998d3b3f956c Mon Sep 17 00:00:00 2001 From: wyldphyre Date: Fri, 27 Feb 2015 13:38:31 +0800 Subject: [PATCH 83/99] Added README.md file for ForkLift plugin --- plugins/forklift/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 plugins/forklift/README.md diff --git a/plugins/forklift/README.md b/plugins/forklift/README.md new file mode 100644 index 000000000000..b452a357cd60 --- /dev/null +++ b/plugins/forklift/README.md @@ -0,0 +1,13 @@ +## forklift + +Plugin for ForkLift, an FTP application for OS X. + +### Requirements + +* [ForkLift](http://forkliftapp.com/forklift/) + +### Usage + +* If `fl` is called without arguments then the current folder is opened in ForkLift. Is equivalent to `fl .` + +* If `fl` is called with a directory as the argument, then that directory is opened in ForkLift \ No newline at end of file From 4b76b7429a820e7eda8bed6c214d81a275be30b9 Mon Sep 17 00:00:00 2001 From: Vadim Date: Sun, 28 Dec 2014 01:54:18 +0200 Subject: [PATCH 84/99] remove trash command from osx plugin --- plugins/osx/osx.plugin.zsh | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh index d0f9f009a21c..a6e3a83e6a73 100644 --- a/plugins/osx/osx.plugin.zsh +++ b/plugins/osx/osx.plugin.zsh @@ -138,23 +138,6 @@ function man-preview() { man -t "$@" | open -f -a Preview } -function trash() { - local trash_dir="${HOME}/.Trash" - local temp_ifs="$IFS" - IFS=$'\n' - for item in "$@"; do - if [[ -e "$item" ]]; then - item_name="$(basename $item)" - if [[ -e "${trash_dir}/${item_name}" ]]; then - mv -f "$item" "${trash_dir}/${item_name} $(date "+%H-%M-%S")" - else - mv -f "$item" "${trash_dir}/" - fi - fi - done - IFS=$temp_ifs -} - function vncviewer() { open vnc://$@ } From 763cef8013c90c3ea0b1edfe8c903008a7406bce Mon Sep 17 00:00:00 2001 From: Erlend Hamberg Date: Mon, 20 Oct 2014 18:53:57 +0200 Subject: [PATCH 85/99] Add `leaves` command to `brew` completion --- plugins/brew/_brew | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/brew/_brew b/plugins/brew/_brew index d11aa245de88..4c99a383ae23 100644 --- a/plugins/brew/_brew +++ b/plugins/brew/_brew @@ -35,6 +35,7 @@ _1st_arguments=( 'info:information about a formula' 'install:install a formula' 'reinstall:install a formula anew; re-using its current options' + 'leaves:show installed formulae that are not dependencies of another installed formula' 'link:link a formula' 'list:list files in a formula or not-installed formulae' 'log:git commit log for a formula' From e55d84f76e07785bec38d802b447df1fc93512f2 Mon Sep 17 00:00:00 2001 From: Filip Bartuzi Date: Sun, 12 Oct 2014 12:29:33 +0200 Subject: [PATCH 86/99] Add reference to bundler plugin issue in README --- plugins/bundler/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler/README.md b/plugins/bundler/README.md index 56f0c71767c6..edd95ccc23a3 100644 --- a/plugins/bundler/README.md +++ b/plugins/bundler/README.md @@ -39,7 +39,7 @@ This will exclude the `foreman` and `spin` gems (i.e. their executable) from bei ## Excluded gems -These gems should not be called with `bundle exec`. Please see the Issues on GitHub for clarification. +These gems should not be called with `bundle exec`. Please see [issue #2923](https://github.com/robbyrussell/oh-my-zsh/pull/2923) on GitHub for clarification. `berks` `foreman` From f1a43daa36efdbf5c75dbc07927310b25259a114 Mon Sep 17 00:00:00 2001 From: ncanceill Date: Fri, 12 Jun 2015 11:50:30 +0200 Subject: [PATCH 87/99] =?UTF-8?q?git=20plugin:=20new/changed=20aliases=20g?= =?UTF-8?q?aa=20was=20brought=20back=20by=20popular=20demand=20=E2=80=94?= =?UTF-8?q?=20see=20#3535=20gap=20was=20replaced=20with=20gapa=20=E2=80=94?= =?UTF-8?q?=20see=20#3682=20gdc=20was=20replaced=20with=20gdca=20=E2=80=94?= =?UTF-8?q?=20see=20#3977?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/git/git.plugin.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 5cceb8d256e2..d59e0ca9f92f 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -48,6 +48,8 @@ function work_in_progress() { alias g='git' alias ga='git add' +alias gaa='git add --all' +alias gapa='git add --patch' alias gb='git branch' alias gba='git branch -a' @@ -79,7 +81,7 @@ alias gcp='git cherry-pick' alias gcs='git commit -S' alias gd='git diff' -alias gdc='git diff --cached' +alias gdca='git diff --cached' alias gdt='git diff-tree --no-commit-id --name-only -r' gdv() { git diff -w "$@" | view - } compdef _git gdv=git-diff From d0b690b584fa48946cfd93014aa6033ec0cc7fc3 Mon Sep 17 00:00:00 2001 From: Tommy Wang Date: Wed, 10 Jun 2015 10:01:38 -0500 Subject: [PATCH 88/99] use local options to set no_equals before sourcing bash completion script --- .../virtualenvwrapper/virtualenvwrapper.plugin.zsh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh index 5faa1a823aa7..b2c804edb298 100644 --- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh +++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh @@ -1,10 +1,18 @@ virtualenvwrapper='virtualenvwrapper.sh' if (( $+commands[$virtualenvwrapper] )); then - source ${${virtualenvwrapper}:c} + function { + setopt local_options + unsetopt equals + source ${${virtualenvwrapper}:c} + } elif [[ -f "/etc/bash_completion.d/virtualenvwrapper" ]]; then - virtualenvwrapper="/etc/bash_completion.d/virtualenvwrapper" - source "/etc/bash_completion.d/virtualenvwrapper" + function { + setopt local_options + unsetopt equals + virtualenvwrapper="/etc/bash_completion.d/virtualenvwrapper" + source "/etc/bash_completion.d/virtualenvwrapper" + } else print "zsh virtualenvwrapper plugin: Cannot find ${virtualenvwrapper}.\n"\ "Please install with \`pip install virtualenvwrapper\`" >&2 From 83295ec9bc0a7c16a706a76c3c1f4a6ddd91948a Mon Sep 17 00:00:00 2001 From: Christian Hoener zu Siederdissen Date: Sat, 13 Sep 2014 20:41:47 +0200 Subject: [PATCH 89/99] last-working-dir working with spaces in dirnames --- plugins/last-working-dir/last-working-dir.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/last-working-dir/last-working-dir.plugin.zsh b/plugins/last-working-dir/last-working-dir.plugin.zsh index 4fa6fcc34800..75041f08ef63 100644 --- a/plugins/last-working-dir/last-working-dir.plugin.zsh +++ b/plugins/last-working-dir/last-working-dir.plugin.zsh @@ -15,7 +15,7 @@ function chpwd() { # Changes directory to the last working directory. function lwd() { - [[ ! -r "$cache_file" ]] || cd `cat "$cache_file"` + [[ ! -r "$cache_file" ]] || cd "`cat "$cache_file"`" } # Automatically jump to last working directory unless this isn't the first time From 8b95bdb5e0059a6007b24f2d60e1719c791c8cce Mon Sep 17 00:00:00 2001 From: Sriram Sundarraj Date: Sun, 19 Apr 2015 22:27:03 +0530 Subject: [PATCH 90/99] Added github in web_search plugin. --- plugins/web-search/web-search.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh index 572427b0b612..d407edb964f6 100644 --- a/plugins/web-search/web-search.plugin.zsh +++ b/plugins/web-search/web-search.plugin.zsh @@ -11,6 +11,7 @@ function web_search() { yahoo "https://search.yahoo.com/search?p=" duckduckgo "https://www.duckduckgo.com/?q=" yandex "https://yandex.ru/yandsearch?text=" + github "https://github.com/search?q=" ) # define the open command @@ -49,6 +50,7 @@ alias google='web_search google' alias yahoo='web_search yahoo' alias ddg='web_search duckduckgo' alias yandex='web_search yandex' +alias github='web_search github' #add your own !bang searches here alias wiki='web_search duckduckgo \!w' From 26c7adf1107043419582c3d7a7dbb204ff70cbcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Fri, 5 Jun 2015 18:58:13 +0200 Subject: [PATCH 91/99] Revert "Added migration notification for rails plugin" This reverts commit 1493d88e3f92c7034da5c1b1638ba19544aa3ccb, made to put a deprecated notice on rails3 and rails4 plugins, so that users would migrate to the unified rails plugin. It's been 1.5 years since that, so everyone should be migrated to the good one. --- plugins/rails3/rails3.plugin.zsh | 4 ---- plugins/rails4/rails4.plugin.zsh | 4 ---- 2 files changed, 8 deletions(-) delete mode 100644 plugins/rails3/rails3.plugin.zsh delete mode 100644 plugins/rails4/rails4.plugin.zsh diff --git a/plugins/rails3/rails3.plugin.zsh b/plugins/rails3/rails3.plugin.zsh deleted file mode 100644 index 261b921087d2..000000000000 --- a/plugins/rails3/rails3.plugin.zsh +++ /dev/null @@ -1,4 +0,0 @@ -echo "It looks like you have been using the 'rails3' plugin," -echo "which has been deprecated in favor of a newly consolidated 'rails' plugin." -echo "You will want to modify your ~/.zshrc configuration to begin using it." -echo "Learn more at https://github.com/robbyrussell/oh-my-zsh/pull/2240" diff --git a/plugins/rails4/rails4.plugin.zsh b/plugins/rails4/rails4.plugin.zsh deleted file mode 100644 index 5452c242cab5..000000000000 --- a/plugins/rails4/rails4.plugin.zsh +++ /dev/null @@ -1,4 +0,0 @@ -echo "It looks like you have been using the 'rails4' plugin," -echo "which has been deprecated in favor of a newly consolidated 'rails' plugin." -echo "You will want to modify your ~/.zshrc configuration to begin using it." -echo "Learn more at https://github.com/robbyrussell/oh-my-zsh/pull/2240" From 4cc0a2638c46cebda5bc6616fa3f94c720c5686d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A4ntz=20Miccoli?= Date: Mon, 16 Dec 2013 00:39:26 +0100 Subject: [PATCH 92/99] A paver (Python build and configuration utility) plugin --- plugins/paver/paver.plugin.zsh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 plugins/paver/paver.plugin.zsh diff --git a/plugins/paver/paver.plugin.zsh b/plugins/paver/paver.plugin.zsh new file mode 100644 index 000000000000..40bdbd12f9b4 --- /dev/null +++ b/plugins/paver/paver.plugin.zsh @@ -0,0 +1,16 @@ +_paver_does_target_list_need_generating () { + [ ! -f .paver_targets ] && return 0; + [ pavement.py -nt .paver_targets ] && return 0; + return 1; +} + +_paver () { + if [ -f pavement.py ]; then + if _paver_does_target_list_need_generating; then + paver --help 2>&1 |grep '-'|grep -v -e '--'|awk -F '-' '{print $1}'|tr -d ' ' > .paver_targets + fi + compadd `cat .paver_targets` + fi +} + +compdef _paver paver From 3d670c0bfc00858aff67f6b4dc161f4c0a0a5aef Mon Sep 17 00:00:00 2001 From: Michael Okner Date: Sat, 13 Jun 2015 08:59:10 -0500 Subject: [PATCH 93/99] Adding quotes to git completion discovery path Previously, spaces in the path would result in wto separate errouneous paths being parsed. This fixes that issue. --- plugins/gitfast/_git | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/gitfast/_git b/plugins/gitfast/_git index 6b7796857229..c75b0be7f1f1 100644 --- a/plugins/gitfast/_git +++ b/plugins/gitfast/_git @@ -30,7 +30,7 @@ if [ -z "$script" ]; then local -a locations local e locations=( - $(dirname ${funcsourcetrace[1]%:*})/git-completion.bash + "$(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 From 55b1a2befe3d041b54c6aa542bd11734db31a6d5 Mon Sep 17 00:00:00 2001 From: UserTaken Date: Sat, 13 Jun 2015 16:30:18 -0700 Subject: [PATCH 94/99] Update _docker --- plugins/docker/_docker | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/docker/_docker b/plugins/docker/_docker index bd494ecaa091..25f55beca384 100644 --- a/plugins/docker/_docker +++ b/plugins/docker/_docker @@ -52,11 +52,10 @@ __build() { __commit() { _arguments \ - '(-a,--author=)'{-a,--author=}'[Author (eg. "John Hannibal Smith "]' \ + '(-a,--author=)'{-a,--author=}'[Author (e.g. "John Hannibal Smith ")]' \ + '(-c,--change=)'{-c,--change=}'[Apply Dockerfile instruction to the created image]' \ '(-m,--message=)'{-m,--message=}'[Commit message]' \ - '--run=[Config automatically applied when the image is run.]' '(-p,--pause=)'{-p,--pause=}'[Pause container during commit]' \ - __docker_containers } __cp() { @@ -70,7 +69,8 @@ __create() { '--add-host=[Add a custom host-to-IP mapping]' \ '--cap-add=[Add Linux capabilities]' \ '--cap-drop=[Drop Linux capabilities]' \ - '(-c,--cpu-shares=)'{-c,--cpu-shares=}':[CPU shares (relative weight)]' \ + '--cpuset-cpus=[CPUs in which to allow execution (0-3, 0,1)]' \ + '(-c,--cpu-shares=)'{-c,--cpu-shares=}'[CPU shares (relative weight)]' \ '--cidfile=[Write the container ID to the file]' \ '--device=[Add a host device to the container]' \ '--dns=[Set custom dns servers]' \ @@ -227,7 +227,8 @@ __run() { '--add-host=[Add a custom host-to-IP mapping]' \ '--cap-add=[Add Linux capabilities]' \ '--cap-drop=[Drop Linux capabilities]' \ - '(-c,--cpu-shares=)'{-c,--cpu-shares=}':[CPU shares (relative weight)]' \ + '--cpuset-cpus=[CPUs in which to allow execution (0-3, 0,1)]' \ + '(-c,--cpu-shares=)'{-c,--cpu-shares=}'[CPU shares (relative weight)]' \ '--cidfile=[Write the container ID to the file]' \ '(-d,--detach=)'{-d,--detach=}'[Run container in the background, print new container id]' \ '--device=[Add a host device to the container]' \ From a7e79824f85a89cbcacbceab0277c9833dee4817 Mon Sep 17 00:00:00 2001 From: "Mikhail S. Pobolovets" Date: Mon, 6 Oct 2014 09:59:20 +0300 Subject: [PATCH 95/99] Add mix-fast plugin (similar to rake-fast) Signed-off-by: Mikhail S. Pobolovets --- plugins/mix-fast/README.md | 28 +++++++++++++++++++++++++++ plugins/mix-fast/mix-fast.plugin.zsh | 29 ++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 plugins/mix-fast/README.md create mode 100644 plugins/mix-fast/mix-fast.plugin.zsh diff --git a/plugins/mix-fast/README.md b/plugins/mix-fast/README.md new file mode 100644 index 000000000000..9a5eccc3f675 --- /dev/null +++ b/plugins/mix-fast/README.md @@ -0,0 +1,28 @@ +# mix-fast + +Fast mix autocompletion plugin. + +This script caches the output for later usage and significantly speeds it up. +It generates a .mix_tasks cache file for current project. Currently if you want +to update cache you should remove .mix_tasks file + +Inspired by and based on rake-fast zsh plugin. + +This is entirely based on [this pull request by Ullrich Schäfer](https://github.com/robb/.dotfiles/pull/10/), which is inspired by [this Ruby on Rails trick from 2006](http://weblog.rubyonrails.org/2006/3/9/fast-mix-task-completion-for-zsh/). + + +## Installation + +Just add the plugin to your `.zshrc`: + +```bash +plugins=(foo bar mix-fast) +``` + +You might consider adding `.mix_tasks` to your [global .gitignore](https://help.github.com/articles/ignoring-files#global-gitignore) + +## Usage + +`mix`, then press tab + +Currently maintained by [styx](https://github.com/styx/) \ No newline at end of file diff --git a/plugins/mix-fast/mix-fast.plugin.zsh b/plugins/mix-fast/mix-fast.plugin.zsh new file mode 100644 index 000000000000..3719c352554c --- /dev/null +++ b/plugins/mix-fast/mix-fast.plugin.zsh @@ -0,0 +1,29 @@ +_mix_refresh () { + if [ -f .mix_tasks ]; then + rm .mix_tasks + fi + echo "Generating .mix_tasks..." > /dev/stderr + _mix_generate + cat .mix_tasks +} + +_mix_does_task_list_need_generating () { + [ ! -f .mix_tasks ]; +} + +_mix_generate () { + mix --help | grep -v 'iex -S' | tail -n +2 | cut -d " " -f 2 > .mix_tasks +} + +_mix () { + if [ -f mix.exs ]; then + if _mix_does_task_list_need_generating; then + echo "\nGenerating .mix_tasks..." > /dev/stderr + _mix_generate + fi + compadd `cat .mix_tasks` + fi +} + +compdef _mix mix +alias mix_refresh='_mix_refresh' From c6460ef3e73f8f26f300dd8a24a83257b3b8579b Mon Sep 17 00:00:00 2001 From: ivanfoo Date: Mon, 15 Jun 2015 00:25:22 +0200 Subject: [PATCH 96/99] Fixed odd chars on mac for agnoster theme --- themes/agnoster.zsh-theme | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 8c7be6e0123e..9f67543f5927 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -26,7 +26,13 @@ # A few utility functions to make it easy and re-usable to draw segmented prompts CURRENT_BG='NONE' -SEGMENT_SEPARATOR='' + +# Fix odd char on mac +if [[ `uname` == 'Darwin' ]]; then + SEGMENT_SEPARATOR='\ue0b0' +else + SEGMENT_SEPARATOR='' +fi # Begin a segment # Takes two arguments, background and foreground. Both can be omitted, From f66a54fb7862b396e3fc09e7041ca6fee4b42a4a Mon Sep 17 00:00:00 2001 From: Ali Afshar Date: Sun, 14 Jun 2015 22:29:11 -0700 Subject: [PATCH 97/99] Add missing space causing parse error. --- lib/misc.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/misc.zsh b/lib/misc.zsh index e90836475130..6d1a64e8dbc5 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -1,6 +1,6 @@ ## Load smart urls if available for d in $fpath; do - if [[ -e "$d/url-quote-magic"]]; then + if [[ -e "$d/url-quote-magic" ]]; then autoload -U url-quote-magic zle -N self-insert url-quote-magic fi From ed6645a2823dc6c3e0fae822186d79542682e68e Mon Sep 17 00:00:00 2001 From: Arnaud Rinquin Date: Wed, 17 Jun 2015 13:25:09 +0100 Subject: [PATCH 98/99] Fix plugin/git ggpull and ggpush backward compatibility Current `ggpush` is `git push origin` instead of `git push origin $(current_branch)` Same for `ggpull` --- plugins/git/git.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index d59e0ca9f92f..1686187605a7 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -105,7 +105,7 @@ ggl() { git pull origin "${b:=$1}" "${*[2,-1]}" } compdef _git ggl=git-checkout -alias ggpull='ggl' +alias ggpull='git pull origin $(current_branch)' compdef _git ggpull=git-checkout ggp() { if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then @@ -116,7 +116,7 @@ git push origin "${b:=$1}" fi } compdef _git ggp=git-checkout -alias ggpush='ggp' +alias ggpush='git push origin $(current_branch)' compdef _git ggpush=git-checkout ggpnp() { if [[ "$#" == 0 ]]; then From d24196cfbdb1b1c7a7055d6dae97c4e4c3e2b4c3 Mon Sep 17 00:00:00 2001 From: ncanceill Date: Wed, 17 Jun 2015 22:38:31 +0200 Subject: [PATCH 99/99] git plugin: fix ggl to avoid empty string see https://github.com/robbyrussell/oh-my-zsh/pull/2790#issuecomment-112716330 --- plugins/git/git.plugin.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 1686187605a7..cc6eb1031b10 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -101,8 +101,12 @@ git push --force origin "${b:=$1}" } compdef _git ggf=git-checkout ggl() { +if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then +git pull origin "${*}" +else [[ "$#" == 0 ]] && local b="$(current_branch)" -git pull origin "${b:=$1}" "${*[2,-1]}" +git pull origin "${b:=$1}" +fi } compdef _git ggl=git-checkout alias ggpull='git pull origin $(current_branch)'