From 5fa4d9d7606057ccb8e39a452db9a656b5f3caed Mon Sep 17 00:00:00 2001
From: wangzengdi
Date: Tue, 31 May 2016 09:57:36 +0800
Subject: [PATCH 001/194] add alias gh=git help
---
plugins/git/git.plugin.zsh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
index eb7bc803..3187cab7 100644
--- a/plugins/git/git.plugin.zsh
+++ b/plugins/git/git.plugin.zsh
@@ -137,6 +137,8 @@ compdef _git ggu=git-checkout
alias ggpur='ggu'
compdef _git ggpur=git-checkout
+alias gh='git help'
+
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'
From 96a2092e377139fbcd95d7b7ac703b740daa22f6 Mon Sep 17 00:00:00 2001
From: Steven
Date: Fri, 15 Jul 2016 02:05:39 -0700
Subject: [PATCH 002/194] lib/git.zsh: Added git_commits_behind function
(#4450)
* Added git_commits_behind function
* Added 'command' to git_commits_behind function
* git_commits_behind code review changes
---
lib/git.zsh | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/lib/git.zsh b/lib/git.zsh
index 1c76d588..c79cc0d8 100644
--- a/lib/git.zsh
+++ b/lib/git.zsh
@@ -83,6 +83,13 @@ function git_commits_ahead() {
fi
}
+# Gets the number of commits behind remote
+function git_commits_behind() {
+ if $(command git rev-parse --git-dir > /dev/null 2>&1); then
+ echo $(git rev-list --count HEAD..@{upstream})
+ fi
+}
+
# Outputs if current branch is ahead of remote
function git_prompt_ahead() {
if [[ -n "$(command git rev-list origin/$(git_current_branch)..HEAD 2> /dev/null)" ]]; then
From bfbfef9fcf87cfb8ecab8b3ee13a27a9f7e392ae Mon Sep 17 00:00:00 2001
From: Jesse Donat
Date: Fri, 15 Jul 2016 14:30:09 -0500
Subject: [PATCH 003/194] Cleans up phing plugin.
---
plugins/phing/phing.plugin.zsh | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/plugins/phing/phing.plugin.zsh b/plugins/phing/phing.plugin.zsh
index 1f022047..60f59c3b 100644
--- a/plugins/phing/phing.plugin.zsh
+++ b/plugins/phing/phing.plugin.zsh
@@ -1,15 +1,6 @@
-_phing_does_target_list_need_generating () {
- [ ! -f .phing_targets ] && return 0;
- [ build.xml -nt .phing_targets ] && return 0;
- return 1;
-}
-
_phing () {
if [ -f build.xml ]; then
- if _phing_does_target_list_need_generating; then
- phing -l|grep -v "\[property\]"|grep -v "Buildfile"|sed 1d|grep -v ":$" |grep -v "^\-*$"|awk '{print $1}' > .phing_targets
- fi
- compadd `cat .phing_targets`
+ compadd $(phing -l|grep -v "\[property\]"|grep -v "Buildfile"|sed 1d|grep -v ":$" |grep -v "^\-*$"|awk '{print $1}')
fi
}
From c51823c04eee3889a17a957790ae5bf7f07fd5eb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20Lenart?=
Date: Tue, 16 Dec 2014 08:34:50 +0100
Subject: [PATCH 004/194] Remove warning lines from phing completion
Remove "Warning:" lines from phing targets list. Warning lines are
returned by phing when a target has no tasks or dependencies.
# Conflicts:
# plugins/phing/phing.plugin.zsh
---
plugins/phing/phing.plugin.zsh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/phing/phing.plugin.zsh b/plugins/phing/phing.plugin.zsh
index 60f59c3b..d5a2649b 100644
--- a/plugins/phing/phing.plugin.zsh
+++ b/plugins/phing/phing.plugin.zsh
@@ -1,6 +1,6 @@
_phing () {
if [ -f build.xml ]; then
- compadd $(phing -l|grep -v "\[property\]"|grep -v "Buildfile"|sed 1d|grep -v ":$" |grep -v "^\-*$"|awk '{print $1}')
+ compadd $(phing -l|grep -v "\[property\]"|grep -v "Buildfile"|sed 1d|grep -v ":$" |grep -v "^\-*$"|grep -v "Warning:"|awk '{print $1}')
fi
}
From eb244d9ec03a5f83102efa89d8d2231282f3c408 Mon Sep 17 00:00:00 2001
From: soredake
Date: Tue, 19 Jul 2016 01:20:59 +0300
Subject: [PATCH 005/194] Update emacs plugin. (#5201)
- Updated minimal version from 23 to 24.
- Added new aliases that fix unexpected close with -nw option.
- Removed some old aliases.
- Fixed line that detects open frames.
---
plugins/emacs/emacs.plugin.zsh | 7 +++----
plugins/emacs/emacsclient.sh | 12 ++++++------
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/plugins/emacs/emacs.plugin.zsh b/plugins/emacs/emacs.plugin.zsh
index a3f0085a..c102a5a1 100644
--- a/plugins/emacs/emacs.plugin.zsh
+++ b/plugins/emacs/emacs.plugin.zsh
@@ -10,7 +10,7 @@
# - Configuration changes made at runtime are applied to all frames.
-if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then
+if "$ZSH/tools/require_tool.sh" emacs 24 2>/dev/null ; then
export EMACS_PLUGIN_LAUNCHER="$ZSH/plugins/emacs/emacsclient.sh"
# set EDITOR if not already defined.
@@ -18,15 +18,14 @@ if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then
alias emacs="$EMACS_PLUGIN_LAUNCHER --no-wait"
alias e=emacs
+ # open terminal emacsclient
+ alias te="$EMACS_PLUGIN_LAUNCHER -nw"
# same than M-x eval but from outside Emacs.
alias eeval="$EMACS_PLUGIN_LAUNCHER --eval"
# create a new X frame
alias eframe='emacsclient --alternate-editor "" --create-frame'
- # to code all night long
- alias emasc=emacs
- alias emcas=emacs
# Write to standard output the path to the file
# opened in the current buffer.
diff --git a/plugins/emacs/emacsclient.sh b/plugins/emacs/emacsclient.sh
index 41682512..26b28d49 100755
--- a/plugins/emacs/emacsclient.sh
+++ b/plugins/emacs/emacsclient.sh
@@ -2,15 +2,15 @@
_emacsfun()
{
- # get list of available X windows.
- x=`emacsclient --alternate-editor '' --eval '(x-display-list)' 2>/dev/null`
+ # get list of emacs frames.
+ frameslist=`emacsclient --alternate-editor '' --eval '(frame-list)' 2>/dev/null | egrep -o '(frame)+'`
- if [ -z "$x" ] || [ "$x" = "nil" ] ;then
- # Create one if there is no X window yet.
- emacsclient --alternate-editor "" --create-frame "$@"
- else
+ if [ "$(echo "$frameslist" | sed -n '$=')" -ge 2 ] ;then
# prevent creating another X frame if there is at least one present.
emacsclient --alternate-editor "" "$@"
+ else
+ # Create one if there is no X window yet.
+ emacsclient --alternate-editor "" --create-frame "$@"
fi
}
From f4013053d302480b7663ad5c3a04d0442237a952 Mon Sep 17 00:00:00 2001
From: Julien Dubreuil
Date: Tue, 19 Jul 2016 00:24:12 +0200
Subject: [PATCH 006/194] Updated _docker-compose to the latest version (from
0.1.0 to 1.5.0). (#5215)
Also fixed formatting of markdown URL in README.
---
plugins/docker-compose/README.md | 3 +-
plugins/docker-compose/_docker-compose | 331 ++++++++++++++++++-------
2 files changed, 240 insertions(+), 94 deletions(-)
diff --git a/plugins/docker-compose/README.md b/plugins/docker-compose/README.md
index 567b8214..d3fcb29f 100644
--- a/plugins/docker-compose/README.md
+++ b/plugins/docker-compose/README.md
@@ -1,5 +1,4 @@
# Docker-compose plugin for oh my zsh
-A copy of the completion script from the [docker-compose](1) git repo.
+A copy of the completion script from the [docker-compose](https://github.com/docker/compose/blob/master/contrib/completion/zsh/_docker-compose) git repo.
-[1]:[https://github.com/docker/compose/blob/master/contrib/completion/zsh/_docker-compose]
diff --git a/plugins/docker-compose/_docker-compose b/plugins/docker-compose/_docker-compose
index 19c06675..2947cef3 100644
--- a/plugins/docker-compose/_docker-compose
+++ b/plugins/docker-compose/_docker-compose
@@ -7,7 +7,7 @@
# -------------------------------------------------------------------------
# Version
# -------
-# 0.1.0
+# 1.5.0
# -------------------------------------------------------------------------
# Authors
# -------
@@ -19,58 +19,69 @@
# * @felixr docker zsh completion script : https://github.com/felixr/docker-zsh-completion
# -------------------------------------------------------------------------
-# For compatibility reasons, Compose and therefore its completion supports several
-# stack compositon files as listed here, in descending priority.
-# Support for these filenames might be dropped in some future version.
-__docker-compose_compose_file() {
- local file
- for file in docker-compose.y{,a}ml fig.y{,a}ml ; do
- [ -e $file ] && {
- echo $file
- return
- }
- done
- echo docker-compose.yml
+__docker-compose_q() {
+ docker-compose 2>/dev/null $compose_options "$@"
}
-# Extracts all service names from docker-compose.yml.
-___docker-compose_all_services_in_compose_file() {
+# All services defined in docker-compose.yml
+__docker-compose_all_services_in_compose_file() {
local already_selected
local -a services
- already_selected=$(echo ${words[@]} | tr " " "|")
- awk -F: '/^[a-zA-Z0-9]/{print $1}' "${compose_file:-$(__docker-compose_compose_file)}" 2>/dev/null | grep -Ev "$already_selected"
+ already_selected=$(echo $words | tr " " "|")
+ __docker-compose_q config --services \
+ | grep -Ev "^(${already_selected})$"
}
# All services, even those without an existing container
__docker-compose_services_all() {
- services=$(___docker-compose_all_services_in_compose_file)
- _alternative "args:services:($services)"
+ [[ $PREFIX = -* ]] && return 1
+ integer ret=1
+ services=$(__docker-compose_all_services_in_compose_file)
+ _alternative "args:services:($services)" && ret=0
+
+ return ret
}
# All services that have an entry with the given key in their docker-compose.yml section
-___docker-compose_services_with_key() {
+__docker-compose_services_with_key() {
local already_selected
local -a buildable
- already_selected=$(echo ${words[@]} | tr " " "|")
+ already_selected=$(echo $words | tr " " "|")
# flatten sections to one line, then filter lines containing the key and return section name.
- awk '/^[a-zA-Z0-9]/{printf "\n"};{printf $0;next;}' "${compose_file:-$(__docker-compose_compose_file)}" 2>/dev/null | awk -F: -v key=": +$1:" '$0 ~ key {print $1}' 2>/dev/null | grep -Ev "$already_selected"
+ __docker-compose_q config \
+ | sed -n -e '/^services:/,/^[^ ]/p' \
+ | sed -n 's/^ //p' \
+ | awk '/^[a-zA-Z0-9]/{printf "\n"};{printf $0;next;}' \
+ | grep " \+$1:" \
+ | cut -d: -f1 \
+ | grep -Ev "^(${already_selected})$"
}
# All services that are defined by a Dockerfile reference
__docker-compose_services_from_build() {
- buildable=$(___docker-compose_services_with_key build)
- _alternative "args:buildable services:($buildable)"
+ [[ $PREFIX = -* ]] && return 1
+ integer ret=1
+ buildable=$(__docker-compose_services_with_key build)
+ _alternative "args:buildable services:($buildable)" && ret=0
+
+ return ret
}
# All services that are defined by an image
__docker-compose_services_from_image() {
- pullable=$(___docker-compose_services_with_key image)
- _alternative "args:pullable services:($pullable)"
+ [[ $PREFIX = -* ]] && return 1
+ integer ret=1
+ pullable=$(__docker-compose_services_with_key image)
+ _alternative "args:pullable services:($pullable)" && ret=0
+
+ return ret
}
__docker-compose_get_services() {
- local kind expl
- declare -a running stopped lines args services
+ [[ $PREFIX = -* ]] && return 1
+ integer ret=1
+ local kind
+ declare -a running paused stopped lines args services
docker_status=$(docker ps > /dev/null 2>&1)
if [ $? -ne 0 ]; then
@@ -80,64 +91,78 @@ __docker-compose_get_services() {
kind=$1
shift
- [[ $kind = (stopped|all) ]] && args=($args -a)
+ [[ $kind =~ (stopped|all) ]] && args=($args -a)
- lines=(${(f)"$(_call_program commands docker ps ${args})"})
- services=(${(f)"$(_call_program commands docker-compose 2>/dev/null ${compose_file:+-f $compose_file} ${compose_project:+-p $compose_project} ps -q)"})
+ lines=(${(f)"$(_call_program commands docker $docker_options ps $args)"})
+ services=(${(f)"$(_call_program commands docker-compose 2>/dev/null $compose_options ps -q)"})
# Parse header line to find columns
local i=1 j=1 k header=${lines[1]}
declare -A begin end
- while (( $j < ${#header} - 1 )) {
- i=$(( $j + ${${header[$j,-1]}[(i)[^ ]]} - 1))
- j=$(( $i + ${${header[$i,-1]}[(i) ]} - 1))
- k=$(( $j + ${${header[$j,-1]}[(i)[^ ]]} - 2))
- begin[${header[$i,$(($j-1))]}]=$i
- end[${header[$i,$(($j-1))]}]=$k
- }
+ while (( j < ${#header} - 1 )); do
+ i=$(( j + ${${header[$j,-1]}[(i)[^ ]]} - 1 ))
+ j=$(( i + ${${header[$i,-1]}[(i) ]} - 1 ))
+ k=$(( j + ${${header[$j,-1]}[(i)[^ ]]} - 2 ))
+ begin[${header[$i,$((j-1))]}]=$i
+ end[${header[$i,$((j-1))]}]=$k
+ done
lines=(${lines[2,-1]})
# Container ID
local line s name
local -a names
for line in $lines; do
- if [[ $services == *"${line[${begin[CONTAINER ID]},${end[CONTAINER ID]}]%% ##}"* ]]; then
+ if [[ ${services[@]} == *"${line[${begin[CONTAINER ID]},${end[CONTAINER ID]}]%% ##}"* ]]; then
names=(${(ps:,:)${${line[${begin[NAMES]},-1]}%% *}})
for name in $names; do
s="${${name%_*}#*_}:${(l:15:: :::)${${line[${begin[CREATED]},${end[CREATED]}]/ ago/}%% ##}}"
s="$s, ${line[${begin[CONTAINER ID]},${end[CONTAINER ID]}]%% ##}"
- s="$s, ${${${line[$begin[IMAGE],$end[IMAGE]]}/:/\\:}%% ##}"
+ s="$s, ${${${line[${begin[IMAGE]},${end[IMAGE]}]}/:/\\:}%% ##}"
if [[ ${line[${begin[STATUS]},${end[STATUS]}]} = Exit* ]]; then
stopped=($stopped $s)
else
+ if [[ ${line[${begin[STATUS]},${end[STATUS]}]} = *\(Paused\)* ]]; then
+ paused=($paused $s)
+ fi
running=($running $s)
fi
done
fi
done
- [[ $kind = (running|all) ]] && _describe -t services-running "running services" running
- [[ $kind = (stopped|all) ]] && _describe -t services-stopped "stopped services" stopped
+ [[ $kind =~ (running|all) ]] && _describe -t services-running "running services" running "$@" && ret=0
+ [[ $kind =~ (paused|all) ]] && _describe -t services-paused "paused services" paused "$@" && ret=0
+ [[ $kind =~ (stopped|all) ]] && _describe -t services-stopped "stopped services" stopped "$@" && ret=0
+
+ return ret
+}
+
+__docker-compose_pausedservices() {
+ [[ $PREFIX = -* ]] && return 1
+ __docker-compose_get_services paused "$@"
}
__docker-compose_stoppedservices() {
+ [[ $PREFIX = -* ]] && return 1
__docker-compose_get_services stopped "$@"
}
__docker-compose_runningservices() {
+ [[ $PREFIX = -* ]] && return 1
__docker-compose_get_services running "$@"
}
-__docker-compose_services () {
+__docker-compose_services() {
+ [[ $PREFIX = -* ]] && return 1
__docker-compose_get_services all "$@"
}
__docker-compose_caching_policy() {
- oldp=( "$1"(Nmh+1) ) # 1 hour
+ oldp=( "$1"(Nmh+1) ) # 1 hour
(( $#oldp ))
}
-__docker-compose_commands () {
+__docker-compose_commands() {
local cache_policy
zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
@@ -151,110 +176,204 @@ __docker-compose_commands () {
local -a lines
lines=(${(f)"$(_call_program commands docker-compose 2>&1)"})
_docker_compose_subcommands=(${${${lines[$((${lines[(i)Commands:]} + 1)),${lines[(I) *]}]}## #}/ ##/:})
- _store_cache docker_compose_subcommands _docker_compose_subcommands
+ (( $#_docker_compose_subcommands > 0 )) && _store_cache docker_compose_subcommands _docker_compose_subcommands
fi
_describe -t docker-compose-commands "docker-compose command" _docker_compose_subcommands
}
-__docker-compose_subcommand () {
- local -a _command_args
+__docker-compose_subcommand() {
+ local opts_help opts_force_recreate opts_no_recreate opts_no_build opts_remove_orphans opts_timeout opts_no_color opts_no_deps
+
+ opts_help='(: -)--help[Print usage]'
+ opts_force_recreate="(--no-recreate)--force-recreate[Recreate containers even if their configuration and image haven't changed. Incompatible with --no-recreate.]"
+ opts_no_recreate="(--force-recreate)--no-recreate[If containers already exist, don't recreate them. Incompatible with --force-recreate.]"
+ opts_no_build="(--build)--no-build[Don't build an image, even if it's missing.]"
+ opts_remove_orphans="--remove-orphans[Remove containers for services not defined in the Compose file]"
+ opts_timeout=('(-t --timeout)'{-t,--timeout}"[Specify a shutdown timeout in seconds. (default: 10)]:seconds: ")
+ opts_no_color='--no-color[Produce monochrome output.]'
+ opts_no_deps="--no-deps[Don't start linked services.]"
+
integer ret=1
+
case "$words[1]" in
(build)
_arguments \
- '--no-cache[Do not use cache when building the image]' \
+ $opts_help \
+ '--force-rm[Always remove intermediate containers.]' \
+ '--no-cache[Do not use cache when building the image.]' \
+ '--pull[Always attempt to pull a newer version of the image.]' \
'*:services:__docker-compose_services_from_build' && ret=0
;;
+ (bundle)
+ _arguments \
+ $opts_help \
+ '(--output -o)'{--output,-o}'[Path to write the bundle file to. Defaults to ".dab".]:file:_files' && ret=0
+ ;;
+ (config)
+ _arguments \
+ $opts_help \
+ '(--quiet -q)'{--quiet,-q}"[Only validate the configuration, don't print anything.]" \
+ '--services[Print the service names, one per line.]' && ret=0
+ ;;
+ (create)
+ _arguments \
+ $opts_help \
+ $opts_force_recreate \
+ $opts_no_recreate \
+ $opts_no_build \
+ "(--no-build)--build[Build images before creating containers.]" \
+ '*:services:__docker-compose_services_all' && ret=0
+ ;;
+ (down)
+ _arguments \
+ $opts_help \
+ "--rmi[Remove images. Type must be one of: 'all': Remove all images used by any service. 'local': Remove only images that don't have a custom tag set by the \`image\` field.]:type:(all local)" \
+ '(-v --volumes)'{-v,--volumes}"[Remove named volumes declared in the \`volumes\` section of the Compose file and anonymous volumes attached to containers.]" \
+ $opts_remove_orphans && ret=0
+ ;;
+ (events)
+ _arguments \
+ $opts_help \
+ '--json[Output events as a stream of json objects]' \
+ '*:services:__docker-compose_services_all' && ret=0
+ ;;
+ (exec)
+ _arguments \
+ $opts_help \
+ '-d[Detached mode: Run command in the background.]' \
+ '--privileged[Give extended privileges to the process.]' \
+ '--user=[Run the command as this user.]:username:_users' \
+ '-T[Disable pseudo-tty allocation. By default `docker-compose exec` allocates a TTY.]' \
+ '--index=[Index of the container if there are multiple instances of a service \[default: 1\]]:index: ' \
+ '(-):running services:__docker-compose_runningservices' \
+ '(-):command: _command_names -e' \
+ '*::arguments: _normal' && ret=0
+ ;;
(help)
_arguments ':subcommand:__docker-compose_commands' && ret=0
;;
(kill)
_arguments \
+ $opts_help \
'-s[SIGNAL to send to the container. Default signal is SIGKILL.]:signal:_signals' \
'*:running services:__docker-compose_runningservices' && ret=0
;;
(logs)
_arguments \
- '--no-color[Produce monochrome output.]' \
+ $opts_help \
+ '(-f --follow)'{-f,--follow}'[Follow log output]' \
+ $opts_no_color \
+ '--tail=[Number of lines to show from the end of the logs for each container.]:number of lines: ' \
+ '(-t --timestamps)'{-t,--timestamps}'[Show timestamps]' \
'*:services:__docker-compose_services_all' && ret=0
;;
- (migrate-to-labels)
+ (pause)
_arguments \
- '(-):Recreate containers to add labels' && ret=0
+ $opts_help \
+ '*:running services:__docker-compose_runningservices' && ret=0
;;
(port)
_arguments \
- '--protocol=-[tcp or udap (defaults to tcp)]:protocol:(tcp udp)' \
- '--index=-[index of the container if there are mutiple instances of a service (defaults to 1)]:index: ' \
+ $opts_help \
+ '--protocol=[tcp or udp \[default: tcp\]]:protocol:(tcp udp)' \
+ '--index=[index of the container if there are multiple instances of a service \[default: 1\]]:index: ' \
'1:running services:__docker-compose_runningservices' \
'2:port:_ports' && ret=0
;;
(ps)
_arguments \
+ $opts_help \
'-q[Only display IDs]' \
'*:services:__docker-compose_services_all' && ret=0
;;
(pull)
_arguments \
- '--allow-insecure-ssl[Allow insecure connections to the docker registry]' \
+ $opts_help \
+ '--ignore-pull-failures[Pull what it can and ignores images with pull failures.]' \
'*:services:__docker-compose_services_from_image' && ret=0
;;
+ (push)
+ _arguments \
+ $opts_help \
+ '--ignore-push-failures[Push what it can and ignores images with push failures.]' \
+ '*:services:__docker-compose_services' && ret=0
+ ;;
(rm)
_arguments \
+ $opts_help \
'(-f --force)'{-f,--force}"[Don't ask to confirm removal]" \
- '-v[Remove volumes associated with containers]' \
+ '-v[Remove any anonymous volumes attached to containers]' \
'*:stopped services:__docker-compose_stoppedservices' && ret=0
;;
(run)
_arguments \
- '--allow-insecure-ssl[Allow insecure connections to the docker registry]' \
+ $opts_help \
'-d[Detached mode: Run container in the background, print new container name.]' \
- '--entrypoint[Overwrite the entrypoint of the image.]:entry point: ' \
'*-e[KEY=VAL Set an environment variable (can be used multiple times)]:environment variable KEY=VAL: ' \
- '(-u --user)'{-u,--user=-}'[Run as specified username or uid]:username or uid:_users' \
- "--no-deps[Don't start linked services.]" \
+ '--entrypoint[Overwrite the entrypoint of the image.]:entry point: ' \
+ '--name=[Assign a name to the container]:name: ' \
+ $opts_no_deps \
+ '(-p --publish)'{-p,--publish=}"[Publish a container's port(s) to the host]" \
'--rm[Remove container after run. Ignored in detached mode.]' \
"--service-ports[Run command with the service's ports enabled and mapped to the host.]" \
'-T[Disable pseudo-tty allocation. By default `docker-compose run` allocates a TTY.]' \
+ '(-u --user)'{-u,--user=}'[Run as specified username or uid]:username or uid:_users' \
+ '(-w --workdir)'{-w,--workdir=}'[Working directory inside the container]:workdir: ' \
'(-):services:__docker-compose_services' \
'(-):command: _command_names -e' \
'*::arguments: _normal' && ret=0
;;
(scale)
- _arguments '*:running services:__docker-compose_runningservices' && ret=0
+ _arguments \
+ $opts_help \
+ $opts_timeout \
+ '*:running services:__docker-compose_runningservices' && ret=0
;;
(start)
- _arguments '*:stopped services:__docker-compose_stoppedservices' && ret=0
+ _arguments \
+ $opts_help \
+ '*:stopped services:__docker-compose_stoppedservices' && ret=0
;;
(stop|restart)
_arguments \
- '(-t --timeout)'{-t,--timeout}"[Specify a shutdown timeout in seconds. (default: 10)]:seconds: " \
+ $opts_help \
+ $opts_timeout \
'*:running services:__docker-compose_runningservices' && ret=0
;;
+ (unpause)
+ _arguments \
+ $opts_help \
+ '*:paused services:__docker-compose_pausedservices' && ret=0
+ ;;
(up)
_arguments \
- '--allow-insecure-ssl[Allow insecure connections to the docker registry]' \
- '-d[Detached mode: Run containers in the background, print new container names.]' \
- '--no-color[Produce monochrome output.]' \
- "--no-deps[Don't start linked services.]" \
- "--no-recreate[If containers already exist, don't recreate them.]" \
- "--no-build[Don't build an image, even if it's missing]" \
- '(-t --timeout)'{-t,--timeout}"[Specify a shutdown timeout in seconds. (default: 10)]:seconds: " \
- "--x-smart-recreate[Only recreate containers whose configuration or image needs to be updated. (EXPERIMENTAL)]" \
+ $opts_help \
+ '(--abort-on-container-exit)-d[Detached mode: Run containers in the background, print new container names. Incompatible with --abort-on-container-exit.]' \
+ $opts_no_color \
+ $opts_no_deps \
+ $opts_force_recreate \
+ $opts_no_recreate \
+ $opts_no_build \
+ "(--no-build)--build[Build images before starting containers.]" \
+ "(-d)--abort-on-container-exit[Stops all containers if any container was stopped. Incompatible with -d.]" \
+ '(-t --timeout)'{-t,--timeout}"[Use this timeout in seconds for container shutdown when attached or when containers are already running. (default: 10)]:seconds: " \
+ $opts_remove_orphans \
'*:services:__docker-compose_services_all' && ret=0
;;
(version)
_arguments \
+ $opts_help \
"--short[Shows only Compose's version number.]" && ret=0
;;
(*)
- _message 'Unknown sub command'
+ _message 'Unknown sub command' && ret=1
+ ;;
esac
return ret
}
-_docker-compose () {
+_docker-compose() {
# Support for subservices, which allows for `compdef _docker docker-shell=_docker_containers`.
# Based on /usr/share/zsh/functions/Completion/Unix/_git without support for `ret`.
if [[ $service != docker-compose ]]; then
@@ -262,34 +381,62 @@ _docker-compose () {
return
fi
- local curcontext="$curcontext" state line ret=1
+ local curcontext="$curcontext" state line
+ integer ret=1
typeset -A opt_args
_arguments -C \
'(- :)'{-h,--help}'[Get help]' \
- '--verbose[Show more output]' \
- '(- :)'{-v,--version}'[Print version and exit]' \
'(-f --file)'{-f,--file}'[Specify an alternate docker-compose file (default: docker-compose.yml)]:file:_files -g "*.yml"' \
'(-p --project-name)'{-p,--project-name}'[Specify an alternate project name (default: directory name)]:project name:' \
+ '--verbose[Show more output]' \
+ '(- :)'{-v,--version}'[Print version and exit]' \
+ '(-H --host)'{-H,--host}'[Daemon socket to connect to]:host:' \
+ '--tls[Use TLS; implied by --tlsverify]' \
+ '--tlscacert=[Trust certs signed only by this CA]:ca path:' \
+ '--tlscert=[Path to TLS certificate file]:client cert path:' \
+ '--tlskey=[Path to TLS key file]:tls key path:' \
+ '--tlsverify[Use TLS and verify the remote]' \
+ "--skip-hostname-check[Don't check the daemon's hostname against the name specified in the client certificate (for example if your docker host is an IP address)]" \
'(-): :->command' \
'(-)*:: :->option-or-argument' && ret=0
- local counter=1
- #local compose_file compose_project
- while [ $counter -lt ${#words[@]} ]; do
- case "${words[$counter]}" in
- -f|--file)
- (( counter++ ))
- compose_file="${words[$counter]}"
- ;;
- -p|--project-name)
- (( counter++ ))
- compose_project="${words[$counter]}"
- ;;
- *)
- ;;
- esac
- (( counter++ ))
+ local -a relevant_compose_flags relevant_docker_flags compose_options docker_options
+
+ relevant_compose_flags=(
+ "--file" "-f"
+ "--host" "-H"
+ "--project-name" "-p"
+ "--tls"
+ "--tlscacert"
+ "--tlscert"
+ "--tlskey"
+ "--tlsverify"
+ "--skip-hostname-check"
+ )
+
+ relevant_docker_flags=(
+ "--host" "-H"
+ "--tls"
+ "--tlscacert"
+ "--tlscert"
+ "--tlskey"
+ "--tlsverify"
+ )
+
+ for k in "${(@k)opt_args}"; do
+ if [[ -n "${relevant_docker_flags[(r)$k]}" ]]; then
+ docker_options+=$k
+ if [[ -n "$opt_args[$k]" ]]; then
+ docker_options+=$opt_args[$k]
+ fi
+ fi
+ if [[ -n "${relevant_compose_flags[(r)$k]}" ]]; then
+ compose_options+=$k
+ if [[ -n "$opt_args[$k]" ]]; then
+ compose_options+=$opt_args[$k]
+ fi
+ fi
done
case $state in
From cc8285b1f708c33338d280bbb5481dc93bafa458 Mon Sep 17 00:00:00 2001
From: Adam Glenn
Date: Tue, 19 Jul 2016 12:01:00 -0700
Subject: [PATCH 007/194] adding python virtualenv support to the prompt
(#5031)
adding python virtualenv support to muse theme
---
themes/muse.zsh-theme | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/themes/muse.zsh-theme b/themes/muse.zsh-theme
index 4bd8fb82..55a37574 100644
--- a/themes/muse.zsh-theme
+++ b/themes/muse.zsh-theme
@@ -13,7 +13,7 @@ GIT_DIRTY_COLOR=$FG[133]
GIT_CLEAN_COLOR=$FG[118]
GIT_PROMPT_INFO=$FG[012]
-PROMPT='%{$PROMPT_SUCCESS_COLOR%}%~%{$reset_color%} %{$GIT_PROMPT_INFO%}$(git_prompt_info)%{$GIT_DIRTY_COLOR%}$(git_prompt_status) %{$reset_color%}%{$PROMPT_PROMPT%}ᐅ%{$reset_color%} '
+PROMPT='%{$PROMPT_SUCCESS_COLOR%}%~%{$reset_color%} %{$GIT_PROMPT_INFO%}$(git_prompt_info) $(virtualenv_prompt_info)%{$GIT_DIRTY_COLOR%}$(git_prompt_status) %{$reset_color%}%{$PROMPT_PROMPT%}ᐅ%{$reset_color%} '
#RPS1="${return_code}"
From a7e30b26baa94bac99d9d05cf642bd1942ae1787 Mon Sep 17 00:00:00 2001
From: Anton
Date: Fri, 22 Jul 2016 17:04:35 +0400
Subject: [PATCH 008/194] Fix hg call when missing on archlinux with
command-not-found (#5218)
---
themes/agnoster.zsh-theme | 1 +
1 file changed, 1 insertion(+)
diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme
index 103041ee..da1f9b6e 100644
--- a/themes/agnoster.zsh-theme
+++ b/themes/agnoster.zsh-theme
@@ -128,6 +128,7 @@ prompt_git() {
}
prompt_hg() {
+ (( $+commands[hg] )) || return
local rev status
if $(hg id >/dev/null 2>&1); then
if $(hg prompt >/dev/null 2>&1); then
From 61981951b1380c431e464a63d394ce890e751b97 Mon Sep 17 00:00:00 2001
From: Steven
Date: Mon, 1 Aug 2016 08:48:46 -0700
Subject: [PATCH 009/194] Updated git_commits_ahead function (#5247)
* Function wasn't returning correct value
* Updated underlying git command
* Kept echo command from previous function for backwards compatibility
* Kept function consistent with git_commits_behind
---
lib/git.zsh | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/lib/git.zsh b/lib/git.zsh
index c79cc0d8..648a766b 100644
--- a/lib/git.zsh
+++ b/lib/git.zsh
@@ -76,9 +76,8 @@ function git_current_branch() {
# 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
- local COMMITS
- COMMITS=$(command git log @{upstream}..HEAD | grep '^commit' | wc -l | tr -d ' ')
+ if $(command git rev-parse --git-dir > /dev/null 2>&1); then
+ local COMMITS="$(git rev-list --count @{upstream}..HEAD)"
echo "$ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX$COMMITS$ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX"
fi
}
From 508b80c1e131ffb5ca6a858345c27eb2400122c9 Mon Sep 17 00:00:00 2001
From: nklmish
Date: Mon, 1 Aug 2016 18:05:01 +0200
Subject: [PATCH 010/194] support for startpage search engine in web-search
plugin (#5245)
---
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 d3bf97d7..3b5478ca 100644
--- a/plugins/web-search/web-search.plugin.zsh
+++ b/plugins/web-search/web-search.plugin.zsh
@@ -10,6 +10,7 @@ function web_search() {
bing "https://www.bing.com/search?q="
yahoo "https://search.yahoo.com/search?p="
duckduckgo "https://www.duckduckgo.com/?q="
+ startpage "https://www.startpage.com/do/search?q="
yandex "https://yandex.ru/yandsearch?text="
github "https://github.com/search?q="
baidu "https://www.baidu.com/s?wd="
@@ -41,6 +42,7 @@ alias bing='web_search bing'
alias google='web_search google'
alias yahoo='web_search yahoo'
alias ddg='web_search duckduckgo'
+alias sp='web_search startpage'
alias yandex='web_search yandex'
alias github='web_search github'
alias baidu='web_search baidu'
From f5537241a4fe7f48a5f7f49fff52db9f0247a5cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Malard?=
Date: Mon, 1 Aug 2016 18:16:54 +0200
Subject: [PATCH 011/194] Fix gbda alias to support `color.ui = always` +
exclude dev branches (#4304)
* Fix gbda alias to support git config color.ui = always
* Update gbda alias to exclude develop and dev branches
---
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 c186a6e1..01c29e14 100644
--- a/plugins/git/git.plugin.zsh
+++ b/plugins/git/git.plugin.zsh
@@ -46,7 +46,7 @@ alias gapa='git add --patch'
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 gbda='git branch --no-color --merged | command grep -vE "^(\*|\s*(master|develop|dev)\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'
From 7654b16b3963844e5079a8935eb93f108c52f273 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Sun, 7 Aug 2016 18:30:57 +0200
Subject: [PATCH 012/194] [git plugin] Fix indentation and organise aliases
---
plugins/git/git.plugin.zsh | 67 ++++++++++++++++++++++----------------
1 file changed, 39 insertions(+), 28 deletions(-)
diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
index 01c29e14..0cee136c 100644
--- a/plugins/git/git.plugin.zsh
+++ b/plugins/git/git.plugin.zsh
@@ -81,62 +81,73 @@ alias gd='git diff'
alias gdca='git diff --cached'
alias gdct='git describe --tags `git rev-list --tags --max-count=1`'
alias gdt='git diff-tree --no-commit-id --name-only -r'
+alias gdw='git diff --word-diff'
+
gdv() { git diff -w "$@" | view - }
compdef _git gdv=git-diff
-alias gdw='git diff --word-diff'
alias gf='git fetch'
alias gfa='git fetch --all --prune'
+alias gfo='git fetch origin'
+
function gfg() { git ls-files | grep $@ }
compdef _grep gfg
-alias gfo='git fetch origin'
alias gg='git gui citool'
alias gga='git gui citool --amend'
+
ggf() {
-[[ "$#" != 1 ]] && local b="$(git_current_branch)"
-git push --force origin "${b:=$1}"
+ [[ "$#" != 1 ]] && local b="$(git_current_branch)"
+ git push --force origin "${b:=$1}"
}
compdef _git ggf=git-checkout
+
ggl() {
-if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then
-git pull origin "${*}"
-else
-[[ "$#" == 0 ]] && local b="$(git_current_branch)"
-git pull origin "${b:=$1}"
-fi
+ if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then
+ git pull origin "${*}"
+ else
+ [[ "$#" == 0 ]] && local b="$(git_current_branch)"
+ git pull origin "${b:=$1}"
+ fi
}
compdef _git ggl=git-checkout
-alias ggpull='git pull origin $(git_current_branch)'
-compdef _git ggpull=git-checkout
+
ggp() {
-if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then
-git push origin "${*}"
-else
-[[ "$#" == 0 ]] && local b="$(git_current_branch)"
-git push origin "${b:=$1}"
-fi
+ if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then
+ git push origin "${*}"
+ else
+ [[ "$#" == 0 ]] && local b="$(git_current_branch)"
+ git push origin "${b:=$1}"
+ fi
}
compdef _git ggp=git-checkout
-alias ggpush='git push origin $(git_current_branch)'
-compdef _git ggpush=git-checkout
+
ggpnp() {
-if [[ "$#" == 0 ]]; then
-ggl && ggp
-else
-ggl "${*}" && ggp "${*}"
-fi
+ if [[ "$#" == 0 ]]; then
+ ggl && ggp
+ else
+ ggl "${*}" && ggp "${*}"
+ fi
}
compdef _git ggpnp=git-checkout
-alias ggsup='git branch --set-upstream-to=origin/$(git_current_branch)'
+
ggu() {
-[[ "$#" != 1 ]] && local b="$(git_current_branch)"
-git pull --rebase origin "${b:=$1}"
+ [[ "$#" != 1 ]] && local b="$(git_current_branch)"
+ git pull --rebase origin "${b:=$1}"
}
compdef _git ggu=git-checkout
+
alias ggpur='ggu'
compdef _git ggpur=git-checkout
+alias ggpull='git pull origin $(git_current_branch)'
+compdef _git ggpull=git-checkout
+
+alias ggpush='git push origin $(git_current_branch)'
+compdef _git ggpush=git-checkout
+
+alias ggsup='git branch --set-upstream-to=origin/$(git_current_branch)'
+
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'
From a7de0fabd7ebbf1776942a8c7fde8ee33ed681b0 Mon Sep 17 00:00:00 2001
From: Luke Childs
Date: Sun, 7 Aug 2016 18:36:44 +0100
Subject: [PATCH 013/194] nvm plugin improvements (#5265)
* Export $NVM_DIR if it doesn't exist and use it when looking for nvm
* Use $NVM_DIR when looking for nvm for completion
* Use $NVM_DIR when looking for nvm in nvm_prompt_info
---
lib/nvm.zsh | 2 +-
plugins/nvm/_nvm | 2 +-
plugins/nvm/nvm.plugin.zsh | 6 ++++--
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/lib/nvm.zsh b/lib/nvm.zsh
index 61d997fc..4a8b6811 100644
--- a/lib/nvm.zsh
+++ b/lib/nvm.zsh
@@ -1,6 +1,6 @@
# get the node.js version
function nvm_prompt_info() {
- [ -f "$HOME/.nvm/nvm.sh" ] || return
+ [[ -f "$NVM_DIR/nvm.sh" ]] || return
local nvm_prompt
nvm_prompt=$(node -v 2>/dev/null)
[[ "${nvm_prompt}x" == "x" ]] && return
diff --git a/plugins/nvm/_nvm b/plugins/nvm/_nvm
index a95c9e37..1414dcbb 100644
--- a/plugins/nvm/_nvm
+++ b/plugins/nvm/_nvm
@@ -1,7 +1,7 @@
#compdef nvm
#autoload
-[[ -s ~/.nvm/nvm.sh ]] || return 0
+[[ -f "$NVM_DIR/nvm.sh" ]] || return 0
local -a _1st_arguments
_1st_arguments=(
diff --git a/plugins/nvm/nvm.plugin.zsh b/plugins/nvm/nvm.plugin.zsh
index 9709719f..9dde3a26 100644
--- a/plugins/nvm/nvm.plugin.zsh
+++ b/plugins/nvm/nvm.plugin.zsh
@@ -1,3 +1,5 @@
-# The addition 'nvm install' attempts in ~/.profile
+# Set NVM_DIR if it isn't already defined
+[[ -z "$NVM_DIR" ]] && export NVM_DIR="$HOME/.nvm"
-[[ -s ~/.nvm/nvm.sh ]] && . ~/.nvm/nvm.sh
+# Load nvm if it exists
+[[ -f "$NVM_DIR/nvm.sh" ]] && source "$NVM_DIR/nvm.sh"
From 9772f8e10d07ce982a45fcce9b074e9084ad76cb Mon Sep 17 00:00:00 2001
From: Fredrik Fornwall
Date: Tue, 9 Aug 2016 02:39:11 +0200
Subject: [PATCH 014/194] Replace /bin/sh with sh for portability (#5291)
This makes things work even on system lacking /bin/sh, such as on
non-rooted Android systems.
---
lib/functions.zsh | 4 ++--
tools/check_for_upgrade.sh | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/functions.zsh b/lib/functions.zsh
index f9d4a971..9f11318d 100644
--- a/lib/functions.zsh
+++ b/lib/functions.zsh
@@ -3,11 +3,11 @@ function zsh_stats() {
}
function uninstall_oh_my_zsh() {
- env ZSH=$ZSH /bin/sh $ZSH/tools/uninstall.sh
+ env ZSH=$ZSH sh $ZSH/tools/uninstall.sh
}
function upgrade_oh_my_zsh() {
- env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh
+ env ZSH=$ZSH sh $ZSH/tools/upgrade.sh
}
function take() {
diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
index 881bc6c4..bd9aba8b 100644
--- a/tools/check_for_upgrade.sh
+++ b/tools/check_for_upgrade.sh
@@ -11,7 +11,7 @@ function _update_zsh_update() {
}
function _upgrade_zsh() {
- env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh
+ env ZSH=$ZSH sh $ZSH/tools/upgrade.sh
# update the zsh file
_update_zsh_update
}
From 4505a438e4829e0335484c08b71244378081d7b7 Mon Sep 17 00:00:00 2001
From: Dominic Motuka
Date: Thu, 11 Aug 2016 03:14:52 +0300
Subject: [PATCH 015/194] update alias of get a list of packages installed
locally (#5276)
---
plugins/ubuntu/ubuntu.plugin.zsh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/ubuntu/ubuntu.plugin.zsh b/plugins/ubuntu/ubuntu.plugin.zsh
index f0885364..d924f886 100644
--- a/plugins/ubuntu/ubuntu.plugin.zsh
+++ b/plugins/ubuntu/ubuntu.plugin.zsh
@@ -63,7 +63,7 @@ alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \
# Misc. #####################################################################
# print all installed packages
-alias allpkgs='aptitude search -F "%p" --disable-columns ~i'
+alias allpkgs='dpkg --get-selections | grep -v deinstall'
# Create a basic .deb package
alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc'
From a9428b137f14969bd44a5787c0080297d81ea0b7 Mon Sep 17 00:00:00 2001
From: Kyle Scully
Date: Wed, 10 Aug 2016 17:28:56 -0700
Subject: [PATCH 016/194] added mix autocompletion support for phoenix (#4967)
---
plugins/mix/_mix | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/plugins/mix/_mix b/plugins/mix/_mix
index 3b3887b1..57fdf808 100644
--- a/plugins/mix/_mix
+++ b/plugins/mix/_mix
@@ -38,6 +38,15 @@ _1st_arguments=(
'local.hex:Install hex locally'
'local.rebar:Install rebar locally'
'new:Create a new Elixir project'
+ 'phoenix.digest:Digests and compress static files'
+ 'phoenix.gen.channel:Generates a Phoenix channel'
+ 'phoenix.gen.html:Generates controller, model and views for an HTML based resource'
+ 'phoenix.gen.json:Generates a controller and model for a JSON based resource'
+ 'phoenix.gen.model:Generates an Ecto model'
+ 'phoenix.gen.secret:Generates a secret'
+ 'phoenix.new:Create a new Phoenix application'
+ 'phoenix.routes:Prints all routes'
+ 'phoenix.server:Starts applications and their servers'
'run:Run the given file or expression'
"test:Run a project's tests"
'--help:Describe available tasks'
@@ -49,7 +58,7 @@ __task_list ()
local expl
declare -a tasks
- 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)
+ 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 phoenix.digest phoenix.gen.channel phoenix.gen.html phoenix.gen.json phoenix.gen.model phoenix.gen.secret phoenix.new phoenix.routes phoenix.server run test)
_wanted tasks expl 'help' compadd $tasks
}
@@ -80,4 +89,3 @@ case $state in
esac
;;
esac
-
From c09323098acb03a0678f87036fad10bd99b283b2 Mon Sep 17 00:00:00 2001
From: Shiv Venkatasubrahmanyam
Date: Wed, 10 Aug 2016 17:44:00 -0700
Subject: [PATCH 017/194] Add shrink-path plugin to shorten directory paths
(e.g. ~/f/b/quux) (#5262)
* Add shrink-path plugin to shorten directory paths (e.g. ~/f/b/quux)
* Add a README
---
plugins/shrink-path/README.md | 68 +++++++++++
plugins/shrink-path/shrink-path.plugin.zsh | 127 +++++++++++++++++++++
2 files changed, 195 insertions(+)
create mode 100644 plugins/shrink-path/README.md
create mode 100644 plugins/shrink-path/shrink-path.plugin.zsh
diff --git a/plugins/shrink-path/README.md b/plugins/shrink-path/README.md
new file mode 100644
index 00000000..51fa8a05
--- /dev/null
+++ b/plugins/shrink-path/README.md
@@ -0,0 +1,68 @@
+# A plugin to shrink directory paths for brevity and pretty-printing
+
+
+## Examples
+
+For this directory tree:
+```
+ /home/
+ me/
+ foo/
+ bar/
+ quux/
+ biz/ # The prefix b is ambiguous between bar and biz.
+```
+here are the results of calling `shrink_path
-Oh My Zsh is an open source, community-driven framework for managing your [zsh](http://www.zsh.org/) configuration. That sounds boring. Let's try this again.
+Oh My Zsh is an open source, community-driven framework for managing your [zsh](http://www.zsh.org/) configuration.
-__Oh My Zsh is a way of life!__ Once installed, your terminal prompt will become the talk of the town _or your money back!_ Each time you interact with your command prompt, you'll be able to take advantage of the hundreds of bundled plugins and pretty themes. Strangers will come up to you in cafés and ask you, _"that is amazing. are you some sort of genius?"_ Finally, you'll begin to get the sort of attention that you always felt that you deserved. ...or maybe you'll just use the time that you saved to start flossing more often.
+That sounds boring. Let's try this again.
+
+__Oh My Zsh is a way of life!__
+
+Once installed, your terminal shell will become the talk of the town _or your money back!_ With each keystroke in your command prompt, you'll take advantage of the hundreds of powerful plugins and beautiful themes. Strangers will come up to you in cafés and ask you, _"that is amazing! are you some sort of genius?"_
+
+Finally, you'll begin to get the sort of attention that you have always felt you deserved. ...or maybe you'll use the time that you're saving to start flossing more often.
To learn more, visit [ohmyz.sh](http://ohmyz.sh) and follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter.
@@ -202,7 +208,10 @@ Thank you so much!
## Follow Us
-We have an [@ohmyzsh](https://twitter.com/ohmyzsh) Twitter account. You should follow it.
+We're on the social medias.
+
+* [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter. You should follow it.
+* [Oh My Zsh](https://www.facebook.com/Oh-My-Zsh-296616263819290/) on Facebook.
## Merchandise
From 798c38dd1a70637cd17c26879be83e7f25a3ee53 Mon Sep 17 00:00:00 2001
From: slavaGanzin
Date: Tue, 27 Sep 2016 15:18:23 +0300
Subject: [PATCH 136/194] globalias fix #4834
---
plugins/globalias/globalias.plugin.zsh | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 plugins/globalias/globalias.plugin.zsh
diff --git a/plugins/globalias/globalias.plugin.zsh b/plugins/globalias/globalias.plugin.zsh
new file mode 100644
index 00000000..95a0e307
--- /dev/null
+++ b/plugins/globalias/globalias.plugin.zsh
@@ -0,0 +1,11 @@
+globalias() {
+ zle _expand_alias
+ zle expand-word
+ zle self-insert
+}
+zle -N globalias
+bindkey -e " " globalias
+bindkey -v " " globalias
+bindkey -e "^ " magic-space # control-space to bypass completion
+bindkey -v "^ " magic-space
+bindkey -M isearch " " magic-space # normal space during searches
From 65874f2b2201c2e55d410ab322dc20394a587b83 Mon Sep 17 00:00:00 2001
From: Leif Ringstad
Date: Wed, 28 Sep 2016 14:47:00 +0200
Subject: [PATCH 137/194] Add more docker compose aliases (#5422)
Adds the following aliases:
```zsh
alias dco='docker-compose'
alias dcr='docker-compose run'
alias dce='docker-compose exec'
```
And sorts the aliases similar to `docker-compose help` order
---
plugins/docker-compose/docker-compose.plugin.zsh | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/plugins/docker-compose/docker-compose.plugin.zsh b/plugins/docker-compose/docker-compose.plugin.zsh
index 351e7782..9f2457fc 100644
--- a/plugins/docker-compose/docker-compose.plugin.zsh
+++ b/plugins/docker-compose/docker-compose.plugin.zsh
@@ -5,9 +5,16 @@
# Aliases ###################################################################
-alias dcup='docker-compose up'
+# Use dco as alias for docker-compose, since dc on *nix is 'dc - an arbitrary precision calculator'
+# https://www.gnu.org/software/bc/manual/dc-1.05/html_mono/dc.html
+
+alias dco='docker-compose'
+
alias dcb='docker-compose build'
-alias dcrm='docker-compose rm'
+alias dce='docker-compose exec'
alias dcps='docker-compose ps'
-alias dcstop='docker-compose stop'
alias dcrestart='docker-compose restart'
+alias dcrm='docker-compose rm'
+alias dcr='docker-compose run'
+alias dcstop='docker-compose stop'
+alias dcup='docker-compose up'
From ac8915d43f0e8de9294c8552dc338ecc9993acd2 Mon Sep 17 00:00:00 2001
From: Diego Said Anaya Mancilla
Date: Wed, 28 Sep 2016 14:28:53 -0500
Subject: [PATCH 138/194] Update pip plugin to last stable release (#5472)
Update pip plugin to last stable release
---
plugins/pip/_pip | 38 ++++++++++++++++++++++++++------------
1 file changed, 26 insertions(+), 12 deletions(-)
diff --git a/plugins/pip/_pip b/plugins/pip/_pip
index cb155e5f..732ffabe 100644
--- a/plugins/pip/_pip
+++ b/plugins/pip/_pip
@@ -1,7 +1,8 @@
#compdef pip pip2 pip-2.7 pip3 pip-3.2 pip-3.3 pip-3.4
#autoload
-# pip zsh completion, based on homebrew completion
+# pip zsh completion, based on last stable release (pip8)
+# homebrew completion and backwards compatibility
_pip_all() {
# we cache the list of packages (originally from the macports plugin)
@@ -17,30 +18,43 @@ _pip_installed() {
local -a _1st_arguments
_1st_arguments=(
- 'bundle:create pybundles (archives containing multiple packages)'
- 'freeze:output all currently installed packages (exact versions) to stdout'
- 'help:show available commands'
- 'show:show information about installed packages'
'install:install packages'
- 'search:search PyPI'
+ 'download:download packages'
'uninstall:uninstall packages'
- 'unzip:unzip individual packages'
- 'zip:zip individual packages'
+ 'freeze:output all currently installed packages (exact versions) to stdout'
+ 'list:list installed packages'
+ 'show:show information about installed packages'
+ 'search:search PyPI'
+ 'wheel:build individual wheel archives for your requirements and dependencies'
+ 'hash:compute a hash of a local package archive'
+ 'help:show available commands'
+ 'bundle:create pybundles (archives containing multiple packages)(deprecated)'
+ 'unzip:unzip individual packages(deprecated)'
+ 'zip:zip individual packages(deprecated)'
)
local expl
local -a all_pkgs installed_pkgs
_arguments \
- '(--version)--version[show version number of program and exit]' \
'(-h --help)'{-h,--help}'[show help]' \
- '(-E --environment)'{-E,--environment}'[virtualenv environment to run pip in]' \
- '(-s --enable-site-packages)'{-s,--enable-site-packages}'[include site-packages in virtualenv]' \
+ '(--isolated)--isolated[run pip in isolated mode, ignores environment variables and user configuration]' \
'(-v --verbose)'{-v,--verbose}'[give more output]' \
+ '(-V --version)'{-V,--version}'[show version number of program and exit]' \
'(-q --quiet)'{-q,--quiet}'[give less output]' \
'(--log)--log[log file location]' \
'(--proxy)--proxy[proxy in form user:passwd@proxy.server:port]' \
+ '(--retries)--retries[max number of retries per connection (default 5 times)]' \
'(--timeout)--timeout[socket timeout (default 15s)]' \
+ '(--exists-action)--exists-action[default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup]' \
+ '(--trusted-host)--trusted-host[mark this host as trusted]' \
+ '(--cert)--cert[path to alternate CA bundle]' \
+ '(--client-cert)--client-cert[path to SSL client certificate]' \
+ '(--cache-dir)--cache-dir[store the cache data in specified directory]' \
+ '(--no-cache-dir)--no-cache-dir[disable de cache]' \
+ '(--disable-pip-version-check)--disable-pip-version-check[do not check periodically for new pip version downloads]' \
+ '(-E --environment)'{-E,--environment}'[virtualenv environment to run pip in (deprecated)]' \
+ '(-s --enable-site-packages)'{-s,--enable-site-packages}'[include site-packages in virtualenv (deprecated)]' \
'*:: :->subcmds' && return 0
if (( CURRENT == 1 )); then
@@ -56,7 +70,7 @@ case "$words[1]" in
_arguments \
'(-l --local)'{-l,--local}'[report only virtualenv packages]' ;;
install)
- _arguments \
+ _arguments \
'(-U --upgrade)'{-U,--upgrade}'[upgrade all packages to the newest available version]' \
'(-f --find-links)'{-f,--find-links}'[URL for finding packages]' \
'(-r --requirement)'{-r,--requirement}'[Requirements file for packages to install]:File:_files' \
From 10ffa4fe992e56a93396ed8914eba74821bb2cca Mon Sep 17 00:00:00 2001
From: Christian Ferbar
Date: Tue, 27 Sep 2016 12:27:37 +0200
Subject: [PATCH 139/194] Add README to svn plugin
---
plugins/svn/README.md | 64 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 64 insertions(+)
create mode 100644 plugins/svn/README.md
diff --git a/plugins/svn/README.md b/plugins/svn/README.md
new file mode 100644
index 00000000..b8eff70f
--- /dev/null
+++ b/plugins/svn/README.md
@@ -0,0 +1,64 @@
+# `svn` plugin
+
+This plugin adds some utility functions to display additional information regarding your current
+svn repsitiory. See http://subversion.apache.org/ for the full svn documentation.
+
+## Functions
+
+| Command | Description |
+|:-----------------------|:----------------------------------------|
+|svn_prompt_info | prompt for some themes |
+|in_svn | within svn directory |
+|svn_get_repo_name | |
+|svn_get_branch_name | branch name (see caveats) |
+|svn_get_rev_nr | revision number |
+|svn_dirty | changes in this subversion repo |
+
+## Caveats
+
+The plugin expects the first directory to be the current branch / tag / trunk. So, it returns
+the first path element if you don't use branches.
+
+## Usage
+
+To use it, add `svn` to your plugins array:
+```sh
+plugins=(... svn)
+```
+
+### Agnoster theme git-like prompt
+
+Enable the svn plugin and add the followind lines to your ```~/.zshrc```
+
+```shell
+prompt_svn() {
+ local rev branch
+ if in_svn; then
+ rev=$(svn_get_rev_nr)
+ branch=$(svn_get_branch_name)
+ if [ `svn_dirty_choose_pwd 1 0` -eq 1 ]; then
+ prompt_segment yellow black
+ echo -n "$rev@$branch"
+ echo -n "±"
+ else
+ prompt_segment green black
+ echo -n "$rev@$branch"
+ fi
+ fi
+}
+```
+
+override the agnoster build_prompt() function:
+
+```shell
+build_prompt() {
+ RETVAL=$?
+ prompt_status
+ prompt_context
+ prompt_dir
+ prompt_git
+ prompt_svn
+ prompt_end
+}
+```
+
From 364019a3c9c4ef08d2d7f0752c0ac008293d62df Mon Sep 17 00:00:00 2001
From: Christian Ferbar
Date: Tue, 27 Sep 2016 12:29:25 +0200
Subject: [PATCH 140/194] Add localization workaround to svn plugin
---
plugins/svn/svn.plugin.zsh | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/plugins/svn/svn.plugin.zsh b/plugins/svn/svn.plugin.zsh
index 816055af..e95ee9d9 100644
--- a/plugins/svn/svn.plugin.zsh
+++ b/plugins/svn/svn.plugin.zsh
@@ -25,14 +25,14 @@ function in_svn() {
function svn_get_repo_name() {
if in_svn; then
- svn info | sed -n 's/Repository\ Root:\ .*\///p' | read SVN_ROOT
- svn info | sed -n "s/URL:\ .*$SVN_ROOT\///p"
+ LANG=C svn info | sed -n 's/^Repository\ Root:\ .*\///p' | read SVN_ROOT
+ LANG=C svn info | sed -n "s/^URL:\ .*$SVN_ROOT\///p"
fi
}
function svn_get_branch_name() {
local _DISPLAY=$(
- svn info 2> /dev/null | \
+ LANG=C svn info 2> /dev/null | \
awk -F/ \
'/^URL:/ { \
for (i=0; i<=NF; i++) { \
@@ -54,13 +54,13 @@ function svn_get_branch_name() {
function svn_get_rev_nr() {
if in_svn; then
- svn info 2> /dev/null | sed -n 's/Revision:\ //p'
+ LANG=C svn info 2> /dev/null | sed -n 's/Revision:\ //p'
fi
}
function svn_dirty_choose() {
if in_svn; then
- local root=`svn info 2> /dev/null | sed -n 's/^Working Copy Root Path: //p'`
+ local root=`LANG=C svn info 2> /dev/null | sed -n 's/^Working Copy Root Path: //p'`
if $(svn status $root 2> /dev/null | command grep -Eq '^\s*[ACDIM!?L]'); then
# Grep exits with 0 when "One or more lines were selected", return "dirty".
echo $1
From f573247a59773f47b1741967335ec6c495bcf4b4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Thu, 29 Sep 2016 13:56:16 +0200
Subject: [PATCH 141/194] Clean up svn README
---
plugins/svn/README.md | 103 ++++++++++++++++++++++--------------------
1 file changed, 53 insertions(+), 50 deletions(-)
diff --git a/plugins/svn/README.md b/plugins/svn/README.md
index b8eff70f..1f7b70c8 100644
--- a/plugins/svn/README.md
+++ b/plugins/svn/README.md
@@ -1,64 +1,67 @@
# `svn` plugin
This plugin adds some utility functions to display additional information regarding your current
-svn repsitiory. See http://subversion.apache.org/ for the full svn documentation.
-
-## Functions
-
-| Command | Description |
-|:-----------------------|:----------------------------------------|
-|svn_prompt_info | prompt for some themes |
-|in_svn | within svn directory |
-|svn_get_repo_name | |
-|svn_get_branch_name | branch name (see caveats) |
-|svn_get_rev_nr | revision number |
-|svn_dirty | changes in this subversion repo |
-
-## Caveats
-
-The plugin expects the first directory to be the current branch / tag / trunk. So, it returns
-the first path element if you don't use branches.
-
-## Usage
+svn repository. See http://subversion.apache.org/ for the full svn documentation.
To use it, add `svn` to your plugins array:
-```sh
+
+```zsh
plugins=(... svn)
```
-### Agnoster theme git-like prompt
+## Functions
-Enable the svn plugin and add the followind lines to your ```~/.zshrc```
+| Command | Description |
+|:----------------------|:--------------------------------------------|
+| `svn_prompt_info` | Shows svn prompt in themes |
+| `in_svn` | Checks if we're in an svn repository |
+| `svn_get_repo_name` | Get repository name |
+| `svn_get_branch_name` | Get branch name (see [caveats](#caveats)) |
+| `svn_get_rev_nr` | Get revision number |
+| `svn_dirty` | Checks if there are changes in the svn repo |
-```shell
-prompt_svn() {
- local rev branch
- if in_svn; then
- rev=$(svn_get_rev_nr)
- branch=$(svn_get_branch_name)
- if [ `svn_dirty_choose_pwd 1 0` -eq 1 ]; then
- prompt_segment yellow black
- echo -n "$rev@$branch"
- echo -n "±"
- else
- prompt_segment green black
- echo -n "$rev@$branch"
+## Caveats
+
+The plugin expects the first directory to be the current branch / tag / trunk. So it returns
+the first path element if you don't use branches.
+
+## Usage on themes
+
+To use this in the `agnoster` theme follow these instructions:
+
+1. Enable the svn plugin
+
+2. Add the following lines to your `zshrc` file:
+
+ ```shell
+ prompt_svn() {
+ local rev branch
+ if in_svn; then
+ rev=$(svn_get_rev_nr)
+ branch=$(svn_get_branch_name)
+ if [[ $(svn_dirty_choose_pwd 1 0) -eq 1 ]]; then
+ prompt_segment yellow black
+ echo -n "$rev@$branch"
+ echo -n "±"
+ else
+ prompt_segment green black
+ echo -n "$rev@$branch"
+ fi
fi
- fi
-}
-```
+ }
+ ```
-override the agnoster build_prompt() function:
+3. Override the agnoster `build_prompt()` function:
-```shell
-build_prompt() {
- RETVAL=$?
- prompt_status
- prompt_context
- prompt_dir
- prompt_git
- prompt_svn
- prompt_end
-}
-```
+ ```zsh
+ build_prompt() {
+ RETVAL=$?
+ prompt_status
+ prompt_context
+ prompt_dir
+ prompt_git
+ prompt_svn
+ prompt_end
+ }
+ ```
From e6df0e036e39bcc2c20d7feaef1749d3c4f2768f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Thu, 29 Sep 2016 14:03:09 +0200
Subject: [PATCH 142/194] Clean up and refactor code in svn plugin
---
plugins/svn/svn.plugin.zsh | 58 ++++++++++++++++----------------------
1 file changed, 25 insertions(+), 33 deletions(-)
diff --git a/plugins/svn/svn.plugin.zsh b/plugins/svn/svn.plugin.zsh
index e95ee9d9..fbc9ee53 100644
--- a/plugins/svn/svn.plugin.zsh
+++ b/plugins/svn/svn.plugin.zsh
@@ -1,9 +1,7 @@
-# vim:ft=zsh ts=2 sw=2 sts=2
-#
-function svn_prompt_info() {
+svn_prompt_info() {
local _DISPLAY
if in_svn; then
- if [ "x$SVN_SHOW_BRANCH" = "xtrue" ]; then
+ if [[ "$SVN_SHOW_BRANCH" = true ]]; then
unset SVN_SHOW_BRANCH
_DISPLAY=$(svn_get_branch_name)
else
@@ -16,21 +14,18 @@ $ZSH_THEME_REPO_NAME_COLOR$_DISPLAY$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_S
}
-function in_svn() {
- if $(svn info >/dev/null 2>&1); then
- return 0
- fi
- return 1
+in_svn() {
+ svn info >/dev/null 2>&1
}
-function svn_get_repo_name() {
+svn_get_repo_name() {
if in_svn; then
LANG=C svn info | sed -n 's/^Repository\ Root:\ .*\///p' | read SVN_ROOT
LANG=C svn info | sed -n "s/^URL:\ .*$SVN_ROOT\///p"
fi
}
-function svn_get_branch_name() {
+svn_get_branch_name() {
local _DISPLAY=$(
LANG=C svn info 2> /dev/null | \
awk -F/ \
@@ -44,41 +39,28 @@ function svn_get_branch_name() {
} \
}'
)
-
- if [ "x$_DISPLAY" = "x" ]; then
+
+ if [[ -z "$_DISPLAY" ]]; then
svn_get_repo_name
else
echo $_DISPLAY
fi
}
-function svn_get_rev_nr() {
+svn_get_rev_nr() {
if in_svn; then
LANG=C svn info 2> /dev/null | sed -n 's/Revision:\ //p'
fi
}
-function svn_dirty_choose() {
- if in_svn; then
- local root=`LANG=C svn info 2> /dev/null | sed -n 's/^Working Copy Root Path: //p'`
- if $(svn status $root 2> /dev/null | command grep -Eq '^\s*[ACDIM!?L]'); then
- # Grep exits with 0 when "One or more lines were selected", return "dirty".
- echo $1
- else
- # Otherwise, no lines were found, or an error occurred. Return clean.
- echo $2
- fi
- fi
-}
-
-function svn_dirty() {
+svn_dirty() {
svn_dirty_choose $ZSH_THEME_SVN_PROMPT_DIRTY $ZSH_THEME_SVN_PROMPT_CLEAN
}
-function svn_dirty_choose_pwd () {
+svn_dirty_choose() {
if in_svn; then
- local root=$PWD
- if $(svn status $root 2> /dev/null | command grep -Eq '^\s*[ACDIM!?L]'); then
+ local root=$(LANG=C svn info 2> /dev/null | sed -n 's/^Working Copy Root Path: //p')
+ if svn status $root 2> /dev/null | command grep -Eq '^\s*[ACDIM!?L]'; then
# Grep exits with 0 when "One or more lines were selected", return "dirty".
echo $1
else
@@ -88,8 +70,18 @@ function svn_dirty_choose_pwd () {
fi
}
-function svn_dirty_pwd () {
+svn_dirty_pwd () {
svn_dirty_choose_pwd $ZSH_THEME_SVN_PROMPT_DIRTY_PWD $ZSH_THEME_SVN_PROMPT_CLEAN_PWD
}
-
+svn_dirty_choose_pwd () {
+ if in_svn; then
+ if svn status "$PWD" 2> /dev/null | command grep -Eq '^\s*[ACDIM!?L]'; then
+ # Grep exits with 0 when "One or more lines were selected", return "dirty".
+ echo $1
+ else
+ # Otherwise, no lines were found, or an error occurred. Return clean.
+ echo $2
+ fi
+ fi
+}
From 09d95251a7176e0c4b2a71837b7356980fe738e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Thu, 29 Sep 2016 13:19:47 +0200
Subject: [PATCH 143/194] extract: fix styling
---
plugins/extract/_extract | 2 -
plugins/extract/extract.plugin.zsh | 149 ++++++++++++++---------------
2 files changed, 71 insertions(+), 80 deletions(-)
diff --git a/plugins/extract/_extract b/plugins/extract/_extract
index 387b344b..a73c892d 100644
--- a/plugins/extract/_extract
+++ b/plugins/extract/_extract
@@ -4,5 +4,3 @@
_arguments \
'(-r --remove)'{-r,--remove}'[Remove archive.]' \
"*::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 5d0809e9..081d5168 100644
--- a/plugins/extract/extract.plugin.zsh
+++ b/plugins/extract/extract.plugin.zsh
@@ -1,80 +1,73 @@
-# ------------------------------------------------------------------------------
-# FILE: extract.plugin.zsh
-# DESCRIPTION: oh-my-zsh plugin file.
-# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com)
-# VERSION: 1.0.1
-# ------------------------------------------------------------------------------
-
-
-function extract() {
- local remove_archive
- local success
- local file_name
- local extract_dir
-
- if (( $# == 0 )); then
- echo "Usage: extract [-option] [file ...]"
- echo
- echo Options:
- echo " -r, --remove Remove archive."
- echo
- echo "Report bugs to ."
- fi
-
- remove_archive=1
- if [[ "$1" == "-r" ]] || [[ "$1" == "--remove" ]]; then
- remove_archive=0
- shift
- fi
-
- while (( $# > 0 )); do
- if [[ ! -f "$1" ]]; then
- echo "extract: '$1' is not a valid file" 1>&2
- shift
- continue
- fi
-
- success=0
- file_name="$( basename "$1" )"
- extract_dir="$( echo "$file_name" | sed "s/\.${1##*.}//g" )"
- case "$1" in
- (*.tar.gz|*.tgz) [ -z $commands[pigz] ] && tar zxvf "$1" || pigz -dc "$1" | tar xv ;;
- (*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;;
- (*.tar.xz|*.txz) tar --xz --help &> /dev/null \
- && tar --xz -xvf "$1" \
- || xzcat "$1" | tar xvf - ;;
- (*.tar.zma|*.tlz) tar --lzma --help &> /dev/null \
- && tar --lzma -xvf "$1" \
- || lzcat "$1" | tar xvf - ;;
- (*.tar) tar xvf "$1" ;;
- (*.gz) [ -z $commands[pigz] ] && gunzip "$1" || pigz -d "$1" ;;
- (*.bz2) bunzip2 "$1" ;;
- (*.xz) unxz "$1" ;;
- (*.lzma) unlzma "$1" ;;
- (*.Z) uncompress "$1" ;;
- (*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk) unzip "$1" -d $extract_dir ;;
- (*.rar) unrar x -ad "$1" ;;
- (*.7z) 7za x "$1" ;;
- (*.deb)
- mkdir -p "$extract_dir/control"
- mkdir -p "$extract_dir/data"
- cd "$extract_dir"; ar vx "../${1}" > /dev/null
- cd control; tar xzvf ../control.tar.gz
- cd ../data; tar xzvf ../data.tar.gz
- cd ..; rm *.tar.gz debian-binary
- cd ..
- ;;
- (*)
- echo "extract: '$1' cannot be extracted" 1>&2
- success=1
- ;;
- esac
-
- (( success = $success > 0 ? $success : $? ))
- (( $success == 0 )) && (( $remove_archive == 0 )) && rm "$1"
- shift
- done
-}
-
alias x=extract
+extract() {
+ local remove_archive
+ local success
+ local file_name
+ local extract_dir
+
+ if (( $# == 0 )); then
+ cat <<-'EOF' >&2
+ Usage: extract [-option] [file ...]
+
+ Options:
+ -r, --remove Remove archive.
+ EOF
+ fi
+
+ remove_archive=1
+ if [[ "$1" == "-r" ]] || [[ "$1" == "--remove" ]]; then
+ remove_archive=0
+ shift
+ fi
+
+ while (( $# > 0 )); do
+ if [[ ! -f "$1" ]]; then
+ echo "extract: '$1' is not a valid file" >&2
+ shift
+ continue
+ fi
+
+ success=0
+ file_name="$( basename "$1" )"
+ extract_dir="$( echo "$file_name" | sed "s/\.${1##*.}//g" )"
+ case "$1" in
+ (*.tar.gz|*.tgz) (( $+commands[pigz] )) && { pigz -dc "$1" | tar xv } || tar zxvf "$1" ;;
+ (*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;;
+ (*.tar.xz|*.txz)
+ tar --xz --help &> /dev/null \
+ && tar --xz -xvf "$1" \
+ || xzcat "$1" | tar xvf - ;;
+ (*.tar.zma|*.tlz)
+ tar --lzma --help &> /dev/null \
+ && tar --lzma -xvf "$1" \
+ || lzcat "$1" | tar xvf - ;;
+ (*.tar) tar xvf "$1" ;;
+ (*.gz) (( $+commands[pigz] )) && pigz -d "$1" || gunzip "$1" ;;
+ (*.bz2) bunzip2 "$1" ;;
+ (*.xz) unxz "$1" ;;
+ (*.lzma) unlzma "$1" ;;
+ (*.Z) uncompress "$1" ;;
+ (*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk) unzip "$1" -d $extract_dir ;;
+ (*.rar) unrar x -ad "$1" ;;
+ (*.7z) 7za x "$1" ;;
+ (*.deb)
+ mkdir -p "$extract_dir/control"
+ mkdir -p "$extract_dir/data"
+ cd "$extract_dir"; ar vx "../${1}" > /dev/null
+ cd control; tar xzvf ../control.tar.gz
+ cd ../data; tar xzvf ../data.tar.gz
+ cd ..; rm *.tar.gz debian-binary
+ cd ..
+ ;;
+ (*)
+ echo "extract: '$1' cannot be extracted" >&2
+ success=1
+ ;;
+ esac
+
+ (( success = $success > 0 ? $success : $? ))
+ (( $success == 0 )) && (( $remove_archive == 0 )) && rm "$1"
+ shift
+ done
+}
From f12cb5a697ca45b3ef8acda24cef72fe041addb3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Thu, 29 Sep 2016 13:20:26 +0200
Subject: [PATCH 144/194] extract: fix extraction of deb packages with
data.tar.xz
---
plugins/extract/extract.plugin.zsh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh
index 081d5168..24b16517 100644
--- a/plugins/extract/extract.plugin.zsh
+++ b/plugins/extract/extract.plugin.zsh
@@ -56,8 +56,8 @@ extract() {
mkdir -p "$extract_dir/data"
cd "$extract_dir"; ar vx "../${1}" > /dev/null
cd control; tar xzvf ../control.tar.gz
- cd ../data; tar xzvf ../data.tar.gz
- cd ..; rm *.tar.gz debian-binary
+ cd ../data; extract ../data.tar.*
+ cd ..; rm *.tar.* debian-binary
cd ..
;;
(*)
From 68425c266a5107e50a2897b7d7cfc0ccb9fb753c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Thu, 29 Sep 2016 13:26:50 +0200
Subject: [PATCH 145/194] extract: replace basename&sed w/ zsh variable
expansion syntax
`${var:t:h}` uses:
- `${var:t}` which acts as `basename`.
- `${var:r}` which removes the extension.
See http://zsh.sourceforge.net/Doc/Release/Expansion.html#Modifiers
---
plugins/extract/extract.plugin.zsh | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh
index 24b16517..c524bf8f 100644
--- a/plugins/extract/extract.plugin.zsh
+++ b/plugins/extract/extract.plugin.zsh
@@ -3,7 +3,6 @@ alias x=extract
extract() {
local remove_archive
local success
- local file_name
local extract_dir
if (( $# == 0 )); then
@@ -29,8 +28,7 @@ extract() {
fi
success=0
- file_name="$( basename "$1" )"
- extract_dir="$( echo "$file_name" | sed "s/\.${1##*.}//g" )"
+ extract_dir="${1:t:r}"
case "$1" in
(*.tar.gz|*.tgz) (( $+commands[pigz] )) && { pigz -dc "$1" | tar xv } || tar zxvf "$1" ;;
(*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;;
From b5dc976d236e8f8d276aa0aeff49980bfccb0532 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Thu, 29 Sep 2016 13:38:01 +0200
Subject: [PATCH 146/194] extract: add file extensions to extract completion
---
plugins/extract/_extract | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/plugins/extract/_extract b/plugins/extract/_extract
index a73c892d..172425d2 100644
--- a/plugins/extract/_extract
+++ b/plugins/extract/_extract
@@ -3,4 +3,5 @@
_arguments \
'(-r --remove)'{-r,--remove}'[Remove archive.]' \
- "*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|ipsw|rar|7z|deb)(-.)'" && return 0
+ "*::archive file:_files -g '(#i)*.(7z|Z|apk|bz2|deb|gz|ipsw|jar|lzma|rar|sublime-package|tar|tar.bz2|tar.gz|tar.xz|tar.zma|tbz|tbz2|tgz|tlz|txz|war|xpi|xz|zip)(-.)'" \
+ && return 0
From bac896fca7b1af1e4237e96c58a0c13b8ff2d0de Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Fri, 30 Sep 2016 00:37:14 +0200
Subject: [PATCH 147/194] extract: add README
---
plugins/extract/README.md | 46 +++++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
create mode 100644 plugins/extract/README.md
diff --git a/plugins/extract/README.md b/plugins/extract/README.md
new file mode 100644
index 00000000..c6bdd36d
--- /dev/null
+++ b/plugins/extract/README.md
@@ -0,0 +1,46 @@
+# extract plugin
+
+This plugin defines a function called `extract` that extracts the archive file
+you pass it, and it supports a wide variety of archive filetypes.
+
+This way you don't have to know what specific command extracts a file, you just
+do `extract ` and the function takes care of the rest.
+
+To use it, add `extract` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... extract)
+```
+
+## Supported file extensions
+
+| Extension | Description |
+|:------------------|:-------------------------------------|
+| `7z` | 7zip file |
+| `Z` | Z archive (LZW) |
+| `apk` | Android app file |
+| `bz2` | Bzip2 file |
+| `deb` | Debian package |
+| `gz` | Gzip file |
+| `ipsw` | iOS firmware file |
+| `jar` | Java Archive |
+| `lzma` | LZMA archive |
+| `rar` | WinRAR archive |
+| `sublime-package` | Sublime Text package |
+| `tar` | Tarball |
+| `tar.bz2` | Tarball with bzip2 compression |
+| `tar.gz` | Tarball with gzip compression |
+| `tar.xz` | Tarball with lzma2 compression |
+| `tar.zma` | Tarball with lzma compression |
+| `tbz` | Tarball with bzip compression |
+| `tbz2` | Tarball with bzip2 compression |
+| `tgz` | Tarball with gzip compression |
+| `tlz` | Tarball with lzma compression |
+| `txz` | Tarball with lzma2 compression |
+| `war` | Web Application archive (Java-based) |
+| `xpi` | Mozilla XPI module file |
+| `xz` | LZMA2 archive |
+| `zip` | Zip archive |
+
+See [list of archive formats](https://en.wikipedia.org/wiki/List_of_archive_formats) for
+more information regarding archive formats.
From c713407f90e7024507c7fc621440cb171108e7f4 Mon Sep 17 00:00:00 2001
From: Allan Lewis
Date: Fri, 30 Sep 2016 12:45:28 +0100
Subject: [PATCH 148/194] git.plugin.zsh: Don't run Git hooks when making a WIP
commit (#4751)
When making a WIP commit, we generally just want to save the state of the
current branch temporarily, maybe because we want to push our work for backup
purposes, or change branch to work on something else. Therefore, it's generally
undesirable to run Git hooks, which might do things like run linters, because
we probably don't care if our WIP has lint errors.
---
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 25da0350..ea9ff826 100644
--- a/plugins/git/git.plugin.zsh
+++ b/plugins/git/git.plugin.zsh
@@ -236,4 +236,4 @@ alias gupv='git pull --rebase -v'
alias glum='git pull upstream master'
alias gwch='git whatchanged -p --abbrev-commit --pretty=medium'
-alias gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit -m "--wip--"'
+alias gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify -m "--wip--"'
From 3de0235ad26d4584727f4cce17c09f1b4ae6cee5 Mon Sep 17 00:00:00 2001
From: Manuel Hutter
Date: Fri, 30 Sep 2016 19:54:27 +0200
Subject: [PATCH 149/194] Add missing newline to end of `spotify status` output
(#5480)
---
plugins/osx/osx.plugin.zsh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh
index aa6a256c..d7baa119 100644
--- a/plugins/osx/osx.plugin.zsh
+++ b/plugins/osx/osx.plugin.zsh
@@ -314,7 +314,7 @@ function spotify() {
position=$(osascript -e 'tell application "Spotify" to player position as string' | tr ',' '.');
position=$(echo "scale=2; $position / 60" | bc | awk '{printf "%0.2f", $0}');
- printf "$reset""Artist: %s\nAlbum: %s\nTrack: %s \nPosition: %s / %s" "$artist" "$album" "$track" "$position" "$duration";
+ printf "$reset""Artist: %s\nAlbum: %s\nTrack: %s \nPosition: %s / %s\n" "$artist" "$album" "$track" "$position" "$duration";
fi
}
@@ -412,17 +412,17 @@ function spotify() {
osascript -e 'tell application "Spotify" to playpause';
break ;;
- "quit" )
+ "quit" )
cecho "Quitting Spotify.";
osascript -e 'tell application "Spotify" to quit';
exit 1 ;;
- "next" )
+ "next" )
cecho "Going to next track." ;
osascript -e 'tell application "Spotify" to next track';
break ;;
- "prev" )
+ "prev" )
cecho "Going to previous track.";
osascript -e 'tell application "Spotify" to previous track';
break ;;
From 8ea56633a40411d1b43127b9cd88e8851edaf922 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Wed, 28 Sep 2016 18:23:15 +0200
Subject: [PATCH 150/194] last-working-dir: clean up source
---
.../last-working-dir.plugin.zsh | 25 ++++++++-----------
1 file changed, 10 insertions(+), 15 deletions(-)
diff --git a/plugins/last-working-dir/last-working-dir.plugin.zsh b/plugins/last-working-dir/last-working-dir.plugin.zsh
index c458464c..c5278d64 100644
--- a/plugins/last-working-dir/last-working-dir.plugin.zsh
+++ b/plugins/last-working-dir/last-working-dir.plugin.zsh
@@ -1,26 +1,21 @@
-#!/usr/bin/env zsh
-# Keeps track of the last used working directory and automatically jumps
-# into it for new shells.
-
-# Flag indicating if we've previously jumped to last directory.
+# Flag indicating if we've previously jumped to last directory
typeset -g ZSH_LAST_WORKING_DIRECTORY
-mkdir -p $ZSH_CACHE_DIR
-cache_file="$ZSH_CACHE_DIR/last-working-dir"
-# Updates the last directory once directory is changed.
+# Updates the last directory once directory is changed
chpwd_functions+=(chpwd_last_working_dir)
-function chpwd_last_working_dir() {
- # Use >| in case noclobber is set to avoid "file exists" error
+chpwd_last_working_dir() {
+ local cache_file="$ZSH_CACHE_DIR/last-working-dir"
pwd >| "$cache_file"
}
-# Changes directory to the last working directory.
-function lwd() {
- [[ ! -r "$cache_file" ]] || cd "`cat "$cache_file"`"
+# Changes directory to the last working directory
+lwd() {
+ local cache_file="$ZSH_CACHE_DIR/last-working-dir"
+ [[ -r "$cache_file" ]] && cd "$(cat "$cache_file")"
}
-# Automatically jump to last working directory unless this isn't the first time
-# this plugin has been loaded.
+# Automatically jump to last working directory unless this
+# isn't the first time this plugin has been loaded.
if [[ -z "$ZSH_LAST_WORKING_DIRECTORY" ]]; then
lwd 2>/dev/null && ZSH_LAST_WORKING_DIRECTORY=1 || true
fi
From fb6738a7e1d476ec9a74b0e8a04f5252f9de91fe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Wed, 28 Sep 2016 18:30:46 +0200
Subject: [PATCH 151/194] last-working-dir: don't jump if not in $HOME
---
plugins/last-working-dir/last-working-dir.plugin.zsh | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/plugins/last-working-dir/last-working-dir.plugin.zsh b/plugins/last-working-dir/last-working-dir.plugin.zsh
index c5278d64..e882b288 100644
--- a/plugins/last-working-dir/last-working-dir.plugin.zsh
+++ b/plugins/last-working-dir/last-working-dir.plugin.zsh
@@ -14,8 +14,10 @@ lwd() {
[[ -r "$cache_file" ]] && cd "$(cat "$cache_file")"
}
-# Automatically jump to last working directory unless this
-# isn't the first time this plugin has been loaded.
-if [[ -z "$ZSH_LAST_WORKING_DIRECTORY" ]]; then
- lwd 2>/dev/null && ZSH_LAST_WORKING_DIRECTORY=1 || true
-fi
+# Jump to last directory automatically unless:
+# - this isn't the first time the plugin is loaded
+# - it's not in $HOME directory
+[[ -n "$ZSH_LAST_WORKING_DIRECTORY" ]] && return
+[[ "$PWD" != "$HOME" ]] && return
+
+lwd 2>/dev/null && ZSH_LAST_WORKING_DIRECTORY=1 || true
From c488ab15f3293c3870f66fe84fc7ee71a182f214 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Wed, 28 Sep 2016 18:23:28 +0200
Subject: [PATCH 152/194] last-working-dir: add README
---
plugins/last-working-dir/README.md | 9 +++++++++
1 file changed, 9 insertions(+)
create mode 100644 plugins/last-working-dir/README.md
diff --git a/plugins/last-working-dir/README.md b/plugins/last-working-dir/README.md
new file mode 100644
index 00000000..4cc4acab
--- /dev/null
+++ b/plugins/last-working-dir/README.md
@@ -0,0 +1,9 @@
+# last-working-dir plugin
+
+Keeps track of the last used working directory and automatically jumps into it
+for new shells, unless:
+
+- The plugin is already loaded.
+- The current `$PWD` is not `$HOME`.
+
+Adds `lwd` function to jump to the last working directory.
From 06d52a60389a85107ed8cc2e302a1e66f719f738 Mon Sep 17 00:00:00 2001
From: FireWave
Date: Fri, 30 Sep 2016 14:12:03 -0400
Subject: [PATCH 153/194] Change confusing 12h-time without AM/PM to
system-localized time
---
themes/xiong-chiamiov-plus.zsh-theme | 2 +-
themes/xiong-chiamiov.zsh-theme | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/themes/xiong-chiamiov-plus.zsh-theme b/themes/xiong-chiamiov-plus.zsh-theme
index 095dae29..26cc3848 100644
--- a/themes/xiong-chiamiov-plus.zsh-theme
+++ b/themes/xiong-chiamiov-plus.zsh-theme
@@ -1,6 +1,6 @@
# user, host, full path, and time/date
# on two lines for easier vgrepping
# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888
-PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%a %b %d, %I:%M"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%}
+PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%c"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%}
%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <$(git_prompt_info)>%{\e[0m%}%b '
PS2=$' \e[0;34m%}%B>%{\e[0m%}%b '
diff --git a/themes/xiong-chiamiov.zsh-theme b/themes/xiong-chiamiov.zsh-theme
index 7c4c2e4f..9cf17f47 100644
--- a/themes/xiong-chiamiov.zsh-theme
+++ b/themes/xiong-chiamiov.zsh-theme
@@ -1,6 +1,6 @@
# user, host, full path, and time/date
# on two lines for easier vgrepping
# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888
-PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%a %b %d, %I:%M"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%}
+PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%c"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%}
%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B]>%{\e[0m%}%b '
PS2=$' \e[0;34m%}%B>%{\e[0m%}%b '
From 9263e9ca59a65cad53d1cf0581c2af344984c2af Mon Sep 17 00:00:00 2001
From: Adrian Petrescu
Date: Fri, 30 Sep 2016 17:39:32 -0400
Subject: [PATCH 154/194] Add /usr/local/bin to autoenv search path (#5481)
The current list of directories to search for autoenv on misses the default location on Ubuntu systems if you just do a normal `pip install autoenv` - [it will place](https://github.com/kennethreitz/autoenv/blob/master/setup.py#L16) `activate.sh` in `/usr/local/bin` unless you manually override the `--prefix` or something.
The `/usr/local/opt/autoenv` is fine for macOS/homebrew installations but it would be nice not to have to manually patch on Linux :)
---
plugins/autoenv/autoenv.plugin.zsh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/autoenv/autoenv.plugin.zsh b/plugins/autoenv/autoenv.plugin.zsh
index ea2e56dd..af58ee77 100644
--- a/plugins/autoenv/autoenv.plugin.zsh
+++ b/plugins/autoenv/autoenv.plugin.zsh
@@ -1,7 +1,7 @@
# Activates autoenv or reports its failure
() {
if ! type autoenv_init >/dev/null; then
- for d (~/.autoenv /usr/local/opt/autoenv); do
+ for d (~/.autoenv /usr/local/opt/autoenv /usr/local/bin); do
if [[ -e $d/activate.sh ]]; then
autoenv_dir=$d
break
From d186bc30d071559a36bb190a3c3b329b882ec183 Mon Sep 17 00:00:00 2001
From: Florian Wilhelm
Date: Sun, 2 Oct 2016 16:34:54 +0200
Subject: [PATCH 155/194] Add aliases for docker-compose logs (#5475)
---
plugins/docker-compose/docker-compose.plugin.zsh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/plugins/docker-compose/docker-compose.plugin.zsh b/plugins/docker-compose/docker-compose.plugin.zsh
index 9f2457fc..7e330701 100644
--- a/plugins/docker-compose/docker-compose.plugin.zsh
+++ b/plugins/docker-compose/docker-compose.plugin.zsh
@@ -18,3 +18,5 @@ alias dcrm='docker-compose rm'
alias dcr='docker-compose run'
alias dcstop='docker-compose stop'
alias dcup='docker-compose up'
+alias dcl='docker-compose logs'
+alias dclf='docker-compose logs -f'
From eaf18167bbf3ee30157728ec50850db73ada3455 Mon Sep 17 00:00:00 2001
From: Juraj Fiala
Date: Tue, 18 Aug 2015 21:37:09 +0200
Subject: [PATCH 156/194] Added pacaur aliases
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This commit removes most of its contents: it just leaves the
contribution signature. The rest is obsolete and superseeded
by #5460, but the contribution is still valuable.
Related: #4263.
Signed-off-by: Marc Cornellà
---
plugins/archlinux/README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/plugins/archlinux/README.md b/plugins/archlinux/README.md
index 785538a5..f32d91f7 100644
--- a/plugins/archlinux/README.md
+++ b/plugins/archlinux/README.md
@@ -67,3 +67,4 @@
- Martin Putniorz - mputniorz@gmail.com
- MatthR3D - matthr3d@gmail.com
- ornicar - thibault.duplessis@gmail.com
+- Juraj Fiala - doctorjellyface@riseup.net
From 485dd2b73671c257571601dda44e5fd94067271f Mon Sep 17 00:00:00 2001
From: Moses Miller
Date: Mon, 26 Sep 2016 23:17:18 -0700
Subject: [PATCH 157/194] Add pacaur compatibility to archlinux plugin +
refactor
---
plugins/archlinux/archlinux.plugin.zsh | 51 +++++++++++++++++++++-----
1 file changed, 42 insertions(+), 9 deletions(-)
diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh
index 1637e856..2e55d1b8 100644
--- a/plugins/archlinux/archlinux.plugin.zsh
+++ b/plugins/archlinux/archlinux.plugin.zsh
@@ -1,12 +1,4 @@
-if ! (( $+commands[yaourt] )); then
- upgrade() {
- sudo pacman -Syu
- }
-else
- upgrade () {
- yaourt -Syu
- }
-
+if (( $+commands[yaourt] )); then
alias yaconf='yaourt -C'
alias yaupg='yaourt -Syua'
alias yasu='yaourt -Syua --noconfirm'
@@ -35,6 +27,47 @@ else
fi
fi
+if (( $+commands[pacaur] )); then
+ alias paupg='pacaur -Syua'
+ alias pasu='pacaur -Syua --noconfirm'
+ alias pain='pacaur -S'
+ alias pains='pacaur -U'
+ alias pare='pacaur -R'
+ alias parem='pacaur -Rns'
+ alias parep='pacaur -Si'
+ alias pareps='pacaur -Ss'
+ alias paloc='pacaur -Qi'
+ alias palocs='pacaur -Qs'
+ alias palst='pacaur -Qe'
+ alias paorph='pacaur -Qtd'
+ alias painsd='pacaur -S --asdeps'
+ alias pamir='pacaur -Syy'
+
+ if (( $+commands[abs] && $+commands[aur] )); then
+ alias paupd='pacaur -Sy && sudo abs && sudo aur'
+ elif (( $+commands[abs] )); then
+ alias paupd='pacaur -Sy && sudo abs'
+ elif (( $+commands[aur] )); then
+ alias paupd='pacaur -Sy && sudo aur'
+ else
+ alias paupd='pacaur -Sy'
+ fi
+fi
+
+if (( $+commands[pacaur] )); then
+ upgrade() {
+ pacaur -Syu
+ }
+elif (( $+commands[yaourt] )); then
+ upgrade() {
+ yaourt -Syu
+ }
+else
+ upgrade() {
+ pacman -Syu
+ }
+fi
+
# Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
alias pacupg='sudo pacman -Syu'
alias pacin='sudo pacman -S'
From e418a2bb92f6b26773d9e55115803a7137c90eec Mon Sep 17 00:00:00 2001
From: Moses Miller
Date: Sun, 2 Oct 2016 14:28:39 -0700
Subject: [PATCH 158/194] Updated README of the archlinux plugin
---
plugins/archlinux/README.md | 25 +++++++++++++++++++++++++
plugins/archlinux/archlinux.plugin.zsh | 2 +-
2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/plugins/archlinux/README.md b/plugins/archlinux/README.md
index f32d91f7..73a5037b 100644
--- a/plugins/archlinux/README.md
+++ b/plugins/archlinux/README.md
@@ -27,6 +27,30 @@
| yasu | yaourt -Syua --no-confirm | Same as `yaupg`, but without confirmation |
| upgrade | yaourt -Syu | Sync with repositories before upgrading packages |
+### PACAUR
+
+| Alias | Command | Description |
+|---------|------------------------------------|---------------------------------------------------------------------|
+| pain | pacaur -S | Install packages from the repositories |
+| pains | pacaur -U | Install a package from a local file |
+| painsd | pacaur -S --asdeps | Install packages as dependencies of another package |
+| paloc | pacaur -Qi | Display information about a package in the local database |
+| palocs | pacaur -Qs | Search for packages in the local database |
+| palst | pacaur -Qe | List installed packages including from AUR (tagged as "local") |
+| pamir | pacaur -Syy | Force refresh of all package lists after updating mirrorlist |
+| paorph | pacaur -Qtd | Remove orphans using pacaur |
+| pare | pacaur -R | Remove packages, keeping its settings and dependencies |
+| parem | pacaur -Rns | Remove packages, including its settings and unneeded dependencies |
+| parep | pacaur -Si | Display information about a package in the repositories |
+| pareps | pacaur -Ss | Search for packages in the repositories |
+| paupd | pacaur -Sy && sudo abs && sudo aur | Update and refresh local package, ABS and AUR databases |
+| paupd | pacaur -Sy && sudo abs | Update and refresh the local package and ABS databases |
+| paupd | pacaur -Sy && sudo aur | Update and refresh the local package and AUR databases |
+| paupd | pacaur -Sy | Update and refresh the local package database |
+| paupg | pacaur -Syua | Sync with repositories before upgrading all packages (from AUR too) |
+| pasu | pacaur -Syua --no-confirm | Same as `paupg`, but without confirmation |
+| upgrade | pacaur -Syu
+
#### PACMAN
| Alias | Command | Description |
@@ -68,3 +92,4 @@
- MatthR3D - matthr3d@gmail.com
- ornicar - thibault.duplessis@gmail.com
- Juraj Fiala - doctorjellyface@riseup.net
+- Majora320 (Moses Miller) - Majora320@gmail.com
diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh
index 2e55d1b8..3156e949 100644
--- a/plugins/archlinux/archlinux.plugin.zsh
+++ b/plugins/archlinux/archlinux.plugin.zsh
@@ -64,7 +64,7 @@ elif (( $+commands[yaourt] )); then
}
else
upgrade() {
- pacman -Syu
+ sudo pacman -Syu
}
fi
From cd44246415d557bc9ba8d7c74acdcc0a44d10e34 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Mon, 3 Oct 2016 01:04:16 +0200
Subject: [PATCH 159/194] Fix small copy-editing mistake in archlinux README
---
plugins/archlinux/README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/archlinux/README.md b/plugins/archlinux/README.md
index 73a5037b..16f09941 100644
--- a/plugins/archlinux/README.md
+++ b/plugins/archlinux/README.md
@@ -49,7 +49,7 @@
| paupd | pacaur -Sy | Update and refresh the local package database |
| paupg | pacaur -Syua | Sync with repositories before upgrading all packages (from AUR too) |
| pasu | pacaur -Syua --no-confirm | Same as `paupg`, but without confirmation |
-| upgrade | pacaur -Syu
+| upgrade | pacaur -Syu | Sync with repositories before upgrading packages |
#### PACMAN
From 6d975f72589dbb6e44084841cddf9ea153990eb8 Mon Sep 17 00:00:00 2001
From: savimat
Date: Mon, 3 Oct 2016 09:11:26 +1000
Subject: [PATCH 160/194] Add alias for signed git commit with message (#5390)
Signed-off-by: Mat Munn
---
plugins/git/git.plugin.zsh | 1 +
1 file changed, 1 insertion(+)
diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
index ea9ff826..28fb253d 100644
--- a/plugins/git/git.plugin.zsh
+++ b/plugins/git/git.plugin.zsh
@@ -65,6 +65,7 @@ alias gca!='git commit -v -a --amend'
alias gcan!='git commit -v -a --no-edit --amend'
alias gcans!='git commit -v -a -s --no-edit --amend'
alias gcam='git commit -a -m'
+alias gcsm='git commit -s -m'
alias gcb='git checkout -b'
alias gcf='git config --list'
alias gcl='git clone --recursive'
From 40bfe5a4124be7b5983756cc81b54a4a4d5846e6 Mon Sep 17 00:00:00 2001
From: Fabian Wolff
Date: Mon, 26 Sep 2016 21:41:42 +0200
Subject: [PATCH 161/194] Implement a locking mechanism to avoid multiple
update prompts (fixes #3766)
---
tools/check_for_upgrade.sh | 43 +++++++++++++++++++++-----------------
1 file changed, 24 insertions(+), 19 deletions(-)
diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
index bd9aba8b..d1b174c6 100644
--- a/tools/check_for_upgrade.sh
+++ b/tools/check_for_upgrade.sh
@@ -29,31 +29,36 @@ fi
# Cancel upgrade if git is unavailable on the system
whence git >/dev/null || return 0
-if [ -f ~/.zsh-update ]
+if mkdir "$ZSH/log/update.lock" 2>/dev/null
then
- . ~/.zsh-update
-
- if [[ -z "$LAST_EPOCH" ]]; then
- _update_zsh_update && return 0;
- fi
-
- epoch_diff=$(($(_current_epoch) - $LAST_EPOCH))
- if [ $epoch_diff -gt $epoch_target ]
+ if [ -f ~/.zsh-update ]
then
- if [ "$DISABLE_UPDATE_PROMPT" = "true" ]
+ . ~/.zsh-update
+
+ if [[ -z "$LAST_EPOCH" ]]; then
+ _update_zsh_update && return 0;
+ fi
+
+ epoch_diff=$(($(_current_epoch) - $LAST_EPOCH))
+ if [ $epoch_diff -gt $epoch_target ]
then
- _upgrade_zsh
- else
- echo "[Oh My Zsh] Would you like to check for updates? [Y/n]: \c"
- read line
- if [[ "$line" == Y* ]] || [[ "$line" == y* ]] || [ -z "$line" ]; then
+ if [ "$DISABLE_UPDATE_PROMPT" = "true" ]
+ then
_upgrade_zsh
else
- _update_zsh_update
+ echo "[Oh My Zsh] Would you like to check for updates? [Y/n]: \c"
+ read line
+ if [[ "$line" == Y* ]] || [[ "$line" == y* ]] || [ -z "$line" ]; then
+ _upgrade_zsh
+ else
+ _update_zsh_update
+ fi
fi
fi
+ else
+ # create the zsh file
+ _update_zsh_update
fi
-else
- # create the zsh file
- _update_zsh_update
+
+ rm -r $ZSH/log/update.lock
fi
From 4fa6be02300ff1bbf3772be0c8f7993a46c3769e Mon Sep 17 00:00:00 2001
From: Fabian Wolff
Date: Mon, 3 Oct 2016 11:52:25 +0200
Subject: [PATCH 162/194] Use rmdir instead of rm -r
---
tools/check_for_upgrade.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
index d1b174c6..3c9a4e4c 100644
--- a/tools/check_for_upgrade.sh
+++ b/tools/check_for_upgrade.sh
@@ -60,5 +60,5 @@ then
_update_zsh_update
fi
- rm -r $ZSH/log/update.lock
+ rmdir $ZSH/log/update.lock
fi
From 1f64fa92f524d47a87320a4baf9d9883fd23ab5e Mon Sep 17 00:00:00 2001
From: Fabian Wolff
Date: Mon, 3 Oct 2016 11:58:15 +0200
Subject: [PATCH 163/194] Convert "if then" statements to "if; then" one-liners
---
tools/check_for_upgrade.sh | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
index 3c9a4e4c..a57f6da0 100644
--- a/tools/check_for_upgrade.sh
+++ b/tools/check_for_upgrade.sh
@@ -29,10 +29,8 @@ fi
# Cancel upgrade if git is unavailable on the system
whence git >/dev/null || return 0
-if mkdir "$ZSH/log/update.lock" 2>/dev/null
-then
- if [ -f ~/.zsh-update ]
- then
+if mkdir "$ZSH/log/update.lock" 2>/dev/null; then
+ if [ -f ~/.zsh-update ]; then
. ~/.zsh-update
if [[ -z "$LAST_EPOCH" ]]; then
@@ -40,10 +38,8 @@ then
fi
epoch_diff=$(($(_current_epoch) - $LAST_EPOCH))
- if [ $epoch_diff -gt $epoch_target ]
- then
- if [ "$DISABLE_UPDATE_PROMPT" = "true" ]
- then
+ if [ $epoch_diff -gt $epoch_target ]; then
+ if [ "$DISABLE_UPDATE_PROMPT" = "true" ]; then
_upgrade_zsh
else
echo "[Oh My Zsh] Would you like to check for updates? [Y/n]: \c"
From 0887a7eb504debd8714bb914b99a2d6343f6b131 Mon Sep 17 00:00:00 2001
From: Henrik Johansson
Date: Fri, 8 Aug 2014 14:09:07 +0200
Subject: [PATCH 164/194] Added simple support for Cargo - the Rust build
system
---
plugins/cargo/cargo.plugin.zsh | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
create mode 100644 plugins/cargo/cargo.plugin.zsh
diff --git a/plugins/cargo/cargo.plugin.zsh b/plugins/cargo/cargo.plugin.zsh
new file mode 100644
index 00000000..e1dc953d
--- /dev/null
+++ b/plugins/cargo/cargo.plugin.zsh
@@ -0,0 +1,22 @@
+function _cargo_commands() {
+ local ret=1 state
+ _arguments ':subcommand:->subcommand' && ret=0
+
+ case $state in
+ subcommand)
+ subcommands=(
+ "build:Build the current project"
+ "clean:Clean up after a build"
+ "help:Help about available commands"
+ "new:Create a new project"
+ "test:Run the tests"
+ "update:Updates list of known packages"
+ "run:Builds and runs the currecnt project"
+ )
+ _describe -t subcommands 'cargo subcommands' subcommands && ret=0
+ esac
+
+ return ret
+}
+
+compdef _cargo_commands cargo
From 9d35d3a5d5db6e3b5aa3935bdb3660b607bf599d Mon Sep 17 00:00:00 2001
From: FireWave
Date: Mon, 3 Oct 2016 14:58:51 -0400
Subject: [PATCH 165/194] Revert "Change confusing 12h-time without AM/PM to
system-localized time"
This reverts commit 06d52a60389a85107ed8cc2e302a1e66f719f738.
---
themes/xiong-chiamiov-plus.zsh-theme | 2 +-
themes/xiong-chiamiov.zsh-theme | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/themes/xiong-chiamiov-plus.zsh-theme b/themes/xiong-chiamiov-plus.zsh-theme
index 26cc3848..095dae29 100644
--- a/themes/xiong-chiamiov-plus.zsh-theme
+++ b/themes/xiong-chiamiov-plus.zsh-theme
@@ -1,6 +1,6 @@
# user, host, full path, and time/date
# on two lines for easier vgrepping
# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888
-PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%c"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%}
+PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%a %b %d, %I:%M"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%}
%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <$(git_prompt_info)>%{\e[0m%}%b '
PS2=$' \e[0;34m%}%B>%{\e[0m%}%b '
diff --git a/themes/xiong-chiamiov.zsh-theme b/themes/xiong-chiamiov.zsh-theme
index 9cf17f47..7c4c2e4f 100644
--- a/themes/xiong-chiamiov.zsh-theme
+++ b/themes/xiong-chiamiov.zsh-theme
@@ -1,6 +1,6 @@
# user, host, full path, and time/date
# on two lines for easier vgrepping
# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888
-PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%c"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%}
+PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%a %b %d, %I:%M"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%}
%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B]>%{\e[0m%}%b '
PS2=$' \e[0;34m%}%B>%{\e[0m%}%b '
From fe605e142fdaaec6282764c8fe88af27241338f3 Mon Sep 17 00:00:00 2001
From: FireWave
Date: Mon, 3 Oct 2016 15:00:39 -0400
Subject: [PATCH 166/194] Change confusing 12h without AM/PM to a clean 24h
display. It was not possible to simply add AM/PM since strftime return blank
for %p %P
---
themes/xiong-chiamiov-plus.zsh-theme | 2 +-
themes/xiong-chiamiov.zsh-theme | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/themes/xiong-chiamiov-plus.zsh-theme b/themes/xiong-chiamiov-plus.zsh-theme
index 095dae29..5fb4fe6f 100644
--- a/themes/xiong-chiamiov-plus.zsh-theme
+++ b/themes/xiong-chiamiov-plus.zsh-theme
@@ -1,6 +1,6 @@
# user, host, full path, and time/date
# on two lines for easier vgrepping
# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888
-PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%a %b %d, %I:%M"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%}
+PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%a %b %d, %H:%M"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%}
%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <$(git_prompt_info)>%{\e[0m%}%b '
PS2=$' \e[0;34m%}%B>%{\e[0m%}%b '
diff --git a/themes/xiong-chiamiov.zsh-theme b/themes/xiong-chiamiov.zsh-theme
index 7c4c2e4f..0ed335fb 100644
--- a/themes/xiong-chiamiov.zsh-theme
+++ b/themes/xiong-chiamiov.zsh-theme
@@ -1,6 +1,6 @@
# user, host, full path, and time/date
# on two lines for easier vgrepping
# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888
-PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%a %b %d, %I:%M"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%}
+PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%a %b %d, %H:%M"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%}
%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B]>%{\e[0m%}%b '
PS2=$' \e[0;34m%}%B>%{\e[0m%}%b '
From 6b7003c3efcabe5ce185d5c2a1a8b708d92dfb82 Mon Sep 17 00:00:00 2001
From: Laurent Commarieu
Date: Mon, 26 Sep 2016 15:26:38 +0200
Subject: [PATCH 167/194] feat(plugin): add nomad
---
plugins/nomad/README.md | 11 +++++++++
plugins/nomad/_nomad | 51 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 62 insertions(+)
create mode 100644 plugins/nomad/README.md
create mode 100644 plugins/nomad/_nomad
diff --git a/plugins/nomad/README.md b/plugins/nomad/README.md
new file mode 100644
index 00000000..ff07e917
--- /dev/null
+++ b/plugins/nomad/README.md
@@ -0,0 +1,11 @@
+## About
+
+Plugin for Nomad, a tool from Hashicorp for easily deploy applications at any scale.
+
+### Requirements
+
+ * [Nomad](https://nomadproject.io/)
+
+### Usage
+
+ * Type `nomad` into your prompt and hit `TAB` to see available completion options
diff --git a/plugins/nomad/_nomad b/plugins/nomad/_nomad
new file mode 100644
index 00000000..25169f39
--- /dev/null
+++ b/plugins/nomad/_nomad
@@ -0,0 +1,51 @@
+#compdef nomad
+
+local -a _nomad_cmds
+_nomad_cmds=(
+ 'agent:Runs a Nomad agent'
+ 'agent-info:Display status information about the local agent'
+ 'alloc-status:Display allocation status information and metadata'
+ 'client-config:View or modify client configuration details'
+ 'eval-status:Display evaluation status and placement failure reasons'
+ 'fs:Inspect the contents of an allocation directory'
+ 'init:Create an example job file'
+ 'inspect:Inspect a submitted job'
+ 'logs:Streams the logs of a task.'
+ 'node-drain:Toggle drain mode on a given node'
+ 'node-status:Display status information about nodes'
+ 'plan:Dry-run a job update to determine its effects'
+ 'run:Run a new job or update an existing'
+ 'server-force-leave:Force a server into the left state'
+ 'server-join:Join server nodes together'
+ 'server-members:Display a list of known servers and their'
+ 'status:Display status information about jobs'
+ 'stop:Stop a running job'
+ 'validate:Checks if a given job specification is valid'
+ 'version:Prints the Nomad version'
+)
+
+
+__allocstatus() {
+ _arguments \
+ '-address=[(addr) The address of the Nomad server. Overrides the NOMAD_ADDR environment variable if set. Default = http://127.0.0.1:4646]' \
+ '-region=[(region) The region of the Nomad servers to forward commands to. Overrides the NOMAD_REGION environment variable if set. Defaults to the Agent s local region.]' \
+ '-no-color[Disables colored command output.]' \
+ '-short[Display short output. Shows only the most recent task event.]' \
+ '-stats[Display detailed resource usage statistics.]' \
+ '-verbose[Show full information.]' \
+ '-json[Output the allocation in its JSON format.]' \
+ '-t[Format and display allocation using a Go template.]'
+}
+
+_arguments '*:: :->command'
+
+if (( CURRENT == 1 )); then
+ _describe -t commands "nomad command" _nomad_cmds
+ return
+fi
+
+local -a _command_args
+case "$words[1]" in
+ alloc-status)
+ __allocstatus ;;
+esac
From dfd7bf9f4141fe6d2ec9cd067b01ad9920e80a24 Mon Sep 17 00:00:00 2001
From: Laurent Commarieu
Date: Mon, 3 Oct 2016 21:11:54 +0200
Subject: [PATCH 168/194] feat(nomad): add common commands and new readme
---
plugins/nomad/README.md | 16 ++++---
plugins/nomad/_nomad | 104 +++++++++++++++++++++++++++++++++++++++-
2 files changed, 113 insertions(+), 7 deletions(-)
diff --git a/plugins/nomad/README.md b/plugins/nomad/README.md
index ff07e917..04b36168 100644
--- a/plugins/nomad/README.md
+++ b/plugins/nomad/README.md
@@ -1,11 +1,15 @@
-## About
+# Nomad
-Plugin for Nomad, a tool from Hashicorp for easily deploy applications at any scale.
+The `nomad` plugin provides a simple autocompletion for [Nomad](https://nomadproject.io/), a tool from Hashicorp for easily deploy applications at any scale.
-### Requirements
+## Usage
- * [Nomad](https://nomadproject.io/)
+1. Enable the `nomad` plugin:
-### Usage
+ ```zsh
+ plugins=(... nomad)
+ ```
- * Type `nomad` into your prompt and hit `TAB` to see available completion options
+2. Install [Nomad](https://nomadproject.io/)
+
+3. Type `nomad` into your prompt and hit `TAB` to see available completion options.
diff --git a/plugins/nomad/_nomad b/plugins/nomad/_nomad
index 25169f39..1c935a02 100644
--- a/plugins/nomad/_nomad
+++ b/plugins/nomad/_nomad
@@ -24,7 +24,6 @@ _nomad_cmds=(
'version:Prints the Nomad version'
)
-
__allocstatus() {
_arguments \
'-address=[(addr) The address of the Nomad server. Overrides the NOMAD_ADDR environment variable if set. Default = http://127.0.0.1:4646]' \
@@ -37,6 +36,93 @@ __allocstatus() {
'-t[Format and display allocation using a Go template.]'
}
+__evalstatus() {
+ _arguments \
+ '-address=[(addr) The address of the Nomad server. Overrides the NOMAD_ADDR environment variable if set. Default = http://127.0.0.1:4646]' \
+ '-region=[(region) The region of the Nomad servers to forward commands to. Overrides the NOMAD_REGION environment variable if set. Defaults to the Agent s local region.]' \
+ '-no-color[Disables colored command output.]' \
+ '-monitor[Monitor an outstanding evaluation.]' \
+ '-verbose[Show full information.]' \
+ '-json[Output the allocation in its JSON format.]' \
+ '-t[Format and display allocation using a Go template.]'
+}
+
+__inspect() {
+ _arguments \
+ '-address=[(addr) The address of the Nomad server. Overrides the NOMAD_ADDR environment variable if set. Default = http://127.0.0.1:4646]' \
+ '-region=[(region) The region of the Nomad servers to forward commands to. Overrides the NOMAD_REGION environment variable if set. Defaults to the Agent s local region.]' \
+ '-no-color[Disables colored command output.]' \
+ '-json[Output the allocation in its JSON format.]' \
+ '-t[Format and display allocation using a Go template.]'
+}
+
+__logs() {
+ _arguments \
+ '-address=[(addr) The address of the Nomad server. Overrides the NOMAD_ADDR environment variable if set. Default = http://127.0.0.1:4646]' \
+ '-region=[(region) The region of the Nomad servers to forward commands to. Overrides the NOMAD_REGION environment variable if set. Defaults to the Agent s local region.]' \
+ '-no-color[Disables colored command output.]' \
+ '-stderr[ Display stderr logs.]' \
+ '-job[ Use a random allocation from the specified job ID.]' \
+ '-verbose[Show full information.]' \
+ '-f[Causes the output to not stop when the end of the logs are reached, but rather to wait for additional output.]' \
+ '-tail[Show the logs contents with offsets relative to the end of the logs. If no offset is given, -n is defaulted to 10.]' \
+ '-n[Sets the tail location in best-efforted number of lines relative to the end of the logs.]' \
+ '-c[Sets the tail location in number of bytes relative to the end of the logs.]'
+}
+
+__nodestatus() {
+ _arguments \
+ '-address=[(addr) The address of the Nomad server. Overrides the NOMAD_ADDR environment variable if set. Default = http://127.0.0.1:4646]' \
+ '-region=[(region) The region of the Nomad servers to forward commands to. Overrides the NOMAD_REGION environment variable if set. Defaults to the Agent s local region.]' \
+ '-no-color[Disables colored command output.]' \
+ '-self[Query the status of the local node.]' \
+ '-allocs[ Display a count of running allocations for each node.]' \
+ '-short[Display short output. Shows only the most recent task event.]' \
+ '-stats[Display detailed resource usage statistics.]' \
+ '-verbose[Show full information.]' \
+ '-json[Output the allocation in its JSON format.]' \
+ '-t[Format and display allocation using a Go template.]'
+}
+
+__plan() {
+ _arguments \
+ '-address=[(addr) The address of the Nomad server. Overrides the NOMAD_ADDR environment variable if set. Default = http://127.0.0.1:4646]' \
+ '-region=[(region) The region of the Nomad servers to forward commands to. Overrides the NOMAD_REGION environment variable if set. Defaults to the Agent s local region.]' \
+ '-no-color[Disables colored command output.]' \
+ '-diff[Determines whether the diff between the remote job and planned job is shown. Defaults to true.]'
+}
+
+__run() {
+ _arguments \
+ '-address=[(addr) The address of the Nomad server. Overrides the NOMAD_ADDR environment variable if set. Default = http://127.0.0.1:4646]' \
+ '-region=[(region) The region of the Nomad servers to forward commands to. Overrides the NOMAD_REGION environment variable if set. Defaults to the Agent s local region.]' \
+ '-no-color[Disables colored command output.]' \
+ '-check-index[If set, the job is only registered or updated if the the passed job modify index matches the server side version. If a check-index value of zero is passed, the job is only registered if it does not yet exist. If a non-zero value is passed, it ensures that the job is being updated from a known state. The use of this flag is most common in conjunction with plan command.]' \
+ '-detach[Return immediately instead of entering monitor mode. After job submission, the evaluation ID will be printed to the screen, which can be used to examine the evaluation using the eval-status command.]' \
+ '-output[Output the JSON that would be submitted to the HTTP API without submitting the job.]' \
+ '-verbose[Show full information.]'
+}
+
+__status() {
+ _arguments \
+ '-address=[(addr) The address of the Nomad server. Overrides the NOMAD_ADDR environment variable if set. Default = http://127.0.0.1:4646]' \
+ '-region=[(region) The region of the Nomad servers to forward commands to. Overrides the NOMAD_REGION environment variable if set. Defaults to the Agent s local region.]' \
+ '-no-color[Disables colored command output.]' \
+ '-short[Display short output. Shows only the most recent task event.]' \
+ '-evals[Display the evaluations associated with the job.]' \
+ '-verbose[Show full information.]'
+}
+
+__stop() {
+ _arguments \
+ '-address=[(addr) The address of the Nomad server. Overrides the NOMAD_ADDR environment variable if set. Default = http://127.0.0.1:4646]' \
+ '-region=[(region) The region of the Nomad servers to forward commands to. Overrides the NOMAD_REGION environment variable if set. Defaults to the Agent s local region.]' \
+ '-no-color[Disables colored command output.]' \
+ '-detach[Return immediately instead of entering monitor mode. After the deregister command is submitted, a new evaluation ID is printed to the screen, which can be used to examine the evaluation using the eval-status command.]' \
+ '-yes[Automatic yes to prompts.]' \
+ '-verbose[Show full information.]'
+}
+
_arguments '*:: :->command'
if (( CURRENT == 1 )); then
@@ -48,4 +134,20 @@ local -a _command_args
case "$words[1]" in
alloc-status)
__allocstatus ;;
+ eval-status)
+ __evalstatus ;;
+ inspect)
+ __inspect ;;
+ logs)
+ __logs ;;
+ node-status)
+ __nodestatus ;;
+ plan)
+ __plan ;;
+ run)
+ __run ;;
+ status)
+ __status ;;
+ stop)
+ __stop ;;
esac
From 915b0e46f275d19e66f8ad7762edc4fcb28967e6 Mon Sep 17 00:00:00 2001
From: Zaki Manian
Date: Tue, 14 Jun 2016 10:53:58 +0200
Subject: [PATCH 169/194] Add completion for cargo, the rust build tool
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Copy of the official repository:
https://github.com/rust-lang/cargo/tree/master/src/etc
Signed-off-by: Marc Cornellà
---
plugins/cargo/_cargo | 497 +++++++++++++++++++++++++++++++++
plugins/cargo/cargo.plugin.zsh | 22 --
2 files changed, 497 insertions(+), 22 deletions(-)
create mode 100644 plugins/cargo/_cargo
delete mode 100644 plugins/cargo/cargo.plugin.zsh
diff --git a/plugins/cargo/_cargo b/plugins/cargo/_cargo
new file mode 100644
index 00000000..17585920
--- /dev/null
+++ b/plugins/cargo/_cargo
@@ -0,0 +1,497 @@
+#compdef cargo
+
+typeset -A opt_args
+autoload -U regexp-replace
+
+_cargo() {
+
+_arguments \
+ '(- 1 *)'{-h,--help}'[show help message]' \
+ '(- 1 *)'--list'[list installed commands]' \
+ '(- 1 *)'{-v,--verbose}'[use verbose output]' \
+ '(- 1 *)'--color'[colorization option]' \
+ '(- 1 *)'{-V,--version}'[show version information]' \
+ '1: :_cargo_cmds' \
+ '*:: :->args'
+
+case $state in
+ args)
+ case $words[1] in
+ bench)
+ _arguments \
+ '--features=[space separated feature list]' \
+ '--all-features[enable all available features]' \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \
+ "${command_scope_spec[@]}" \
+ '--manifest-path=[path to manifest]: :_files -/' \
+ '--no-default-features[do not build the default features]' \
+ '--no-run[compile but do not run]' \
+ '(-p,--package)'{-p=,--package=}'[package to run benchmarks for]:packages:_get_package_names' \
+ '--target=[target triple]' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
+ '--color=:colorization option:(auto always never)' \
+ ;;
+
+ build)
+ _arguments \
+ '--features=[space separated feature list]' \
+ '--all-features[enable all available features]' \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \
+ "${command_scope_spec[@]}" \
+ '--manifest-path=[path to manifest]: :_files -/' \
+ '--no-default-features[do not build the default features]' \
+ '(-p,--package)'{-p=,--package=}'[package to build]:packages:_get_package_names' \
+ '--release=[build in release mode]' \
+ '--target=[target triple]' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
+ '--color=:colorization option:(auto always never)' \
+ ;;
+
+ clean)
+ _arguments \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '--manifest-path=[path to manifest]: :_files -/' \
+ '(-p,--package)'{-p=,--package=}'[package to clean]:packages:_get_package_names' \
+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
+ '--release[whether or not to clean release artifacts]' \
+ '--target=[target triple(default:all)]' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ '--color=:colorization option:(auto always never)' \
+ ;;
+
+ doc)
+ _arguments \
+ '--features=[space separated feature list]' \
+ '--all-features[enable all available features]' \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \
+ '--manifest-path=[path to manifest]: :_files -/' \
+ '--no-deps[do not build docs for dependencies]' \
+ '--no-default-features[do not build the default features]' \
+ '--open[open docs in browser after the build]' \
+ '(-p, --package)'{-p,--package}'=[package to document]' \
+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
+ '--release[build artifacts in release mode, with optimizations]' \
+ '--target=[build for the target triple]' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ '--color=:colorization option:(auto always never)' \
+ ;;
+
+ fetch)
+ _arguments \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '--manifest-path=[path to manifest]: :_files -/' \
+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ '--color=:colorization option:(auto always never)' \
+ ;;
+
+ generate-lockfile)
+ _arguments \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '--manifest-path=[path to manifest]: :_files -/' \
+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ '--color=:colorization option:(auto always never)' \
+ ;;
+
+ git-checkout)
+ _arguments \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ 'q(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
+ '--reference=[REF]' \
+ '--url=[URL]' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ '--color=:colorization option:(auto always never)' \
+ ;;
+
+ help)
+ _arguments \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '*: :_cargo_cmds' \
+ ;;
+
+ init)
+ _arguments \
+ '--bin[use binary template]' \
+ '--vcs:initialize a new repo with a given VCS:(git hg none)' \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '--name=[set the resulting package name]' \
+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ '--color=:colorization option:(auto always never)' \
+ ;;
+
+ install)
+ _arguments \
+ '--bin=[only install the specified binary]' \
+ '--branch=[branch to use when installing from git]' \
+ '--color=:colorization option:(auto always never)' \
+ '--debug[build in debug mode instead of release mode]' \
+ '--example[install the specified example instead of binaries]' \
+ '--features=[space separated feature list]' \
+ '--all-features[enable all available features]' \
+ '--git=[URL from which to install the crate]' \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \
+ '--no-default-features[do not build the default features]' \
+ '--path=[local filesystem path to crate to install]' \
+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
+ '--rev=[specific commit to use when installing from git]' \
+ '--root=[directory to install packages into]' \
+ '--tag=[tag to use when installing from git]' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ '--vers=[version to install from crates.io]' \
+ ;;
+
+ locate-project)
+ _arguments \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '--manifest-path=[path to manifest]: :_files -/' \
+ ;;
+
+ login)
+ _arguments \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '--host=[Host to set the token for]' \
+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ '--color=:colorization option:(auto always never)' \
+ ;;
+
+ metadata)
+ _arguments \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ "--no-deps[output information only about the root package and don't fetch dependencies]" \
+ '--no-default-features[do not include the default feature]' \
+ '--manifest-path=[path to manifest]: :_files -/' \
+ '--features=[space separated feature list]' \
+ '--all-features[enable all available features]' \
+ '--format-version=[format version(default: 1)]' \
+ '--color=:colorization option:(auto always never)' \
+ ;;
+
+ new)
+ _arguments \
+ '--bin[use binary template]' \
+ '--vcs:initialize a new repo with a given VCS:(git hg none)' \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '--name=[set the resulting package name]' \
+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ '--color=:colorization option:(auto always never)' \
+ ;;
+
+ owner)
+ _arguments \
+ '(-a, --add)'{-a,--add}'[add owner LOGIN]' \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '--index[registry index]' \
+ '(-l, --list)'{-l,--list}'[list owners of a crate]' \
+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
+ '(-r, --remove)'{-r,--remove}'[remove owner LOGIN]' \
+ '--token[API token to use when authenticating]' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ '--color=:colorization option:(auto always never)' \
+ ;;
+
+ package)
+ _arguments \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '(-l, --list)'{-l,--list}'[print files included in a package without making one]' \
+ '--manifest-path=[path to manifest]: :_files -/' \
+ '--no-metadata[ignore warnings about a lack of human-usable metadata]' \
+ '--no-verify[do not build to verify contents]' \
+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ '--color=:colorization option:(auto always never)' \
+ ;;
+
+ pkgid)
+ _arguments \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '--manifest-path=[path to manifest]: :_files -/' \
+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ '--color=:colorization option:(auto always never)' \
+ ;;
+
+ publish)
+ _arguments \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '--host=[Host to set the token for]' \
+ '--manifest-path=[path to manifest]: :_files -/' \
+ '--no-verify[Do not verify tarball until before publish]' \
+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
+ '--token[token to use when uploading]' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ '--color=:colorization option:(auto always never)' \
+ ;;
+
+ read-manifest)
+ _arguments \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '--manifest-path=[path to manifest]: :_files -/' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ '--color=:colorization option:(auto always never)' \
+ ;;
+
+ run)
+ _arguments \
+ '--example=[name of the bin target]' \
+ '--features=[space separated feature list]' \
+ '--all-features[enable all available features]' \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \
+ '--manifest-path=[path to manifest]: :_files -/' \
+ '--bin=[name of the bin target]' \
+ '--no-default-features[do not build the default features]' \
+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
+ '--release=[build in release mode]' \
+ '--target=[target triple]' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ '--color=:colorization option:(auto always never)' \
+ '*: :_normal' \
+ ;;
+
+ rustc)
+ _arguments \
+ '--color=:colorization option:(auto always never)' \
+ '--features=[features to compile for the package]' \
+ '--all-features[enable all available features]' \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '(-j, --jobs)'{-j,--jobs}'=[number of parallel jobs, defaults to # of CPUs]' \
+ '--manifest-path=[path to the manifest to fetch dependencies for]' \
+ '--no-default-features[do not compile default features for the package]' \
+ '(-p, --package)'{-p,--package}'=[profile to compile for]' \
+ '--profile=[profile to build the selected target for]' \
+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
+ '--release[build artifacts in release mode, with optimizations]' \
+ '--target=[target triple which compiles will be for]' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ "${command_scope_spec[@]}" \
+ ;;
+
+ rustdoc)
+ _arguments \
+ '--color=:colorization option:(auto always never)' \
+ '--features=[space-separated list of features to also build]' \
+ '--all-features[enable all available features]' \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '(-j, --jobs)'{-j,--jobs}'=[number of parallel jobs, defaults to # of CPUs]' \
+ '--manifest-path=[path to the manifest to document]' \
+ '--no-default-features[do not build the `default` feature]' \
+ '--open[open the docs in a browser after the operation]' \
+ '(-p, --package)'{-p,--package}'=[package to document]' \
+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
+ '--release[build artifacts in release mode, with optimizations]' \
+ '--target=[build for the target triple]' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ "${command_scope_spec[@]}" \
+ ;;
+
+ search)
+ _arguments \
+ '--color=:colorization option:(auto always never)' \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '--host=[host of a registry to search in]' \
+ '--limit=[limit the number of results]' \
+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ ;;
+
+ test)
+ _arguments \
+ '--features=[space separated feature list]' \
+ '--all-features[enable all available features]' \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \
+ '--manifest-path=[path to manifest]: :_files -/' \
+ '--test=[test name]: :_test_names' \
+ '--no-default-features[do not build the default features]' \
+ '--no-fail-fast[run all tests regardless of failure]' \
+ '--no-run[compile but do not run]' \
+ '(-p,--package)'{-p=,--package=}'[package to run tests for]:packages:_get_package_names' \
+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
+ '--release[build artifacts in release mode, with optimizations]' \
+ '--target=[target triple]' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ '--color=:colorization option:(auto always never)' \
+ '1: :_test_names' \
+ ;;
+
+ uninstall)
+ _arguments \
+ '--bin=[only uninstall the binary NAME]' \
+ '--color=:colorization option:(auto always never)' \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '(-q, --quiet)'{-q,--quiet}'[less output printed to stdout]' \
+ '--root=[directory to uninstall packages from]' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ ;;
+
+ update)
+ _arguments \
+ '--aggressive=[force dependency update]' \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '--manifest-path=[path to manifest]: :_files -/' \
+ '(-p,--package)'{-p=,--package=}'[package to update]:packages:__get_package_names' \
+ '--precise=[update single dependency to PRECISE]: :' \
+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ '--color=:colorization option:(auto always never)' \
+ ;;
+
+ verify-project)
+ _arguments \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '--manifest-path=[path to manifest]: :_files -/' \
+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ '--color=:colorization option:(auto always never)' \
+ ;;
+
+ version)
+ _arguments \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ '--color=:colorization option:(auto always never)' \
+ ;;
+
+ yank)
+ _arguments \
+ '(-h, --help)'{-h,--help}'[show help message]' \
+ '--index[registry index]' \
+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
+ '--token[API token to use when authenticating]' \
+ '--undo[undo a yank, putting a version back into the index]' \
+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
+ '--color=:colorization option:(auto always never)' \
+ '--vers[yank version]' \
+ ;;
+ esac
+ ;;
+esac
+}
+
+_cargo_cmds(){
+local -a commands;commands=(
+'bench:execute all benchmarks of a local package'
+'build:compile the current project'
+'clean:remove generated artifacts'
+'doc:build package documentation'
+'fetch:fetch package dependencies'
+'generate-lockfile:create lockfile'
+'git-checkout:git checkout'
+'help:get help for commands'
+'init:create new project in current directory'
+'install:install a Rust binary'
+'locate-project:print "Cargo.toml" location'
+'login:login to remote server'
+'metadata:the metadata for a project in json'
+'new:create a new project'
+'owner:manage the owners of a crate on the registry'
+'package:assemble local package into a distributable tarball'
+'pkgid:print a fully qualified package specification'
+'publish:upload package to the registry'
+'read-manifest:print manifest in JSON format'
+'run:run the main binary of the local package'
+'rustc:compile a package and all of its dependencies'
+'rustdoc:build documentation for a package'
+'search:search packages on crates.io'
+'test:execute all unit and tests of a local package'
+'uninstall:remove a Rust binary'
+'update:update dependencies'
+'verify-project:check Cargo.toml'
+'version:show version information'
+'yank:remove pushed file from index'
+)
+_describe 'command' commands
+
+}
+
+
+#FIXME: Disabled until fixed
+#gets package names from the manifest file
+_get_package_names()
+{
+}
+
+#TODO:see if it makes sense to have 'locate-project' to have non-json output.
+#strips package name from json stuff
+_locate_manifest(){
+local manifest=`cargo locate-project 2>/dev/null`
+regexp-replace manifest '\{"root":"|"\}' ''
+echo $manifest
+}
+
+# Extracts the values of "name" from the array given in $1 and shows them as
+# command line options for completion
+_get_names_from_array()
+{
+ local -a filelist;
+ local manifest=$(_locate_manifest)
+ if [[ -z $manifest ]]; then
+ return 0
+ fi
+
+ local last_line
+ local -a names;
+ local in_block=false
+ local block_name=$1
+ names=()
+ while read line
+ do
+ if [[ $last_line == "[[$block_name]]" ]]; then
+ in_block=true
+ else
+ if [[ $last_line =~ '.*\[\[.*' ]]; then
+ in_block=false
+ fi
+ fi
+
+ if [[ $in_block == true ]]; then
+ if [[ $line =~ '.*name.*=' ]]; then
+ regexp-replace line '^.*name *= *|"' ""
+ names+=$line
+ fi
+ fi
+
+ last_line=$line
+ done < $manifest
+ _describe $block_name names
+
+}
+
+#Gets the test names from the manifest file
+_test_names()
+{
+ _get_names_from_array "test"
+}
+
+#Gets the bench names from the manifest file
+_benchmark_names()
+{
+ _get_names_from_array "bench"
+}
+
+# These flags are mutally exclusive specifiers for the scope of a command; as
+# they are used in multiple places without change, they are expanded into the
+# appropriate command's `_arguments` where appropriate.
+set command_scope_spec
+command_scope_spec=(
+ '(--bin --example --test --lib)--bench=[benchmark name]: :_benchmark_names'
+ '(--bench --bin --test --lib)--example=[example name]'
+ '(--bench --example --test --lib)--bin=[binary name]'
+ '(--bench --bin --example --test)--lib=[library name]'
+ '(--bench --bin --example --lib)--test=[test name]'
+)
+
+
+_cargo
diff --git a/plugins/cargo/cargo.plugin.zsh b/plugins/cargo/cargo.plugin.zsh
deleted file mode 100644
index e1dc953d..00000000
--- a/plugins/cargo/cargo.plugin.zsh
+++ /dev/null
@@ -1,22 +0,0 @@
-function _cargo_commands() {
- local ret=1 state
- _arguments ':subcommand:->subcommand' && ret=0
-
- case $state in
- subcommand)
- subcommands=(
- "build:Build the current project"
- "clean:Clean up after a build"
- "help:Help about available commands"
- "new:Create a new project"
- "test:Run the tests"
- "update:Updates list of known packages"
- "run:Builds and runs the currecnt project"
- )
- _describe -t subcommands 'cargo subcommands' subcommands && ret=0
- esac
-
- return ret
-}
-
-compdef _cargo_commands cargo
From 16bd691b3bd5ca9319e677b66096337e9bac1795 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Tue, 4 Oct 2016 00:17:38 +0200
Subject: [PATCH 170/194] Add README for the cargo plugin
---
plugins/cargo/README.md | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 plugins/cargo/README.md
diff --git a/plugins/cargo/README.md b/plugins/cargo/README.md
new file mode 100644
index 00000000..5fa688d2
--- /dev/null
+++ b/plugins/cargo/README.md
@@ -0,0 +1,11 @@
+# cargo
+
+This plugin adds completion for the Rust build tool [`cargo`](https://github.com/rust-lang/cargo).
+
+To use it, add `cargo` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... cargo)
+```
+
+Updated on October 4th, 2016.
From 2a0223370a2e5bae604344a735ad7b53f30b0cab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Ordon?=
Date: Mon, 3 Oct 2016 23:37:35 +0100
Subject: [PATCH 171/194] Add an alias for React Native Link command (#5491)
---
plugins/react-native/react-native.plugin.zsh | 1 +
1 file changed, 1 insertion(+)
diff --git a/plugins/react-native/react-native.plugin.zsh b/plugins/react-native/react-native.plugin.zsh
index 7323f1d2..9463a98b 100644
--- a/plugins/react-native/react-native.plugin.zsh
+++ b/plugins/react-native/react-native.plugin.zsh
@@ -3,4 +3,5 @@ alias rnios4s='react-native run-ios --simulator "iPhone 4s"'
alias rnios5='react-native run-ios --simulator "iPhone 5"'
alias rnios5s='react-native run-ios --simulator "iPhone 5s"'
alias rnios='react-native run-ios'
+alias rnlink='react-native link'
From d57f36dab82b332be6fd7362c0916b226709834b Mon Sep 17 00:00:00 2001
From: Mats Faugli
Date: Tue, 4 Oct 2016 00:47:59 +0200
Subject: [PATCH 172/194] Add jgitflow maven goals (#5489)
---
plugins/mvn/mvn.plugin.zsh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh
index 625aad94..04bd186a 100644
--- a/plugins/mvn/mvn.plugin.zsh
+++ b/plugins/mvn/mvn.plugin.zsh
@@ -110,6 +110,8 @@ function listMavenCompletions {
help:active-profiles help:all-profiles help:describe help:effective-pom help:effective-settings help:evaluate help:expressions help:system
# release
release:clean release:prepare release:rollback release:perform release:stage release:branch release:update-versions
+ # jgitflow
+ jgitflow:feature-start jgitflow:feature-finish jgitflow:release-start jgitflow:release-finish jgitflow:hotfix-start jgitflow:hotfix-finish jgitflow:build-number
# repository
repository:bundle-create repository:bundle-pack
# source
From 81981ef248e6e05d11affd4fca40bcfb98306b0e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Tue, 4 Oct 2016 01:03:16 +0200
Subject: [PATCH 173/194] Fix cp plugin completion and refactor (#5427)
* cp plugin: change cpv to function so that completion works
* cp plugin: show numbers in units of 1024 (K,M,G,T)
Use `-h` level (3): output numbers in units of 1024.
See the manpage of rsync for more information.
* cp plugin: add a README file
* cp plugin: recurse directories
* cp plugin: remove `--` to separate files from options
This has some undesired effects, like having `cpv --help` be a file
not found error.
Use `--` yourself if you need it (which you generally don't):
```zsh
cpv -- -some-file-with-hyphens.txt /tmp
```
Added this same info to the README.
---
plugins/cp/README.md | 32 ++++++++++++++++++++++++++++++++
plugins/cp/cp.plugin.zsh | 18 ++++--------------
2 files changed, 36 insertions(+), 14 deletions(-)
create mode 100644 plugins/cp/README.md
diff --git a/plugins/cp/README.md b/plugins/cp/README.md
new file mode 100644
index 00000000..e8a9b6cc
--- /dev/null
+++ b/plugins/cp/README.md
@@ -0,0 +1,32 @@
+# cp plugin
+
+This plugin defines a `cpv` function that uses `rsync` so that you
+get the features and security of this command.
+
+To enable, add `cp` to your `plugins` array in your zshrc file:
+
+```zsh
+plugins=(... cp)
+```
+
+## Description
+
+The enabled options for rsync are:
+
+- `-p`: preserves permissions.
+
+- `-o`: preserves owner.
+
+* `-g`: preserves group.
+
+* `-b`: make a backup of the original file instead of overwriting it, if it exists.
+
+* `-r`: recurse directories.
+
+* `-hhh`: outputs numbers in human-readable format, in units of 1024 (K, M, G, T).
+
+* `--backup-dir=/tmp/rsync`: move backup copies to "/tmp/rsync".
+
+* `-e /dev/null`: only work on local files (disable remote shells).
+
+* `--progress`: display progress.
diff --git a/plugins/cp/cp.plugin.zsh b/plugins/cp/cp.plugin.zsh
index 7355a999..fe6ea87a 100644
--- a/plugins/cp/cp.plugin.zsh
+++ b/plugins/cp/cp.plugin.zsh
@@ -1,14 +1,4 @@
-#Show progress while file is copying
-
-# Rsync options are:
-# -p - preserve permissions
-# -o - preserve owner
-# -g - preserve group
-# -h - output in human-readable format
-# --progress - display progress
-# -b - instead of just overwriting an existing file, save the original
-# --backup-dir=/tmp/rsync - move backup copies to "/tmp/rsync"
-# -e /dev/null - only work on local files
-# -- - everything after this is an argument, even if it looks like an option
-
-alias cpv="rsync -poghb --backup-dir=/tmp/rsync -e /dev/null --progress --"
+cpv() {
+ rsync -pogbr -hhh --backup-dir=/tmp/rsync -e /dev/null --progress "$@"
+}
+compdef _files cpv
From efa7c7b7ff72953368dfaba979e3014826bf1837 Mon Sep 17 00:00:00 2001
From: Hong Xu
Date: Sun, 2 Oct 2016 19:15:57 -0700
Subject: [PATCH 174/194] set better default colors for GNU ls instead of none.
GNU coreutils ship a color setup command by default which can be used to
set a good default color theme for ls:
https://www.gnu.org/software/coreutils/manual/html_node/dircolors-invocation.html
---
lib/theme-and-appearance.zsh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh
index 5c5bb0e6..585f872e 100644
--- a/lib/theme-and-appearance.zsh
+++ b/lib/theme-and-appearance.zsh
@@ -5,7 +5,7 @@ export LSCOLORS="Gxfxcxdxbxegedabagacad"
# Enable ls colors
if [ "$DISABLE_LS_COLORS" != "true" ]
then
- # Find the option for using colors in ls, depending on the version: Linux or BSD
+ # Find the option for using colors in ls, depending on the version: GNU or BSD
if [[ "$(uname -s)" == "NetBSD" ]]; then
# On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);
# otherwise, leave ls as is, because NetBSD's ls doesn't support -G
@@ -18,6 +18,8 @@ then
gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
colorls -G -d . &>/dev/null 2>&1 && alias ls='colorls -G'
else
+ # For GNU ls, we use the default ls color theme. They can later be overwritten by themes.
+ type dircolors >/dev/null 2>&1 && eval "$(dircolors)"
ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
fi
fi
From 6c08286c8e0ca4d2b48679d2692f0ce4ac443f4c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Tue, 4 Oct 2016 01:25:07 +0200
Subject: [PATCH 175/194] Use `$commands[]` to check for command existence
---
lib/theme-and-appearance.zsh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh
index 585f872e..43e245e1 100644
--- a/lib/theme-and-appearance.zsh
+++ b/lib/theme-and-appearance.zsh
@@ -19,7 +19,8 @@ then
colorls -G -d . &>/dev/null 2>&1 && alias ls='colorls -G'
else
# For GNU ls, we use the default ls color theme. They can later be overwritten by themes.
- type dircolors >/dev/null 2>&1 && eval "$(dircolors)"
+ (( $+commands[dircolors] )) && eval "$(dircolors)"
+
ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
fi
fi
From 6304a789ab280e4a6e984faedd4b046f703327e8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Tue, 4 Oct 2016 01:25:36 +0200
Subject: [PATCH 176/194] Only set default LS_COLORS if not set before
Also, force the use of Bourne-style shell syntax with `dircolors -b`.
---
lib/theme-and-appearance.zsh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh
index 43e245e1..621cd067 100644
--- a/lib/theme-and-appearance.zsh
+++ b/lib/theme-and-appearance.zsh
@@ -19,7 +19,9 @@ then
colorls -G -d . &>/dev/null 2>&1 && alias ls='colorls -G'
else
# For GNU ls, we use the default ls color theme. They can later be overwritten by themes.
- (( $+commands[dircolors] )) && eval "$(dircolors)"
+ if [[ -z "$LS_COLORS" ]]; then
+ (( $+commands[dircolors] )) && eval "$(dircolors -b)"
+ fi
ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
fi
From c2e3a410ea7975f72bf7f0d5b4550ac4375b1e10 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Tue, 4 Oct 2016 01:24:48 +0200
Subject: [PATCH 177/194] Fix style of theme-and-appearance.zsh
---
lib/theme-and-appearance.zsh | 27 ++++++++++-----------------
1 file changed, 10 insertions(+), 17 deletions(-)
diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh
index 621cd067..a3bb2467 100644
--- a/lib/theme-and-appearance.zsh
+++ b/lib/theme-and-appearance.zsh
@@ -1,41 +1,37 @@
# ls colors
autoload -U colors && colors
-export LSCOLORS="Gxfxcxdxbxegedabagacad"
# Enable ls colors
-if [ "$DISABLE_LS_COLORS" != "true" ]
-then
- # Find the option for using colors in ls, depending on the version: GNU or BSD
+export LSCOLORS="Gxfxcxdxbxegedabagacad"
+
+if [[ "$DISABLE_LS_COLORS" != "true" ]]; then
+ # Find the option for using colors in ls, depending on the version
if [[ "$(uname -s)" == "NetBSD" ]]; then
# On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);
# otherwise, leave ls as is, because NetBSD's ls doesn't support -G
- gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
+ gls --color -d . &>/dev/null && alias ls='gls --color=tty'
elif [[ "$(uname -s)" == "OpenBSD" ]]; then
# On OpenBSD, "gls" (ls from GNU coreutils) and "colorls" (ls from base,
# with color and multibyte support) are available from ports. "colorls"
# will be installed on purpose and can't be pulled in by installing
# coreutils, so prefer it to "gls".
- gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
- colorls -G -d . &>/dev/null 2>&1 && alias ls='colorls -G'
+ gls --color -d . &>/dev/null && alias ls='gls --color=tty'
+ colorls -G -d . &>/dev/null && alias ls='colorls -G'
else
# For GNU ls, we use the default ls color theme. They can later be overwritten by themes.
if [[ -z "$LS_COLORS" ]]; then
(( $+commands[dircolors] )) && eval "$(dircolors -b)"
fi
- ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
+ ls --color -d . &>/dev/null && alias ls='ls --color=tty' || alias ls='ls -G'
fi
fi
setopt auto_cd
setopt multios
+setopt prompt_subst
-if [[ x$WINDOW != x ]]
-then
- SCREEN_NO="%B$WINDOW%b "
-else
- SCREEN_NO=""
-fi
+[[ -n "$WINDOW" ]] && SCREEN_NO="%B$WINDOW%b " || SCREEN_NO=""
# Apply theming defaults
PS1="%n@%m:%~%# "
@@ -45,6 +41,3 @@ ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix at the very beginning of th
ZSH_THEME_GIT_PROMPT_SUFFIX=")" # At the very end of the prompt
ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is dirty
ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean
-
-# Setup the prompt with pretty colors
-setopt prompt_subst
From 86126233bb5bb99ced64b95c16a4e4ed776fd8de Mon Sep 17 00:00:00 2001
From: slavaGanzin
Date: Tue, 4 Oct 2016 12:21:18 +0300
Subject: [PATCH 178/194] specify globalias modes
---
plugins/globalias/globalias.plugin.zsh | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/plugins/globalias/globalias.plugin.zsh b/plugins/globalias/globalias.plugin.zsh
index 95a0e307..bac657c4 100644
--- a/plugins/globalias/globalias.plugin.zsh
+++ b/plugins/globalias/globalias.plugin.zsh
@@ -4,8 +4,11 @@ globalias() {
zle self-insert
}
zle -N globalias
-bindkey -e " " globalias
-bindkey -v " " globalias
-bindkey -e "^ " magic-space # control-space to bypass completion
-bindkey -v "^ " magic-space
-bindkey -M isearch " " magic-space # normal space during searches
+
+# space expands all global aliases
+bindkey -M emacs " " globalias
+bindkey -M viins " " globalias
+
+# control-space to make a normal space
+bindkey -M emacs "^ " magic-space
+bindkey -M viins "^ " magic-space
From 75f87dd24ec60bd243ffbe7c9dbd1daec5b51ae2 Mon Sep 17 00:00:00 2001
From: slavaGanzin
Date: Tue, 4 Oct 2016 14:03:37 +0300
Subject: [PATCH 179/194] README for globalias
---
plugins/globalias/README.md | 37 ++++++++++++++++++++++++++
plugins/globalias/globalias.plugin.zsh | 3 +++
2 files changed, 40 insertions(+)
create mode 100644 plugins/globalias/README.md
diff --git a/plugins/globalias/README.md b/plugins/globalias/README.md
new file mode 100644
index 00000000..db2e5bee
--- /dev/null
+++ b/plugins/globalias/README.md
@@ -0,0 +1,37 @@
+#Globalias
+
+
+Expands all globes, backtick expressions and aliases(including global).
+
+```
+$ touch {1..10}
+#expands to
+$ touch 1 2 3 4 5 6 7 8 9 10
+
+$ mkdir "`date -R`"
+#expands to
+$ mkdir Tue,\ 04\ Oct\ 2016\ 13:54:03\ +0300
+
+#.zshrc:
+alias -g G="| grep --color=auto -P"
+alias l='ls --color=auto -lah'
+
+$ lG
+#expands to
+$ ls --color=auto -lah | grep --color=auto -P
+
+ls **/*.json
+#expands to
+ls folder/file.json anotherfolder/another.json
+```
+
+####Returns autocompletion to your custom aliases:
+```
+#.zsrc
+alias S="sudo systemctl"
+
+$ S
+#expands to:
+sudo systemctl s
+#trigger autocompletion
+```
diff --git a/plugins/globalias/globalias.plugin.zsh b/plugins/globalias/globalias.plugin.zsh
index bac657c4..bf4cfc03 100644
--- a/plugins/globalias/globalias.plugin.zsh
+++ b/plugins/globalias/globalias.plugin.zsh
@@ -12,3 +12,6 @@ bindkey -M viins " " globalias
# control-space to make a normal space
bindkey -M emacs "^ " magic-space
bindkey -M viins "^ " magic-space
+
+# normal space during searches
+bindkey -M isearch " " magic-space
From 6eaa868cd9ad8447973a53f09453121d58366a6a Mon Sep 17 00:00:00 2001
From: slavaGanzin
Date: Tue, 4 Oct 2016 14:05:41 +0300
Subject: [PATCH 180/194] fix comment
---
plugins/globalias/globalias.plugin.zsh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/globalias/globalias.plugin.zsh b/plugins/globalias/globalias.plugin.zsh
index bf4cfc03..9602a960 100644
--- a/plugins/globalias/globalias.plugin.zsh
+++ b/plugins/globalias/globalias.plugin.zsh
@@ -5,7 +5,7 @@ globalias() {
}
zle -N globalias
-# space expands all global aliases
+# space expands all aliases, including global
bindkey -M emacs " " globalias
bindkey -M viins " " globalias
From f701b4de0fb55b71e2cfb17522a08fba741ff170 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Tue, 4 Oct 2016 13:55:11 +0200
Subject: [PATCH 181/194] Fix formatting and usage section
Also:
- Changes `globes` (which doesn't exist) to `glob expressions`.
- Delete the `trigger autocompletion to your current aliases` use case, since that's not
really implemented.
---
plugins/globalias/README.md | 55 +++++++++++++++++++++++++++----------
1 file changed, 40 insertions(+), 15 deletions(-)
diff --git a/plugins/globalias/README.md b/plugins/globalias/README.md
index db2e5bee..ba9888cc 100644
--- a/plugins/globalias/README.md
+++ b/plugins/globalias/README.md
@@ -1,37 +1,62 @@
-#Globalias
+# Globalias plugin
+Expands all glob expressions, subcommands and aliases (including global).
-Expands all globes, backtick expressions and aliases(including global).
+Idea from: http://blog.patshead.com/2012/11/automatically-expaning-zsh-global-aliases---simplified.html.
+
+## Usage
+
+Add `globalias` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... globalias)
+```
+
+Then just press `SPACE` to trigger the expansion of a command you've written.
+
+If you only want to insert a space without expanding the command line, press
+`CTRL`+`SPACE`.
+
+## Examples
+
+#### Glob expressions
```
$ touch {1..10}
-#expands to
+# expands to
$ touch 1 2 3 4 5 6 7 8 9 10
+$ ls **/*.json
+# expands to
+$ ls folder/file.json anotherfolder/another.json
+```
+
+#### Subcommands
+
+```
$ mkdir "`date -R`"
-#expands to
+# expands to
$ mkdir Tue,\ 04\ Oct\ 2016\ 13:54:03\ +0300
-#.zshrc:
+```
+
+#### Aliases
+
+```
+# .zshrc:
alias -g G="| grep --color=auto -P"
alias l='ls --color=auto -lah'
$ lG
-#expands to
+# expands to
$ ls --color=auto -lah | grep --color=auto -P
-
-ls **/*.json
-#expands to
-ls folder/file.json anotherfolder/another.json
```
-####Returns autocompletion to your custom aliases:
```
-#.zsrc
+# .zsrc:
alias S="sudo systemctl"
$ S
-#expands to:
-sudo systemctl s
-#trigger autocompletion
+# expands to:
+$ sudo systemctl
```
From 3cc61701bd7fd0a3fa6cb3c70f2b927a1e51970a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Tue, 4 Oct 2016 13:56:25 +0200
Subject: [PATCH 182/194] Update per-directory-history plugin to latest version
(#5493)
Latest version: February 17, 2016 - dd81201
---
plugins/per-directory-history/README.md | 5 ++---
.../per-directory-history/per-directory-history.zsh | 12 +++++++-----
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/plugins/per-directory-history/README.md b/plugins/per-directory-history/README.md
index d8ff93dc..196f74e6 100644
--- a/plugins/per-directory-history/README.md
+++ b/plugins/per-directory-history/README.md
@@ -27,9 +27,8 @@ Usage
2. The default mode if per directory history, interact with your history as normal.
3. Press ^G (the Control and G keys simultaneously) to toggle between local
- and global histories.
-
-
+ and global histories. If you would prefer a different shortcut to toggle
+ set the PER_DIRECTORY_HISTORY_TOGGLE environment variable.
-------------------------------------------------------------------------------
Configuration
diff --git a/plugins/per-directory-history/per-directory-history.zsh b/plugins/per-directory-history/per-directory-history.zsh
index bdee341b..1242dc42 100644
--- a/plugins/per-directory-history/per-directory-history.zsh
+++ b/plugins/per-directory-history/per-directory-history.zsh
@@ -30,7 +30,7 @@
#
################################################################################
#
-# Copyright (c) 2012 Jim Hester
+# Copyright (c) 2014 Jim Hester
#
# This software is provided 'as-is', without any express or implied warranty.
# In no event will the authors be held liable for any damages arising from the
@@ -57,6 +57,7 @@
#-------------------------------------------------------------------------------
[[ -z $HISTORY_BASE ]] && HISTORY_BASE="$HOME/.directory_history"
+[[ -z $PER_DIRECTORY_HISTORY_TOGGLE ]] && PER_DIRECTORY_HISTORY_TOGGLE='^G'
#-------------------------------------------------------------------------------
# toggle global/directory history used for searching - ctrl-G by default
@@ -76,7 +77,7 @@ function per-directory-history-toggle-history() {
autoload per-directory-history-toggle-history
zle -N per-directory-history-toggle-history
-bindkey '^G' per-directory-history-toggle-history
+bindkey $PER_DIRECTORY_HISTORY_TOGGLE per-directory-history-toggle-history
#-------------------------------------------------------------------------------
# implementation details
@@ -108,7 +109,7 @@ function _per-directory-history-change-directory() {
}
function _per-directory-history-addhistory() {
- print -Sr -- ${1%%$'\n'}
+ print -Sr -- "${1%%$'\n'}"
fc -p $_per_directory_history_directory
}
@@ -140,8 +141,9 @@ function _per-directory-history-set-global-history() {
#add functions to the exec list for chpwd and zshaddhistory
-chpwd_functions=(${chpwd_functions[@]} "_per-directory-history-change-directory")
-zshaddhistory_functions=(${zshaddhistory_functions[@]} "_per-directory-history-addhistory")
+autoload -U add-zsh-hook
+add-zsh-hook chpwd _per-directory-history-change-directory
+add-zsh-hook zshaddhistory _per-directory-history-addhistory
#start in directory mode
mkdir -p ${_per_directory_history_directory:h}
From 7f9b7733507d57a6cd4f38d0c0db830647c1940d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Tue, 4 Oct 2016 17:23:20 +0200
Subject: [PATCH 183/194] Fix compdef commands in git plugin
The command `compdef command=git` returns an error in some cases, the
appropriate command is `compdef _git command`.
Fixes #5442
---
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 28fb253d..178f1deb 100644
--- a/plugins/git/git.plugin.zsh
+++ b/plugins/git/git.plugin.zsh
@@ -76,7 +76,7 @@ alias gcd='git checkout develop'
alias gcmsg='git commit -m'
alias gco='git checkout'
alias gcount='git shortlog -sn'
-compdef gcount=git
+compdef _git gcount
alias gcp='git cherry-pick'
alias gcpa='git cherry-pick --abort'
alias gcpc='git cherry-pick --continue'
@@ -159,7 +159,7 @@ alias ghh='git help'
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
+compdef _git git-svn-dcommit-push=git
alias gk='\gitk --all --branches'
compdef _git gk='gitk'
From d69f2850afc189310b40141c839480b42f71775c Mon Sep 17 00:00:00 2001
From: diego
Date: Fri, 7 Oct 2016 23:54:54 +0200
Subject: [PATCH 184/194] Add non 0 exit code for missing jump targets (#5500)
This allows for the user to combine the jump command with something else. In my example cd and jump are now combined like this:
```bash
jumpcd() {
jump $1 > /dev/null || cd $1
}
alias cd="jumpcd"
```
---
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 e58e7373..86d9553a 100644
--- a/plugins/jump/jump.plugin.zsh
+++ b/plugins/jump/jump.plugin.zsh
@@ -9,7 +9,7 @@
export MARKPATH=$HOME/.marks
jump() {
- cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1"
+ cd -P "$MARKPATH/$1" 2>/dev/null || {echo "No such mark: $1"; return 1}
}
mark() {
From cd37d19ddaf9cc5acbf443f93f88ca355f74090d Mon Sep 17 00:00:00 2001
From: Florian Boulay
Date: Sat, 8 Oct 2016 08:26:10 +0200
Subject: [PATCH 185/194] Add m4a format in the common aliases plugin (#5502)
The m4a file format can be opened in the command line with mplayer
---
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 c7aafd8b..128db6e5 100644
--- a/plugins/common-aliases/common-aliases.plugin.zsh
+++ b/plugins/common-aliases/common-aliases.plugin.zsh
@@ -63,7 +63,7 @@ if is-at-least 4.2.0; then
_image_fts=(jpg jpeg png gif mng tiff tif xpm)
for ft in $_image_fts ; do alias -s $ft=$XIVIEWER; done
- _media_fts=(ape avi flv mkv mov mp3 mpeg mpg ogg ogm rm wav webm)
+ _media_fts=(ape avi flv m4a mkv mov mp3 mpeg mpg ogg ogm rm wav webm)
for ft in $_media_fts ; do alias -s $ft=mplayer ; done
#read documents
From 3be4108d722269720c71138a211dd744ade66f5d Mon Sep 17 00:00:00 2001
From: Michel Filipe
Date: Sun, 9 Oct 2016 14:36:47 -0300
Subject: [PATCH 186/194] remove duplicate alias (#5508)
Removing one "apt-get autoremove" alias because it is duplicated.
---
plugins/ubuntu/ubuntu.plugin.zsh | 2 --
1 file changed, 2 deletions(-)
diff --git a/plugins/ubuntu/ubuntu.plugin.zsh b/plugins/ubuntu/ubuntu.plugin.zsh
index d924f886..ffde284f 100644
--- a/plugins/ubuntu/ubuntu.plugin.zsh
+++ b/plugins/ubuntu/ubuntu.plugin.zsh
@@ -29,7 +29,6 @@ compdef _ppap ppap='sudo ppa-purge'
alias ag='sudo apt-get' # age - but without sudo
alias aga='sudo apt-get autoclean' # aac
-alias agar='sudo apt-get autoremove'
alias agb='sudo apt-get build-dep' # abd
alias agc='sudo apt-get clean' # adc
alias agd='sudo apt-get dselect-upgrade' # ads
@@ -44,7 +43,6 @@ alias agar='sudo apt-get autoremove'
compdef _ag ag='sudo apt-get'
compdef _aga aga='sudo apt-get autoclean'
-compdef _agar agar='sudo apt-get autoremove'
compdef _agb agb='sudo apt-get build-dep'
compdef _agc agc='sudo apt-get clean'
compdef _agd agd='sudo apt-get dselect-upgrade'
From 98cd3973d23dfb83aa60f5d11bbb31e2dc714fad Mon Sep 17 00:00:00 2001
From: Hong
Date: Mon, 10 Oct 2016 11:40:17 -0700
Subject: [PATCH 187/194] Take advantage of LS_COLORS for the color of
completion if GNU ls is used. (#5510)
---
lib/theme-and-appearance.zsh | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh
index a3bb2467..12bcd284 100644
--- a/lib/theme-and-appearance.zsh
+++ b/lib/theme-and-appearance.zsh
@@ -24,6 +24,9 @@ if [[ "$DISABLE_LS_COLORS" != "true" ]]; then
fi
ls --color -d . &>/dev/null && alias ls='ls --color=tty' || alias ls='ls -G'
+
+ # Take advantage of $LS_COLORS for completion as well.
+ zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
fi
fi
From a56eac7a71a774a4d97bb9456f36b8eb495329d5 Mon Sep 17 00:00:00 2001
From: Hong
Date: Mon, 10 Oct 2016 13:24:30 -0700
Subject: [PATCH 188/194] Use OSTYPE instead of uname whenever possible for
better speed. (#5496)
---
lib/theme-and-appearance.zsh | 4 ++--
plugins/battery/battery.plugin.zsh | 2 +-
plugins/gitfast/git-completion.bash | 2 +-
plugins/sublime/sublime.plugin.zsh | 2 +-
plugins/zsh-navigation-tools/_n-kill | 4 ++--
plugins/zsh-navigation-tools/n-kill | 4 ++--
6 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh
index 12bcd284..039a59d2 100644
--- a/lib/theme-and-appearance.zsh
+++ b/lib/theme-and-appearance.zsh
@@ -6,11 +6,11 @@ export LSCOLORS="Gxfxcxdxbxegedabagacad"
if [[ "$DISABLE_LS_COLORS" != "true" ]]; then
# Find the option for using colors in ls, depending on the version
- if [[ "$(uname -s)" == "NetBSD" ]]; then
+ if [[ "$OSTYPE" == netbsd* ]]; then
# On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);
# otherwise, leave ls as is, because NetBSD's ls doesn't support -G
gls --color -d . &>/dev/null && alias ls='gls --color=tty'
- elif [[ "$(uname -s)" == "OpenBSD" ]]; then
+ elif [[ "$OSTYPE" == openbsd* ]]; then
# On OpenBSD, "gls" (ls from GNU coreutils) and "colorls" (ls from base,
# with color and multibyte support) are available from ports. "colorls"
# will be installed on purpose and can't be pulled in by installing
diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh
index 0bb9e77f..da229cf3 100644
--- a/plugins/battery/battery.plugin.zsh
+++ b/plugins/battery/battery.plugin.zsh
@@ -64,7 +64,7 @@ if [[ "$OSTYPE" = darwin* ]] ; then
[[ $(ioreg -rc "AppleSmartBattery"| grep '^.*"IsCharging"\ =\ ' | sed -e 's/^.*"IsCharging"\ =\ //') == "Yes" ]]
}
-elif [[ $(uname) == "Linux" ]] ; then
+elif [[ "$OSTYPE" = linux* ]] ; then
function battery_is_charging() {
! [[ $(acpi 2>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]]
diff --git a/plugins/gitfast/git-completion.bash b/plugins/gitfast/git-completion.bash
index e3918c87..8ce6b5c5 100644
--- a/plugins/gitfast/git-completion.bash
+++ b/plugins/gitfast/git-completion.bash
@@ -2771,6 +2771,6 @@ __git_complete gitk __gitk_main
# when the user has tab-completed the executable name and consequently
# included the '.exe' suffix.
#
-if [ Cygwin = "$(uname -o 2>/dev/null)" ]; then
+if [[ "$OSTYPE" = cygwin* ]]; then
__git_complete git.exe __git_main
fi
diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh
index 75a39eab..f84b7032 100644
--- a/plugins/sublime/sublime.plugin.zsh
+++ b/plugins/sublime/sublime.plugin.zsh
@@ -1,4 +1,4 @@
-if [[ $('uname') == 'Linux' ]]; then
+if [[ "$OSTYPE" == linux* ]]; then
local _sublime_linux_paths > /dev/null 2>&1
_sublime_linux_paths=(
"$HOME/bin/sublime_text"
diff --git a/plugins/zsh-navigation-tools/_n-kill b/plugins/zsh-navigation-tools/_n-kill
index 8a4ec9da..6f5d4797 100644
--- a/plugins/zsh-navigation-tools/_n-kill
+++ b/plugins/zsh-navigation-tools/_n-kill
@@ -10,8 +10,8 @@ integer cygwin=0
local IFS="
"
-case "$(uname)" in
- CYGWIN*) list=( `command ps -Wa` ); cygwin=1 ;;
+case "$OSTYPE" in
+ cygwin*) list=( `command ps -Wa` ); cygwin=1 ;;
*) list=( `command ps -o pid,uid,command -A` ) ;;
esac
diff --git a/plugins/zsh-navigation-tools/n-kill b/plugins/zsh-navigation-tools/n-kill
index 0d10565e..76050f96 100644
--- a/plugins/zsh-navigation-tools/n-kill
+++ b/plugins/zsh-navigation-tools/n-kill
@@ -42,8 +42,8 @@ NLIST_NONSELECTABLE_ELEMENTS=( 1 )
type ps 2>/dev/null 1>&2 || { echo >&2 "Error: \`ps' not found"; return 1 }
-case "$(uname)" in
- CYGWIN*) list=( `command ps -Wa` ) ;;
+case "$OSTYPE" in
+ cygwin*) list=( `command ps -Wa` ) ;;
*) list=( `command ps -o pid,uid,command -A` ) ;;
esac
From f7d4f985ac391e4532a5e6331e0c296fad4a913c Mon Sep 17 00:00:00 2001
From: Hong
Date: Mon, 10 Oct 2016 14:01:37 -0700
Subject: [PATCH 189/194] Use $+commands to check the existence of a command in
clipboard.zsh. (#5519)
---
lib/clipboard.zsh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/clipboard.zsh b/lib/clipboard.zsh
index b663800a..2c93d1bb 100644
--- a/lib/clipboard.zsh
+++ b/lib/clipboard.zsh
@@ -31,13 +31,13 @@ function clipcopy() {
cat $file > /dev/clipboard
fi
else
- if which xclip &>/dev/null; then
+ if (( $+commands[xclip] )); then
if [[ -z $file ]]; then
xclip -in -selection clipboard
else
xclip -in -selection clipboard $file
fi
- elif which xsel &>/dev/null; then
+ elif (( $+commands[xsel] )); then
if [[ -z $file ]]; then
xsel --clipboard --input
else
@@ -74,9 +74,9 @@ function clippaste() {
elif [[ $OSTYPE == cygwin* ]]; then
cat /dev/clipboard
else
- if which xclip &>/dev/null; then
+ if (( $+commands[xclip] )); then
xclip -out -selection clipboard
- elif which xsel &>/dev/null; then
+ elif (( $+commands[xsel] )); then
xsel --clipboard --output
else
print "clipcopy: Platform $OSTYPE not supported or xclip/xsel not installed" >&2
From 628d0bb10664453fe55c1e725ab89fa42dc4ab0a Mon Sep 17 00:00:00 2001
From: rossmcf
Date: Mon, 10 Oct 2016 15:42:55 +0100
Subject: [PATCH 190/194] Fix ls colouring for Darwin. (#5516)
---
lib/theme-and-appearance.zsh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh
index 039a59d2..0fd3c44d 100644
--- a/lib/theme-and-appearance.zsh
+++ b/lib/theme-and-appearance.zsh
@@ -6,7 +6,7 @@ export LSCOLORS="Gxfxcxdxbxegedabagacad"
if [[ "$DISABLE_LS_COLORS" != "true" ]]; then
# Find the option for using colors in ls, depending on the version
- if [[ "$OSTYPE" == netbsd* ]]; then
+ if [[ "$OSTYPE" == netbsd* ]] || [[ "$OSTYPE" == darwin* ]]; then
# On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);
# otherwise, leave ls as is, because NetBSD's ls doesn't support -G
gls --color -d . &>/dev/null && alias ls='gls --color=tty'
From c24dfa1ab4abb1f28fad7666f3bc24f3abced801 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Tue, 11 Oct 2016 09:24:43 +0200
Subject: [PATCH 191/194] Fix ls coloring in MacOS if gls is not installed
Fixes #5520.
---
lib/theme-and-appearance.zsh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh
index 0fd3c44d..467b770d 100644
--- a/lib/theme-and-appearance.zsh
+++ b/lib/theme-and-appearance.zsh
@@ -6,7 +6,7 @@ export LSCOLORS="Gxfxcxdxbxegedabagacad"
if [[ "$DISABLE_LS_COLORS" != "true" ]]; then
# Find the option for using colors in ls, depending on the version
- if [[ "$OSTYPE" == netbsd* ]] || [[ "$OSTYPE" == darwin* ]]; then
+ if [[ "$OSTYPE" == netbsd* ]]; then
# On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);
# otherwise, leave ls as is, because NetBSD's ls doesn't support -G
gls --color -d . &>/dev/null && alias ls='gls --color=tty'
@@ -17,6 +17,8 @@ if [[ "$DISABLE_LS_COLORS" != "true" ]]; then
# coreutils, so prefer it to "gls".
gls --color -d . &>/dev/null && alias ls='gls --color=tty'
colorls -G -d . &>/dev/null && alias ls='colorls -G'
+ elif [[ "$OSTYPE" == darwin* ]]; then
+ gls --color -d . &>/dev/null && alias ls='gls --color=tty' || alias ls='ls -G'
else
# For GNU ls, we use the default ls color theme. They can later be overwritten by themes.
if [[ -z "$LS_COLORS" ]]; then
From c861430d3e8ff202b84b2a89c3caa6e414e2f8c1 Mon Sep 17 00:00:00 2001
From: Chenje Katanda
Date: Thu, 13 Oct 2016 17:33:44 -0400
Subject: [PATCH 192/194] readme change OS X to macOS
Change OS X to macOS in the read me file in line with apples rebranding
of the operating system.
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 6da73189..2b0856c2 100644
--- a/README.md
+++ b/README.md
@@ -18,9 +18,9 @@ To learn more, visit [ohmyz.sh](http://ohmyz.sh) and follow [@ohmyzsh](https://t
### Prerequisites
-__Disclaimer:__ _Oh My Zsh works best on OS X and Linux._
+__Disclaimer:__ _Oh My Zsh works best on macOS and Linux._
-* Unix-based operating system (OS X or Linux)
+* Unix-based operating system (macOS 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
From 015598b8a82457a03ab9d75f770bbd333599a601 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Mon, 10 Oct 2016 20:33:40 +0200
Subject: [PATCH 193/194] Display suvash prompt w/o Ruby; refactor code
---
themes/suvash.zsh-theme | 38 +++++++++++++++++++++-----------------
1 file changed, 21 insertions(+), 17 deletions(-)
diff --git a/themes/suvash.zsh-theme b/themes/suvash.zsh-theme
index c87f6455..1680973d 100644
--- a/themes/suvash.zsh-theme
+++ b/themes/suvash.zsh-theme
@@ -5,26 +5,30 @@ function prompt_char {
}
function virtualenv_info {
- [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') '
+ [[ -n "$VIRTUAL_ENV" ]] && echo '('${VIRTUAL_ENV:t}') '
}
-function collapse_pwd {
- echo $(pwd | sed -e "s,^$HOME,~,")
+function ruby_prompt {
+ if (( $+commands[rvm-prompt] )); then
+ print -n $ZSH_THEME_RUBY_PROMPT_PREFIX
+ print -n $(~/.rvm/bin/rvm-prompt)
+ print -n $ZSH_THEME_RUBY_PROMPT_SUFFIX
+ elif (( $+commands[rbenv] )); then
+ print -n $ZSH_THEME_RUBY_PROMPT_PREFIX
+ print -n $(rbenv version | sed -e "s/ (set.*$//")
+ print -n $ZSH_THEME_RUBY_PROMPT_SUFFIX
+ fi
+ return 0
}
-if which rvm-prompt &> /dev/null; then
- PROMPT='%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) using %{$reset_color%}%{$fg[red]%}$(~/.rvm/bin/rvm-prompt)%{$reset_color%}
-$(virtualenv_info)$(prompt_char) '
-else
- if which rbenv &> /dev/null; then
- PROMPT='%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) using %{$reset_color%}%{$fg[red]%}$(rbenv version | sed -e "s/ (set.*$//")%{$reset_color%}
-$(virtualenv_info)$(prompt_char) '
- fi
-fi
+PROMPT='%F{magenta}%n%f at %F{yellow}%m%f in %B%F{green}%~%f%b$(git_prompt_info)$(ruby_prompt)
+$(virtualenv_info) $(prompt_char) '
+ZSH_THEME_GIT_PROMPT_PREFIX=' on %F{magenta}'
+ZSH_THEME_GIT_PROMPT_SUFFIX='%f'
+ZSH_THEME_GIT_PROMPT_DIRTY='%F{green}!'
+ZSH_THEME_GIT_PROMPT_UNTRACKED='%F{green}?'
+ZSH_THEME_GIT_PROMPT_CLEAN=''
-ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}"
-ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
-ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!"
-ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?"
-ZSH_THEME_GIT_PROMPT_CLEAN=""
+ZSH_THEME_RUBY_PROMPT_PREFIX=' using %F{red}'
+ZSH_THEME_RUBY_PROMPT_SUFFIX='%f'
From cff228e342a797b6ac0da7edb431f5f66de79ae4 Mon Sep 17 00:00:00 2001
From: Jocelyn Thode
Date: Sat, 15 Oct 2016 14:02:01 +0200
Subject: [PATCH 194/194] Update bira theme (#4954)
* Add '#' instead of '$' when in root
* Make return code bold
---
themes/bira.zsh-theme | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/themes/bira.zsh-theme b/themes/bira.zsh-theme
index 1ead9355..4b2853c3 100644
--- a/themes/bira.zsh-theme
+++ b/themes/bira.zsh-theme
@@ -4,8 +4,10 @@ local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
if [[ $UID -eq 0 ]]; then
local user_host='%{$terminfo[bold]$fg[red]%}%n@%m%{$reset_color%}'
+ local user_symbol='#'
else
local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
+ local user_symbol='$'
fi
local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}'
@@ -20,8 +22,9 @@ fi
local git_branch='$(git_prompt_info)%{$reset_color%}'
PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch}
-╰─%B$%b "
-RPS1="${return_code}"
+╰─%B${user_symbol}%b "
+RPS1="%B${return_code}%b"
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹"
ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}"
+