From c840594c6ffdcecc241c9ccb130daeb630831ef7 Mon Sep 17 00:00:00 2001 From: Robert McLeod Date: Fri, 10 Apr 2015 15:07:29 +1200 Subject: [PATCH 0001/1098] added aliases for vagrant --- plugins/vagrant/vagrant.plugin.zsh | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 plugins/vagrant/vagrant.plugin.zsh diff --git a/plugins/vagrant/vagrant.plugin.zsh b/plugins/vagrant/vagrant.plugin.zsh new file mode 100644 index 000000000..a238d9ffe --- /dev/null +++ b/plugins/vagrant/vagrant.plugin.zsh @@ -0,0 +1,31 @@ +alias vgi="vagrant init" + +alias vup="vagrant up" +alias vd="vagrant destroy" +alias vdf="vagrant destroy -f" + +alias vssh="vagrant ssh" +alias vrdp="vagrant rdp" + +alias vh="vagrant halt" +alias vssp="vagrant suspend" +alias vst="vagrant status" +alias vre="vagrant resume" + +alias vpr="vagrant provision" +alias vr="vagrant reload" +alias vrp="vagrant reload --provision" + +alias vp="vagrant push" +alias vsh="vagrant share" + +alias vba="vagrant box add" +alias vbr="vagrant box remove" +alias vbl="vagrant box list" +alias vbo="vagrant box outdated" +alias vbu="vagrant box update" + +alias vpli="vagrant plugin install" +alias vpll="vagrant plugin list" +alias vplun="vagrant plugin uninstall" +alias vplu="vagrant plugin update" From b6ed2e7ac378438689d3348b4be00b2bce4fd9a8 Mon Sep 17 00:00:00 2001 From: Robert McLeod Date: Wed, 8 Jul 2015 07:54:42 +1200 Subject: [PATCH 0002/1098] added aliases for ssh-config and global-status So the following aliases call the respective commands: vgs = vagrant global-status vsshc = vagrant ssh-config --- plugins/vagrant/vagrant.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/vagrant/vagrant.plugin.zsh b/plugins/vagrant/vagrant.plugin.zsh index a238d9ffe..a4e9b06c2 100644 --- a/plugins/vagrant/vagrant.plugin.zsh +++ b/plugins/vagrant/vagrant.plugin.zsh @@ -5,12 +5,14 @@ alias vd="vagrant destroy" alias vdf="vagrant destroy -f" alias vssh="vagrant ssh" +alias vsshc="vagrant ssh-config" alias vrdp="vagrant rdp" alias vh="vagrant halt" alias vssp="vagrant suspend" alias vst="vagrant status" alias vre="vagrant resume" +alias vgs="vagrant global-status" alias vpr="vagrant provision" alias vr="vagrant reload" From 96d10e2147b59adc25e9c3b90ac6f31935495ef3 Mon Sep 17 00:00:00 2001 From: Robert Strack Date: Fri, 13 Nov 2015 23:42:21 -0500 Subject: [PATCH 0003/1098] calculating command's execution time --- plugins/timer/timer.plugin.zsh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 plugins/timer/timer.plugin.zsh diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh new file mode 100644 index 000000000..aa4573b9f --- /dev/null +++ b/plugins/timer/timer.plugin.zsh @@ -0,0 +1,18 @@ +preexec() { + __timer_cmd_start_time=$(date '+%s') +} + +precmd() { + if [ -n "${__timer_cmd_start_time}" ]; then + local cmd_end_time=$(date '+%s') + local tdiff=$((${cmd_end_time} - ${__timer_cmd_start_time})) + unset __timer_cmd_start_time + local tdiffstr='/' + if (( tdiff >= 60 )); then + tdiffstr+="$((tdiff / 60))m" + fi + tdiffstr+="$((tdiff % 60))s" + local cols=$(($COLUMNS - ${#tdiffstr} - 1)) + echo -e "\033[1A\033[${cols}C ${tdiffstr}" + fi +} From 1b8f05a3d395c107d81724445cac7fcd599942d8 Mon Sep 17 00:00:00 2001 From: Robert Strack Date: Sat, 14 Nov 2015 23:13:44 -0500 Subject: [PATCH 0004/1098] simplified time string calculation --- plugins/timer/timer.plugin.zsh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh index aa4573b9f..f73d2ab53 100644 --- a/plugins/timer/timer.plugin.zsh +++ b/plugins/timer/timer.plugin.zsh @@ -7,12 +7,8 @@ precmd() { local cmd_end_time=$(date '+%s') local tdiff=$((${cmd_end_time} - ${__timer_cmd_start_time})) unset __timer_cmd_start_time - local tdiffstr='/' - if (( tdiff >= 60 )); then - tdiffstr+="$((tdiff / 60))m" - fi - tdiffstr+="$((tdiff % 60))s" - local cols=$(($COLUMNS - ${#tdiffstr} - 1)) - echo -e "\033[1A\033[${cols}C ${tdiffstr}" + local tdiffstr="$((tdiff / 60))m$((tdiff % 60))s" + local cols=$(($COLUMNS - ${#tdiffstr#0m} - 2)) + echo -e "\033[1A\033[${cols}C \`${tdiffstr#0m}" fi } From 120e8620af6e1d7d01159614186403c7a816457d Mon Sep 17 00:00:00 2001 From: Robert Strack Date: Sat, 14 Nov 2015 23:48:26 -0500 Subject: [PATCH 0005/1098] cleaning up --- plugins/timer/timer.plugin.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh index f73d2ab53..ee2cb66c1 100644 --- a/plugins/timer/timer.plugin.zsh +++ b/plugins/timer/timer.plugin.zsh @@ -3,12 +3,12 @@ preexec() { } precmd() { - if [ -n "${__timer_cmd_start_time}" ]; then + if [ -n "$__timer_cmd_start_time" ]; then local cmd_end_time=$(date '+%s') - local tdiff=$((${cmd_end_time} - ${__timer_cmd_start_time})) + local tdiff=$((cmd_end_time - __timer_cmd_start_time)) unset __timer_cmd_start_time local tdiffstr="$((tdiff / 60))m$((tdiff % 60))s" - local cols=$(($COLUMNS - ${#tdiffstr#0m} - 2)) + local cols=$((COLUMNS - ${#tdiffstr#0m} - 2)) echo -e "\033[1A\033[${cols}C \`${tdiffstr#0m}" fi } From d4c74690b61b74e317410df3b80b784891ab55ed Mon Sep 17 00:00:00 2001 From: Robert Strack Date: Sun, 15 Nov 2015 22:08:16 -0500 Subject: [PATCH 0006/1098] increased timer's pecision --- plugins/timer/timer.plugin.zsh | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh index ee2cb66c1..729dd3ee2 100644 --- a/plugins/timer/timer.plugin.zsh +++ b/plugins/timer/timer.plugin.zsh @@ -1,14 +1,25 @@ +__timer_current_time() { + perl -MTime::HiRes=time -e'print time' +} + +__timer_format_duration() { + local mins=$(printf '%.0f' $(($1 / 60))) + local secs=$(printf '%.1f' $(($1 - 60 * mins))) + local duration_str=$(echo "${mins}m${secs}s") + echo "\`${duration_str#0m}" +} + preexec() { - __timer_cmd_start_time=$(date '+%s') + __timer_cmd_start_time=$(__timer_current_time) } precmd() { - if [ -n "$__timer_cmd_start_time" ]; then - local cmd_end_time=$(date '+%s') + if [ -n "${__timer_cmd_start_time}" ]; then + local cmd_end_time=$(__timer_current_time) local tdiff=$((cmd_end_time - __timer_cmd_start_time)) unset __timer_cmd_start_time - local tdiffstr="$((tdiff / 60))m$((tdiff % 60))s" - local cols=$((COLUMNS - ${#tdiffstr#0m} - 2)) - echo -e "\033[1A\033[${cols}C \`${tdiffstr#0m}" + local tdiffstr=$(__timer_format_duration ${tdiff}) + local cols=$((COLUMNS - ${#tdiffstr} - 1)) + echo -e "\033[1A\033[${cols}C ${tdiffstr}" fi } From 111dd018b9b821fad2c7899b31aa46b5c0aaa218 Mon Sep 17 00:00:00 2001 From: Robert Strack Date: Mon, 16 Nov 2015 22:20:26 -0500 Subject: [PATCH 0007/1098] allow changes in display format --- plugins/timer/timer.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh index 729dd3ee2..33481ea4e 100644 --- a/plugins/timer/timer.plugin.zsh +++ b/plugins/timer/timer.plugin.zsh @@ -4,9 +4,9 @@ __timer_current_time() { __timer_format_duration() { local mins=$(printf '%.0f' $(($1 / 60))) - local secs=$(printf '%.1f' $(($1 - 60 * mins))) + local secs=$(printf "%.${TIMER_PRECISION:-1}f" $(($1 - 60 * mins))) local duration_str=$(echo "${mins}m${secs}s") - echo "\`${duration_str#0m}" + echo "${TIMER_SYMBOL:-\`}${duration_str#0m}" } preexec() { From 96148d2275b848dbfb976a58967535067def4210 Mon Sep 17 00:00:00 2001 From: Robert Strack Date: Tue, 17 Nov 2015 20:50:30 -0500 Subject: [PATCH 0008/1098] customizable timer format --- plugins/timer/timer.plugin.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh index 33481ea4e..f7f039b78 100644 --- a/plugins/timer/timer.plugin.zsh +++ b/plugins/timer/timer.plugin.zsh @@ -6,7 +6,8 @@ __timer_format_duration() { local mins=$(printf '%.0f' $(($1 / 60))) local secs=$(printf "%.${TIMER_PRECISION:-1}f" $(($1 - 60 * mins))) local duration_str=$(echo "${mins}m${secs}s") - echo "${TIMER_SYMBOL:-\`}${duration_str#0m}" + local format="${TIMER_FORMAT:-/%d}" + echo "${format//\%d/${duration_str#0m}}" } preexec() { From de8d6841b00903f2873a8b009faf7002bfbc1273 Mon Sep 17 00:00:00 2001 From: Robert Strack Date: Wed, 18 Nov 2015 20:33:38 -0500 Subject: [PATCH 0009/1098] added pre_functions --- plugins/timer/timer.plugin.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh index f7f039b78..231134e7d 100644 --- a/plugins/timer/timer.plugin.zsh +++ b/plugins/timer/timer.plugin.zsh @@ -10,11 +10,11 @@ __timer_format_duration() { echo "${format//\%d/${duration_str#0m}}" } -preexec() { +__timer_save_time_preexec() { __timer_cmd_start_time=$(__timer_current_time) } -precmd() { +__timer_display_timer_precmd() { if [ -n "${__timer_cmd_start_time}" ]; then local cmd_end_time=$(__timer_current_time) local tdiff=$((cmd_end_time - __timer_cmd_start_time)) @@ -24,3 +24,6 @@ precmd() { echo -e "\033[1A\033[${cols}C ${tdiffstr}" fi } + +preexec_functions+=(__timer_save_time_preexec) +precmd_functions+=(__timer_display_timer_precmd) From d615961430aca9668cfb056aef6024c4ed41eff8 Mon Sep 17 00:00:00 2001 From: Robert Strack Date: Wed, 18 Nov 2015 21:09:18 -0500 Subject: [PATCH 0010/1098] readme file --- plugins/timer/README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 plugins/timer/README.md diff --git a/plugins/timer/README.md b/plugins/timer/README.md new file mode 100644 index 000000000..19072cb24 --- /dev/null +++ b/plugins/timer/README.md @@ -0,0 +1,18 @@ +This plugin allows to display command's execution time in a very nonintrusive way. + +Timer can be tuned by these two variables: +* `TIMER_PRECISION` allows to control number of decimal places (default `1`) +* `TIMER_FORMAT` allows to adjust display format (default `'/%d'`) + +Sample session: + + me@here:~$ sleep 1 /1.0s + me@here:~$ sleep 73 /1m13.0s + me@here:~$ TIMER_FORMAT='[%d]'; TIMER_PRECISION=2 [0.00s] + me@here:~$ head -c50 < /dev/urandom | hexdump + 0000000 b2 16 20 f0 29 1f 61 2d 8a 29 20 8c 8c 39 5a ab + 0000010 21 47 0e f9 ee a4 76 46 71 9e 4f 6b a4 c4 51 cb + 0000020 f9 1f 7e b9 6f 2c ae dd cf 40 6d 64 a8 fb d3 db + 0000030 09 37 + 0000032 [0.02s] + From 7553bcb4185b9d584a40b41cf15501e43041fe57 Mon Sep 17 00:00:00 2001 From: Robert Strack Date: Wed, 18 Nov 2015 21:27:29 -0500 Subject: [PATCH 0011/1098] minor corrections in the readme file --- plugins/timer/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/timer/README.md b/plugins/timer/README.md index 19072cb24..321307e59 100644 --- a/plugins/timer/README.md +++ b/plugins/timer/README.md @@ -8,11 +8,10 @@ Sample session: me@here:~$ sleep 1 /1.0s me@here:~$ sleep 73 /1m13.0s - me@here:~$ TIMER_FORMAT='[%d]'; TIMER_PRECISION=2 [0.00s] + me@here:~$ TIMER_FORMAT='[%d]'; TIMER_PRECISION=2 [0.00s] me@here:~$ head -c50 < /dev/urandom | hexdump 0000000 b2 16 20 f0 29 1f 61 2d 8a 29 20 8c 8c 39 5a ab 0000010 21 47 0e f9 ee a4 76 46 71 9e 4f 6b a4 c4 51 cb 0000020 f9 1f 7e b9 6f 2c ae dd cf 40 6d 64 a8 fb d3 db 0000030 09 37 0000032 [0.02s] - From 9dd76fb6bc29071bd616d9ea32e29ce7b4dcba73 Mon Sep 17 00:00:00 2001 From: spacewander Date: Fri, 23 Sep 2016 12:02:23 +0800 Subject: [PATCH 0012/1098] add task description to fabric completion --- plugins/fabric/_fab | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/fabric/_fab b/plugins/fabric/_fab index 9628e1224..79d596ed6 100644 --- a/plugins/fabric/_fab +++ b/plugins/fabric/_fab @@ -5,7 +5,10 @@ local curcontext=$curcontext state line declare -A opt_args declare target_list -target_list=(`fab --shortlist 2>/dev/null`) +IFS="$(printf '\n+')" target_list=($(fab -l | awk '{ + if(NR > 2) + printf "%s:%s\n", $1, substr($0, index($0, $2)) +}' 2>/dev/null)) _targets() { _describe -t commands "fabric targets" target_list From 6fe2028a1264a79330f16b1dbd6da8f59dc6854f Mon Sep 17 00:00:00 2001 From: Dariusz Luksza Date: Sun, 25 Jan 2015 13:29:42 +0100 Subject: [PATCH 0013/1098] Fix emacs client terminal Fixes #3305 Signed-off-by: Dariusz Luksza --- plugins/emacs/emacs.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/emacs/emacs.plugin.zsh b/plugins/emacs/emacs.plugin.zsh index c102a5a1e..929aa0616 100644 --- a/plugins/emacs/emacs.plugin.zsh +++ b/plugins/emacs/emacs.plugin.zsh @@ -16,7 +16,7 @@ if "$ZSH/tools/require_tool.sh" emacs 24 2>/dev/null ; then # set EDITOR if not already defined. export EDITOR="${EDITOR:-${EMACS_PLUGIN_LAUNCHER}}" - alias emacs="$EMACS_PLUGIN_LAUNCHER --no-wait" + alias emacs="$EMACS_PLUGIN_LAUNCHER -t" alias e=emacs # open terminal emacsclient alias te="$EMACS_PLUGIN_LAUNCHER -nw" From fbc878cb66cbe0067998034c2d2e383b2742c0de Mon Sep 17 00:00:00 2001 From: Rob Freiburger Date: Sat, 18 Feb 2017 04:31:36 -0600 Subject: [PATCH 0014/1098] Adds option to disable auto update prompt I noticed this option was missing from the template. When I followed the directions in README to enable it, I put it below line 59 without noticing it wouldn't have any effect by then. Prevent others from making a rookie mistake like mine. --- templates/zshrc.zsh-template | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index af42e5b9f..93bbf36aa 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -19,6 +19,9 @@ ZSH_THEME="robbyrussell" # Uncomment the following line to disable bi-weekly auto-update checks. # DISABLE_AUTO_UPDATE="true" +# Uncomment the following line to automatically update without prompting. +# DISABLE_UPDATE_PROMPT="true" + # Uncomment the following line to change how often to auto-update (in days). # export UPDATE_ZSH_DAYS=13 From 132bffcbe164bc3b60208215ddea5bd405605f2b Mon Sep 17 00:00:00 2001 From: Zopanix Date: Mon, 26 Mar 2018 21:04:27 -0400 Subject: [PATCH 0015/1098] Added a myissues option This will allow the user to directly open the my open issues page. This will make it easier for the user to open his open issues in jira. --- plugins/jira/jira.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh index 052481a60..e03bda90e 100644 --- a/plugins/jira/jira.plugin.zsh +++ b/plugins/jira/jira.plugin.zsh @@ -44,6 +44,9 @@ function jira() { open_command "${jira_url}/secure/CreateIssue!default.jspa" elif [[ "$action" == "assigned" || "$action" == "reported" ]]; then _jira_query $@ + elif [[ "$action" == "myissues" ]]; then + echo "Opening my issues" + open_command "${jira_url}/issues/?filter=-1" elif [[ "$action" == "dashboard" ]]; then echo "Opening dashboard" if [[ "$JIRA_RAPID_BOARD" == "true" ]]; then From afb028763cf40fc339e49011b2cba124dc108fcb Mon Sep 17 00:00:00 2001 From: Zopanix Date: Tue, 27 Mar 2018 09:16:43 -0400 Subject: [PATCH 0016/1098] MOdified README to reflect changes for myissues command --- plugins/jira/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/jira/README.md b/plugins/jira/README.md index a934ae68c..091dccb97 100644 --- a/plugins/jira/README.md +++ b/plugins/jira/README.md @@ -21,6 +21,7 @@ jira new # opens a new issue jira dashboard # opens your JIRA dashboard jira reported [username] # queries for issues reported by a user jira assigned [username] # queries for issues assigned to a user +jira myissues # queries for you own issues jira branch # opens an existing issue matching the current branch name jira ABC-123 # opens an existing issue jira ABC-123 m # opens an existing issue for adding a comment From b0a149076fc39ff2707279c2246744378643c0d5 Mon Sep 17 00:00:00 2001 From: Ben Klein Date: Sat, 16 Jun 2018 20:35:41 -0400 Subject: [PATCH 0017/1098] Allow arguments to `d` to be passed to dirs Replace the alias with a function. Call `dirs` if arguments are given to `d`. --- lib/directories.zsh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/directories.zsh b/lib/directories.zsh index 14064b86f..355c442d2 100644 --- a/lib/directories.zsh +++ b/lib/directories.zsh @@ -21,7 +21,14 @@ alias 9='cd -9' alias md='mkdir -p' alias rd=rmdir -alias d='dirs -v | head -10' +function d () { + if [[ -n $1 ]]; then + dirs "$@" + else + dirs -v | head -10 + fi +} +compdef _dirs d # List directory contents alias lsa='ls -lah' From d326cc5c411ac17f1a2befa1e717d221b2bbbf35 Mon Sep 17 00:00:00 2001 From: Frederick Zhang Date: Sat, 7 Jan 2017 20:32:56 +1100 Subject: [PATCH 0018/1098] target name completion --- plugins/cargo/_cargo | 45 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/plugins/cargo/_cargo b/plugins/cargo/_cargo index 54e709ca0..3eb3acb96 100644 --- a/plugins/cargo/_cargo +++ b/plugins/cargo/_cargo @@ -31,7 +31,7 @@ case $state in '--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]' \ + '--target=[target triple]: :_get_targets' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ '--color=:colorization option:(auto always never)' \ @@ -48,7 +48,7 @@ case $state in '--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]' \ + '--target=[target triple]: :_get_targets' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ '--color=:colorization option:(auto always never)' \ @@ -61,7 +61,7 @@ case $state in '(-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)]' \ + '--target=[target triple(default:all)]: :_get_targets' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ '--color=:colorization option:(auto always never)' \ ;; @@ -79,7 +79,7 @@ case $state in '(-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]' \ + '--target=[build for the target triple]: :_get_targets' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ '--color=:colorization option:(auto always never)' \ ;; @@ -276,7 +276,7 @@ case $state in '--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]' \ + '--target=[target triple which compiles will be for]: :_get_targets' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ "${command_scope_spec[@]}" \ ;; @@ -294,7 +294,7 @@ case $state in '(-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]' \ + '--target=[build for the target triple]: :_get_targets' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ "${command_scope_spec[@]}" \ ;; @@ -323,7 +323,7 @@ case $state in '(-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]' \ + '--target=[target triple]: :_get_targets' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ '--color=:colorization option:(auto always never)' \ '1: :_test_names' \ @@ -484,6 +484,37 @@ _benchmark_names() _get_names_from_array "bench" } +#Gets the target names from config files +_get_targets() +{ + local CURRENT_PATH + if [[ $(uname -o) = "Cygwin" && -f "$PWD"/Cargo.toml ]]; then + CURRENT_PATH=$PWD + else + CURRENT_PATH=$(_locate_manifest) + fi + if [[ -z "$CURRENT_PATH" ]]; then + return 1 + fi + local -a TARGETS + local -a FIND_PATHS=( "/" ) + local -a FLINES + local FIND_PATH FLINE + while [[ "$CURRENT_PATH" != "/" ]]; do + FIND_PATHS+=( "$CURRENT_PATH" ) + CURRENT_PATH=$(dirname $CURRENT_PATH) + done + for FIND_PATH in ${FIND_PATHS[@]}; do + if [[ -f "$FIND_PATH"/.cargo/config ]]; then + FLINES=( `grep "$FIND_PATH"/.cargo/config -e "^\[target\."` ) + for FLINE in ${FLINES[@]}; do + TARGETS+=(`sed 's/^\[target\.\(.*\)\]$/\1/' <<< $FLINE`) + done + fi + done + _describe 'target' TARGETS +} + # 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. From da30a1d6d2709d768c68de122d6d0ab96c5a9a90 Mon Sep 17 00:00:00 2001 From: Frederick Zhang Date: Sat, 7 Jan 2017 20:48:11 +1100 Subject: [PATCH 0019/1098] add description for --color --- plugins/cargo/_cargo | 54 ++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/plugins/cargo/_cargo b/plugins/cargo/_cargo index 3eb3acb96..99eac2bdb 100644 --- a/plugins/cargo/_cargo +++ b/plugins/cargo/_cargo @@ -34,7 +34,7 @@ case $state in '--target=[target triple]: :_get_targets' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--color=:colorization option:(auto always never)' \ + '--color=[coloring]:colorization option:(auto always never)' \ ;; build) @@ -51,7 +51,7 @@ case $state in '--target=[target triple]: :_get_targets' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--color=:colorization option:(auto always never)' \ + '--color=[coloring]:colorization option:(auto always never)' \ ;; clean) @@ -63,7 +63,7 @@ case $state in '--release[whether or not to clean release artifacts]' \ '--target=[target triple(default:all)]: :_get_targets' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ + '--color=[coloring]:colorization option:(auto always never)' \ ;; doc) @@ -81,7 +81,7 @@ case $state in '--release[build artifacts in release mode, with optimizations]' \ '--target=[build for the target triple]: :_get_targets' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ + '--color=[coloring]:colorization option:(auto always never)' \ ;; fetch) @@ -90,7 +90,7 @@ case $state in '--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)' \ + '--color=[coloring]:colorization option:(auto always never)' \ ;; generate-lockfile) @@ -99,7 +99,7 @@ case $state in '--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)' \ + '--color=[coloring]:colorization option:(auto always never)' \ ;; git-checkout) @@ -109,7 +109,7 @@ case $state in '--reference=[REF]' \ '--url=[URL]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ + '--color=[coloring]:colorization option:(auto always never)' \ ;; help) @@ -126,14 +126,14 @@ case $state in '--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)' \ + '--color=[coloring]: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)' \ + '--color=[coloring]: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]' \ @@ -163,7 +163,7 @@ case $state in '--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)' \ + '--color=[coloring]:colorization option:(auto always never)' \ ;; metadata) @@ -177,7 +177,7 @@ case $state in '--features=[space separated feature list]' \ '--all-features[enable all available features]' \ '--format-version=[format version(default: 1)]' \ - '--color=:colorization option:(auto always never)' \ + '--color=[coloring]:colorization option:(auto always never)' \ ;; new) @@ -188,7 +188,7 @@ case $state in '--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)' \ + '--color=[coloring]:colorization option:(auto always never)' \ ;; owner) @@ -201,7 +201,7 @@ case $state in '(-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)' \ + '--color=[coloring]:colorization option:(auto always never)' \ ;; package) @@ -213,7 +213,7 @@ case $state in '--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)' \ + '--color=[coloring]:colorization option:(auto always never)' \ ;; pkgid) @@ -222,7 +222,7 @@ case $state in '--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)' \ + '--color=[coloring]:colorization option:(auto always never)' \ ;; publish) @@ -234,7 +234,7 @@ case $state in '(-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)' \ + '--color=[coloring]:colorization option:(auto always never)' \ ;; read-manifest) @@ -242,7 +242,7 @@ case $state in '(-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)' \ + '--color=[coloring]:colorization option:(auto always never)' \ ;; run) @@ -259,13 +259,13 @@ case $state in '--release=[build in release mode]' \ '--target=[target triple]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ + '--color=[coloring]:colorization option:(auto always never)' \ '*: :_normal' \ ;; rustc) _arguments \ - '--color=:colorization option:(auto always never)' \ + '--color=[coloring]: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]' \ @@ -283,7 +283,7 @@ case $state in rustdoc) _arguments \ - '--color=:colorization option:(auto always never)' \ + '--color=[coloring]: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]' \ @@ -301,7 +301,7 @@ case $state in search) _arguments \ - '--color=:colorization option:(auto always never)' \ + '--color=[coloring]: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]' \ @@ -325,14 +325,14 @@ case $state in '--release[build artifacts in release mode, with optimizations]' \ '--target=[target triple]: :_get_targets' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ + '--color=[coloring]:colorization option:(auto always never)' \ '1: :_test_names' \ ;; uninstall) _arguments \ '--bin=[only uninstall the binary NAME]' \ - '--color=:colorization option:(auto always never)' \ + '--color=[coloring]: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]' \ @@ -348,7 +348,7 @@ case $state in '--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)' \ + '--color=[coloring]:colorization option:(auto always never)' \ ;; verify-project) @@ -357,14 +357,14 @@ case $state in '--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)' \ + '--color=[coloring]: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)' \ + '--color=[coloring]:colorization option:(auto always never)' \ ;; yank) @@ -375,7 +375,7 @@ case $state in '--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)' \ + '--color=[coloring]:colorization option:(auto always never)' \ '--vers[yank version]' \ ;; esac From b9533ccac2846d74693158eef1759d198231a79b Mon Sep 17 00:00:00 2001 From: Frederick Zhang Date: Sat, 7 Jan 2017 20:54:48 +1100 Subject: [PATCH 0020/1098] complete --message-format --- plugins/cargo/_cargo | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/cargo/_cargo b/plugins/cargo/_cargo index 99eac2bdb..7ed95c0ce 100644 --- a/plugins/cargo/_cargo +++ b/plugins/cargo/_cargo @@ -34,6 +34,7 @@ case $state in '--target=[target triple]: :_get_targets' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ + '--message-format=[error format]:format option:(human json)' \ '--color=[coloring]:colorization option:(auto always never)' \ ;; @@ -51,6 +52,7 @@ case $state in '--target=[target triple]: :_get_targets' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ + '--message-format=[error format]:format option:(human json)' \ '--color=[coloring]:colorization option:(auto always never)' \ ;; @@ -259,12 +261,14 @@ case $state in '--release=[build in release mode]' \ '--target=[target triple]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ + '--message-format=[error format]:format option:(human json)' \ '--color=[coloring]:colorization option:(auto always never)' \ '*: :_normal' \ ;; rustc) _arguments \ + '--message-format=[error format]:format option:(human json)' \ '--color=[coloring]:colorization option:(auto always never)' \ '--features=[features to compile for the package]' \ '--all-features[enable all available features]' \ @@ -283,6 +287,7 @@ case $state in rustdoc) _arguments \ + '--message-format=[error format]:format option:(human json)' \ '--color=[coloring]:colorization option:(auto always never)' \ '--features=[space-separated list of features to also build]' \ '--all-features[enable all available features]' \ @@ -325,6 +330,7 @@ case $state in '--release[build artifacts in release mode, with optimizations]' \ '--target=[target triple]: :_get_targets' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ + '--message-format=[error format]:format option:(human json)' \ '--color=[coloring]:colorization option:(auto always never)' \ '1: :_test_names' \ ;; From 5423f7fa2ad255ec417fc3aea0c69077f0530ccb Mon Sep 17 00:00:00 2001 From: Frederick Zhang Date: Tue, 24 Jan 2017 03:48:57 +1100 Subject: [PATCH 0021/1098] complete installed sub-commands --- plugins/cargo/_cargo | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/cargo/_cargo b/plugins/cargo/_cargo index 7ed95c0ce..e26fbfeba 100644 --- a/plugins/cargo/_cargo +++ b/plugins/cargo/_cargo @@ -390,6 +390,7 @@ esac } _cargo_cmds(){ +local IFS=$'\n' local -a commands;commands=( 'bench:execute all benchmarks of a local package' 'build:compile the current project' @@ -420,6 +421,7 @@ local -a commands;commands=( 'verify-project:check Cargo.toml' 'version:show version information' 'yank:remove pushed file from index' +$( cargo --list | sed -n '1!p' | tr -d ' ' | egrep -v "^bench$|^build$|^clean$|^doc$|^fetch$|^generate-lockfile$|^git-checkout$|^help$|^init$|^install$|^locate-project$|^login$|^metadata$|^new$|^owner$|^package$|^pkgid$|^publish$|^read-manifest$|^run$|^rustc$|^rustdoc$|^search$|^test$|^uninstall$|^update$|^verify-project$|^version$|^yank$" | sed -r "s/(.*)/echo \"\1:$\(cargo help \1 | head -n 1\)\"/" | sh ) ) _describe 'command' commands From 5d0b90a7ef8fde6d8c53a5d88b5599af6b5da75e Mon Sep 17 00:00:00 2001 From: Frederick Zhang Date: Mon, 26 Jun 2017 12:47:27 +1000 Subject: [PATCH 0022/1098] redir debug output to std --- plugins/cargo/_cargo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/cargo/_cargo b/plugins/cargo/_cargo index e26fbfeba..7d6ca9fc5 100644 --- a/plugins/cargo/_cargo +++ b/plugins/cargo/_cargo @@ -421,7 +421,7 @@ local -a commands;commands=( 'verify-project:check Cargo.toml' 'version:show version information' 'yank:remove pushed file from index' -$( cargo --list | sed -n '1!p' | tr -d ' ' | egrep -v "^bench$|^build$|^clean$|^doc$|^fetch$|^generate-lockfile$|^git-checkout$|^help$|^init$|^install$|^locate-project$|^login$|^metadata$|^new$|^owner$|^package$|^pkgid$|^publish$|^read-manifest$|^run$|^rustc$|^rustdoc$|^search$|^test$|^uninstall$|^update$|^verify-project$|^version$|^yank$" | sed -r "s/(.*)/echo \"\1:$\(cargo help \1 | head -n 1\)\"/" | sh ) +$( cargo --list | sed -n '1!p' | tr -d ' ' | egrep -v "^bench$|^build$|^clean$|^doc$|^fetch$|^generate-lockfile$|^git-checkout$|^help$|^init$|^install$|^locate-project$|^login$|^metadata$|^new$|^owner$|^package$|^pkgid$|^publish$|^read-manifest$|^run$|^rustc$|^rustdoc$|^search$|^test$|^uninstall$|^update$|^verify-project$|^version$|^yank$" | sed -r "s/(.*)/echo \"\1:$\(cargo help \1 2>&1 | head -n 1\)\"/" | sh ) ) _describe 'command' commands From 440d8ef344686b699c918edc7c878a362b3a5038 Mon Sep 17 00:00:00 2001 From: Frederick Zhang Date: Mon, 26 Jun 2017 12:56:16 +1000 Subject: [PATCH 0023/1098] fix escaping --- plugins/cargo/_cargo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/cargo/_cargo b/plugins/cargo/_cargo index 7d6ca9fc5..01089dff4 100644 --- a/plugins/cargo/_cargo +++ b/plugins/cargo/_cargo @@ -421,7 +421,7 @@ local -a commands;commands=( 'verify-project:check Cargo.toml' 'version:show version information' 'yank:remove pushed file from index' -$( cargo --list | sed -n '1!p' | tr -d ' ' | egrep -v "^bench$|^build$|^clean$|^doc$|^fetch$|^generate-lockfile$|^git-checkout$|^help$|^init$|^install$|^locate-project$|^login$|^metadata$|^new$|^owner$|^package$|^pkgid$|^publish$|^read-manifest$|^run$|^rustc$|^rustdoc$|^search$|^test$|^uninstall$|^update$|^verify-project$|^version$|^yank$" | sed -r "s/(.*)/echo \"\1:$\(cargo help \1 2>&1 | head -n 1\)\"/" | sh ) +$( cargo --list | sed -n '1!p' | tr -d ' ' | egrep -v "^bench$|^build$|^clean$|^doc$|^fetch$|^generate-lockfile$|^git-checkout$|^help$|^init$|^install$|^locate-project$|^login$|^metadata$|^new$|^owner$|^package$|^pkgid$|^publish$|^read-manifest$|^run$|^rustc$|^rustdoc$|^search$|^test$|^uninstall$|^update$|^verify-project$|^version$|^yank$" | sed -r "s/(.*)/echo \"\1:$\(cargo help \1 2>\&1 | head -n 1\)\"/" | sh ) ) _describe 'command' commands From 1e161e839f5b544955096b30b01841307b4e4d2f Mon Sep 17 00:00:00 2001 From: Frederick Zhang Date: Mon, 24 Sep 2018 18:02:03 +1000 Subject: [PATCH 0024/1098] fix subcommands completion --- plugins/cargo/_cargo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/cargo/_cargo b/plugins/cargo/_cargo index 01089dff4..7d7d9b2d8 100644 --- a/plugins/cargo/_cargo +++ b/plugins/cargo/_cargo @@ -421,7 +421,7 @@ local -a commands;commands=( 'verify-project:check Cargo.toml' 'version:show version information' 'yank:remove pushed file from index' -$( cargo --list | sed -n '1!p' | tr -d ' ' | egrep -v "^bench$|^build$|^clean$|^doc$|^fetch$|^generate-lockfile$|^git-checkout$|^help$|^init$|^install$|^locate-project$|^login$|^metadata$|^new$|^owner$|^package$|^pkgid$|^publish$|^read-manifest$|^run$|^rustc$|^rustdoc$|^search$|^test$|^uninstall$|^update$|^verify-project$|^version$|^yank$" | sed -r "s/(.*)/echo \"\1:$\(cargo help \1 2>\&1 | head -n 1\)\"/" | sh ) +$( cargo --list | sed -n '1!p' | tr -s ' ' | cut -d ' ' -f 2 | egrep -v "^bench$|^build$|^clean$|^doc$|^fetch$|^generate-lockfile$|^git-checkout$|^help$|^init$|^install$|^locate-project$|^login$|^metadata$|^new$|^owner$|^package$|^pkgid$|^publish$|^read-manifest$|^run$|^rustc$|^rustdoc$|^search$|^test$|^uninstall$|^update$|^verify-project$|^version$|^yank$" | sed -r "s/(.*)/echo \"\1:$\(cargo help \1 2>\&1 | head -n 1\)\"/" | sh ) ) _describe 'command' commands From 23688fc7ab925111fdb0db07670b6b641e380ec9 Mon Sep 17 00:00:00 2001 From: Iulian Onofrei <6d0847b9@opayq.com> Date: Sat, 29 Sep 2018 17:01:41 +0300 Subject: [PATCH 0025/1098] Add option to color any help command This allows you to use `colored git log --help` for example, to get colored output. --- plugins/colored-man-pages/colored-man-pages.plugin.zsh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/colored-man-pages/colored-man-pages.plugin.zsh b/plugins/colored-man-pages/colored-man-pages.plugin.zsh index 1bea536e0..ac6a94654 100644 --- a/plugins/colored-man-pages/colored-man-pages.plugin.zsh +++ b/plugins/colored-man-pages/colored-man-pages.plugin.zsh @@ -16,7 +16,7 @@ EOF fi fi -function man() { +function colored() { env \ LESS_TERMCAP_mb=$(printf "\e[1;31m") \ LESS_TERMCAP_md=$(printf "\e[1;31m") \ @@ -28,5 +28,9 @@ function man() { PAGER="${commands[less]:-$PAGER}" \ _NROFF_U=1 \ PATH="$HOME/bin:$PATH" \ - man "$@" + "$@" +} + +function man() { + colored man "$@" } From 729339c7808f65b95d9fc68f67fed45336ec6eef Mon Sep 17 00:00:00 2001 From: Luiz Guilherme Fonseca Rosa Date: Tue, 2 Oct 2018 21:37:02 -0300 Subject: [PATCH 0026/1098] Update laravel.plugin.zsh Add some laravel aliases --- plugins/laravel/laravel.plugin.zsh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/plugins/laravel/laravel.plugin.zsh b/plugins/laravel/laravel.plugin.zsh index ed932ee89..7ddfd85ba 100644 --- a/plugins/laravel/laravel.plugin.zsh +++ b/plugins/laravel/laravel.plugin.zsh @@ -1,3 +1,26 @@ #!zsh alias artisan='php artisan' alias bob='php artisan bob::build' + +# Development +alias pas='php artisan serve' + +# Database +alias pam='php artisan migrate' +alias pamf='php artisan migrate:fresh' +alias pamfs='php artisan migrate:fresh --seed' +alias pamr='php artisan migrate:rollback' +alias pads='php artisan db:seed' + +# Makers +alias pamm='php artisan make:model' +alias pamc='php artisan make:controller' +alias pams='php artisan make:seeder' +alias pamt='php artisan make:test' + + +# Clears +alias pacac='php artisan cache:clear' +alias pacoc='php artisan config:clear' +alias pavic='php artisan view:clear' +alias paroc='php artisan route:clear' From c2113d7cc67e2865a4692918198fba27e8360fe5 Mon Sep 17 00:00:00 2001 From: Luiz Guilherme Fonseca Rosa Date: Tue, 2 Oct 2018 21:44:26 -0300 Subject: [PATCH 0027/1098] Create Laravel plugin README --- plugins/laravel/README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 plugins/laravel/README.md diff --git a/plugins/laravel/README.md b/plugins/laravel/README.md new file mode 100644 index 000000000..c7ae17f80 --- /dev/null +++ b/plugins/laravel/README.md @@ -0,0 +1,39 @@ +# Laravel + +Enable some cool aliases for Laravel [artisan console](https://laravel.com/docs/5.7/artisan). To use it, add `laravel` to the plugins array of your zshrc file: +``` +plugins=(... laravel) +``` + +| Alias | Description | +|:-:|:-:| +| `artisan` | `php artisan` | +| `pas` | `php artisan serve` | + +## Database + +| Alias | Description | +|:-:|:-:| +| `pam` | `php artisan migrate` | +| `pamf` | `php artisan migrate:fresh` | +| `pamfs` | `php artisan migrate:fresh --seed` | +| `pamr` | `php artisan migrate:rollback` | +| `pads` | `php artisan db:seed` | + +## Makers + +| Alias | Description | +|:-:|:-:| +| `pamm` | `php artisan make:model` | +| `pamc` | `php artisan make:controller` | +| `pams` | `php artisan make:seeder` | +| `pamt` | `php artisan make:test` | + +## Clears + +| Alias | Description | +|:-:|:-:| +| `pacac` | `php artisan cache:clear` | +| `pacoc` | `php artisan config:clear` | +| `pavic` | `php artisan view:clear` | +| `paroc` | `php artisan route:clear` | From 1a4052b0451121556fceca63ee96255cca0ca94c Mon Sep 17 00:00:00 2001 From: Pasan Date: Sat, 20 Oct 2018 08:55:19 +0530 Subject: [PATCH 0028/1098] Added README.md to lighthouse plugin --- plugins/lighthouse/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 plugins/lighthouse/README.md diff --git a/plugins/lighthouse/README.md b/plugins/lighthouse/README.md new file mode 100644 index 000000000..0dd0003f1 --- /dev/null +++ b/plugins/lighthouse/README.md @@ -0,0 +1,15 @@ +# Lighthouse plugin + +This plugin issue lighthouse tickets. + +To use it, add `lighthouse` to the plugins array in your zshrc file: + +```zsh +plugins=(... lighthouse) +``` + +## Aliases + +| Alias | Command | Description | +|-------|----------------------------------------|------------------------------------------------------| +| lho | `open_lighthouse_ticket` | Opening lighthouse ticket | \ No newline at end of file From 4365792985f6bbaf65c847400fa47ce7c0d1cb79 Mon Sep 17 00:00:00 2001 From: Erwan ROUSSEL Date: Tue, 23 Oct 2018 14:43:44 +0200 Subject: [PATCH 0029/1098] Create README.md Add README.md to Symfony2 plugin --- plugins/symfony2/README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 plugins/symfony2/README.md diff --git a/plugins/symfony2/README.md b/plugins/symfony2/README.md new file mode 100644 index 000000000..d5d9c1880 --- /dev/null +++ b/plugins/symfony2/README.md @@ -0,0 +1,25 @@ +# Symfony2 + +This plugin provides completion for [symfony2](https://symfony.com/), as well as aliases for frequent composer commands. + +To use it add composer to the plugins array in your zshrc file. + +```bash +plugins=(... symfony2) +``` + +## Aliases + +| Alias | Command | Description | +|---------------|------------------------------|-------------------------------| +| `sf` | php app/console | Start the symfony console | +| `sfcl` | sf cache:clear | Clear the cache | +| `sfsr` | sf server:run | Run the dev server | +| `sfcw` | sf cache:warmup | Use the Bundles warmer | +| `sfroute` | sf debug:router | Show the different routes | +| `sfcontainer` | sf debug:contaner | List the different services | +| `sfgb` | sf generate:bundle | Generate a bundle | +| `sfge` | sf doctrine:generate:entity | Generate an entity | +| `sfsu` | sf doctrine:schema:update | Update the schema in Database | +| `sfdev` | sf --env=dev | Update environment to `dev` | +| `sfprod` | sf --env=prod | Update environment to `prod` | From 550781561bf6871fcf5036e0beb707e116de9d3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20H=C3=A4ber?= Date: Wed, 24 Oct 2018 15:56:51 +0200 Subject: [PATCH 0030/1098] helm: add README (#7325) --- plugins/helm/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 plugins/helm/README.md diff --git a/plugins/helm/README.md b/plugins/helm/README.md new file mode 100644 index 000000000..49844c78f --- /dev/null +++ b/plugins/helm/README.md @@ -0,0 +1,9 @@ +# Helm plugin + +This plugin adds completion for [Helm](https://helm.sh/), the Kubernetes package manager. + +To use it, add `helm` to the plugins array in your zshrc file: + +```zsh +plugins=(... helm) +``` From 50208f5c427fb6af076e24ac3a1eab714b4511b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 24 Oct 2018 16:01:42 +0200 Subject: [PATCH 0031/1098] fix copy errors --- plugins/symfony2/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/symfony2/README.md b/plugins/symfony2/README.md index d5d9c1880..562641dfb 100644 --- a/plugins/symfony2/README.md +++ b/plugins/symfony2/README.md @@ -1,8 +1,8 @@ # Symfony2 -This plugin provides completion for [symfony2](https://symfony.com/), as well as aliases for frequent composer commands. +This plugin provides completion for [Symfony 2](https://symfony.com/), as well as aliases for frequent Symfony commands. -To use it add composer to the plugins array in your zshrc file. +To use it add symfony2 to the plugins array in your zshrc file. ```bash plugins=(... symfony2) From 745b6550a6a8415e2c6df0006aad40549c3bc56a Mon Sep 17 00:00:00 2001 From: "Paul N. Baker" Date: Wed, 24 Oct 2018 09:41:05 -0600 Subject: [PATCH 0032/1098] mvn: run mvnw only if executable (#7326) The problem that can occur is ocassionally mvnw will not be executable. This can happen if mvnw is included from an archetype, as unix permissions aren't preserved within the jar they're stored in. Only using mvnw if it exists AND is executable --- plugins/mvn/mvn.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index 74583c6dc..f367fecce 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -20,9 +20,9 @@ BACKGROUND_CYAN=$(tput setab 6) BACKGROUND_WHITE=$(tput setab 7) RESET_FORMATTING=$(tput sgr0) -# if found a ./mvnw file execute it otherwise execute orignal mvn +# if found an executable ./mvnw file execute it otherwise execute orignal mvn mvn-or-mvnw() { - if [ -f ./mvnw ] ; then + if [ -x ./mvnw ] ; then echo "executing mvnw instead of mvn" ./mvnw "$@"; else From ad41fe50f9ac8b44b2171fea8b0b990aa9542699 Mon Sep 17 00:00:00 2001 From: Erwan ROUSSEL Date: Thu, 25 Oct 2018 13:12:02 +0200 Subject: [PATCH 0033/1098] symfony: add README (#7337) --- plugins/symfony/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 plugins/symfony/README.md diff --git a/plugins/symfony/README.md b/plugins/symfony/README.md new file mode 100644 index 000000000..c58f64fdd --- /dev/null +++ b/plugins/symfony/README.md @@ -0,0 +1,9 @@ +# Symfony + +This plugin provides completion for [Symfony](https://symfony.com/). + +To use it add symfony to the plugins array in your zshrc file. + +```bash +plugins=(... symfony) +``` From ad9a8f2d434deb698702ba136d935d9d0910a4ae Mon Sep 17 00:00:00 2001 From: Patrick Artounian Date: Thu, 25 Oct 2018 04:26:22 -0700 Subject: [PATCH 0034/1098] systemadmin: fix getip output with ifconfig (#7306) --- plugins/systemadmin/systemadmin.plugin.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/systemadmin/systemadmin.plugin.zsh b/plugins/systemadmin/systemadmin.plugin.zsh index 5cc7b7397..bdc2219fa 100644 --- a/plugins/systemadmin/systemadmin.plugin.zsh +++ b/plugins/systemadmin/systemadmin.plugin.zsh @@ -134,12 +134,12 @@ geteip() { curl -s -S https://icanhazip.com } -# determine local IP address +# determine local IP address(es) getip() { if (( ${+commands[ip]} )); then - ip addr | grep "inet " | grep -v '127.0.0.1' | awk '{print $2}' + ip addr | awk '/inet /{print $2}' | command grep -v 127.0.0.1 else - ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}' + ifconfig | awk '/inet /{print $2}' | command grep -v 127.0.0.1 fi } From 4c8dd9c26da5b6cb85c5b82dab5b31b9d216834e Mon Sep 17 00:00:00 2001 From: Erwan ROUSSEL Date: Fri, 26 Oct 2018 14:52:54 +0200 Subject: [PATCH 0035/1098] heroku: add README (#7342) --- plugins/heroku/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 plugins/heroku/README.md diff --git a/plugins/heroku/README.md b/plugins/heroku/README.md new file mode 100644 index 000000000..2bf92c9de --- /dev/null +++ b/plugins/heroku/README.md @@ -0,0 +1,9 @@ +# Heroku + +This plugin provides completion for the [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli). + +To use it add heroku to the plugins array in your zshrc file: + +```bash +plugins=(... heroku) +``` From c6b68707f95faabb31fcaabf55f5d78abc64fb19 Mon Sep 17 00:00:00 2001 From: Erwan ROUSSEL Date: Fri, 26 Oct 2018 17:05:50 +0200 Subject: [PATCH 0036/1098] doctl: add README (#7346) --- plugins/doctl/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 plugins/doctl/README.md diff --git a/plugins/doctl/README.md b/plugins/doctl/README.md new file mode 100644 index 000000000..a81e90b0a --- /dev/null +++ b/plugins/doctl/README.md @@ -0,0 +1,9 @@ +# Doctl + +This plugin provides completion for [Doctl](https://github.com/digitalocean/doctl). + +To use it add doctl to the plugins array in your zshrc file. + +```bash +plugins=(... doctl) +``` From b3483109f54dbb0481fb0d6a491f2bf89f0f4cf8 Mon Sep 17 00:00:00 2001 From: Erwan ROUSSEL Date: Fri, 26 Oct 2018 17:06:45 +0200 Subject: [PATCH 0037/1098] celery: add README (#7345) --- plugins/celery/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 plugins/celery/README.md diff --git a/plugins/celery/README.md b/plugins/celery/README.md new file mode 100644 index 000000000..d2597f702 --- /dev/null +++ b/plugins/celery/README.md @@ -0,0 +1,9 @@ +# Celery + +This plugin provides completion for [Celery](http://www.celeryproject.org/). + +To use it add celery to the plugins array in your zshrc file. + +```bash +plugins=(... celery) +``` From fcbfd75827e52cb11e40246735d2a8f43f861d1a Mon Sep 17 00:00:00 2001 From: Erwan ROUSSEL Date: Fri, 26 Oct 2018 17:08:27 +0200 Subject: [PATCH 0038/1098] homestead: add README (#7343) --- plugins/homestead/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 plugins/homestead/README.md diff --git a/plugins/homestead/README.md b/plugins/homestead/README.md new file mode 100644 index 000000000..476302371 --- /dev/null +++ b/plugins/homestead/README.md @@ -0,0 +1,9 @@ +# Homestead + +This plugin provides completion for [Homestead](https://laravel.com/docs/homestead). + +To use it add homestead to the plugins array in your zshrc file. + +```bash +plugins=(... homestead) +``` From f31ef2024dacc4c3a35e8486173fe9de3fcd67be Mon Sep 17 00:00:00 2001 From: Erwan ROUSSEL Date: Fri, 26 Oct 2018 17:10:50 +0200 Subject: [PATCH 0039/1098] jake-node: add README (#7344) --- plugins/jake-node/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 plugins/jake-node/README.md diff --git a/plugins/jake-node/README.md b/plugins/jake-node/README.md new file mode 100644 index 000000000..78ca8d85f --- /dev/null +++ b/plugins/jake-node/README.md @@ -0,0 +1,9 @@ +# Jake + +This plugin provides completion for [Jake](http://jakejs.com/). + +To use it add jake-node to the plugins array in your zshrc file. + +```bash +plugins=(... jake-node) +``` From f96d18ca935f9b9bd6f1c51cb5c821a0b18e9601 Mon Sep 17 00:00:00 2001 From: Ezequiel Pochiero Date: Sat, 27 Oct 2018 12:09:55 -0300 Subject: [PATCH 0040/1098] avit: fix handling of time since last commit (#7350) --- themes/avit.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/avit.zsh-theme b/themes/avit.zsh-theme index cf439f757..aec14e4a6 100644 --- a/themes/avit.zsh-theme +++ b/themes/avit.zsh-theme @@ -63,7 +63,7 @@ function _git_time_since_commit() { sub_hours=$((hours % 24)) sub_minutes=$((minutes % 60)) - if [ $hours -gt 24 ]; then + if [ $hours -ge 24 ]; then commit_age="${days}d" elif [ $minutes -gt 60 ]; then commit_age="${sub_hours}h${sub_minutes}m" From 5da824526a0184087c8aa0eae2255ea547385e81 Mon Sep 17 00:00:00 2001 From: Jorge Vargas Date: Sat, 27 Oct 2018 16:32:13 -0700 Subject: [PATCH 0041/1098] kops: add README.md --- plugins/kops/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 plugins/kops/README.md diff --git a/plugins/kops/README.md b/plugins/kops/README.md new file mode 100644 index 000000000..1983afab4 --- /dev/null +++ b/plugins/kops/README.md @@ -0,0 +1,9 @@ +# kops + +This plugin provides completion for [kops](https://github.com/kubernetes/kops). + +To use it, add `kops` to the plugins array in your zshrc file. + +``` +plugins=(... kops) +``` From c4bdb83f07e8efee940292a42dd286a6263848ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Z=C3=BChlke?= Date: Sun, 28 Oct 2018 11:36:54 +0100 Subject: [PATCH 0042/1098] add readme fot git-flow-avh --- plugins/git-flow-avh/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 plugins/git-flow-avh/README.md diff --git a/plugins/git-flow-avh/README.md b/plugins/git-flow-avh/README.md new file mode 100644 index 000000000..340ed80d1 --- /dev/null +++ b/plugins/git-flow-avh/README.md @@ -0,0 +1,12 @@ +# git-flow (AVH Edition) plugin + +This plugin adds completion for the [git-flow (AVH Edition)](https://github.com/petervanderdoes/gitflow-avh). +The AVH Edition of the git extensions that provides high-level repository operations for [Vincent Driessen's branching model](https://nvie.com/posts/a-successful-git-branching-model/). + +The git-flow tool has to be [installed](https://github.com/petervanderdoes/gitflow-avh#installing-git-flow) separately. + +To use it, add `git-flow-avh` to the plugins array in your zshrc file: + +```zsh +plugins=(... git-flow-avh) +``` From ac2ccb753521c279fc17ae26e33359f7dec9d527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Z=C3=BChlke?= Date: Sun, 28 Oct 2018 12:21:29 +0100 Subject: [PATCH 0043/1098] add readme for grails plugin --- plugins/grails/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 plugins/grails/README.md diff --git a/plugins/grails/README.md b/plugins/grails/README.md new file mode 100644 index 000000000..1b0eda1dd --- /dev/null +++ b/plugins/grails/README.md @@ -0,0 +1,15 @@ +# Grails plugin + +Adds tab-completion of Grails script names to the command line use of grails. +Looks for scripts in the following paths: + +- `$GRAILS_HOME/scripts` +- `~/.grails/scripts` +- `./scripts` +- `./plugins/*/scripts` + +To use it, add `grails` to the plugins array in your zshrc file: + +```zsh +plugins=(... grails) +``` From abcac3e8a1819c0ad2a5bab84e4c57512a5d745e Mon Sep 17 00:00:00 2001 From: Erwan ROUSSEL Date: Sun, 28 Oct 2018 12:28:28 +0100 Subject: [PATCH 0044/1098] Create README.md Create stack's plugin README.md --- plugins/stack/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 plugins/stack/README.md diff --git a/plugins/stack/README.md b/plugins/stack/README.md new file mode 100644 index 000000000..da73444ad --- /dev/null +++ b/plugins/stack/README.md @@ -0,0 +1,9 @@ +# Stack + +This plugin provides completion for [Stack](https://haskellstack.org). + +To use it add stack to the plugins array in your zshrc file. + +```bash +plugins=(... stack) +``` From 684feffc355df95c804a6a32196248bacfefebe7 Mon Sep 17 00:00:00 2001 From: Jorge Luis Vargas Aguilar Date: Sun, 28 Oct 2018 05:17:41 -0700 Subject: [PATCH 0045/1098] aws: add README (#7357) --- plugins/aws/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 plugins/aws/README.md diff --git a/plugins/aws/README.md b/plugins/aws/README.md new file mode 100644 index 000000000..8a45199b8 --- /dev/null +++ b/plugins/aws/README.md @@ -0,0 +1,20 @@ +# aws + +This plugin provides completion support for [awscli](https://docs.aws.amazon.com/cli/latest/reference/index.html) +and a few utilities to manage AWS profiles: a function to change profiles with autocompletion support +and a function to get the current AWS profile. The current AWS profile is also displayed in `RPROMPT`. + +To use it, add `aws` to the plugins array in your zshrc file. + +```zsh +plugins=(... aws) +``` + +## Plugin commands + +* `asp `: Sets `AWS_PROFILE` and `AWS_DEFAULT_PROFILE` (legacy) to ``. +It also adds it to your RPROMPT. + +* `agp`: Gets the current value of `AWS_PROFILE`. + +* `aws_profiles`: Lists the available profiles in the file referenced in `AWS_CONFIG_FILE` (default: ~/.aws/config). Used to provide completion for the `asp` function. From 3752700a5a12136e0b6b80d3fd07a271c868d616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 28 Oct 2018 13:21:58 +0100 Subject: [PATCH 0046/1098] add description and author --- plugins/kops/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/kops/README.md b/plugins/kops/README.md index 1983afab4..5d9b5f8d6 100644 --- a/plugins/kops/README.md +++ b/plugins/kops/README.md @@ -1,9 +1,12 @@ # kops -This plugin provides completion for [kops](https://github.com/kubernetes/kops). +This plugin provides completion for [kops](https://github.com/kubernetes/kops) (Kubernetes Operations), +the command line interface to get a production grade Kubernetes cluster up and running. To use it, add `kops` to the plugins array in your zshrc file. ``` plugins=(... kops) ``` + +**Author:** [@nmrony](https://github.com/nmrony) From a58dc3232332db61f0e8244bcf0416aaef5d6fe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 28 Oct 2018 13:22:26 +0100 Subject: [PATCH 0047/1098] delete duplicate documentation --- plugins/kops/kops.plugin.zsh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/plugins/kops/kops.plugin.zsh b/plugins/kops/kops.plugin.zsh index f707f3aff..0c38ce2df 100644 --- a/plugins/kops/kops.plugin.zsh +++ b/plugins/kops/kops.plugin.zsh @@ -1,9 +1,3 @@ -# Autocompletion for kops (Kubernetes Operations), -# the command line interface to get a production grade -# Kubernetes cluster up and running - -# Author: https://github.com/nmrony - if [ $commands[kops] ]; then source <(kops completion zsh) fi From 70246da9cbc96b33256496e501618b9963ac73ee Mon Sep 17 00:00:00 2001 From: Jorge Luis Vargas Aguilar Date: Sun, 28 Oct 2018 05:24:17 -0700 Subject: [PATCH 0048/1098] minikube: add README (#7359) --- plugins/minikube/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 plugins/minikube/README.md diff --git a/plugins/minikube/README.md b/plugins/minikube/README.md new file mode 100644 index 000000000..eb2dd9b46 --- /dev/null +++ b/plugins/minikube/README.md @@ -0,0 +1,9 @@ +# minikube + +This plugin provides completion for [minikube](https://github.com/kubernetes/minikube). + +To use it, add `minikube` to the plugins array in your zshrc file. + +``` +plugins=(... minikube) +``` From 8f777f30bbb97f27b855bad5585619da499ea7e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 28 Oct 2018 13:37:55 +0100 Subject: [PATCH 0049/1098] add git completion requirements notice --- plugins/git-flow-avh/README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/git-flow-avh/README.md b/plugins/git-flow-avh/README.md index 340ed80d1..0768d93ea 100644 --- a/plugins/git-flow-avh/README.md +++ b/plugins/git-flow-avh/README.md @@ -3,10 +3,17 @@ This plugin adds completion for the [git-flow (AVH Edition)](https://github.com/petervanderdoes/gitflow-avh). The AVH Edition of the git extensions that provides high-level repository operations for [Vincent Driessen's branching model](https://nvie.com/posts/a-successful-git-branching-model/). -The git-flow tool has to be [installed](https://github.com/petervanderdoes/gitflow-avh#installing-git-flow) separately. - To use it, add `git-flow-avh` to the plugins array in your zshrc file: ```zsh plugins=(... git-flow-avh) ``` + +## Requirements + +1. The git-flow tool has to be [installed](https://github.com/petervanderdoes/gitflow-avh#installing-git-flow) + separately. + +2. You have to use zsh's git completion instead of the git project's git completion. This is typically + done by default so you don't need to do anything else. If you installed git with Homebrew you + might have to uninstall the git completion it's bundled with. From b6f629dc1c63c354d1e635f36a0f016554354a86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 28 Oct 2018 13:39:26 +0100 Subject: [PATCH 0050/1098] delete not applicable comments --- plugins/git-flow-avh/git-flow-avh.plugin.zsh | 22 -------------------- 1 file changed, 22 deletions(-) diff --git a/plugins/git-flow-avh/git-flow-avh.plugin.zsh b/plugins/git-flow-avh/git-flow-avh.plugin.zsh index db8b5ff89..860ca55c5 100644 --- a/plugins/git-flow-avh/git-flow-avh.plugin.zsh +++ b/plugins/git-flow-avh/git-flow-avh.plugin.zsh @@ -1,25 +1,3 @@ -#!zsh -# -# Installation -# ------------ -# -# To achieve git-flow completion nirvana: -# -# 0. Update your zsh's git-completion module to the newest version. -# From here: https://github.com/zsh-users/zsh/blob/master/Completion/Unix/Command/_git -# -# 1. Install this file. Either: -# -# a. Place it in your .zshrc: -# -# b. Or, copy it somewhere (e.g. ~/.git-flow-completion.zsh) and put the following line in -# your .zshrc: -# -# source ~/.git-flow-completion.zsh -# -# c. Or, use this file as a oh-my-zsh plugin. -# - _git-flow () { local curcontext="$curcontext" state line From f1250cfbce4dc08b1b4d147ff533fad0ca64d5e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Z=C3=BChlke?= Date: Sun, 28 Oct 2018 13:46:08 +0100 Subject: [PATCH 0051/1098] git-hubflow: add README (#7361) --- plugins/git-hubflow/README.md | 24 ++++++++++++++++++++++ plugins/git-hubflow/git-hubflow.plugin.zsh | 22 -------------------- 2 files changed, 24 insertions(+), 22 deletions(-) create mode 100644 plugins/git-hubflow/README.md diff --git a/plugins/git-hubflow/README.md b/plugins/git-hubflow/README.md new file mode 100644 index 000000000..dada60d78 --- /dev/null +++ b/plugins/git-hubflow/README.md @@ -0,0 +1,24 @@ +# git-hubflow plugin + +This plugin adds completion for [HubFlow](https://datasift.github.io/gitflow/) (GitFlow for GitHub), as well as some +aliases for common commands. HubFlow is a git extension to make it easy to use GitFlow with GitHub. Based on the +original gitflow extension for git. + +The hubflow tool has to be [installed](https://github.com/datasift/gitflow#installation) separately. + +To use it, add `git-hubflow` to the plugins array in your zshrc file: + +```zsh +plugins=(... git-hubflow) +``` + +## Aliases + +| Alias | Command | Description | +|-------|------------------|------------------------------------------------------------------| +| ghf | `git hf` | Print command overview | +| ghff | `git hf feature` | Manage your feature branches | +| ghfr | `git hf release` | Manage your release branches | +| ghfh | `git hf hotfix` | Manage your hotfix branches | +| ghfs | `git hf support` | Manage your support branches | +| ghfu | `git hf update` | Pull upstream changes down into your master and develop branches | diff --git a/plugins/git-hubflow/git-hubflow.plugin.zsh b/plugins/git-hubflow/git-hubflow.plugin.zsh index 8d968229f..05479f7e6 100644 --- a/plugins/git-hubflow/git-hubflow.plugin.zsh +++ b/plugins/git-hubflow/git-hubflow.plugin.zsh @@ -1,25 +1,3 @@ -#!zsh -# -# Installation -# ------------ -# -# To achieve git-hubflow completion nirvana: -# -# 0. Update your zsh's git-completion module to the newest version. -# From here: https://github.com/zsh-users/zsh/blob/master/Completion/Unix/Command/_git -# -# 1. Install this file. Either: -# -# a. Place it in your .zshrc: -# -# b. Or, copy it somewhere (e.g. ~/.git-hubflow-completion.zsh) and put the following line in -# your .zshrc: -# -# source ~/.git-hubflow-completion.zsh -# -# c. Or, use this file as an oh-my-zsh plugin. -# - alias ghf='git hf' alias ghff='git hf feature' alias ghfr='git hf release' From 4e59ba755cb75793582566eacc6f042cb8f2461b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 28 Oct 2018 13:50:34 +0100 Subject: [PATCH 0052/1098] move path section after plugin-enabling section --- plugins/grails/README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/plugins/grails/README.md b/plugins/grails/README.md index 1b0eda1dd..9d69b161e 100644 --- a/plugins/grails/README.md +++ b/plugins/grails/README.md @@ -1,15 +1,16 @@ # Grails plugin Adds tab-completion of Grails script names to the command line use of grails. -Looks for scripts in the following paths: - -- `$GRAILS_HOME/scripts` -- `~/.grails/scripts` -- `./scripts` -- `./plugins/*/scripts` To use it, add `grails` to the plugins array in your zshrc file: ```zsh plugins=(... grails) ``` + +It looks for scripts in the following paths: + +- `$GRAILS_HOME/scripts` +- `~/.grails/scripts` +- `./scripts` +- `./plugins/*/scripts` From c87eea8bdb19aa3d3324158e83518140bf1c2b28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 28 Oct 2018 13:51:26 +0100 Subject: [PATCH 0053/1098] add link --- plugins/grails/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/grails/README.md b/plugins/grails/README.md index 9d69b161e..6bf2ac1e6 100644 --- a/plugins/grails/README.md +++ b/plugins/grails/README.md @@ -1,6 +1,6 @@ # Grails plugin -Adds tab-completion of Grails script names to the command line use of grails. +Adds tab-completion of [Grails](https://grails.org/) script names to the command line use of grails. To use it, add `grails` to the plugins array in your zshrc file: From e4946ef9f94360dd4767c2e58274cd62057822a5 Mon Sep 17 00:00:00 2001 From: "Vargas, Jorge L" Date: Sat, 27 Oct 2018 15:21:18 -0700 Subject: [PATCH 0054/1098] aws: change AWS_DEFAULT_PROFILE to AWS_PROFILE The environment variable name used to be AWS_DEFAULT_PROFILE but the CLI documentation now only mentions AWS_PROFILE. https://docs.aws.amazon.com/cli/latest/userguide/cli-environment.html It seems like the CLI was the only tool using AWS_DEFAULT_PROFILE, and all the AWS SDKs used AWS_PROFILE, so they standardized on it. https://onetechnical.wordpress.com/2016/10/07/the-curious-case-of-aws_default_profile/ Note: still left AWS_DEFAULT_PROFILE on the method to set the profile to maintain backwards compatibility. Close #7354 --- plugins/aws/aws.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index 183b0f226..252c0d9c1 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -24,7 +24,7 @@ _awscli-homebrew-installed() { export AWS_HOME=~/.aws function agp { - echo $AWS_DEFAULT_PROFILE + echo $AWS_PROFILE } function asp { @@ -33,7 +33,7 @@ function asp { export AWS_DEFAULT_PROFILE=$1 export AWS_PROFILE=$1 - export RPROMPT="$rprompt" + export RPROMPT="$rprompt" } function aws_profiles { From 543044efe3940b623069996cf6b2f5127635815f Mon Sep 17 00:00:00 2001 From: Jorge Vargas Date: Sat, 27 Oct 2018 15:59:03 -0700 Subject: [PATCH 0055/1098] aws: use AWS_CONFIG_FILE to complete profiles Stop exporting AWS_HOME and use the standard AWS_CONFIG_FILE environment variable, with a fallback to ~/.aws/config (default location) if not defined. Close #7356 --- plugins/aws/aws.plugin.zsh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index 252c0d9c1..f78e96ce3 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -21,8 +21,6 @@ _awscli-homebrew-installed() { [ -r $_brew_prefix/libexec/bin/aws_zsh_completer.sh ] &> /dev/null } -export AWS_HOME=~/.aws - function agp { echo $AWS_PROFILE } @@ -37,7 +35,7 @@ function asp { } function aws_profiles { - reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_\.-]*\).*/\1/')) + reply=($(grep profile "${AWS_CONFIG_FILE:-$HOME/.aws/config}"|sed -e 's/.*profile \([a-zA-Z0-9_\.-]*\).*/\1/')) } compctl -K aws_profiles asp From 2d74c1bf2beaef4bd6ee6b9448d170450c45b172 Mon Sep 17 00:00:00 2001 From: Mike Truso Date: Sun, 28 Oct 2018 13:26:08 -0500 Subject: [PATCH 0056/1098] grails readme (#7365) --- plugins/grails/README.md | 57 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/plugins/grails/README.md b/plugins/grails/README.md index 6bf2ac1e6..64b4a9f07 100644 --- a/plugins/grails/README.md +++ b/plugins/grails/README.md @@ -1,6 +1,6 @@ # Grails plugin -Adds tab-completion of [Grails](https://grails.org/) script names to the command line use of grails. +This plugin adds completion for the [Grails 2 CLI](https://grails.github.io/grails2-doc/2.5.x/guide/commandLine.html) To use it, add `grails` to the plugins array in your zshrc file: @@ -14,3 +14,58 @@ It looks for scripts in the following paths: - `~/.grails/scripts` - `./scripts` - `./plugins/*/scripts` + +## Grails Commands +- `add-proxy` +- `alias` +- `bootstrap` +- `bug-report` +- `clean` +- `clean-all` +- `clear-proxy` +- `compile` +- `console` +- `create-app` +- `create-controller` +- `create-domain-class` +- `create-filters` +- `create-integration-test` +- `create-multi-project-build` +- `create-plugin` +- `create-pom` +- `create-script` +- `create-service` +- `create-tag-lib` +- `create-unit-test` +- `dependency-report` +- `doc` +- `help` +- `init` +- `install-app-templates` +- `install-dependency` +- `install-plugin` +- `install-templates` +- `integrate-with` +- `interactive` +- `list-plugin-updates` +- `list-plugins` +- `migrate-docs` +- `package` +- `package-plugin` +- `plugin-info` +- `refresh-dependencies` +- `remove-proxy` +- `run-app` +- `run-script` +- `run-war` +- `set-grails-version` +- `set-proxy` +- `set-version` +- `shell` +- `stats` +- `stop-app` +- `test-app` +- `uninstall-plugin` +- `url-mappings-report` +- `war` +- `wrapper` From fa2dc41c233ac2f6a1fea81b6363cd97bb1d199b Mon Sep 17 00:00:00 2001 From: Michy Amrane Date: Sun, 28 Oct 2018 19:27:34 +0100 Subject: [PATCH 0057/1098] [yarn] more aliases ^^ (#7310) * more aliases ^^ --- plugins/yarn/README.md | 6 ++++++ plugins/yarn/yarn.plugin.zsh | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/plugins/yarn/README.md b/plugins/yarn/README.md index c4e6d6da5..671a272d9 100644 --- a/plugins/yarn/README.md +++ b/plugins/yarn/README.md @@ -19,13 +19,19 @@ plugins=(... yarn) | yap | `yarn add --peer` | Install a package in peerDependencies (`package.json`) | | yb | `yarn build` | Run the build script defined in `package.json` | | ycc | `yarn cache clean` | Clean yarn's global cache of packages | +| yga | `yarn global add` | Install packages globally on your operating system | +| ygls | `yarn global list` | Lists global installed packages | +| ygrm | `yarn global remove` | Remove global installed packages from your OS | | ygu | `yarn global upgrade` | Upgrade packages installed globally to their latest version | | yh | `yarn help` | Show help for a yarn command | +| yi | `yarn init` | Interactively creates or updates a package.json file | | yin | `yarn install` | Install dependencies defined in `package.json` | | yls | `yarn list` | List installed packages | | yout | `yarn outdated` | Check for outdated package dependencies | +| yp | `yarn pack` | Create a compressed gzip archive of package dependencies | | yrm | `yarn remove` | Remove installed packages | | yrun | `yarn run` | Run a defined package script | +| ys | `yarn serve` | Start the dev server | | yst | `yarn start` | Run the start script defined in `package.json` | | yt | `yarn test` | Run the test script defined in `package.json` | | yuc | `yarn global upgrade && yarn cache clean` | Upgrade global packages and clean yarn's global cache | diff --git a/plugins/yarn/yarn.plugin.zsh b/plugins/yarn/yarn.plugin.zsh index fe752357f..9ed8322cd 100644 --- a/plugins/yarn/yarn.plugin.zsh +++ b/plugins/yarn/yarn.plugin.zsh @@ -4,13 +4,19 @@ alias yad="yarn add --dev" alias yap="yarn add --peer" alias yb="yarn build" alias ycc="yarn cache clean" +alias yga="yarn global add" +alias ygls="yarn global list" +alias ygrm="yarn global remove" alias ygu="yarn global upgrade" alias yh="yarn help" +alias yi="yarn init" alias yin="yarn install" alias yls="yarn list" alias yout="yarn outdated" +alias yp="yarn pack" alias yrm="yarn remove" alias yrun="yarn run" +alias ys="yarn serve" alias yst="yarn start" alias yt="yarn test" alias yuc="yarn global upgrade && yarn cache clean" From dc3a605ec1cd7fb2476074ce47f74b0b5093ab46 Mon Sep 17 00:00:00 2001 From: Erwan ROUSSEL Date: Sun, 28 Oct 2018 19:28:15 +0100 Subject: [PATCH 0058/1098] Add symfony2 aliases (#7338) * Documentation for Npm plugin added * Fix style and add alias descriptions * Add Generate Command alias * Add Create Database alias * Add Generate Controller alias --- plugins/symfony2/README.md | 3 +++ plugins/symfony2/symfony2.plugin.zsh | 3 +++ 2 files changed, 6 insertions(+) diff --git a/plugins/symfony2/README.md b/plugins/symfony2/README.md index 562641dfb..2946d0937 100644 --- a/plugins/symfony2/README.md +++ b/plugins/symfony2/README.md @@ -19,7 +19,10 @@ plugins=(... symfony2) | `sfroute` | sf debug:router | Show the different routes | | `sfcontainer` | sf debug:contaner | List the different services | | `sfgb` | sf generate:bundle | Generate a bundle | +| `sfgc` | sf generate:controller | Generate a controller | +| `sfgcom` | sf generate:command | Generate a command | | `sfge` | sf doctrine:generate:entity | Generate an entity | | `sfsu` | sf doctrine:schema:update | Update the schema in Database | +| `sfdc` | sf doctrine:database:create | Create the Database | | `sfdev` | sf --env=dev | Update environment to `dev` | | `sfprod` | sf --env=prod | Update environment to `prod` | diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh index 0b608fe2a..1498e8d02 100644 --- a/plugins/symfony2/symfony2.plugin.zsh +++ b/plugins/symfony2/symfony2.plugin.zsh @@ -25,7 +25,10 @@ alias sfcw='sf cache:warmup' alias sfroute='sf debug:router' alias sfcontainer='sf debug:container' alias sfgb='sf generate:bundle' +alias sfgc='sf generate:controller' +alias sfgcom='sf generate:command' alias sfge='sf doctrine:generate:entity' alias sfsu='sf doctrine:schema:update' +alias sfdc='sf doctrine:database:create' alias sfdev='sf --env=dev' alias sfprod='sf --env=prod' From e83a4c81845885f378843cb0e9726592d964aafe Mon Sep 17 00:00:00 2001 From: Akash Krishnan Date: Tue, 30 Oct 2018 02:41:02 +0530 Subject: [PATCH 0059/1098] cabal: add README (#7367) --- plugins/cabal/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 plugins/cabal/README.md diff --git a/plugins/cabal/README.md b/plugins/cabal/README.md new file mode 100644 index 000000000..b1106c40f --- /dev/null +++ b/plugins/cabal/README.md @@ -0,0 +1,9 @@ +# Cabal + +This plugin provides completion for [Cabal](https://www.haskell.org/cabal/), a build tool for Haskell. It +also provides a function `cabal_sandbox_info` that prints whether the current working directory is in a sandbox. + +To use it, add cabal to the plugins array of your zshrc file: +``` +plugins=(... cabal) +``` From 30125e10a60134e08f9ce411f2b2ebdd67face35 Mon Sep 17 00:00:00 2001 From: Erwan ROUSSEL Date: Tue, 30 Oct 2018 15:55:35 +0100 Subject: [PATCH 0060/1098] bwana: add README (#7369) --- plugins/bwana/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 plugins/bwana/README.md diff --git a/plugins/bwana/README.md b/plugins/bwana/README.md new file mode 100644 index 000000000..8cbeaa32e --- /dev/null +++ b/plugins/bwana/README.md @@ -0,0 +1,9 @@ +# Bwana + +This plugin provides a function to open `man` pages directly with [Bwana](https://www.bruji.com/bwana/). + +To use it add bwana to the plugins array in your zshrc file. + +```bash +plugins=(... bwana) +``` From 78935f7cf74e5092002dc66df875879aea502c86 Mon Sep 17 00:00:00 2001 From: Erwan ROUSSEL Date: Thu, 1 Nov 2018 15:17:25 +0100 Subject: [PATCH 0061/1098] ant: add README (#7375) --- plugins/ant/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 plugins/ant/README.md diff --git a/plugins/ant/README.md b/plugins/ant/README.md new file mode 100644 index 000000000..5f88984ac --- /dev/null +++ b/plugins/ant/README.md @@ -0,0 +1,12 @@ +# Ant + +This plugin provides completion for [Ant](https://ant.apache.org/). + +To use it add ant to the plugins array in your zshrc file. + +```bash +plugins=(... ant) +``` + +It caches ant targets in a file named `.ant_targets`, you might want to add that to +your `.gitignore` file. From 5c91cfcb061aafbffe7b60f22c23a3ed580fdf2a Mon Sep 17 00:00:00 2001 From: Erwan ROUSSEL Date: Thu, 1 Nov 2018 15:29:05 +0100 Subject: [PATCH 0062/1098] capistrano: add README (#7376) --- plugins/capistrano/README.md | 14 ++++++++++++++ plugins/capistrano/capistrano.plugin.zsh | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 plugins/capistrano/README.md diff --git a/plugins/capistrano/README.md b/plugins/capistrano/README.md new file mode 100644 index 000000000..335b794fa --- /dev/null +++ b/plugins/capistrano/README.md @@ -0,0 +1,14 @@ +# Capistrano + +This plugin provides completion for [Capistrano](https://capistranorb.com/). + +To use it add capistrano to the plugins array in your zshrc file. + +```bash +plugins=(... capistrano) +``` + +For a working completion use the `capit` command instead of `cap`, because cap is a +[reserved word in zsh](http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fcap-Module). + +`capit` automatically runs cap with bundler if a Gemfile is found. diff --git a/plugins/capistrano/capistrano.plugin.zsh b/plugins/capistrano/capistrano.plugin.zsh index 0b5559791..819572825 100644 --- a/plugins/capistrano/capistrano.plugin.zsh +++ b/plugins/capistrano/capistrano.plugin.zsh @@ -1,7 +1,7 @@ -# Added `shipit` because `cap` is a reserved word. `cap` completion doesn't work. +# Added `capit` because `cap` is a reserved word. `cap` completion doesn't work. # http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fcap-Module -func capit() { +function capit() { if [ -f Gemfile ] then bundle exec cap $* From 545446a3db0c7e7a2a7e44985b9d0459c347dc49 Mon Sep 17 00:00:00 2001 From: Erwan ROUSSEL Date: Thu, 1 Nov 2018 15:42:18 +0100 Subject: [PATCH 0063/1098] cpanm: add README (#7377) --- plugins/cpanm/README.md | 9 +++++++++ plugins/cpanm/_cpanm | 3 --- 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 plugins/cpanm/README.md diff --git a/plugins/cpanm/README.md b/plugins/cpanm/README.md new file mode 100644 index 000000000..3803e3e00 --- /dev/null +++ b/plugins/cpanm/README.md @@ -0,0 +1,9 @@ +# Cpanm + +This plugin provides completion for [Cpanm](https://github.com/miyagawa/cpanminus) ([docs](https://metacpan.org/pod/App::cpanminus)). + +To use it add cpanm to the plugins array in your zshrc file. + + ```bash +plugins=(... cpanm) +``` diff --git a/plugins/cpanm/_cpanm b/plugins/cpanm/_cpanm index 58451d35a..ff9ae1c15 100644 --- a/plugins/cpanm/_cpanm +++ b/plugins/cpanm/_cpanm @@ -6,9 +6,6 @@ # # Current supported cpanm version: 1.4000 (Tue Mar 8 01:00:49 PST 2011) # -# The latest code is always located at: -# https://github.com/rshhh/cpanminus/blob/master/etc/_cpanm -# local arguments curcontext="$curcontext" typeset -A opt_args From fa9d93008b2c9d42f26320c92752f4f019c47404 Mon Sep 17 00:00:00 2001 From: Erwan ROUSSEL Date: Thu, 1 Nov 2018 16:40:31 +0100 Subject: [PATCH 0064/1098] fabric: add README (#7378) --- plugins/fabric/README.md | 9 +++++++++ plugins/fabric/{_fab => _fabric} | 0 plugins/fabric/fabric.plugin.zsh | 1 - 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 plugins/fabric/README.md rename plugins/fabric/{_fab => _fabric} (100%) delete mode 100644 plugins/fabric/fabric.plugin.zsh diff --git a/plugins/fabric/README.md b/plugins/fabric/README.md new file mode 100644 index 000000000..cf0fa81f4 --- /dev/null +++ b/plugins/fabric/README.md @@ -0,0 +1,9 @@ +# Fabric + +This plugin provides completion for [Fabric](https://www.fabfile.org/). + +To use it add fabric to the plugins array in your zshrc file. + +```bash +plugins=(... fabric) +``` diff --git a/plugins/fabric/_fab b/plugins/fabric/_fabric similarity index 100% rename from plugins/fabric/_fab rename to plugins/fabric/_fabric diff --git a/plugins/fabric/fabric.plugin.zsh b/plugins/fabric/fabric.plugin.zsh deleted file mode 100644 index aca411329..000000000 --- a/plugins/fabric/fabric.plugin.zsh +++ /dev/null @@ -1 +0,0 @@ -# DECLARION: This plugin was created by vhbit. What I did is just making a portal from https://github.com/vhbit/fabric-zsh-autocomplete. From 95a3b2768033627d9ba3e347f368dffae92906b7 Mon Sep 17 00:00:00 2001 From: Joseph Benden Date: Thu, 1 Nov 2018 15:07:58 -0700 Subject: [PATCH 0065/1098] Add keychain plugin This plugin integrates the Keychain tool[1] in to the project. [1] [keychain](https://www.funtoo.org/Keychain) --- plugins/keychain/README.md | 45 ++++++++++++++++++++++++++++ plugins/keychain/keychain.plugin.zsh | 32 ++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 plugins/keychain/README.md create mode 100644 plugins/keychain/keychain.plugin.zsh diff --git a/plugins/keychain/README.md b/plugins/keychain/README.md new file mode 100644 index 000000000..c603f6790 --- /dev/null +++ b/plugins/keychain/README.md @@ -0,0 +1,45 @@ +# keychain plugin + +This plugin starts automatically [`keychain`](https://www.funtoo.org/Keychain) +to set up and load whichever credentials you want for both gpg and ssh +connections. + +To enable it, add `keychain` to your plugins: + +```zsh +plugins=(... keychain) +``` + +**NOTE**: It is HIGHLY recommended to also enable the `gpg-agent` plugin. + +## Instructions + +**IMPORTANT: put these settings _before_ the line that sources oh-my-zsh** + +**To adjust the agents** that keychain manages, use the `agents` style as +shown below. By default, only the `gpg` agent is managed. + +```zsh +zstyle :omz:plugins:keychain agents gpg,ssh +``` + +To **load multiple identities** use the `identities` style, For example: + +```zsh +zstyle :omz:plugins:keychain identities id_ed25519 id_github 2C5879C2 +``` + +**To pass additional options** to the `keychain` program, use the +`options` style; for example: + +```zsh +zstyle :omz:plugins:keychain options --quiet +``` + +## Credits + +Based on code from the `ssh-agent` plugin. + +## References + +- [Keychain](https://www.funtoo.org/Keychain) diff --git a/plugins/keychain/keychain.plugin.zsh b/plugins/keychain/keychain.plugin.zsh new file mode 100644 index 000000000..af34793e7 --- /dev/null +++ b/plugins/keychain/keychain.plugin.zsh @@ -0,0 +1,32 @@ +function _start_agent() { + local agents + local -a identities + local -a options + local _keychain_env_sh + local _keychain_env_sh_gpg + + # load agents to start. + zstyle -s :omz:plugins:keychain agents agents + + # load identities to manage. + zstyle -a :omz:plugins:keychain identities identities + + # load additional options + zstyle -a :omz:plugins:keychain options options + + # start keychain... + keychain ${^options:-} --agents ${agents:-gpg} ${^identities} + + # Get the filenames to store/lookup the environment from + _keychain_env_sh="$HOME/.keychain/$SHORT_HOST-sh" + _keychain_env_sh_gpg="$HOME/.keychain/$SHORT_HOST-sh-gpg" + + # Source environment settings. + [ -f "$_keychain_env_sh" ] && . "$_keychain_env_sh" + [ -f "$_keychain_env_sh_gpg" ] && . "$_keychain_env_sh_gpg" +} + +_start_agent + +# tidy up after ourselves +unfunction _start_agent From 05b617066ba5a37ef0c533385efd6e232a387b8f Mon Sep 17 00:00:00 2001 From: Arvindraj Date: Fri, 2 Nov 2018 22:10:13 +0530 Subject: [PATCH 0066/1098] transfer: add deprecation notice (#7372) Fixes #7371 Signed-off-by: Arvindraj Co-authored-by: Stephen Ward --- plugins/transfer/README.md | 4 ++++ plugins/transfer/transfer.plugin.zsh | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/plugins/transfer/README.md b/plugins/transfer/README.md index 5fa064445..37c7ca2f7 100644 --- a/plugins/transfer/README.md +++ b/plugins/transfer/README.md @@ -1,5 +1,9 @@ # `transfer` plugin +**NOTICE: The `transfer` plugin is deprecated and will be removed soon, since the [transfer.sh](https://transfer.sh) service will be shutdown on 30th November 30th, 2018. Please move your files to an alternative file sharing service provider.** + +---- + [`transfer.sh`](https://transfer.sh) is an easy to use file sharing service from the command line ## Usage diff --git a/plugins/transfer/transfer.plugin.zsh b/plugins/transfer/transfer.plugin.zsh index 7a7cd85ec..8fd09ef04 100644 --- a/plugins/transfer/transfer.plugin.zsh +++ b/plugins/transfer/transfer.plugin.zsh @@ -12,6 +12,14 @@ # Modified to use tar command instead of zip # +echo -ne '\e[1;33m' +cat <<-EOF + [oh-my-zsh] WARNING: The 'transfer' plugin is deprecated and will be removed after + [oh-my-zsh] transfer.sh shuts down on November 30th. We suggest you stop using the + [oh-my-zsh] plugin and find an alternative file hosting service. +EOF +echo -ne '\e[0m' + curl --version 2>&1 > /dev/null if [ $? -ne 0 ]; then echo "Could not find curl." @@ -64,4 +72,4 @@ transfer() { # cleanup rm -f $tmpfile -} \ No newline at end of file +} From 209f1aa8d669622fa37fb48ecccefe2eea97813d Mon Sep 17 00:00:00 2001 From: Deepankumar Date: Sat, 3 Nov 2018 17:34:04 +0530 Subject: [PATCH 0067/1098] ansible plugin added --- plugins/ansible/README.md | 35 ++++++++++++++++++++++++++++++ plugins/ansible/ansible.plugin.zsh | 29 +++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 plugins/ansible/README.md create mode 100644 plugins/ansible/ansible.plugin.zsh diff --git a/plugins/ansible/README.md b/plugins/ansible/README.md new file mode 100644 index 000000000..38bc13775 --- /dev/null +++ b/plugins/ansible/README.md @@ -0,0 +1,35 @@ +# ansible plugin + +## Introduction + +The `ansible plugin` adds several aliases for useful [ansible](https://docs.ansible.com/ansible/latest/index.html) commands and [aliases](#aliases). + +To use it, add `ansible` to the plugins array of your zshrc file: + +``` +plugins=(... ansible) +``` + +## Aliases + +| Command | Description | +|:-------------------------------------------|:--------------------------------------------------------------------| +| `ansible-version` / `aver` | Show the version on ansible installed in this host | +| `ansible-role-init ` / `arinit` | Creates the Ansible Role as per Ansible Galaxy standard | +| `a` | command `ansible` | +| `aconf` | command `ansible-config` | +| `acon` | command `ansible-console` | +| `aconn` | command `ansible-connection` | +| `ainv` | command `ansible-inventory` | +| `aplay` | command `ansible-playbook` | +| `ainv` | command `ansible-inventory` | +| `adoc` | command `ansible-doc` | +| `agal` | command `ansible-galaxy` | +| `apull` | command `ansible-pull` | +| `aval` | command `ansible-vault` | + +## Maintainer + +### [Deepankumar](https://github.com/deepan10) + +[https://github.com/deepan10/oh-my-zsh/tree/features/ansible-plugin](https://github.com/deepan10/oh-my-zsh/tree/features/ansible-plugin) diff --git a/plugins/ansible/ansible.plugin.zsh b/plugins/ansible/ansible.plugin.zsh new file mode 100644 index 000000000..0e7aff528 --- /dev/null +++ b/plugins/ansible/ansible.plugin.zsh @@ -0,0 +1,29 @@ +# Functions +function ansible-version(){ + ansible --version +} + +function ansible-role-init(){ + if ! [ -z $1] ; then + echo "Ansible Role : $1 Creating...." + ansible-galaxy init $1 + tree $1 + else + echo "Usage : ansible-role-init " + echo "Example : ansible-role-init role1" + fi +} + +# Alias +alias a='ansible ' +alias aconf='ansible-config ' +alias acon='ansible-console ' +alias aconn='ansible-connection ' +alias aver='ansible-version' +alias arinit='ansible-role-init' +alias aplay='ansible-playbook ' +alias ainv='ansible-inventory ' +alias adoc='ansible-doc ' +alias agal='ansible-galaxy ' +alias apull='ansible-pull ' +alias aval='ansible-vault' \ No newline at end of file From 3d8f2bda599c8c6d160dc448e5ab28aaf2d5e90d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 13 Nov 2018 10:54:33 +0100 Subject: [PATCH 0068/1098] Revert "transfer: add deprecation notice (#7372)" (#7402) This reverts commit 05b617066ba5a37ef0c533385efd6e232a387b8f. --- plugins/transfer/README.md | 4 ---- plugins/transfer/transfer.plugin.zsh | 10 +--------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/plugins/transfer/README.md b/plugins/transfer/README.md index 37c7ca2f7..5fa064445 100644 --- a/plugins/transfer/README.md +++ b/plugins/transfer/README.md @@ -1,9 +1,5 @@ # `transfer` plugin -**NOTICE: The `transfer` plugin is deprecated and will be removed soon, since the [transfer.sh](https://transfer.sh) service will be shutdown on 30th November 30th, 2018. Please move your files to an alternative file sharing service provider.** - ----- - [`transfer.sh`](https://transfer.sh) is an easy to use file sharing service from the command line ## Usage diff --git a/plugins/transfer/transfer.plugin.zsh b/plugins/transfer/transfer.plugin.zsh index 8fd09ef04..7a7cd85ec 100644 --- a/plugins/transfer/transfer.plugin.zsh +++ b/plugins/transfer/transfer.plugin.zsh @@ -12,14 +12,6 @@ # Modified to use tar command instead of zip # -echo -ne '\e[1;33m' -cat <<-EOF - [oh-my-zsh] WARNING: The 'transfer' plugin is deprecated and will be removed after - [oh-my-zsh] transfer.sh shuts down on November 30th. We suggest you stop using the - [oh-my-zsh] plugin and find an alternative file hosting service. -EOF -echo -ne '\e[0m' - curl --version 2>&1 > /dev/null if [ $? -ne 0 ]; then echo "Could not find curl." @@ -72,4 +64,4 @@ transfer() { # cleanup rm -f $tmpfile -} +} \ No newline at end of file From b1424e289375439eef04254f3817dc3fa4b18a8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Fri, 16 Nov 2018 19:40:06 +0100 Subject: [PATCH 0069/1098] tmux: use echoti instead of tput for FreeBSD compatibility Fixes #7407 FreeBSD's tput needs termcap codes instead of terminfo capnames, so using `tput colors` has the wrong effect. See #7407 --- plugins/tmux/tmux.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 7ddf42099..64687641c 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -36,7 +36,7 @@ alias tkss='tmux kill-session -t' : ${ZSH_TMUX_FIXTERM_WITH_256COLOR:=screen-256color} # Determine if the terminal supports 256 colors -if [[ $(tput colors) == 256 ]]; then +if [[ $(echoti colors) == 256 ]]; then export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITH_256COLOR else export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR From ad69c7a82f25857343f3d57a77466da790f0e65e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Fri, 16 Nov 2018 18:55:07 +0000 Subject: [PATCH 0070/1098] fabric: rename completion back to _fab Fixes #7405 --- plugins/fabric/{_fabric => _fab} | 0 plugins/fabric/fabric.plugin.zsh | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename plugins/fabric/{_fabric => _fab} (100%) create mode 100644 plugins/fabric/fabric.plugin.zsh diff --git a/plugins/fabric/_fabric b/plugins/fabric/_fab similarity index 100% rename from plugins/fabric/_fabric rename to plugins/fabric/_fab diff --git a/plugins/fabric/fabric.plugin.zsh b/plugins/fabric/fabric.plugin.zsh new file mode 100644 index 000000000..e69de29bb From e8aba1bf5912f89f408eaebd1bc74c25ba32a62c Mon Sep 17 00:00:00 2001 From: Ricardo Seriani Date: Fri, 16 Nov 2018 18:53:29 -0300 Subject: [PATCH 0071/1098] golang: support "go help environment" in autocompletion (#7404) Signed-off-by: Ricardo Seriani --- plugins/golang/golang.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/golang/golang.plugin.zsh b/plugins/golang/golang.plugin.zsh index 919c98629..8284ab83c 100644 --- a/plugins/golang/golang.plugin.zsh +++ b/plugins/golang/golang.plugin.zsh @@ -126,6 +126,7 @@ __go_tool_complete() { ;; help) _values "${commands[@]}" \ + 'environment[show Go environment variables available]' \ 'gopath[GOPATH environment variable]' \ 'packages[description of package lists]' \ 'remote[remote import path syntax]' \ From e780209c33883d0ecab39dd50663e2e1424250c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 26 Nov 2018 19:57:52 +0100 Subject: [PATCH 0072/1098] tmux: use $terminfo to avoid echoti errors See https://github.com/robbyrussell/oh-my-zsh/issues/7407#issuecomment-441665143 --- plugins/tmux/tmux.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 64687641c..2f3c3e79d 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -36,7 +36,7 @@ alias tkss='tmux kill-session -t' : ${ZSH_TMUX_FIXTERM_WITH_256COLOR:=screen-256color} # Determine if the terminal supports 256 colors -if [[ $(echoti colors) == 256 ]]; then +if [[ $terminfo[colors] == 256 ]]; then export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITH_256COLOR else export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR From 0a59baf4c526b95fe6137397be6b1b8b63d1daba Mon Sep 17 00:00:00 2001 From: Sagar Patil Date: Wed, 28 Nov 2018 03:27:07 +0530 Subject: [PATCH 0073/1098] debian: add README (#7438) --- plugins/debian/README.md | 75 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 plugins/debian/README.md diff --git a/plugins/debian/README.md b/plugins/debian/README.md new file mode 100644 index 000000000..a676674dc --- /dev/null +++ b/plugins/debian/README.md @@ -0,0 +1,75 @@ +# debian + +This plugin provides debian related zsh aliases. +To use it add `debian` to the plugins array in your zshrc file. + +```zsh +plugins=(... debian) +``` + +## Common Aliases + +| Alias | Command | Description | +| -------- | ------------------------------------------------------------------------------|--------------------------------------------------------------------------- | +| `age` | apt-get | Command line tool for handling packages | +| `api` | aptitude | Same functionality as `apt-get`, provides extra options while installation | +| `acs` | apt-cache search | Command line tool for searching apt software package cache | +| `aps` | aptitude search | Searches installed packages using aptitude | +| `as` | aptitude -F \"* %p -> %d \n(%v/%V)\" \ -no-gui --disable-columns search | - | +| `afs` | apt-file search --regexp | Search file in packages | +| `asrc` | apt-get source | Fetch source packages through `apt-get` | +| `app` | apt-cache policy | Displays priority of package sources | + +## Superuser Operations Aliases + +| Alias | Command | Description | +| -------- | -------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------- | +| `aac` | sudo $apt_pref autoclean | Clears out the local repository of retrieved package files | +| `abd` | sudo $apt_pref build-dep | Installs all dependencies for building packages | +| `ac` | sudo $apt_pref clean | Clears out the local repository of retrieved package files except lock files | +| `ad` | sudo $apt_pref update | Updates the package lists for upgrades for packages | +| `adg` | sudo $apt_pref update && sudo $apt_pref $apt_upgr | Update and upgrade packages | +| `adu` | sudo $apt_pref update && sudo $apt_pref dist-upgrade | Smart upgrade that handles dependencies | +| `afu` | sudo apt-file update | Update the files in packages | +| `au` | sudo $apt_pref $apt_upgr | - | +| `ai` | sudo $apt_pref install | Command-line tool to install package | +| `ail` | sed -e 's/ */ /g' -e 's/ *//' | cut -s -d ' ' -f 1 | "' xargs sudo $apt_pref install | Install all packages given on the command line while using only the first word of each line | +| `ap` | sudo $apt_pref purge | Removes packages along with configuration files | +| `ar` | sudo $apt_pref remove | Removes packages, keeps the configuration files | +| `ads` | sudo apt-get dselect-upgrade | Installs packages from list and removes all not in the list | +| `dia` | sudo dpkg -i ./*.deb | Install all .deb files in the current directory | +| `di` | sudo dpkg -i | Install all .deb files in the current directory | +| `kclean` | sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) ?not(~n`uname -r`)) | Remove ALL kernel images and headers EXCEPT the one in use | + +- `$apt_pref` - Use apt or aptitude if installed, fallback is apt-get. +- `$apt_upgr` - Use upgrade. + +## Aliases - Commands using `su` + +| Alias | Command | +| -------- | ------------------------------------------------------------------------------| +| `aac` | su -ls \'$apt_pref autoclean\' root | +| `ac` | su -ls \'$apt_pref clean\' root | +| `ad` | su -lc \'$apt_pref update\' root | +| `adg` | su -lc \'$apt_pref update && aptitude $apt_upgr\' root | +| `adu` | su -lc \'$apt_pref update && aptitude dist-upgrade\' root | +| `afu` | su -lc "apt-file update | +| `ag` | su -lc \'$apt_pref $apt_upgr\' root | +| `dia` | su -lc "dpkg -i ./*.deb" root | + +## Miscellaneous Aliases + +| Alias | Command | Description | +| -------- | -------------------------------------------------|---------------------------------------- | +| `allpkgs`| aptitude search -F "%p" --disable-columns ~i | Display all installed packages | +| `mydeb` | time dpkg-buildpackage -rfakeroot -us -uc | Create a basic .deb package | + +## Functions + +| Fucntion | Description | +|-----------------------|-------------------------------------------------------------------------------| +| `apt-copy` | Create a simple script that can be used to 'duplicate' a system | +| `apt-history` | Displays apt history for a command | +| `kerndeb` | Builds kernel packages | +| `apt-list-packages` | List packages by size | + From 2614b7ecdfe8b8f0cbeafffefb5925196f4011d4 Mon Sep 17 00:00:00 2001 From: Igor Kapkov Date: Wed, 28 Nov 2018 08:58:36 +1100 Subject: [PATCH 0074/1098] osx: fix rmdsstore function definition (#7443) --- plugins/osx/osx.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh index 6a4b6eec4..a1c73a184 100644 --- a/plugins/osx/osx.plugin.zsh +++ b/plugins/osx/osx.plugin.zsh @@ -284,6 +284,6 @@ alias showfiles="defaults write com.apple.finder AppleShowAllFiles -bool true && alias hidefiles="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder" # Remove .DS_Store files recursively in a directory, default . -rmdsstore() { +function rmdsstore() { find "${@:-.}" -type f -name .DS_Store -delete } From cf07fe2c6f0ea1561e21189feb12592a21d10306 Mon Sep 17 00:00:00 2001 From: Frederick Zhang Date: Wed, 28 Nov 2018 14:50:45 +1100 Subject: [PATCH 0075/1098] -r is not available for bsd sed --- plugins/cargo/_cargo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/cargo/_cargo b/plugins/cargo/_cargo index 7d7d9b2d8..a8c58ecc5 100644 --- a/plugins/cargo/_cargo +++ b/plugins/cargo/_cargo @@ -421,7 +421,7 @@ local -a commands;commands=( 'verify-project:check Cargo.toml' 'version:show version information' 'yank:remove pushed file from index' -$( cargo --list | sed -n '1!p' | tr -s ' ' | cut -d ' ' -f 2 | egrep -v "^bench$|^build$|^clean$|^doc$|^fetch$|^generate-lockfile$|^git-checkout$|^help$|^init$|^install$|^locate-project$|^login$|^metadata$|^new$|^owner$|^package$|^pkgid$|^publish$|^read-manifest$|^run$|^rustc$|^rustdoc$|^search$|^test$|^uninstall$|^update$|^verify-project$|^version$|^yank$" | sed -r "s/(.*)/echo \"\1:$\(cargo help \1 2>\&1 | head -n 1\)\"/" | sh ) +$( cargo --list | sed -n '1!p' | tr -s ' ' | cut -d ' ' -f 2 | egrep -v "^bench$|^build$|^clean$|^doc$|^fetch$|^generate-lockfile$|^git-checkout$|^help$|^init$|^install$|^locate-project$|^login$|^metadata$|^new$|^owner$|^package$|^pkgid$|^publish$|^read-manifest$|^run$|^rustc$|^rustdoc$|^search$|^test$|^uninstall$|^update$|^verify-project$|^version$|^yank$" | sed "s/\(.*\)/echo \"\1:$\(cargo help \1 2>\&1 | head -n 1\)\"/" | sh ) ) _describe 'command' commands From a244d47131e1a638cdb5d0142004200de6872be8 Mon Sep 17 00:00:00 2001 From: Antu Acharjee Date: Thu, 20 Dec 2018 10:25:36 +0600 Subject: [PATCH 0076/1098] Added stackoverflow in /plugins/web-search/-web-search --- plugins/web-search/.web-search.plugin.zsh.swp | Bin 0 -> 12288 bytes plugins/web-search/web-search.plugin.zsh | 2 ++ 2 files changed, 2 insertions(+) create mode 100644 plugins/web-search/.web-search.plugin.zsh.swp diff --git a/plugins/web-search/.web-search.plugin.zsh.swp b/plugins/web-search/.web-search.plugin.zsh.swp new file mode 100644 index 0000000000000000000000000000000000000000..b8352f9ec2974a144a3eb6984b4534d3b3ab5da2 GIT binary patch literal 12288 zcmYc?2=nw+u+TGLU|?VnU|`6Ukd8Ub+{6?l#K4f4S5gWRCWJxibUpKm3o?uH^K?y3 z&CIdur~@g~cgZi$%gIknDb~-=(9NyXtt!sYFUToP&&(^Oo}n zs){qPn>#8x8UmvsKp+H4OVV^Lco~e148d7lSxHerSSXZ$rcvq95Eu=C(GVC7fzc2c z4S~@R7!85Z5Eu=C;S>TT1&j>!3=9lRP*2%IX+|^}${nRfLtr!nMnhmU1V%$(Gz3ON zU^E0qLtr!nMnhmU1V%$(Gz5lV2qdO3FqpA3F!*sm=Ko>+|EK&63{UtO7|!rBFzn`M zVA#daz%YlOfuW0^fuWI~fx(ZTfkBp^f#C%o1H*Pc28KF51_n<)1_miU28K7h3=BJY z85o**85qKO85rbw85pE_85pE^85myjFfg3tVPKfY!@w|+hk>Dohk>D+hk?PBhk-$x zhk-$uhk@Y?Hv_{mZU%<=+zbpY+zbpB+zbr7+zbpH+zbrt+zbpKxfmGUb1^Wy<6>ZV z%f-NOfs27*Jr@JR1TF@KJT3+XKQ0CaT`mR&9*{gI1H&0k28N}a3=D0Y3=Hv{3=DCc z3=B4$3=E>23=Ho$7#I$7Ffh#JU|=ZafQG{mjK@(YkA}c#2#kinXb6mkz`%t-Voqja zu|i5|a(1PydUI}+>DJcq-`K3h)`Q>>Eib;ui=?V}Jrxq(@ zq!y(zKz&+Vl9-&0ViZ^;zbv&VEhoPmW?^A@VqOV~GO!3tIz2x>r6@Hq1=a0vQJAvS z8*^7B#DfJI=^>G}ETIjB($5rQd5%FIKx0wkc$ zz`#(;prDXnkeU~toS&PUn3tlUq*7Xxqr||VppcfyprD|jP+F8@tE5t`k!7W?Z>6bH ztx;^HZ>3pUlv5n7Vi;Q+ZKz`uTdM?Cs;p34kds-WkW{IluCK16P?C|Fr%;rdm7kfX zP*9X#lAoNPqo84^sQ|JlB|kSYGfzRoNK>I8v8be2p**uBLqT0%Uma>zQfX#RiUL>> zD6l{dv0_kANX;ou1*?EM4DJ%J8?~)89iokNbPW-10$ZP0lwO*fnpaY+P>@($oSFi) zO&jLQ#Dap)855FM?cqO72sUZP;A z5F2X^_A`Tmf-=mU{33<)e2}>akEEo6?8?kbSIEy($SciFN-a{zPg6j5B2pX_rIwTy z3|cgx?_!(gT+-VC4`2`vR!* zKqUuM4?+_t7C{oo8eq{5DTyFj;9&;R0Fl7d0?N_08Vm{wC6xuK#i=CR}9Wp zDXD3odT~XKHR~PGU)_g07DOXmNa6X Date: Thu, 20 Dec 2018 10:41:33 +0600 Subject: [PATCH 0077/1098] Added stackoverflow in /plugins/web-search/-web-search --- plugins/web-search/.web-search.plugin.zsh.swp | Bin 12288 -> 0 bytes plugins/web-search/web-search.plugin.zsh | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 plugins/web-search/.web-search.plugin.zsh.swp diff --git a/plugins/web-search/.web-search.plugin.zsh.swp b/plugins/web-search/.web-search.plugin.zsh.swp deleted file mode 100644 index b8352f9ec2974a144a3eb6984b4534d3b3ab5da2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmYc?2=nw+u+TGLU|?VnU|`6Ukd8Ub+{6?l#K4f4S5gWRCWJxibUpKm3o?uH^K?y3 z&CIdur~@g~cgZi$%gIknDb~-=(9NyXtt!sYFUToP&&(^Oo}n zs){qPn>#8x8UmvsKp+H4OVV^Lco~e148d7lSxHerSSXZ$rcvq95Eu=C(GVC7fzc2c z4S~@R7!85Z5Eu=C;S>TT1&j>!3=9lRP*2%IX+|^}${nRfLtr!nMnhmU1V%$(Gz3ON zU^E0qLtr!nMnhmU1V%$(Gz5lV2qdO3FqpA3F!*sm=Ko>+|EK&63{UtO7|!rBFzn`M zVA#daz%YlOfuW0^fuWI~fx(ZTfkBp^f#C%o1H*Pc28KF51_n<)1_miU28K7h3=BJY z85o**85qKO85rbw85pE_85pE^85myjFfg3tVPKfY!@w|+hk>Dohk>D+hk?PBhk-$x zhk-$uhk@Y?Hv_{mZU%<=+zbpY+zbpB+zbr7+zbpH+zbrt+zbpKxfmGUb1^Wy<6>ZV z%f-NOfs27*Jr@JR1TF@KJT3+XKQ0CaT`mR&9*{gI1H&0k28N}a3=D0Y3=Hv{3=DCc z3=B4$3=E>23=Ho$7#I$7Ffh#JU|=ZafQG{mjK@(YkA}c#2#kinXb6mkz`%t-Voqja zu|i5|a(1PydUI}+>DJcq-`K3h)`Q>>Eib;ui=?V}Jrxq(@ zq!y(zKz&+Vl9-&0ViZ^;zbv&VEhoPmW?^A@VqOV~GO!3tIz2x>r6@Hq1=a0vQJAvS z8*^7B#DfJI=^>G}ETIjB($5rQd5%FIKx0wkc$ zz`#(;prDXnkeU~toS&PUn3tlUq*7Xxqr||VppcfyprD|jP+F8@tE5t`k!7W?Z>6bH ztx;^HZ>3pUlv5n7Vi;Q+ZKz`uTdM?Cs;p34kds-WkW{IluCK16P?C|Fr%;rdm7kfX zP*9X#lAoNPqo84^sQ|JlB|kSYGfzRoNK>I8v8be2p**uBLqT0%Uma>zQfX#RiUL>> zD6l{dv0_kANX;ou1*?EM4DJ%J8?~)89iokNbPW-10$ZP0lwO*fnpaY+P>@($oSFi) zO&jLQ#Dap)855FM?cqO72sUZP;A z5F2X^_A`Tmf-=mU{33<)e2}>akEEo6?8?kbSIEy($SciFN-a{zPg6j5B2pX_rIwTy z3|cgx?_!(gT+-VC4`2`vR!* zKqUuM4?+_t7C{oo8eq{5DTyFj;9&;R0Fl7d0?N_08Vm{wC6xuK#i=CR}9Wp zDXD3odT~XKHR~PGU)_g07DOXmNa6X Date: Mon, 31 Dec 2018 20:12:55 +0100 Subject: [PATCH 0079/1098] Remove duplicate space on the maran theme (#7454) --- themes/maran.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/maran.zsh-theme b/themes/maran.zsh-theme index 6fba04688..fddb7bc30 100644 --- a/themes/maran.zsh-theme +++ b/themes/maran.zsh-theme @@ -1,6 +1,6 @@ # Theme with full path names and hostname # Handy if you work on different servers all the time; -PROMPT='%{$fg[cyan]%}%n%{$reset_color%}@%{$fg[yellow]%}%M:%{$fg[green]%}%/%{$reset_color%} $(git_prompt_info) %(!.#.$) ' +PROMPT='%{$fg[cyan]%}%n%{$reset_color%}@%{$fg[yellow]%}%M:%{$fg[green]%}%/%{$reset_color%}$(git_prompt_info) %(!.#.$) ' ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[cyan]%}git:(" ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}" From 64976138b643b6adc1f46d9529d1d5fb2aa587e1 Mon Sep 17 00:00:00 2001 From: Andrew Imeson Date: Mon, 31 Dec 2018 14:13:31 -0500 Subject: [PATCH 0080/1098] Add new vagrant commands (#7455) * vagrant: Add `cloud` subcommand to completion * vagrant: Add `port` subcommand to completion * vagrant: Add `validate` subcommand to completion --- plugins/vagrant/_vagrant | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant index a99a8f0e7..2efb4473d 100644 --- a/plugins/vagrant/_vagrant +++ b/plugins/vagrant/_vagrant @@ -6,6 +6,7 @@ local -a _1st_arguments _1st_arguments=( 'box:Box commands' + 'cloud:Manages everything related to Vagrant Cloud' 'connect:Connects to a remotely shared Vagrant environment' 'destroy:Destroys the vagrant environment' 'docker-logs:Outputs the logs from the Docker container' @@ -18,6 +19,7 @@ _1st_arguments=( 'login:Authenticates against a Vagrant Cloud server to access protected boxes' 'package:Packages a vagrant environment for distribution' 'plugin:Plugin commands' + 'port:Displays information about guest port mappings' 'provision:Run the provisioner' 'push:Deploys code in this environment to a configured destination' 'rdp:Connects to machine via RDP' @@ -33,6 +35,7 @@ _1st_arguments=( 'suspend:Suspends the currently running vagrant environment' 'snapshot:Used to manage snapshots with the guest machine' 'up:Creates the vagrant environment' + 'validate:Validates the Vagrantfile' 'version:Prints current and latest Vagrant version' '--help:[TASK] Describe available tasks or one specific task' '--version:Prints the Vagrant version information' @@ -54,7 +57,7 @@ __task_list () local expl declare -a tasks - tasks=(box destroy halt init package provision reload resume ssh ssh_config status suspend up version) + tasks=(box destroy halt init package port provision reload resume ssh ssh_config status suspend up version) _wanted tasks expl 'help' compadd $tasks } @@ -123,7 +126,7 @@ case $state in (box) __vagrant-box ;; - (up|provision|package|destroy|reload|ssh|ssh-config|halt|resume|status) + (up|provision|port|package|destroy|reload|ssh|ssh-config|halt|resume|status) _arguments ':feature:__vm_list' esac ;; From d0c06d9ec840739623bbc2e1ae0b1f473187d7f2 Mon Sep 17 00:00:00 2001 From: Ben Davies Date: Mon, 31 Dec 2018 19:14:22 +0000 Subject: [PATCH 0081/1098] added svcat plugin (#7452) Including a Kubernetes Service Catalog plugin --- plugins/svcat/README.md | 9 +++++++++ plugins/svcat/svcat.plugin.zsh | 6 ++++++ 2 files changed, 15 insertions(+) create mode 100644 plugins/svcat/README.md create mode 100644 plugins/svcat/svcat.plugin.zsh diff --git a/plugins/svcat/README.md b/plugins/svcat/README.md new file mode 100644 index 000000000..0bc60b117 --- /dev/null +++ b/plugins/svcat/README.md @@ -0,0 +1,9 @@ +# svcat + +This plugin provides completion for the [Kubernetes service catalog cli](https://github.com/kubernetes-incubator/service-catalog). + +To use it, add `svcat` to the plugins array in your zshrc file. + +``` +plugins=(... svcat) +``` diff --git a/plugins/svcat/svcat.plugin.zsh b/plugins/svcat/svcat.plugin.zsh new file mode 100644 index 000000000..f90e7d8d6 --- /dev/null +++ b/plugins/svcat/svcat.plugin.zsh @@ -0,0 +1,6 @@ +# Autocompletion for svcat. +# + +if [ $commands[svcat] ]; then + source <(svcat completion zsh) +fi From 3c3766fdf5f64daa4a4e96bee56487314ebcd642 Mon Sep 17 00:00:00 2001 From: Alexander Huynh Date: Mon, 31 Dec 2018 14:15:14 -0500 Subject: [PATCH 0082/1098] Provide even spacing between marks (#7456) Before, when typing the `marks` command, longer mark keys would cause the tabs to spill over to the next tab stop, like so: rc -> /home/ahlex/.rc repos -> /home/ahlex/repos a-longer-string -> /tmp Implement better key display by running through all of the marks twice, once to get the longest key length, and the second time to format everything according to that length: rc -> /home/ahlex/.rc repos -> /home/ahlex/repos a-longer-string -> /tmp --- plugins/jump/jump.plugin.zsh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/jump/jump.plugin.zsh b/plugins/jump/jump.plugin.zsh index a19a86022..d161a6da0 100644 --- a/plugins/jump/jump.plugin.zsh +++ b/plugins/jump/jump.plugin.zsh @@ -28,11 +28,18 @@ unmark() { } marks() { + local max=0 + for link in $MARKPATH/*(@); do + if [[ ${#link:t} -gt $max ]]; then + max=${#link:t} + fi + done + local printf_markname_template="$(printf -- "%%%us " "$max")" for link in $MARKPATH/*(@); do local markname="$fg[cyan]${link:t}$reset_color" local markpath="$fg[blue]$(readlink $link)$reset_color" - printf "%s\t" $markname - printf -- "-> %s \t\n" $markpath + printf -- "$printf_markname_template" "$markname" + printf -- "-> %s\n" "$markpath" done } From 0cc1266c17204b84255f924f099152c9e4f0383f Mon Sep 17 00:00:00 2001 From: Anton Stamenov Date: Mon, 31 Dec 2018 21:15:56 +0200 Subject: [PATCH 0083/1098] aws_porfiles regex is catching more lines than profiles, thus breaking completion (#7469) --- plugins/aws/aws.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index f78e96ce3..af27e669a 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -35,7 +35,7 @@ function asp { } function aws_profiles { - reply=($(grep profile "${AWS_CONFIG_FILE:-$HOME/.aws/config}"|sed -e 's/.*profile \([a-zA-Z0-9_\.-]*\).*/\1/')) + reply=($(grep '\[profile' "${AWS_CONFIG_FILE:-$HOME/.aws/config}"|sed -e 's/.*profile \([a-zA-Z0-9_\.-]*\).*/\1/')) } compctl -K aws_profiles asp From 22e00b02efe63d3ee19a55dadbdea0bea1785942 Mon Sep 17 00:00:00 2001 From: Caleb Williams Date: Wed, 2 Jan 2019 14:12:13 -0600 Subject: [PATCH 0084/1098] Add Yarn Workspace command aliases --- plugins/yarn/yarn.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/yarn/yarn.plugin.zsh b/plugins/yarn/yarn.plugin.zsh index 9ed8322cd..7bdfdb48a 100644 --- a/plugins/yarn/yarn.plugin.zsh +++ b/plugins/yarn/yarn.plugin.zsh @@ -22,3 +22,5 @@ alias yt="yarn test" alias yuc="yarn global upgrade && yarn cache clean" alias yui="yarn upgrade-interactive" alias yup="yarn upgrade" +alias yw="yarn workspace" +alias yws="yarn workspaces" From 2596aef866e67425d450f8fc006ec0e216e01c93 Mon Sep 17 00:00:00 2001 From: Yusuf Kocaman Date: Mon, 7 Jan 2019 17:24:44 +0300 Subject: [PATCH 0085/1098] added change namespace and rolling restart functions for kubectl --- plugins/kubectl/kubectl.plugin.zsh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index 4cfe3f45b..fa74df164 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -59,6 +59,7 @@ alias kgns='kubectl get namespaces' alias kens='kubectl edit namespace' alias kdns='kubectl describe namespace' alias kdelns='kubectl delete namespace' +alias kcn='kubectl config set-context $(kubectl config current-context) --namespace' #change namespace # ConfigMap management alias kgcm='kubectl get configmaps' @@ -80,6 +81,10 @@ alias kdd='kubectl describe deployment' alias kdeld='kubectl delete deployment' alias ksd='kubectl scale deployment' alias krsd='kubectl rollout status deployment' +# Recreate all pods in deployment with zero-downtime +kres(){ + kubectl set env $@ REFRESHED_AT=$(date +%Y%m%d%H%M%S) +} # Rollout management. alias kgrs='kubectl get rs' From d8c71bbce128aaf9f774bf38b6dc573d1a29380d Mon Sep 17 00:00:00 2001 From: Yusuf Kocaman Date: Mon, 7 Jan 2019 17:35:39 +0300 Subject: [PATCH 0086/1098] added details about kcn and kres --- plugins/kubectl/README.md | 2 ++ plugins/kubectl/kubectl.plugin.zsh | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/kubectl/README.md b/plugins/kubectl/README.md index a93a9339e..b30f90548 100644 --- a/plugins/kubectl/README.md +++ b/plugins/kubectl/README.md @@ -46,6 +46,7 @@ plugins=(... kubectl) | kdeli | `kubectl delete ingress` | Delete ingress resources matching passed argument | | | | **Namespace management** | | kgns | `kubectl get namespaces` | List the current namespaces in a cluster | +| kcn | `kubectl config set-context ...` | Change current namespace | | kens | `kubectl edit namespace` | Edit namespace resource from the default editor | | kdns | `kubectl describe namespace` | Describe namespace resource in detail | | kdelns | `kubectl delete namespace` | Delete the namespace. WARNING! This deletes everything in the namespace | @@ -67,6 +68,7 @@ plugins=(... kubectl) | kdeld | `kubectl delete deployment` | Delete the deployment | | ksd | `kubectl scale deployment` | Scale a deployment | | krsd | `kubectl rollout status deployment` | Check the rollout status of a deployment | +| kres | `kubectl set env $@ REFRESHED_AT=...` | Recreate all pods in deployment with zero-downtime | | | | **Rollout management** | | kgrs | `kubectl get rs` | To see the ReplicaSet `rs` created by the deployment | | krh | `kubectl rollout history` | Check the revisions of this deployment | diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index fa74df164..d388d6543 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -59,7 +59,7 @@ alias kgns='kubectl get namespaces' alias kens='kubectl edit namespace' alias kdns='kubectl describe namespace' alias kdelns='kubectl delete namespace' -alias kcn='kubectl config set-context $(kubectl config current-context) --namespace' #change namespace +alias kcn='kubectl config set-context $(kubectl config current-context) --namespace' # ConfigMap management alias kgcm='kubectl get configmaps' @@ -81,7 +81,6 @@ alias kdd='kubectl describe deployment' alias kdeld='kubectl delete deployment' alias ksd='kubectl scale deployment' alias krsd='kubectl rollout status deployment' -# Recreate all pods in deployment with zero-downtime kres(){ kubectl set env $@ REFRESHED_AT=$(date +%Y%m%d%H%M%S) } From fabee55948776e2e4c210e9dcd75e7bc38c02bec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 9 Jan 2019 21:19:52 +0100 Subject: [PATCH 0087/1098] ssh-agent: autoload identities not already loaded (#7174) With this PR the ssh-agent plugin checks the `ssh-add -l` output for the identities added, and adds all those specified by the user that haven't been added yet. We also decouple the logic of starting ssh-agent from the logic of adding identities, meaning that even if ssh-agent has been started by some other means (like launchd) we can still ssh-add the user's identities. Fixes #3019 Fixes #6979 --- plugins/ssh-agent/ssh-agent.plugin.zsh | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index fe4946c6d..a688855d0 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -2,20 +2,27 @@ typeset _agent_forwarding _ssh_env_cache function _start_agent() { local lifetime - local -a identities - - # start ssh-agent and setup environment zstyle -s :omz:plugins:ssh-agent lifetime lifetime + # start ssh-agent and setup environment + echo starting ssh-agent... ssh-agent -s ${lifetime:+-t} ${lifetime} | sed 's/^echo/#echo/' >! $_ssh_env_cache chmod 600 $_ssh_env_cache . $_ssh_env_cache > /dev/null +} - # load identies +function _add_identities() { + local id line + local -a identities ids zstyle -a :omz:plugins:ssh-agent identities identities - echo starting ssh-agent... - ssh-add $HOME/.ssh/${^identities} + # get list of loaded identities + for line in ${(f)"$(ssh-add -l)"}; do ids+=${${(z)line}[3]}; done + + # add identities if not already loaded + for id in ${^identities}; do + [[ ${ids[(I)$HOME/.ssh/$id]} -le 0 ]] && ssh-add $HOME/.ssh/$id + done } # Get the filename to store/lookup the environment from @@ -42,6 +49,8 @@ else _start_agent fi +_add_identities + # tidy up after ourselves unset _agent_forwarding _ssh_env_cache -unfunction _start_agent +unfunction _start_agent _add_identities From 2a603856598eafc3c8a0bde80f8a885d2a81dfee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Scala?= Date: Mon, 14 Jan 2019 16:38:45 +0100 Subject: [PATCH 0088/1098] ssh-agent: use key signatures to check loaded ids (#7504) Use fingerprint of ssh key instead of file name to control if the key is already loaded. Also check for .ssh folder presence (#5128) --- plugins/ssh-agent/ssh-agent.plugin.zsh | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index a688855d0..2a860f3aa 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -12,16 +12,28 @@ function _start_agent() { } function _add_identities() { - local id line - local -a identities ids + local id line sig + local -a identities loaded signatures zstyle -a :omz:plugins:ssh-agent identities identities - # get list of loaded identities - for line in ${(f)"$(ssh-add -l)"}; do ids+=${${(z)line}[3]}; done + # check for .ssh folder presence + if [[ ! -d $HOME/.ssh ]]; then + return + fi + + # get list of loaded identities' signatures + for line in ${(f)"$(ssh-add -l)"}; do loaded+=${${(z)line}[2]}; done + + # get signatures of private keys + for id in $identities; do + signatures+="$(ssh-keygen -lf "$HOME/.ssh/$id" | awk '{print $2}') $id" + done # add identities if not already loaded - for id in ${^identities}; do - [[ ${ids[(I)$HOME/.ssh/$id]} -le 0 ]] && ssh-add $HOME/.ssh/$id + for sig in $signatures; do + id="$(cut -f2 <<< $sig)" + sig="$(cut -f1 <<< $sig)" + [[ ${loaded[(I)$sig]} -le 0 ]] && ssh-add $HOME/.ssh/$id done } From 9329efd2522b3eaba5f6d9d53e41c090eb6b3c92 Mon Sep 17 00:00:00 2001 From: Andreas Date: Mon, 14 Jan 2019 16:42:14 +0100 Subject: [PATCH 0089/1098] ssh-agent: autoload identities in one go (#7507) With this PR the ssh-agent plugin loads all identities which are not yet loaded in a single call to ssh-add. If a passphrase is shared between loaded identities it only needs to be entered once. Fixes #7506 --- plugins/ssh-agent/ssh-agent.plugin.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index 2a860f3aa..1cc5630e1 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -13,7 +13,7 @@ function _start_agent() { function _add_identities() { local id line sig - local -a identities loaded signatures + local -a identities loaded not_loaded signatures zstyle -a :omz:plugins:ssh-agent identities identities # check for .ssh folder presence @@ -33,8 +33,10 @@ function _add_identities() { for sig in $signatures; do id="$(cut -f2 <<< $sig)" sig="$(cut -f1 <<< $sig)" - [[ ${loaded[(I)$sig]} -le 0 ]] && ssh-add $HOME/.ssh/$id + [[ ${loaded[(I)$sig]} -le 0 ]] && not_loaded+="$HOME/.ssh/$id" done + + if [[ -n "$not_loaded" ]] && ssh-add ${^not_loaded} } # Get the filename to store/lookup the environment from From 026e4e499e6b01ebe4b6d9748c6e2eb182ad1359 Mon Sep 17 00:00:00 2001 From: Jackson Delahunt Date: Wed, 16 Jan 2019 05:01:34 +1100 Subject: [PATCH 0090/1098] installer: make TEST_CURRENT_SHELL use basename (#7514) Fixes #7492 --- tools/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/install.sh b/tools/install.sh index 0cc020053..2fb87cdaf 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -79,7 +79,7 @@ main() { mv -f ~/.zshrc-omztemp ~/.zshrc # If this user's login shell is not already "zsh", attempt to switch. - TEST_CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)') + TEST_CURRENT_SHELL=$(basename "$SHELL") if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then # If this platform provides a "chsh" command (not Cygwin), do it, man! if hash chsh >/dev/null 2>&1; then From 586ca16902d9dae4d95d5256a824572f60219c83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ing=2E=20Jan=20Kal=C3=A1b?= Date: Tue, 15 Jan 2019 19:03:07 +0100 Subject: [PATCH 0091/1098] extract: add AAR Android archive support (#7511) --- plugins/extract/README.md | 1 + plugins/extract/_extract | 2 +- plugins/extract/extract.plugin.zsh | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/extract/README.md b/plugins/extract/README.md index c6bdd36dd..83b878c32 100644 --- a/plugins/extract/README.md +++ b/plugins/extract/README.md @@ -19,6 +19,7 @@ plugins=(... extract) | `7z` | 7zip file | | `Z` | Z archive (LZW) | | `apk` | Android app file | +| `aar` | Android library file | | `bz2` | Bzip2 file | | `deb` | Debian package | | `gz` | Gzip file | diff --git a/plugins/extract/_extract b/plugins/extract/_extract index 3baefa339..33d49fcc5 100644 --- a/plugins/extract/_extract +++ b/plugins/extract/_extract @@ -3,5 +3,5 @@ _arguments \ '(-r --remove)'{-r,--remove}'[Remove archive.]' \ - "*::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|whl|xpi|xz|zip)(-.)'" \ + "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lzma|rar|sublime-package|tar|tar.bz2|tar.gz|tar.xz|tar.zma|tbz|tbz2|tgz|tlz|txz|war|whl|xpi|xz|zip)(-.)'" \ && return 0 diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index 4c72ce870..5e9b9ff24 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -46,7 +46,7 @@ extract() { (*.xz) unxz "$1" ;; (*.lzma) unlzma "$1" ;; (*.z) uncompress "$1" ;; - (*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.whl) unzip "$1" -d $extract_dir ;; + (*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;; (*.rar) unrar x -ad "$1" ;; (*.7z) 7za x "$1" ;; (*.deb) From 9d1dd24e3568ebbcce093bb351ea776a0bf2c0ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 19 Jan 2019 18:00:04 +0100 Subject: [PATCH 0092/1098] ssh-agent: add default keys if no zstyle identities were set (#7520) --- plugins/ssh-agent/ssh-agent.plugin.zsh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index 1cc5630e1..0a204309e 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -21,6 +21,16 @@ function _add_identities() { return fi + # add default keys if no identities were set up via zstyle + # this is to mimic the call to ssh-add with no identities + if [[ ${#identities} -eq 0 ]]; then + # key list found on `ssh-add` man page's DESCRIPTION section + for id in id_rsa id_dsa id_ecdsa id_ed25519 identity; do + # check if file exists + [[ -f "$HOME/.ssh/$id" ]] && identities+=$id + done + fi + # get list of loaded identities' signatures for line in ${(f)"$(ssh-add -l)"}; do loaded+=${${(z)line}[2]}; done @@ -36,7 +46,7 @@ function _add_identities() { [[ ${loaded[(I)$sig]} -le 0 ]] && not_loaded+="$HOME/.ssh/$id" done - if [[ -n "$not_loaded" ]] && ssh-add ${^not_loaded} + [[ -n "$not_loaded" ]] && ssh-add ${^not_loaded} } # Get the filename to store/lookup the environment from From 7dab4f07e614ad2ebeabb4f3de0bbacb67317540 Mon Sep 17 00:00:00 2001 From: pahakalle Date: Sun, 20 Jan 2019 04:24:52 +0200 Subject: [PATCH 0093/1098] Added brew cask update --- plugins/brew/README.md | 2 ++ plugins/brew/brew.plugin.zsh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/plugins/brew/README.md b/plugins/brew/README.md index aab55ea39..c129a7652 100644 --- a/plugins/brew/README.md +++ b/plugins/brew/README.md @@ -17,3 +17,5 @@ plugins=(... brew) | bubo | `brew update && brew outdated` | Fetch the newest version of Homebrew and all formulae, then list outdated formulae. | | bubc | `brew upgrade && brew cleanup` | Upgrade outdated, unpinned brews (with existing install options), then removes stale lock files and outdated downloads for formulae and casks, and removes old versions of installed formulae. | | bubu | `bubo && bubc` | Updates Homebrew, lists outdated formulae, upgrades oudated and unpinned formulae, and removes stale and outdated downloads and versions. | +| bcubo | `brew update && brew cask outdated` | Fetch the newest version of Homebrew and all formulae, then list outdated casks. | +| bcubc | `brew cask reinstall $(brew cask outdated) && brew cleanup` | Updates outdated casks, then runs cleanup. | \ No newline at end of file diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh index 60b81f8ec..cfbaa3480 100644 --- a/plugins/brew/brew.plugin.zsh +++ b/plugins/brew/brew.plugin.zsh @@ -4,6 +4,8 @@ alias brewsp='brew list --pinned' alias bubo='brew update && brew outdated' alias bubc='brew upgrade && brew cleanup' alias bubu='bubo && bubc' +alias bcubo='brew update && brew cask outdated' +alias bcubc='brew cask reinstall $(brew cask outdated) && brew cleanup' if command mkdir "$ZSH_CACHE_DIR/.brew-completion-message" 2>/dev/null; then print -P '%F{yellow}'Oh My Zsh brew plugin: From 6db298c57a5a8901cc280f00ec38fffb527ac86d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 20 Jan 2019 17:20:26 +0100 Subject: [PATCH 0094/1098] misc: remove please alias to sudo Fixes #7527 --- lib/misc.zsh | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/misc.zsh b/lib/misc.zsh index f45c10757..b30822b50 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -23,7 +23,6 @@ env_default 'LESS' '-R' ## super user alias alias _='sudo' -alias please='sudo' ## more intelligent acking for ubuntu users if which ack-grep &> /dev/null; then From 3c16466a14516eb3c177e7eb0553adbe16f39890 Mon Sep 17 00:00:00 2001 From: neeasade Date: Sun, 20 Jan 2019 13:19:07 -0600 Subject: [PATCH 0095/1098] git: quote branch name in ggpull and ggpush (#7472) --- 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 45a706173..2251bae2e 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -155,10 +155,10 @@ compdef _git ggu=git-checkout alias ggpur='ggu' compdef _git ggpur=git-checkout -alias ggpull='git pull origin $(git_current_branch)' +alias ggpull='git pull origin "$(git_current_branch)"' compdef _git ggpull=git-checkout -alias ggpush='git push origin $(git_current_branch)' +alias ggpush='git push origin "$(git_current_branch)"' compdef _git ggpush=git-checkout alias ggsup='git branch --set-upstream-to=origin/$(git_current_branch)' From b9670d04092a461ae1db41080263b5a82bc1f958 Mon Sep 17 00:00:00 2001 From: Rehan Mahmood Date: Sun, 20 Jan 2019 14:31:23 -0500 Subject: [PATCH 0096/1098] template: change plugins definition to single line (#7498) --- templates/zshrc.zsh-template | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 7cd2a873b..abd2c8812 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -62,9 +62,7 @@ ZSH_THEME="robbyrussell" # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. -plugins=( - git -) +plugins=(git) source $ZSH/oh-my-zsh.sh From fcf1fe72c0057b5eccecd7ae9bfc2fe199cc9b3d Mon Sep 17 00:00:00 2001 From: "Z.Shang" Date: Tue, 22 Jan 2019 04:49:21 +1100 Subject: [PATCH 0097/1098] init ros plugin --- plugins/ros/README.mkd | 10 +++++++ plugins/ros/_ros | 64 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 plugins/ros/README.mkd create mode 100644 plugins/ros/_ros diff --git a/plugins/ros/README.mkd b/plugins/ros/README.mkd new file mode 100644 index 000000000..83573e499 --- /dev/null +++ b/plugins/ros/README.mkd @@ -0,0 +1,10 @@ +# Roswell Plugin + +This plugin adds completions and aliases for [Roswell](https://github.com/roswell/roswell/). + +To use it, add `ros` to the plugins array in your zshrc file: + +```zsh +plugins=(... ros) +``` + diff --git a/plugins/ros/_ros b/plugins/ros/_ros new file mode 100644 index 000000000..6a04d3c8f --- /dev/null +++ b/plugins/ros/_ros @@ -0,0 +1,64 @@ +#compdef ros +#autoload + +# roswell zsh completion, based on gem completion + +local -a _1st_arguments +_1st_arguments=( +'run: Run repl' +'install:Install a given implementation or a system for roswell environment' +'update:Update installed systems.' +'build:Make executable from script.' +'use:Change default implementation.' +'init:a new ros script, optionally based on a template.' +'fmt:Indent lisp source.' +'list:Information' +'template:[WIP] Manage templates' +'delete:Delete installed implementations' +'config:Get and set options' +'version:Show the roswell version information' +"help:Use \"ros help [command]\" for more information about a command."$'\n\t\t'"Use \"ros help [topic]\" for more information about the topic." +) + +#local expl + +_arguments \ + '(--version)'--version'[Print version information and quit]' \ + '(-w --wrap)'{-w,--wrap}'[\[CODE\] Run roswell with a shell wrapper CODE]' \ + '(-m --image)'{-m,--image}'[\[IMAGE\] continue from Lisp image IMAGE]' \ + '(-M --module)'{-M,--module}'[\[NAME\] Execute ros script found in ROSWELLPATH. (pythons -m)]' \ + '(-L --lisp)'{-L,--lisp}'[\[NAME\] Run roswell with a lisp impl NAME\[/VERSION\].]' \ + '(-l --load)'{-l,--load}'[\[FILE\] load lisp FILE while building]' \ + '(-S --source-registry)'{-S,--source-registry}'[\[X\] override source registry of asdf systems]' \ + '(-s --system --load-system)'{-s,--system,--load-system}'[\[SYSTEM\] load asdf SYSTEM while building]' \ + '(-p --package)'{-p,--package}'[\[PACKAGE\] change current package to \[PACKAGE\]]' \ + '(-sp --system-package)'{-sp,--system-package}'[\[SP\] combination of -s \[SP\] and -p \[SP\]]' \ + '(-e --eval)'{-e,--eval}'[\[FORM\] evaluate \[FORM\] while building]' \ + '--require'--require'[\[MODULE\] require \[MODULE\] while building]' \ + '(-q --quit)'{-q,--quit}'[quit lisp here]' \ + '(-r --restart)'{-r,--restart}'[\[FUNC\] restart from build by calling (\[FUNC\])]' \ + '(-E --entry)'{-E,--entry}'[\[FUNC\] restart from build by calling (\[FUNC\] argv)]' \ + '(-i --init)'{-i,--init}'[\[FORM\] evaluate \[FORM\] after restart]' \ + '(-ip --print)'{-ip,--print}'[\[FORM\] evaluate and princ \[FORM\] after restart]' \ + '(-iw --write)'{-iw,--write}'[\[FORM\] evaluate and write \[FORM\] after restart]' \ + '(-F --final)'{-F,--final}'[\[FORM\] evaluate \[FORM\] before dumping IMAGE]' \ + '(\+R --no-rc)'{\+R,--no-rc}'[skip /etc/rosrc, ~/.roswell/init.lisp]' \ + '(-A --asdf)'{-A,--asdf}'[use new asdf]' \ + '(\+Q --no-quicklisp)'{\+Q,--no-quicklisp}'[do not use quicklisp]' \ + '(-v --verbose)'{-v,--verbose}'[be quite noisy while building]' \ + '--quiet'--quiet'[be quite quiet while building default]' \ + '--test'--test'[for test purpose]' \ + '*:: :->subcmds' && return 0 + + +if (( CURRENT == 1 )); then + _describe -t commands "ros subcommand" _1st_arguments + return +fi + +# _files +case "$words[1]" in + -l|--load) + _files + ;; +esac From c4948696328eab3b954932eb940ec8ec97b12906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 21 Jan 2019 20:31:30 +0100 Subject: [PATCH 0098/1098] ssh-agent: check for loaded id filenames first (#7521) This change makes the plugin check if an identity is loaded by looking first at the key filename reported by `ssh-add -l`. This fixes the use case where ssh-keygen is not able to output the fingerprint of a key, such as the one reported on #7516. Now, for an identity to be passed onto ssh-add, it has to fail the match for a loaded identity, both filename and signature. --- plugins/ssh-agent/ssh-agent.plugin.zsh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index 0a204309e..a7a4ee33a 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -13,7 +13,7 @@ function _start_agent() { function _add_identities() { local id line sig - local -a identities loaded not_loaded signatures + local -a identities loaded_sigs loaded_ids not_loaded zstyle -a :omz:plugins:ssh-agent identities identities # check for .ssh folder presence @@ -31,19 +31,19 @@ function _add_identities() { done fi - # get list of loaded identities' signatures - for line in ${(f)"$(ssh-add -l)"}; do loaded+=${${(z)line}[2]}; done - - # get signatures of private keys - for id in $identities; do - signatures+="$(ssh-keygen -lf "$HOME/.ssh/$id" | awk '{print $2}') $id" + # get list of loaded identities' signatures and filenames + for line in ${(f)"$(ssh-add -l)"}; do + loaded_sigs+=${${(z)line}[2]} + loaded_ids+=${${(z)line}[3]} done # add identities if not already loaded - for sig in $signatures; do - id="$(cut -f2 <<< $sig)" - sig="$(cut -f1 <<< $sig)" - [[ ${loaded[(I)$sig]} -le 0 ]] && not_loaded+="$HOME/.ssh/$id" + for id in $identities; do + # check for filename match, otherwise try for signature match + if [[ ${loaded_ids[(I)$HOME/.ssh/$id]} -le 0 ]]; then + sig="$(ssh-keygen -lf "$HOME/.ssh/$id" | awk '{print $2}')" + [[ ${loaded_sigs[(I)$sig]} -le 0 ]] && not_loaded+="$HOME/.ssh/$id" + fi done [[ -n "$not_loaded" ]] && ssh-add ${^not_loaded} From 12c516822c7017355e264540b236405e1ab49a84 Mon Sep 17 00:00:00 2001 From: Jesse Farinacci Date: Tue, 22 Jan 2019 10:09:07 -0500 Subject: [PATCH 0099/1098] add brew install path to search recent `brew install jenv` installs to `/usr/local/bin/jenv`, auto-discover it for recent brew installs to avoid secondary, slower search --- plugins/jenv/jenv.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/jenv/jenv.plugin.zsh b/plugins/jenv/jenv.plugin.zsh index 14c586be9..2eda8037b 100644 --- a/plugins/jenv/jenv.plugin.zsh +++ b/plugins/jenv/jenv.plugin.zsh @@ -1,4 +1,4 @@ -jenvdirs=("$HOME/.jenv" "/usr/local/jenv" "/opt/jenv") +jenvdirs=("$HOME/.jenv" "/usr/local" "/usr/local/jenv" "/opt/jenv") FOUND_JENV=0 for jenvdir in $jenvdirs; do From ea6ec09b9c7752ee0e074659ca0689d0af053e5a Mon Sep 17 00:00:00 2001 From: Erwan ROUSSEL Date: Fri, 25 Jan 2019 12:16:20 +0100 Subject: [PATCH 0100/1098] cake: add README (#7473) --- plugins/cake/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 plugins/cake/README.md diff --git a/plugins/cake/README.md b/plugins/cake/README.md new file mode 100644 index 000000000..aad92a3ec --- /dev/null +++ b/plugins/cake/README.md @@ -0,0 +1,15 @@ +# Cake + +This plugin provides completion for [CakePHP](https://cakephp.org/). + +To use it add cake to the plugins array in your zshrc file. + +```bash +plugins=(... cake) +``` + +## Note + +This plugin generates a cache file of the cake tasks found, named `.cake_task_cache`, in the current working directory. +It is regenerated when the Cakefile is newer than the cache file. It is advised that you add the cake file to your +`.gitignore` files. From 308b046875f745abb87b3ef9f0382029fe37b452 Mon Sep 17 00:00:00 2001 From: Gianluca Recchia Date: Sun, 30 Dec 2018 03:10:49 +0100 Subject: [PATCH 0101/1098] Use stash 'push' or 'save' depending on Git version A utility function now parses the output of git --version and set the alias for git stash to 'git stash push' iff the current version of Git is greater than 2.13; it falls back to 'git stash save' otherwise. --- plugins/git/git.plugin.zsh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 2251bae2e..17e4d4b9d 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -33,6 +33,11 @@ function work_in_progress() { fi } +function _omz_git_stash_command() { + [[ `git --version 2>/dev/null` =~ '^git version ([[:digit:]]+.[[:digit:]]+)' && "$match[1]" >= '2.13' ]] \ + && echo push || echo save +} + # # Aliases # (sorted alphabetically) @@ -238,7 +243,7 @@ alias gsps='git show --pretty=short --show-signature' alias gsr='git svn rebase' alias gss='git status -s' alias gst='git status' -alias gsta='git stash save' +alias gsta="git stash $(_omz_git_stash_command)" alias gstaa='git stash apply' alias gstc='git stash clear' alias gstd='git stash drop' From 932d611c90b979078f4cdd37a20e2bf12e400a84 Mon Sep 17 00:00:00 2001 From: Bartlomiej Tartanus Date: Wed, 30 Jan 2019 16:22:14 +0100 Subject: [PATCH 0102/1098] git: properly indent ggfl function (#7556) Fixes (probably MacOS) issue: > ggfl zsh: command not found: ggfl --- 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 2251bae2e..12400ede4 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -112,8 +112,8 @@ ggf() { git push --force origin "${b:=$1}" } ggfl() { -[[ "$#" != 1 ]] && local b="$(git_current_branch)" -git push --force-with-lease origin "${b:=$1}" + [[ "$#" != 1 ]] && local b="$(git_current_branch)" + git push --force-with-lease origin "${b:=$1}" } compdef _git ggf=git-checkout From 83ce8d05dfefacf1d4a7fdc957f38b3bd6cba6b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 30 Jan 2019 16:35:16 +0100 Subject: [PATCH 0103/1098] transfer: add newline after showing the link Fixes #7562 --- plugins/transfer/transfer.plugin.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/transfer/transfer.plugin.zsh b/plugins/transfer/transfer.plugin.zsh index 7a7cd85ec..db744b0cd 100644 --- a/plugins/transfer/transfer.plugin.zsh +++ b/plugins/transfer/transfer.plugin.zsh @@ -61,7 +61,9 @@ transfer() { # cat output link cat $tmpfile + # add newline + echo # cleanup rm -f $tmpfile -} \ No newline at end of file +} From 851899e59ea71ce8fbae738ec7aeb7a967585977 Mon Sep 17 00:00:00 2001 From: Brian Hong Date: Thu, 31 Jan 2019 08:57:37 -0500 Subject: [PATCH 0104/1098] theme/gallifrey: set color to red if root (#6203) --- themes/gallifrey.zsh-theme | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/themes/gallifrey.zsh-theme b/themes/gallifrey.zsh-theme index 252566f06..768547064 100644 --- a/themes/gallifrey.zsh-theme +++ b/themes/gallifrey.zsh-theme @@ -1,8 +1,11 @@ -# ZSH Theme - Preview: https://flic.kr/p/ZFvivf -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" +# ZSH Theme - Preview: https://github.com/robbyrussell/oh-my-zsh/wiki/Themes#gallifrey +return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" +host_color="%(!.%{$fg[red]%}.%{$fg[green]%})" -PROMPT='%{$fg[green]%}%m%{$reset_color%} %2~ $(git_prompt_info)%{$reset_color%}%B»%b ' +PROMPT="${host_color}%m%{$reset_color%} %2~ \$(git_prompt_info)%{$reset_color%}%B»%b " RPS1="${return_code}" ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" + +unset return_code host_color From e634730e35450b408efa6acc9273d3c1eff12d8c Mon Sep 17 00:00:00 2001 From: genevera Date: Tue, 5 Feb 2019 05:20:25 -0500 Subject: [PATCH 0105/1098] update spotify to newest version --- plugins/osx/spotify | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/osx/spotify b/plugins/osx/spotify index 2ab98d3a0..b4215dbe7 100644 --- a/plugins/osx/spotify +++ b/plugins/osx/spotify @@ -1,7 +1,7 @@ #!/usr/bin/env bash function spotify() { -# Copyright (c) 2012--2017 Harish Narayanan +# Copyright (c) 2012--2018 Harish Narayanan # # Contains numerous helpful contributions from Jorge Colindres, Thomas # Pritchard, iLan Epstein, Gabriele Bonetti, Sean Heller, Eric Martin @@ -134,8 +134,13 @@ showStatus () { if [ $# = 0 ]; then showHelp; else + if [ ! -d /Applications/Spotify.app ] && [ ! -d $HOME/Applications/Spotify.app ]; then + echo "The Spotify application must be installed." + exit 1 + fi + if [ $(osascript -e 'application "Spotify" is running') = "false" ]; then - osascript -e 'tell application "Spotify" to activate' + osascript -e 'tell application "Spotify" to activate' || exit 1 sleep 2 fi fi @@ -160,7 +165,7 @@ while [ $# -gt 0 ]; do showAPIHelp; exit 1; fi - SHPOTIFY_CREDENTIALS=$(printf "${CLIENT_ID}:${CLIENT_SECRET}" | base64 | tr -d "\n"); + SHPOTIFY_CREDENTIALS=$(printf "${CLIENT_ID}:${CLIENT_SECRET}" | base64 | tr -d "\n"|tr -d '\r'); SPOTIFY_PLAY_URI=""; getAccessToken() { From 052493b1ba71fe7e13554e57571fe4c793d53c3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 6 Feb 2019 11:55:38 +0100 Subject: [PATCH 0106/1098] z: refresh $RANDOM's value outside subshell This change references `$RANDOM` outside the subshell to refresh it for the next subshell invocation. Otherwise, subsequent runs of the function get the same value and, if run simultaneously, they may clobber each others' temp .z files. This is due to how zsh distributes RANDOM values when running inside a subshell: subshells that reference RANDOM will result in identical pseudo-random values unless the value of RANDOM is referenced or seeded in the parent shell in between subshell invocations See: http://zsh.sourceforge.net/Doc/Release/Parameters.html#index-RANDOM --- plugins/z/z.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/z/z.sh b/plugins/z/z.sh index 4fc75dc6a..5fe6d5266 100644 --- a/plugins/z/z.sh +++ b/plugins/z/z.sh @@ -222,10 +222,16 @@ if type compctl >/dev/null 2>&1; then if [ "$_Z_NO_RESOLVE_SYMLINKS" ]; then _z_precmd() { (_z --add "${PWD:a}" &) + # Reference $RANDOM to refresh its value inside the subshell + # Otherwise, multiple runs get the same value + : $RANDOM } else _z_precmd() { (_z --add "${PWD:A}" &) + # Reference $RANDOM to refresh its value inside the subshell + # Otherwise, multiple runs get the same value + : $RANDOM } fi [[ -n "${precmd_functions[(r)_z_precmd]}" ]] || { From 86ea319536a8012b9e8f508d3d257029014bdafe Mon Sep 17 00:00:00 2001 From: eric-christian <298704+eric-christian@users.noreply.github.com> Date: Fri, 8 Feb 2019 15:14:09 +0100 Subject: [PATCH 0107/1098] asdf: fix homebrew installation path (#7582) * The check for the asdf installation directory is more precise: The existence of the directory `$HOME/.asdf` does not mean that it is the installation directory of `asdf`. It will also be created after installing at least one asdf plugin. * Completions, while installed with homebrew, are now expected on an alternative location. --- plugins/asdf/asdf.plugin.zsh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/asdf/asdf.plugin.zsh b/plugins/asdf/asdf.plugin.zsh index 75395c718..38b225538 100644 --- a/plugins/asdf/asdf.plugin.zsh +++ b/plugins/asdf/asdf.plugin.zsh @@ -1,9 +1,11 @@ # Find where asdf should be installed ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}" +ASDF_COMPLETIONS="$ASDF_DIR/completions" # If not found, check for Homebrew package -if [[ ! -d $ASDF_DIR ]] && (( $+commands[brew] )); then +if [[ ! -f "$ASDF_DIR/asdf.sh" ]] && (( $+commands[brew] )); then ASDF_DIR="$(brew --prefix asdf)" + ASDF_COMPLETIONS="$ASDF_DIR/etc/bash_completion.d" fi # Load command @@ -11,7 +13,7 @@ if [[ -f "$ASDF_DIR/asdf.sh" ]]; then . "$ASDF_DIR/asdf.sh" # Load completions - if [[ -f "$ASDF_DIR/completions/asdf.bash" ]]; then - . "$ASDF_DIR/completions/asdf.bash" + if [[ -f "$ASDF_COMPLETIONS/asdf.bash" ]]; then + . "$ASDF_COMPLETIONS/asdf.bash" fi fi From 237c83aae0e1092eb47f17758d046306c9051243 Mon Sep 17 00:00:00 2001 From: Lukas Aldersley Date: Fri, 15 Feb 2019 19:22:27 +0100 Subject: [PATCH 0108/1098] Update LICENSE.txt --- LICENSE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.txt b/LICENSE.txt index 7af38f217..4d465b1c3 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2009-2018 Robby Russell and contributors +Copyright (c) 2009-2019 Robby Russell and contributors See the full list at https://github.com/robbyrussell/oh-my-zsh/contributors Permission is hereby granted, free of charge, to any person obtaining a copy From df002539f8c12cab9a4ca236be56fa19982fd6cb Mon Sep 17 00:00:00 2001 From: nslqqq Date: Mon, 9 Sep 2013 07:35:57 -0700 Subject: [PATCH 0109/1098] mvn: enable completion for maven colorizer --- plugins/mvn/mvn.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index f367fecce..4f3d40ec9 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -288,5 +288,6 @@ function listMavenCompletions { } compctl -K listMavenCompletions mvn +compctl -K listMavenCompletions mvn-color compctl -K listMavenCompletions mvn-or-mvnw From e056aee79447bb0f61e33a8901f3a9bfef2d06b9 Mon Sep 17 00:00:00 2001 From: Neil Green Date: Mon, 13 Feb 2017 12:17:06 +0000 Subject: [PATCH 0110/1098] mvn: enable completion for mvnw --- plugins/mvn/mvn.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index 4f3d40ec9..d846508d3 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -287,7 +287,7 @@ function listMavenCompletions { ); } -compctl -K listMavenCompletions mvn +compctl -K listMavenCompletions mvn mvnw compctl -K listMavenCompletions mvn-color compctl -K listMavenCompletions mvn-or-mvnw From 35539fd6e4519eaa9110f160aae7a403478263d2 Mon Sep 17 00:00:00 2001 From: Wajdi Al-Hawari Date: Thu, 17 Sep 2015 13:46:28 -0400 Subject: [PATCH 0111/1098] mvn: add initialize support in mvn completion --- plugins/mvn/mvn.plugin.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index d846508d3..ad0ae0ca0 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -53,6 +53,7 @@ mvn-color() { alias mvn="mvn-or-mvnw" # aliases +alias mvncini='mvn clean initialize' alias mvncie='mvn clean install eclipse:eclipse' alias mvnci='mvn clean install' alias mvncist='mvn clean install -DskipTests' @@ -81,7 +82,7 @@ alias mvndocs='mvn dependency:resolve -Dclassifier=javadoc' function listMavenCompletions { reply=( # common lifecycle - clean process-resources compile process-test-resources test-compile test integration-test package verify install deploy site + clean initialize process-resources compile process-test-resources test-compile test integration-test package verify install deploy site # common plugins deploy failsafe install site surefire checkstyle javadoc jxr pmd ant antrun archetype assembly dependency enforcer gpg help release repository source eclipse idea jetty cargo jboss tomcat tomcat6 tomcat7 exec versions war ear ejb android scm buildnumber nexus repository sonar license hibernate3 liquibase flyway gwt From 4d4a2fac584e199cc9f15f0431173f376cb674bd Mon Sep 17 00:00:00 2001 From: Alexey Merezhin Date: Fri, 22 Sep 2017 16:19:59 +0200 Subject: [PATCH 0112/1098] mvn: add mvncp alias to 'mvn clean package' --- plugins/mvn/mvn.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index ad0ae0ca0..53136db9c 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -56,6 +56,7 @@ alias mvn="mvn-or-mvnw" alias mvncini='mvn clean initialize' alias mvncie='mvn clean install eclipse:eclipse' alias mvnci='mvn clean install' +alias mvncp='mvn clean package' alias mvncist='mvn clean install -DskipTests' alias mvncisto='mvn clean install -DskipTests --offline' alias mvne='mvn eclipse:eclipse' From 0dbe7ecedc7631668fdad8ca23d9f19e91b4d0d2 Mon Sep 17 00:00:00 2001 From: sparsick Date: Tue, 31 Jan 2017 10:10:53 +0100 Subject: [PATCH 0113/1098] mvn: add alias to 'mvn clean deploy' --- plugins/mvn/README.md | 1 + plugins/mvn/mvn.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/mvn/README.md b/plugins/mvn/README.md index 986ac84a4..be6bd6db3 100644 --- a/plugins/mvn/README.md +++ b/plugins/mvn/README.md @@ -19,6 +19,7 @@ plugins=(... mvn) | `mvne` | `mvn eclipse:eclipse` | | `mvncv` | `mvn clean verify` | | `mvnd` | `mvn deploy` | +| `mvncd` | `mvn clean deploy` | | `mvnp` | `mvn package` | | `mvnc` | `mvn clean` | | `mvncom` | `mvn compile` | diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index 53136db9c..9baf66464 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -63,6 +63,7 @@ alias mvne='mvn eclipse:eclipse' alias mvnce='mvn clean eclipse:clean eclipse:eclipse' alias mvncv='mvn clean verify' alias mvnd='mvn deploy' +alias mvncd='mvn clean deploy' alias mvnp='mvn package' alias mvnc='mvn clean' alias mvncom='mvn compile' From 7ebd80fc7df544e112480cb9a7ea9d564cbdc160 Mon Sep 17 00:00:00 2001 From: Laurent Vaills Date: Thu, 15 Oct 2015 09:04:32 +0200 Subject: [PATCH 0114/1098] mvn: add mvncvst alias --- plugins/mvn/mvn.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index 9baf66464..edcd10a17 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -62,6 +62,7 @@ alias mvncisto='mvn clean install -DskipTests --offline' alias mvne='mvn eclipse:eclipse' alias mvnce='mvn clean eclipse:clean eclipse:eclipse' alias mvncv='mvn clean verify' +alias mvncvst='mvn clean verify -DskipTests' alias mvnd='mvn deploy' alias mvncd='mvn clean deploy' alias mvnp='mvn package' From 283dcab64ffac23e40c80f7fa8bb2e8d06548c50 Mon Sep 17 00:00:00 2001 From: Bryan Banz Date: Wed, 22 Oct 2014 12:07:31 -0500 Subject: [PATCH 0115/1098] mvn: colorize [DEBUG] statements in mvn-color --- plugins/mvn/mvn.plugin.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index edcd10a17..f4c46bfa1 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -35,7 +35,9 @@ mvn-color() { ( # Filter mvn output using sed. Before filtering set the locale to C, so invalid characters won't break some sed implementations unset LANG - LC_CTYPE=C mvn "$@" | sed -e "s/\(\[INFO\]\)\(.*\)/${TEXT_BLUE}${BOLD}\1${RESET_FORMATTING}\2/g" \ + LC_CTYPE=C mvn "$@" | sed \ + -e "s/\(\[INFO\]\)\(.*\)/${TEXT_BLUE}${BOLD}\1${RESET_FORMATTING}\2/g" \ + -e "s/\(\[DEBUG\]\)\(.*\)/${TEXT_RED}${BOLD}\1${RESET_FORMATTING}\2/g" \ -e "s/\(\[INFO\]\ BUILD SUCCESSFUL\)/${BOLD}${TEXT_GREEN}\1${RESET_FORMATTING}/g" \ -e "s/\(\[WARNING\]\)\(.*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}\2/g" \ -e "s/\(\[ERROR\]\)\(.*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}\2/g" \ From 0a5e69b87eef354e96d8995b786082de7f67c082 Mon Sep 17 00:00:00 2001 From: Bryan Banz Date: Wed, 22 Oct 2014 12:09:53 -0500 Subject: [PATCH 0116/1098] mvn: add alias to run maven from a project's subdirectory --- plugins/mvn/mvn.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index f4c46bfa1..7dd3c98dd 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -54,6 +54,9 @@ mvn-color() { # either use orignal mvn oder the mvn wrapper alias mvn="mvn-or-mvnw" +# Run mvn against the pom found in a project's root directory (assumes a git repo) +alias 'mvn!'='mvn -f $(git rev-parse --show-toplevel 2>/dev/null || echo ".")/pom.xml' + # aliases alias mvncini='mvn clean initialize' alias mvncie='mvn clean install eclipse:eclipse' From 9afaa0c40625a8fa03531efeac6e364d15810e95 Mon Sep 17 00:00:00 2001 From: Bryan Banz Date: Wed, 22 Oct 2014 12:15:29 -0500 Subject: [PATCH 0117/1098] mvn: add integration-test options to mvn autocomplete --- plugins/mvn/mvn.plugin.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index 7dd3c98dd..28d49d73b 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -90,7 +90,10 @@ alias mvndocs='mvn dependency:resolve -Dclassifier=javadoc' function listMavenCompletions { reply=( # common lifecycle - clean initialize process-resources compile process-test-resources test-compile test integration-test package verify install deploy site + clean initialize process-resources compile process-test-resources test-compile test package verify install deploy site + + # integration testing + pre-integration-test integration-test # common plugins deploy failsafe install site surefire checkstyle javadoc jxr pmd ant antrun archetype assembly dependency enforcer gpg help release repository source eclipse idea jetty cargo jboss tomcat tomcat6 tomcat7 exec versions war ear ejb android scm buildnumber nexus repository sonar license hibernate3 liquibase flyway gwt From 5b569149f33a2eadd29f303a3e2f09d9e3c67c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 17 Feb 2019 17:34:31 +0100 Subject: [PATCH 0118/1098] mvn: fix formatting --- plugins/mvn/mvn.plugin.zsh | 440 ++++++++++++++++++------------------- 1 file changed, 218 insertions(+), 222 deletions(-) diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index 28d49d73b..a6cd4edd1 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -22,34 +22,31 @@ RESET_FORMATTING=$(tput sgr0) # if found an executable ./mvnw file execute it otherwise execute orignal mvn mvn-or-mvnw() { - if [ -x ./mvnw ] ; then - echo "executing mvnw instead of mvn" - ./mvnw "$@"; + if [ -x ./mvnw ]; then + echo "executing mvnw instead of mvn" + ./mvnw "$@" else - mvn "$@"; + mvn "$@" fi } # Wrapper function for Maven's mvn command. mvn-color() { - ( - # Filter mvn output using sed. Before filtering set the locale to C, so invalid characters won't break some sed implementations - unset LANG - LC_CTYPE=C mvn "$@" | sed \ - -e "s/\(\[INFO\]\)\(.*\)/${TEXT_BLUE}${BOLD}\1${RESET_FORMATTING}\2/g" \ - -e "s/\(\[DEBUG\]\)\(.*\)/${TEXT_RED}${BOLD}\1${RESET_FORMATTING}\2/g" \ - -e "s/\(\[INFO\]\ BUILD SUCCESSFUL\)/${BOLD}${TEXT_GREEN}\1${RESET_FORMATTING}/g" \ - -e "s/\(\[WARNING\]\)\(.*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}\2/g" \ - -e "s/\(\[ERROR\]\)\(.*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}\2/g" \ - -e "s/Tests run: \([^,]*\), Failures: \([^,]*\), Errors: \([^,]*\), Skipped: \([^,]*\)/${BOLD}${TEXT_GREEN}Tests run: \1${RESET_FORMATTING}, Failures: ${BOLD}${TEXT_RED}\2${RESET_FORMATTING}, Errors: ${BOLD}${TEXT_RED}\3${RESET_FORMATTING}, Skipped: ${BOLD}${TEXT_YELLOW}\4${RESET_FORMATTING}/g" - - # Make sure formatting is reset - echo -ne "${RESET_FORMATTING}" - ) -} + ( + # Filter mvn output using sed. Before filtering set the locale to C, so invalid characters won't break some sed implementations + unset LANG + LC_CTYPE=C mvn "$@" | sed \ + -e "s/\(\[INFO\]\)\(.*\)/${TEXT_BLUE}${BOLD}\1${RESET_FORMATTING}\2/g" \ + -e "s/\(\[DEBUG\]\)\(.*\)/${TEXT_RED}${BOLD}\1${RESET_FORMATTING}\2/g" \ + -e "s/\(\[INFO\]\ BUILD SUCCESSFUL\)/${BOLD}${TEXT_GREEN}\1${RESET_FORMATTING}/g" \ + -e "s/\(\[WARNING\]\)\(.*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}\2/g" \ + -e "s/\(\[ERROR\]\)\(.*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}\2/g" \ + -e "s/Tests run: \([^,]*\), Failures: \([^,]*\), Errors: \([^,]*\), Skipped: \([^,]*\)/${BOLD}${TEXT_GREEN}Tests run: \1${RESET_FORMATTING}, Failures: ${BOLD}${TEXT_RED}\2${RESET_FORMATTING}, Errors: ${BOLD}${TEXT_RED}\3${RESET_FORMATTING}, Skipped: ${BOLD}${TEXT_YELLOW}\4${RESET_FORMATTING}/g" -# Override the mvn command with the colorized one. -#alias mvn="mvn-color" + # Make sure formatting is reset + echo -ne "${RESET_FORMATTING}" + ) +} # either use orignal mvn oder the mvn wrapper alias mvn="mvn-or-mvnw" @@ -77,7 +74,7 @@ alias mvnct='mvn clean test' alias mvnt='mvn test' alias mvnag='mvn archetype:generate' alias mvn-updates='mvn versions:display-dependency-updates' -alias mvntc7='mvn tomcat7:run' +alias mvntc7='mvn tomcat7:run' alias mvntc='mvn tomcat:run' alias mvnjetty='mvn jetty:run' alias mvnboot='mvn spring-boot:run' @@ -87,219 +84,218 @@ alias mvnsrc='mvn dependency:sources' alias mvndocs='mvn dependency:resolve -Dclassifier=javadoc' -function listMavenCompletions { - reply=( - # common lifecycle - clean initialize process-resources compile process-test-resources test-compile test package verify install deploy site +function listMavenCompletions { + reply=( + # common lifecycle + clean initialize process-resources compile process-test-resources test-compile test package verify install deploy site - # integration testing - pre-integration-test integration-test + # integration testing + pre-integration-test integration-test - # common plugins - deploy failsafe install site surefire checkstyle javadoc jxr pmd ant antrun archetype assembly dependency enforcer gpg help release repository source eclipse idea jetty cargo jboss tomcat tomcat6 tomcat7 exec versions war ear ejb android scm buildnumber nexus repository sonar license hibernate3 liquibase flyway gwt + # common plugins + deploy failsafe install site surefire checkstyle javadoc jxr pmd ant antrun archetype assembly dependency enforcer gpg help release repository source eclipse idea jetty cargo jboss tomcat tomcat6 tomcat7 exec versions war ear ejb android scm buildnumber nexus repository sonar license hibernate3 liquibase flyway gwt - # deploy - deploy:deploy-file - # failsafe - failsafe:integration-test failsafe:verify - # install - install:install-file install:help - # site - site:site site:deploy site:run site:stage site:stage-deploy site:attach-descriptor site:jar site:effective-site - # surefire - surefire:test + # deploy + deploy:deploy-file + # failsafe + failsafe:integration-test failsafe:verify + # install + install:install-file install:help + # site + site:site site:deploy site:run site:stage site:stage-deploy site:attach-descriptor site:jar site:effective-site + # surefire + surefire:test - # checkstyle - checkstyle:checkstyle checkstyle:check checkstyle:checkstyle-aggregate - # javadoc - javadoc:javadoc javadoc:test-javadoc javadoc:javadoc-no-fork javadoc:test-javadoc-no-fork javadoc:aggregate javadoc:test-aggregate javadoc:jar javadoc:test-jar javadoc:aggregate-jar javadoc:test-aggregate-jar javadoc:fix javadoc:test-fix javadoc:resource-bundle javadoc:test-resource-bundle - # jxr - jxr:jxr jxr:aggregate jxr:test-jxr jxr:test-aggregate - # pmd - pmd:pmd pmd:cpd pmd:check pmd:cpd-check + # checkstyle + checkstyle:checkstyle checkstyle:check checkstyle:checkstyle-aggregate + # javadoc + javadoc:javadoc javadoc:test-javadoc javadoc:javadoc-no-fork javadoc:test-javadoc-no-fork javadoc:aggregate javadoc:test-aggregate javadoc:jar javadoc:test-jar javadoc:aggregate-jar javadoc:test-aggregate-jar javadoc:fix javadoc:test-fix javadoc:resource-bundle javadoc:test-resource-bundle + # jxr + jxr:jxr jxr:aggregate jxr:test-jxr jxr:test-aggregate + # pmd + pmd:pmd pmd:cpd pmd:check pmd:cpd-check - # ant - ant:ant ant:clean - # antrun - antrun:run - # archetype - archetype:generate archetype:create-from-project archetype:crawl - # assembly - assembly:single assembly:assembly - # dependency - dependency:analyze dependency:analyze-dep-mgt dependency:analyze-only dependency:analyze-report dependency:analyze-duplicate dependency:build-classpath dependency:copy dependency:copy-dependencies dependency:display-ancestors dependency:get dependency:go-offline dependency:list dependency:list-repositories dependency:properties dependency:purge-local-repository dependency:resolve dependency:resolve-plugins dependency:sources dependency:tree dependency:unpack dependency:unpack-dependencies - # enforcer - enforcer:enforce enforcer:display-info - # gpg - gpg:sign gpg:sign-and-deploy-file - # help - 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:prepare-with-pom 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 - source:aggregate source:jar source:jar-no-fork source:test-jar source:test-jar-no-fork + # ant + ant:ant ant:clean + # antrun + antrun:run + # archetype + archetype:generate archetype:create-from-project archetype:crawl + # assembly + assembly:single assembly:assembly + # dependency + dependency:analyze dependency:analyze-dep-mgt dependency:analyze-only dependency:analyze-report dependency:analyze-duplicate dependency:build-classpath dependency:copy dependency:copy-dependencies dependency:display-ancestors dependency:get dependency:go-offline dependency:list dependency:list-repositories dependency:properties dependency:purge-local-repository dependency:resolve dependency:resolve-plugins dependency:sources dependency:tree dependency:unpack dependency:unpack-dependencies + # enforcer + enforcer:enforce enforcer:display-info + # gpg + gpg:sign gpg:sign-and-deploy-file + # help + 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:prepare-with-pom 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 + source:aggregate source:jar source:jar-no-fork source:test-jar source:test-jar-no-fork - # eclipse - eclipse:clean eclipse:eclipse - # idea - idea:clean idea:idea + # eclipse + eclipse:clean eclipse:eclipse + # idea + idea:clean idea:idea - # jetty - jetty:run jetty:run-exploded - # cargo - cargo:start cargo:run cargo:stop cargo:deploy cargo:undeploy cargo:help - # jboss - jboss:start jboss:stop jboss:deploy jboss:undeploy jboss:redeploy - # tomcat - tomcat:start tomcat:stop tomcat:deploy tomcat:undeploy tomcat:redeploy - # tomcat6 - tomcat6:run tomcat6:run-war tomcat6:run-war-only tomcat6:stop tomcat6:deploy tomcat6:undeploy - # tomcat7 - tomcat7:run tomcat7:run-war tomcat7:run-war-only tomcat7:deploy - # tomee - tomee:run tomee:run-war tomee:run-war-only tomee:stop tomee:deploy tomee:undeploy - # spring-boot - spring-boot:run spring-boot:repackage - # exec - exec:exec exec:java - # versions - versions:display-dependency-updates versions:display-plugin-updates versions:display-property-updates versions:update-parent versions:update-properties versions:update-child-modules versions:lock-snapshots versions:unlock-snapshots versions:resolve-ranges versions:set versions:use-releases versions:use-next-releases versions:use-latest-releases versions:use-next-snapshots versions:use-latest-snapshots versions:use-next-versions versions:use-latest-versions versions:commit versions:revert - # scm - scm:add scm:bootstrap scm:branch scm:changelog scm:check-local-modification scm:checkin scm:checkout scm:diff scm:edit scm:export scm:list scm:remove scm:status scm:tag scm:unedit scm:update scm:update-subprojects scm:validate - # buildnumber - buildnumber:create buildnumber:create-timestamp buildnumber:help buildnumber:hgchangeset + # jetty + jetty:run jetty:run-exploded + # cargo + cargo:start cargo:run cargo:stop cargo:deploy cargo:undeploy cargo:help + # jboss + jboss:start jboss:stop jboss:deploy jboss:undeploy jboss:redeploy + # tomcat + tomcat:start tomcat:stop tomcat:deploy tomcat:undeploy tomcat:redeploy + # tomcat6 + tomcat6:run tomcat6:run-war tomcat6:run-war-only tomcat6:stop tomcat6:deploy tomcat6:undeploy + # tomcat7 + tomcat7:run tomcat7:run-war tomcat7:run-war-only tomcat7:deploy + # tomee + tomee:run tomee:run-war tomee:run-war-only tomee:stop tomee:deploy tomee:undeploy + # spring-boot + spring-boot:run spring-boot:repackage + # exec + exec:exec exec:java + # versions + versions:display-dependency-updates versions:display-plugin-updates versions:display-property-updates versions:update-parent versions:update-properties versions:update-child-modules versions:lock-snapshots versions:unlock-snapshots versions:resolve-ranges versions:set versions:use-releases versions:use-next-releases versions:use-latest-releases versions:use-next-snapshots versions:use-latest-snapshots versions:use-next-versions versions:use-latest-versions versions:commit versions:revert + # scm + scm:add scm:bootstrap scm:branch scm:changelog scm:check-local-modification scm:checkin scm:checkout scm:diff scm:edit scm:export scm:list scm:remove scm:status scm:tag scm:unedit scm:update scm:update-subprojects scm:validate + # buildnumber + buildnumber:create buildnumber:create-timestamp buildnumber:help buildnumber:hgchangeset - # war - war:war war:exploded war:inplace war:manifest - # ear - ear:ear ear:generate-application-xml - # ejb - ejb:ejb - # android - android:apk android:apklib android:deploy android:deploy-dependencies android:dex android:emulator-start android:emulator-stop android:emulator-stop-all android:generate-sources android:help android:instrument android:manifest-update android:pull android:push android:redeploy android:run android:undeploy android:unpack android:version-update android:zipalign android:devices - # nexus - nexus:staging-list nexus:staging-close nexus:staging-drop nexus:staging-release nexus:staging-build-promotion nexus:staging-profiles-list nexus:settings-download - # repository - repository:bundle-create repository:bundle-pack repository:help + # war + war:war war:exploded war:inplace war:manifest + # ear + ear:ear ear:generate-application-xml + # ejb + ejb:ejb + # android + android:apk android:apklib android:deploy android:deploy-dependencies android:dex android:emulator-start android:emulator-stop android:emulator-stop-all android:generate-sources android:help android:instrument android:manifest-update android:pull android:push android:redeploy android:run android:undeploy android:unpack android:version-update android:zipalign android:devices + # nexus + nexus:staging-list nexus:staging-close nexus:staging-drop nexus:staging-release nexus:staging-build-promotion nexus:staging-profiles-list nexus:settings-download + # repository + repository:bundle-create repository:bundle-pack repository:help - # sonar - sonar:sonar - # license - license:format license:check - # hibernate3 - hibernate3:hbm2ddl hibernate3:help - # liquibase - liquibase:changelogSync liquibase:changelogSyncSQL liquibase:clearCheckSums liquibase:dbDoc liquibase:diff liquibase:dropAll liquibase:help liquibase:migrate liquibase:listLocks liquibase:migrateSQL liquibase:releaseLocks liquibase:rollback liquibase:rollbackSQL liquibase:status liquibase:tag liquibase:update liquibase:updateSQL liquibase:updateTestingRollback - # flyway - flyway:clean flyway:history flyway:init flyway:migrate flyway:status flyway:validate - # gwt - gwt:browser gwt:clean gwt:compile gwt:compile-report gwt:css gwt:debug gwt:eclipse gwt:eclipseTest gwt:generateAsync gwt:help gwt:i18n gwt:mergewebxml gwt:resources gwt:run gwt:sdkInstall gwt:source-jar gwt:soyc gwt:test - # asciidoctor - asciidoctor:process-asciidoc asciidoctor:auto-refresh asciidoctor:http asciidoctor:zip - # compiler - compiler:compile compiler:testCompile - # resources - resources:resources resources:testResources resources:copy-resources - # verifier - verifier:verify - # jar - jar:jar jar:test-jar - # rar - rar:rar - # acr - acr:acr - # shade - shade:shade - # changelog - changelog:changelog changelog:dev-activity changelog:file-activity - # changes - changes:announcement-mail changes:announcement-generate changes:changes-check changes:changes-validate changes:changes-report changes:jira-report changes:trac-report changes:github-report - # doap - doap:generate - # docck - docck:check - # jdeps - jdeps:jdkinternals jdeps:test-jdkinternals - # linkcheck - linkcheck:linkcheck - # project-info-reports - project-info-reports:cim project-info-reports:dependencies project-info-reports:dependency-convergence project-info-reports:dependency-info project-info-reports:dependency-management project-info-reports:distribution-management project-info-reports:help project-info-reports:index project-info-reports:issue-tracking project-info-reports:license project-info-reports:mailing-list project-info-reports:modules project-info-reports:plugin-management project-info-reports:plugins project-info-reports:project-team project-info-reports:scm project-info-reports:summary - # surefire-report - surefire-report:failsafe-report-only surefire-report:report surefire-report:report-only - # invoker - invoker:install invoker:integration-test invoker:verify invoker:run - # jarsigner - jarsigner:sign jarsigner:verify - # patch - patch:apply - # pdf - pdf:pdf - # plugin - plugin:descriptor plugin:report plugin:updateRegistry plugin:addPluginArtifactMetadata plugin:helpmojo - # remote-resources - remote-resources:bundle remote-resources:process - # scm-publish - scm-publish:help scm-publish:publish-scm scm-publish:scmpublish - # stage - stage:copy - # toolchain - toolchain:toolchain - - # options - "-Dmaven.test.skip=true" -DskipTests -DskipITs -Dmaven.surefire.debug -DenableCiProfile "-Dpmd.skip=true" "-Dcheckstyle.skip=true" "-Dtycho.mode=maven" "-Dmaven.test.failure.ignore=true" "-DgroupId=" "-DartifactId=" "-Dversion=" "-Dpackaging=jar" "-Dfile=" + # sonar + sonar:sonar + # license + license:format license:check + # hibernate3 + hibernate3:hbm2ddl hibernate3:help + # liquibase + liquibase:changelogSync liquibase:changelogSyncSQL liquibase:clearCheckSums liquibase:dbDoc liquibase:diff liquibase:dropAll liquibase:help liquibase:migrate liquibase:listLocks liquibase:migrateSQL liquibase:releaseLocks liquibase:rollback liquibase:rollbackSQL liquibase:status liquibase:tag liquibase:update liquibase:updateSQL liquibase:updateTestingRollback + # flyway + flyway:clean flyway:history flyway:init flyway:migrate flyway:status flyway:validate + # gwt + gwt:browser gwt:clean gwt:compile gwt:compile-report gwt:css gwt:debug gwt:eclipse gwt:eclipseTest gwt:generateAsync gwt:help gwt:i18n gwt:mergewebxml gwt:resources gwt:run gwt:sdkInstall gwt:source-jar gwt:soyc gwt:test + # asciidoctor + asciidoctor:process-asciidoc asciidoctor:auto-refresh asciidoctor:http asciidoctor:zip + # compiler + compiler:compile compiler:testCompile + # resources + resources:resources resources:testResources resources:copy-resources + # verifier + verifier:verify + # jar + jar:jar jar:test-jar + # rar + rar:rar + # acr + acr:acr + # shade + shade:shade + # changelog + changelog:changelog changelog:dev-activity changelog:file-activity + # changes + changes:announcement-mail changes:announcement-generate changes:changes-check changes:changes-validate changes:changes-report changes:jira-report changes:trac-report changes:github-report + # doap + doap:generate + # docck + docck:check + # jdeps + jdeps:jdkinternals jdeps:test-jdkinternals + # linkcheck + linkcheck:linkcheck + # project-info-reports + project-info-reports:cim project-info-reports:dependencies project-info-reports:dependency-convergence project-info-reports:dependency-info project-info-reports:dependency-management project-info-reports:distribution-management project-info-reports:help project-info-reports:index project-info-reports:issue-tracking project-info-reports:license project-info-reports:mailing-list project-info-reports:modules project-info-reports:plugin-management project-info-reports:plugins project-info-reports:project-team project-info-reports:scm project-info-reports:summary + # surefire-report + surefire-report:failsafe-report-only surefire-report:report surefire-report:report-only + # invoker + invoker:install invoker:integration-test invoker:verify invoker:run + # jarsigner + jarsigner:sign jarsigner:verify + # patch + patch:apply + # pdf + pdf:pdf + # plugin + plugin:descriptor plugin:report plugin:updateRegistry plugin:addPluginArtifactMetadata plugin:helpmojo + # remote-resources + remote-resources:bundle remote-resources:process + # scm-publish + scm-publish:help scm-publish:publish-scm scm-publish:scmpublish + # stage + stage:copy + # toolchain + toolchain:toolchain - # arguments - -am --also-make - -amd --also-make-dependents-am - -B --batch-mode - -b --builder - -C --strict-checksums - -c --lax-checksums - -cpu --check-plugin-updates - -D --define - -e --errors - -emp --encrypt-master-password - -ep --encrypt-password - -f --file - -fae --fail-at-end - -ff --fail-fast - -fn --fail-never - -gs --global-settings - -gt --global-toolchains - -h --help - -l --log-file - -llr --legacy-local-repository - -N --non-recursive - -npr --no-plugin-registry - -npu --no-plugin-updates - -nsu --no-snapshot-updates - -o --offline - -P --activate-profiles - -pl --projects - -q --quiet - -rf --resume-from - -s --settings - -t --toolchains - -T --threads - -U --update-snapshots - -up --update-plugins - -v --version - -V --show-version - -X --debug + # options + "-Dmaven.test.skip=true" -DskipTests -DskipITs -Dmaven.surefire.debug -DenableCiProfile "-Dpmd.skip=true" "-Dcheckstyle.skip=true" "-Dtycho.mode=maven" "-Dmaven.test.failure.ignore=true" "-DgroupId=" "-DartifactId=" "-Dversion=" "-Dpackaging=jar" "-Dfile=" - cli:execute cli:execute-phase - archetype:generate generate-sources - cobertura:cobertura - -Dtest=$(if [ -d ./src/test/java ] ; then find ./src/test/java -type f -name '*.java' | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dtest=\1?' ; fi) - -Dit.test=$(if [ -d ./src/test/java ] ; then find ./src/test/java -type f -name '*.java' | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dit.test=\1?' ; fi) - ); + # arguments + -am --also-make + -amd --also-make-dependents-am + -B --batch-mode + -b --builder + -C --strict-checksums + -c --lax-checksums + -cpu --check-plugin-updates + -D --define + -e --errors + -emp --encrypt-master-password + -ep --encrypt-password + -f --file + -fae --fail-at-end + -ff --fail-fast + -fn --fail-never + -gs --global-settings + -gt --global-toolchains + -h --help + -l --log-file + -llr --legacy-local-repository + -N --non-recursive + -npr --no-plugin-registry + -npu --no-plugin-updates + -nsu --no-snapshot-updates + -o --offline + -P --activate-profiles + -pl --projects + -q --quiet + -rf --resume-from + -s --settings + -t --toolchains + -T --threads + -U --update-snapshots + -up --update-plugins + -v --version + -V --show-version + -X --debug + + cli:execute cli:execute-phase + archetype:generate generate-sources + cobertura:cobertura + -Dtest=$(if [ -d ./src/test/java ] ; then find ./src/test/java -type f -name '*.java' | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dtest=\1?' ; fi) + -Dit.test=$(if [ -d ./src/test/java ] ; then find ./src/test/java -type f -name '*.java' | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dit.test=\1?' ; fi) + ) } compctl -K listMavenCompletions mvn mvnw compctl -K listMavenCompletions mvn-color compctl -K listMavenCompletions mvn-or-mvnw - From b767976586a4be87a8e57bbe7feddab9fda097b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 17 Feb 2019 17:35:57 +0100 Subject: [PATCH 0119/1098] mvn: use echoti instead of tput Avoids forking to tput and some systems don't have tput --- plugins/mvn/mvn.plugin.zsh | 40 +++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index a6cd4edd1..b557c23e8 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -1,24 +1,24 @@ # mvn-color based on https://gist.github.com/1027800 -BOLD=$(tput bold) -UNDERLINE_ON=$(tput smul) -UNDERLINE_OFF=$(tput rmul) -TEXT_BLACK=$(tput setaf 0) -TEXT_RED=$(tput setaf 1) -TEXT_GREEN=$(tput setaf 2) -TEXT_YELLOW=$(tput setaf 3) -TEXT_BLUE=$(tput setaf 4) -TEXT_MAGENTA=$(tput setaf 5) -TEXT_CYAN=$(tput setaf 6) -TEXT_WHITE=$(tput setaf 7) -BACKGROUND_BLACK=$(tput setab 0) -BACKGROUND_RED=$(tput setab 1) -BACKGROUND_GREEN=$(tput setab 2) -BACKGROUND_YELLOW=$(tput setab 3) -BACKGROUND_BLUE=$(tput setab 4) -BACKGROUND_MAGENTA=$(tput setab 5) -BACKGROUND_CYAN=$(tput setab 6) -BACKGROUND_WHITE=$(tput setab 7) -RESET_FORMATTING=$(tput sgr0) +BOLD=$(echoti bold) +UNDERLINE_ON=$(echoti smul) +UNDERLINE_OFF=$(echoti rmul) +TEXT_BLACK=$(echoti setaf 0) +TEXT_RED=$(echoti setaf 1) +TEXT_GREEN=$(echoti setaf 2) +TEXT_YELLOW=$(echoti setaf 3) +TEXT_BLUE=$(echoti setaf 4) +TEXT_MAGENTA=$(echoti setaf 5) +TEXT_CYAN=$(echoti setaf 6) +TEXT_WHITE=$(echoti setaf 7) +BACKGROUND_BLACK=$(echoti setab 0) +BACKGROUND_RED=$(echoti setab 1) +BACKGROUND_GREEN=$(echoti setab 2) +BACKGROUND_YELLOW=$(echoti setab 3) +BACKGROUND_BLUE=$(echoti setab 4) +BACKGROUND_MAGENTA=$(echoti setab 5) +BACKGROUND_CYAN=$(echoti setab 6) +BACKGROUND_WHITE=$(echoti setab 7) +RESET_FORMATTING=$(echoti sgr0) # if found an executable ./mvnw file execute it otherwise execute orignal mvn mvn-or-mvnw() { From c636e0933a63c85b3c6cef251e1c91d4a8bdb83d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 17 Feb 2019 18:28:24 +0100 Subject: [PATCH 0120/1098] mvn: avoid mvn-or-mvnw function calling itself when mvn is aliased to it --- plugins/mvn/mvn.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index b557c23e8..1bc678b74 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -26,7 +26,7 @@ mvn-or-mvnw() { echo "executing mvnw instead of mvn" ./mvnw "$@" else - mvn "$@" + command mvn "$@" fi } From 006b88209872f5f26c57fbb8c0e5d17d5e1ddd9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 17 Feb 2019 18:30:38 +0100 Subject: [PATCH 0121/1098] mvn: clean up mvn-color function --- plugins/mvn/mvn.plugin.zsh | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index 1bc678b74..7e31da46a 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -1,25 +1,3 @@ -# mvn-color based on https://gist.github.com/1027800 -BOLD=$(echoti bold) -UNDERLINE_ON=$(echoti smul) -UNDERLINE_OFF=$(echoti rmul) -TEXT_BLACK=$(echoti setaf 0) -TEXT_RED=$(echoti setaf 1) -TEXT_GREEN=$(echoti setaf 2) -TEXT_YELLOW=$(echoti setaf 3) -TEXT_BLUE=$(echoti setaf 4) -TEXT_MAGENTA=$(echoti setaf 5) -TEXT_CYAN=$(echoti setaf 6) -TEXT_WHITE=$(echoti setaf 7) -BACKGROUND_BLACK=$(echoti setab 0) -BACKGROUND_RED=$(echoti setab 1) -BACKGROUND_GREEN=$(echoti setab 2) -BACKGROUND_YELLOW=$(echoti setab 3) -BACKGROUND_BLUE=$(echoti setab 4) -BACKGROUND_MAGENTA=$(echoti setab 5) -BACKGROUND_CYAN=$(echoti setab 6) -BACKGROUND_WHITE=$(echoti setab 7) -RESET_FORMATTING=$(echoti sgr0) - # if found an executable ./mvnw file execute it otherwise execute orignal mvn mvn-or-mvnw() { if [ -x ./mvnw ]; then @@ -31,13 +9,21 @@ mvn-or-mvnw() { } # Wrapper function for Maven's mvn command. +# based on https://gist.github.com/1027800 mvn-color() { + local BOLD=$(echoti bold) + local TEXT_RED=$(echoti setaf 1) + local TEXT_GREEN=$(echoti setaf 2) + local TEXT_YELLOW=$(echoti setaf 3) + local TEXT_BLUE=$(echoti setaf 4) + local TEXT_WHITE=$(echoti setaf 7) + local RESET_FORMATTING=$(echoti sgr0) ( # Filter mvn output using sed. Before filtering set the locale to C, so invalid characters won't break some sed implementations unset LANG LC_CTYPE=C mvn "$@" | sed \ -e "s/\(\[INFO\]\)\(.*\)/${TEXT_BLUE}${BOLD}\1${RESET_FORMATTING}\2/g" \ - -e "s/\(\[DEBUG\]\)\(.*\)/${TEXT_RED}${BOLD}\1${RESET_FORMATTING}\2/g" \ + -e "s/\(\[DEBUG\]\)\(.*\)/${TEXT_WHITE}${BOLD}\1${RESET_FORMATTING}\2/g" \ -e "s/\(\[INFO\]\ BUILD SUCCESSFUL\)/${BOLD}${TEXT_GREEN}\1${RESET_FORMATTING}/g" \ -e "s/\(\[WARNING\]\)\(.*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}\2/g" \ -e "s/\(\[ERROR\]\)\(.*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}\2/g" \ From d0a0421e10e222f76c30cdaa04fed2f4911a5272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 17 Feb 2019 18:50:46 +0100 Subject: [PATCH 0122/1098] mvn: sort aliases and improve comments and README --- plugins/mvn/README.md | 45 +++++++++++++++++++++++++++----------- plugins/mvn/mvn.plugin.zsh | 43 ++++++++++++++++++------------------ 2 files changed, 53 insertions(+), 35 deletions(-) diff --git a/plugins/mvn/README.md b/plugins/mvn/README.md index be6bd6db3..3f08c56d8 100644 --- a/plugins/mvn/README.md +++ b/plugins/mvn/README.md @@ -10,26 +10,45 @@ plugins=(... mvn) ## Aliases +The plugin aliases mvn to a either calls `mvnw` ([Maven Wrapper](https://github.com/takari/maven-wrapper)) +if it's found, or the mvn command otherwise. + | Alias | Command | |:---------------------|:------------------------------------------------| -| `mvncie` | `mvn clean install eclipse:eclipse` | +| `mvn!` | `mvn -f /pom.xml` | +| `mvnag` | `mvn archetype:generate` | +| `mvnboot` | `mvn spring-boot:run` | +| `mvnc` | `mvn clean` | +| `mvncd` | `mvn clean deploy` | +| `mvnce` | `mvn clean eclipse:clean eclipse:eclipse` | | `mvnci` | `mvn clean install` | +| `mvncie` | `mvn clean install eclipse:eclipse` | +| `mvncini` | `mvn clean initialize` | | `mvncist` | `mvn clean install -DskipTests` | | `mvncisto` | `mvn clean install -DskipTests --offline` | -| `mvne` | `mvn eclipse:eclipse` | -| `mvncv` | `mvn clean verify` | -| `mvnd` | `mvn deploy` | -| `mvncd` | `mvn clean deploy` | -| `mvnp` | `mvn package` | -| `mvnc` | `mvn clean` | | `mvncom` | `mvn compile` | +| `mvncp` | `mvn clean package` | | `mvnct` | `mvn clean test` | -| `mvnt` | `mvn test` | -| `mvnag` | `mvn archetype:generate` | -| `mvn-updates` | `mvn versions:display-dependency-updates` | -| `mvntc7` | `mvn tomcat7:run` | -| `mvnjetty` | `mvn jetty:run` | +| `mvncv` | `mvn clean verify` | +| `mvncvst` | `mvn clean verify -DskipTests` | +| `mvnd` | `mvn deploy` | +| `mvndocs` | `mvn dependency:resolve -Dclassifier=javadoc` | | `mvndt` | `mvn dependency:tree` | +| `mvne` | `mvn eclipse:eclipse` | +| `mvnjetty` | `mvn jetty:run` | +| `mvnp` | `mvn package` | | `mvns` | `mvn site` | | `mvnsrc` | `mvn dependency:sources` | -| `mvndocs` | `mvn dependency:resolve -Dclassifier=javadoc` | +| `mvnt` | `mvn test` | +| `mvntc` | `mvn tomcat:run` | +| `mvntc7` | `mvn tomcat7:run` | +| `mvn-updates` | `mvn versions:display-dependency-updates` | + +## mvn-color + +It's a function that wraps the mvn command to colorize it's output. Since Maven 3.5.0 +the mvn command adds colored output, so this function will be soon removed from the +plugin. + +It also has a bug where it won't print when mvn prompts for user input, _e.g._ when +using `archetype:generate`. See [#5052](https://github.com/robbyrussell/oh-my-zsh/issues/5052). diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index 7e31da46a..66ea548ad 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -1,4 +1,4 @@ -# if found an executable ./mvnw file execute it otherwise execute orignal mvn +# Calls ./mvnw if found, otherwise execute the original mvn mvn-or-mvnw() { if [ -x ./mvnw ]; then echo "executing mvnw instead of mvn" @@ -8,8 +8,7 @@ mvn-or-mvnw() { fi } -# Wrapper function for Maven's mvn command. -# based on https://gist.github.com/1027800 +# Wrapper function for Maven's mvn command. Based on https://gist.github.com/1027800 mvn-color() { local BOLD=$(echoti bold) local TEXT_RED=$(echoti setaf 1) @@ -34,40 +33,40 @@ mvn-color() { ) } -# either use orignal mvn oder the mvn wrapper +# either use orignal mvn or the mvn wrapper alias mvn="mvn-or-mvnw" # Run mvn against the pom found in a project's root directory (assumes a git repo) alias 'mvn!'='mvn -f $(git rev-parse --show-toplevel 2>/dev/null || echo ".")/pom.xml' # aliases -alias mvncini='mvn clean initialize' -alias mvncie='mvn clean install eclipse:eclipse' +alias mvnag='mvn archetype:generate' +alias mvnboot='mvn spring-boot:run' +alias mvnc='mvn clean' +alias mvncd='mvn clean deploy' +alias mvnce='mvn clean eclipse:clean eclipse:eclipse' alias mvnci='mvn clean install' -alias mvncp='mvn clean package' +alias mvncie='mvn clean install eclipse:eclipse' +alias mvncini='mvn clean initialize' alias mvncist='mvn clean install -DskipTests' alias mvncisto='mvn clean install -DskipTests --offline' -alias mvne='mvn eclipse:eclipse' -alias mvnce='mvn clean eclipse:clean eclipse:eclipse' +alias mvncom='mvn compile' +alias mvncp='mvn clean package' +alias mvnct='mvn clean test' alias mvncv='mvn clean verify' alias mvncvst='mvn clean verify -DskipTests' alias mvnd='mvn deploy' -alias mvncd='mvn clean deploy' -alias mvnp='mvn package' -alias mvnc='mvn clean' -alias mvncom='mvn compile' -alias mvnct='mvn clean test' -alias mvnt='mvn test' -alias mvnag='mvn archetype:generate' -alias mvn-updates='mvn versions:display-dependency-updates' -alias mvntc7='mvn tomcat7:run' -alias mvntc='mvn tomcat:run' -alias mvnjetty='mvn jetty:run' -alias mvnboot='mvn spring-boot:run' +alias mvndocs='mvn dependency:resolve -Dclassifier=javadoc' alias mvndt='mvn dependency:tree' +alias mvne='mvn eclipse:eclipse' +alias mvnjetty='mvn jetty:run' +alias mvnp='mvn package' alias mvns='mvn site' alias mvnsrc='mvn dependency:sources' -alias mvndocs='mvn dependency:resolve -Dclassifier=javadoc' +alias mvnt='mvn test' +alias mvntc='mvn tomcat:run' +alias mvntc7='mvn tomcat7:run' +alias mvn-updates='mvn versions:display-dependency-updates' function listMavenCompletions { From fff756069f678ceda0b7c760b843c09bbc2bc72d Mon Sep 17 00:00:00 2001 From: kubamarchwicki Date: Sun, 1 Jun 2014 21:01:01 +0200 Subject: [PATCH 0123/1098] mvn: add dynamic profile support to mvn completion * Maven profiles for current pom.xml file * Maven profiles for pom hierarchy * Ommiting comments in profiles --- plugins/mvn/mvn.plugin.zsh | 63 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index 66ea548ad..71bba454c 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -68,8 +68,66 @@ alias mvntc='mvn tomcat:run' alias mvntc7='mvn tomcat7:run' alias mvn-updates='mvn versions:display-dependency-updates' +#realpath replacement for iOS - not always present +function _realpath { + if [[ -f "$1" ]] + then + # file *must* exist + if cd "$(echo "${1%/*}")" &>/dev/null + then + # file *may* not be local + # exception is ./file.ext + # try 'cd .; cd -;' *works!* + local tmppwd="$PWD" + cd - &>/dev/null + else + # file *must* be local + local tmppwd="$PWD" + fi + else + # file *cannot* exist + return 1 # failure + fi + + # reassemble realpath + echo "$tmppwd"/"${1##*/}" + return 1 #success +} + +function __pom_hierarchy { + local file=`_realpath "pom.xml"` + POM_HIERARCHY+=("~/.m2/settings.xml") + POM_HIERARCHY+=("$file") + while [ -n "$file" ] && grep -q "" $file; do + ##look for a new relativePath for parent pom.xml + local new_file=`grep -e ".*" $file | sed 's/.*//' | sed 's/<\/relativePath>.*//g'` + + ## is present but not defined. Asume ../pom.xml + if [ -z "$new_file" ]; then + new_file="../pom.xml" + fi + + ## if file exists continue else break + new_pom=`_realpath "${file%/*}/$new_file"` + if [ -n "$new_pom" ]; then + file=$new_pom + else + break + fi + POM_HIERARCHY+=("$file") + done +} function listMavenCompletions { + POM_HIERARCHY=() + __pom_hierarchy + + profiles=() + #current pom profiles + for item in ${POM_HIERARCHY[*]}; do + profiles=($profiles `[ -e $item ] && cat $item | sed 's///' | sed '//d' | grep -e "" -A 1 | grep -e ".*" | sed 's?.*\(.*\)<\/id>.*?-P\1?'`) + done + reply=( # common lifecycle clean initialize process-resources compile process-test-resources test-compile test package verify install deploy site @@ -278,7 +336,12 @@ function listMavenCompletions { cobertura:cobertura -Dtest=$(if [ -d ./src/test/java ] ; then find ./src/test/java -type f -name '*.java' | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dtest=\1?' ; fi) -Dit.test=$(if [ -d ./src/test/java ] ; then find ./src/test/java -type f -name '*.java' | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dit.test=\1?' ; fi) + + $profiles ) + + unset POM_HIERARCHY + unset profiles } compctl -K listMavenCompletions mvn mvnw From f4b2e460c77b79f99831cd048eb0004059c96370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 17 Feb 2019 20:28:32 +0100 Subject: [PATCH 0124/1098] mvn: fix and cleanup dynamic profiles logic --- plugins/mvn/mvn.plugin.zsh | 78 +++++++++++++------------------------- 1 file changed, 27 insertions(+), 51 deletions(-) diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index 71bba454c..01aef814d 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -68,64 +68,43 @@ alias mvntc='mvn tomcat:run' alias mvntc7='mvn tomcat7:run' alias mvn-updates='mvn versions:display-dependency-updates' -#realpath replacement for iOS - not always present -function _realpath { - if [[ -f "$1" ]] - then - # file *must* exist - if cd "$(echo "${1%/*}")" &>/dev/null - then - # file *may* not be local - # exception is ./file.ext - # try 'cd .; cd -;' *works!* - local tmppwd="$PWD" - cd - &>/dev/null - else - # file *must* be local - local tmppwd="$PWD" - fi - else - # file *cannot* exist - return 1 # failure + +function listMavenCompletions { + local file new_file + local -a profiles POM_FILES + + # Root POM + POM_FILES=(~/.m2/settings.xml) + + # POM in the current directory + if [[ -f pom.xml ]]; then + local file=pom.xml + POM_FILES+=("${file:A}") fi - # reassemble realpath - echo "$tmppwd"/"${1##*/}" - return 1 #success -} + # Look for POM files in parent directories + while [[ -n "$file" ]] && grep -q "" "$file"; do + # look for a new relativePath for parent pom.xml + new_file=$(grep -e ".*" "$file" | sed -e 's/.*\(.*\)<\/relativePath>.*/\1/') -function __pom_hierarchy { - local file=`_realpath "pom.xml"` - POM_HIERARCHY+=("~/.m2/settings.xml") - POM_HIERARCHY+=("$file") - while [ -n "$file" ] && grep -q "" $file; do - ##look for a new relativePath for parent pom.xml - local new_file=`grep -e ".*" $file | sed 's/.*//' | sed 's/<\/relativePath>.*//g'` - - ## is present but not defined. Asume ../pom.xml - if [ -z "$new_file" ]; then + # if is present but not defined, assume ../pom.xml + if [[ -z "$new_file" ]]; then new_file="../pom.xml" fi - ## if file exists continue else break - new_pom=`_realpath "${file%/*}/$new_file"` - if [ -n "$new_pom" ]; then - file=$new_pom - else + # if file doesn't exist break + file="${file:h}/${new_file}" + if ! [[ -e "$file" ]]; then break fi - POM_HIERARCHY+=("$file") + + POM_FILES+=("${file:A}") done -} -function listMavenCompletions { - POM_HIERARCHY=() - __pom_hierarchy - - profiles=() - #current pom profiles - for item in ${POM_HIERARCHY[*]}; do - profiles=($profiles `[ -e $item ] && cat $item | sed 's///' | sed '//d' | grep -e "" -A 1 | grep -e ".*" | sed 's?.*\(.*\)<\/id>.*?-P\1?'`) + # Get profiles from found files + for file in $POM_FILES; do + [[ -e $file ]] || continue + profiles+=($(sed 's///' "$file" | sed '//d' | grep -e "" -A 1 | grep -e ".*" | sed 's?.*\(.*\)<\/id>.*?-P\1?')) done reply=( @@ -339,9 +318,6 @@ function listMavenCompletions { $profiles ) - - unset POM_HIERARCHY - unset profiles } compctl -K listMavenCompletions mvn mvnw From 0e647904ffdd19c697e1c6ab602f65377cb186fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 17 Feb 2019 20:48:13 +0100 Subject: [PATCH 0125/1098] mvn: update documentation --- plugins/mvn/README.md | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/plugins/mvn/README.md b/plugins/mvn/README.md index 3f08c56d8..88f5be8ba 100644 --- a/plugins/mvn/README.md +++ b/plugins/mvn/README.md @@ -1,7 +1,7 @@ -## Introduction +# mvn plugin -The [mvn plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/mvn) provides many -[useful aliases](#aliases) as well as completion for the `mvn` command. +The mvn plugin provides many [useful aliases](#aliases) as well as completion for +the [Apache Maven](https://maven.apache.org/) command (`mvn`). Enable it by adding `mvn` to the plugins array in your zshrc file: ```zsh @@ -10,7 +10,7 @@ plugins=(... mvn) ## Aliases -The plugin aliases mvn to a either calls `mvnw` ([Maven Wrapper](https://github.com/takari/maven-wrapper)) +The plugin aliases mvn to a function that calls `mvnw` (the [Maven Wrapper](https://github.com/takari/maven-wrapper)) if it's found, or the mvn command otherwise. | Alias | Command | @@ -46,9 +46,13 @@ if it's found, or the mvn command otherwise. ## mvn-color -It's a function that wraps the mvn command to colorize it's output. Since Maven 3.5.0 -the mvn command adds colored output, so this function will be soon removed from the -plugin. +It's a function that wraps the mvn command to colorize it's output. You can use it in place +of the `mvn` command. For example: instead of `mvn test`, use `mvn-color test`. -It also has a bug where it won't print when mvn prompts for user input, _e.g._ when -using `archetype:generate`. See [#5052](https://github.com/robbyrussell/oh-my-zsh/issues/5052). +Since [Maven 3.5.0](https://maven.apache.org/docs/3.5.0/release-notes.html) the mvn command +has colored output, so this function will be soon removed from the plugin. + +### Known bugs + +It has a bug where it will swallow mvn prompts for user input, _e.g._ when using +`archetype:generate`. See [#5052](https://github.com/robbyrussell/oh-my-zsh/issues/5052). From dfd1b4f8dfe977016bfe0ecd0fc360a526252827 Mon Sep 17 00:00:00 2001 From: Muhannad Fakhouri Date: Sun, 17 Feb 2019 23:10:17 +0100 Subject: [PATCH 0126/1098] adb: improve `adb -s` completion to show helpful info (#7532) Currently it shows for example the following: DEVICE_ID -- transport_id:2 which doesn't really ease device selection. I've adapted the awk script to print device name with it's model name, see the example below: DEVICE_ID -- Pixel_3(blueline) --- plugins/adb/_adb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/adb/_adb b/plugins/adb/_adb index e3c20d751..78c457746 100644 --- a/plugins/adb/_adb +++ b/plugins/adb/_adb @@ -49,7 +49,12 @@ _arguments \ case "$state" in specify_device) _values -C 'devices' ${$(adb devices -l|awk 'NR>1&& $1 \ - {sub(/ +/," ",$0);gsub(":","\\:",$1); printf "%s[%s] ",$1, $NF}'):-""} + {sub(/ +/," ",$0); \ + gsub(":","\\:",$1); \ + for(i=1;i<=NF;i++) { + if($i ~ /model:/) { split($i,m,":") } \ + else if($i ~ /product:/) { split($i,p,":") } } \ + printf "%s[%s(%s)] ",$1, p[2], m[2]}'):-""} return ;; esac @@ -59,4 +64,4 @@ if (( CURRENT == 1 )); then return fi -_files \ No newline at end of file +_files From ca1123a044e7e09dd8376868b372c541aedcd82d Mon Sep 17 00:00:00 2001 From: Thomas Hutterer Date: Wed, 20 Feb 2019 16:59:57 +0100 Subject: [PATCH 0127/1098] Fix "hurt sme" typo Just found this typo while browsing through the `plugins` folder ... and it "hurt sme" :hurtrealbad: --- plugins/fancy-ctrl-z/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/fancy-ctrl-z/README.md b/plugins/fancy-ctrl-z/README.md index a7670fa2c..f1b1dfa5c 100644 --- a/plugins/fancy-ctrl-z/README.md +++ b/plugins/fancy-ctrl-z/README.md @@ -1,10 +1,10 @@ # Use Ctrl-Z to switch back to Vim -I frequently need to execute random command in my shell. To achieve it I pause +I frequently need to execute random commands in my shell. To achieve it I pause Vim by pressing Ctrl-z, type command and press fg to switch back to Vim. -The fg part really hurt sme. I just wanted to hit Ctrl-z once again to get back +The fg part really hurts me. I just wanted to hit Ctrl-z once again to get back to Vim. I could not find a solution, so I developed one on my own that -works wonderfully with ZSH +works wonderfully with ZSH. Source: http://sheerun.net/2014/03/21/how-to-boost-your-vim-productivity/ From 243c46b7cd85c3578bbba8501fae62befc25f378 Mon Sep 17 00:00:00 2001 From: Deepankumar Date: Sat, 23 Feb 2019 09:00:05 +0100 Subject: [PATCH 0128/1098] fixed aplay conflict --- plugins/ansible/README.md | 3 +-- plugins/ansible/ansible.plugin.zsh | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/ansible/README.md b/plugins/ansible/README.md index 38bc13775..e0e6a19bb 100644 --- a/plugins/ansible/README.md +++ b/plugins/ansible/README.md @@ -19,9 +19,8 @@ plugins=(... ansible) | `a` | command `ansible` | | `aconf` | command `ansible-config` | | `acon` | command `ansible-console` | -| `aconn` | command `ansible-connection` | | `ainv` | command `ansible-inventory` | -| `aplay` | command `ansible-playbook` | +| `aplaybook` | command `ansible-playbook` | | `ainv` | command `ansible-inventory` | | `adoc` | command `ansible-doc` | | `agal` | command `ansible-galaxy` | diff --git a/plugins/ansible/ansible.plugin.zsh b/plugins/ansible/ansible.plugin.zsh index 0e7aff528..f68ff23a5 100644 --- a/plugins/ansible/ansible.plugin.zsh +++ b/plugins/ansible/ansible.plugin.zsh @@ -18,10 +18,9 @@ function ansible-role-init(){ alias a='ansible ' alias aconf='ansible-config ' alias acon='ansible-console ' -alias aconn='ansible-connection ' alias aver='ansible-version' alias arinit='ansible-role-init' -alias aplay='ansible-playbook ' +alias aplaybook='ansible-playbook ' alias ainv='ansible-inventory ' alias adoc='ansible-doc ' alias agal='ansible-galaxy ' From 25d0a10cda82edfa6cf5e1611e018a714ecbfb3e Mon Sep 17 00:00:00 2001 From: akinnane Date: Mon, 25 Feb 2019 13:37:41 +0000 Subject: [PATCH 0129/1098] Revert "Fix emacs client terminal" (#7597) Reverts robbyrussell/oh-my-zsh#5714 --- plugins/emacs/emacs.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/emacs/emacs.plugin.zsh b/plugins/emacs/emacs.plugin.zsh index 934c8d673..db0ab13af 100644 --- a/plugins/emacs/emacs.plugin.zsh +++ b/plugins/emacs/emacs.plugin.zsh @@ -16,7 +16,7 @@ if "$ZSH/tools/require_tool.sh" emacsclient 24 2>/dev/null ; then # set EDITOR if not already defined. export EDITOR="${EDITOR:-${EMACS_PLUGIN_LAUNCHER}}" - alias emacs="$EMACS_PLUGIN_LAUNCHER -t" + alias emacs="$EMACS_PLUGIN_LAUNCHER --no-wait" alias e=emacs # open terminal emacsclient alias te="$EMACS_PLUGIN_LAUNCHER -nw" From 4cdffcd4858c7818e5325c03909d75e41995eeae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 25 Feb 2019 21:30:00 +0100 Subject: [PATCH 0130/1098] init: cut down on the number of compaudit calls --- oh-my-zsh.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index d7c68d35c..4f6bfd5a5 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -69,14 +69,12 @@ fi if [[ $ZSH_DISABLE_COMPFIX != true ]]; then # If completion insecurities exist, warn the user - if ! compaudit &>/dev/null; then - handle_completion_insecurities - fi + handle_completion_insecurities # Load only from secure directories - compinit -i -d "${ZSH_COMPDUMP}" + compinit -i -C -d "${ZSH_COMPDUMP}" else # If the user wants it, load from all found directories - compinit -u -d "${ZSH_COMPDUMP}" + compinit -u -C -d "${ZSH_COMPDUMP}" fi # Load all of the plugins that were defined in ~/.zshrc From 55575b88f9e47d88fab02c26fc69e4af48af1cd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 25 Feb 2019 23:20:47 +0100 Subject: [PATCH 0131/1098] lib: optimize default and env_default --- lib/functions.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/functions.zsh b/lib/functions.zsh index 4ef8920f6..9f8736bd7 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -79,7 +79,7 @@ function try_alias_value() { # 0 if the variable exists, 3 if it was set # function default() { - test `typeset +m "$1"` && return 0 + (( $+parameters[$1] )) && return 0 typeset -g "$1"="$2" && return 3 } @@ -93,8 +93,8 @@ function default() { # 0 if the env variable exists, 3 if it was set # function env_default() { - env | grep -q "^$1=" && return 0 - export "$1=$2" && return 3 + (( ${${(@f):-$(typeset +xg)}[(I)$1]} )) && return 0 + export "$1=$2" && return 3 } From f319aa845dfa6b202e31dacf49ec8c2b2d5d17c2 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Mon, 25 Feb 2019 19:22:07 -0600 Subject: [PATCH 0132/1098] Updating Oh My Zsh shop URLs (#7619) * Updating Oh My Zsh shop URLs Linking directly to the Oh My Zsh inventory vs the top-level store with non-OMZ items. * Updating link to Oh My Zsh products in the install script * Updating link to Oh My Zsh shop products in the upgrade script * Getting rid of 't-' in shirts for now --- README.md | 2 +- tools/install.sh | 2 +- tools/upgrade.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b3651a99c..d6c77a147 100644 --- a/README.md +++ b/README.md @@ -238,7 +238,7 @@ We're on the social media. ## Merchandise -We have [stickers](https://shop.planetargon.com/products/ohmyzsh-stickers-set-of-3-stickers) and [shirts](https://shop.planetargon.com/products/ohmyzsh-t-shirts) for you to show off your love of Oh My Zsh. Again, this will help you become the talk of the town! +We have [stickers, shirts, and coffee mugs available](https://shop.planetargon.com/collections/oh-my-zsh?utm_source=github) for you to show off your love of Oh My Zsh. Again, you will become the talk of the town! ## License diff --git a/tools/install.sh b/tools/install.sh index 2fb87cdaf..e2b33f640 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -105,7 +105,7 @@ main() { echo '' echo 'p.s. Follow us at https://twitter.com/ohmyzsh.' echo '' - echo 'p.p.s. Get stickers and t-shirts at https://shop.planetargon.com.' + echo 'p.p.s. Get stickers, shirts, and coffee mugs at https://shop.planetargon.com/collections/oh-my-zsh.' echo '' printf "${NORMAL}" env zsh -l diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 25b2de27a..d234c7f88 100644 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -33,7 +33,7 @@ then printf '%s\n' ' /____/ ' printf "${BLUE}%s\n" "Hooray! Oh My Zsh has been updated and/or is at the current version." printf "${BLUE}${BOLD}%s${NORMAL}\n" "To keep up on the latest news and updates, follow us on twitter: https://twitter.com/ohmyzsh" - printf "${BLUE}${BOLD}%s${NORMAL}\n" "Get your Oh My Zsh swag at: https://shop.planetargon.com/" + printf "${BLUE}${BOLD}%s${NORMAL}\n" "Get your Oh My Zsh swag at: https://shop.planetargon.com/collections/oh-my-zsh" else printf "${RED}%s${NORMAL}\n" 'There was an error updating. Try again later?' fi From 934615480e8a008deda1a5330d8fbd47815b7cf4 Mon Sep 17 00:00:00 2001 From: Alec Ge Date: Tue, 26 Feb 2019 15:13:27 -0500 Subject: [PATCH 0133/1098] docs: fixed themes link for readme (#7620) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d6c77a147..511e6aeff 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ Most plugins (should! we're working on this) include a __README__, which documen ### Themes -We'll admit it. Early in the Oh My Zsh world, we may have gotten a bit too theme happy. We have over one hundred themes now bundled. Most of them have [screenshots](https://wiki.github.com/robbyrussell/oh-my-zsh/themes) on the wiki. Check them out! +We'll admit it. Early in the Oh My Zsh world, we may have gotten a bit too theme happy. We have over one hundred themes now bundled. Most of them have [screenshots](https://github.com/robbyrussell/oh-my-zsh/wiki/Themes) on the wiki. Check them out! #### Selecting a Theme From 52afbf77f63844abd719e565a15af2c34075de7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 3 Mar 2019 20:32:59 +0100 Subject: [PATCH 0134/1098] per-directory-history: update to latest version (0e090e8) --- .../per-directory-history/per-directory-history.zsh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/per-directory-history/per-directory-history.zsh b/plugins/per-directory-history/per-directory-history.zsh index 53ad963e7..41de2f91d 100644 --- a/plugins/per-directory-history/per-directory-history.zsh +++ b/plugins/per-directory-history/per-directory-history.zsh @@ -26,7 +26,7 @@ # # [1]: http://www.compbiome.com/2010/07/bash-per-directory-bash-history.html # [2]: http://dieter.plaetinck.be/per_directory_bash -# [3]: https://www.zsh.org/mla/users/1997/msg00226.html +# [3]: http://www.zsh.org/mla/users/1997/msg00226.html # ################################################################################ # @@ -109,8 +109,13 @@ function _per-directory-history-change-directory() { } function _per-directory-history-addhistory() { - print -Sr -- "${1%%$'\n'}" - fc -p $_per_directory_history_directory + # respect hist_ignore_space + if [[ -o hist_ignore_space ]] && [[ "$1" == \ * ]]; then + true + else + print -Sr -- "${1%%$'\n'}" + fc -p $_per_directory_history_directory + fi } From e3e0dd599ea4ed3e4d89ed4cadbe049a25013700 Mon Sep 17 00:00:00 2001 From: Rahil Wazir Date: Sun, 10 Mar 2019 21:36:21 +0500 Subject: [PATCH 0135/1098] fix typo (#7643) Extra t in `wp theme updatet` --- plugins/wp-cli/wp-cli.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/wp-cli/wp-cli.plugin.zsh b/plugins/wp-cli/wp-cli.plugin.zsh index 45fac0761..97bed406e 100644 --- a/plugins/wp-cli/wp-cli.plugin.zsh +++ b/plugins/wp-cli/wp-cli.plugin.zsh @@ -109,7 +109,7 @@ alias wptm='wp theme mod' alias wptp='wp theme path' alias wpts='wp theme search' alias wptst='wp theme status' -alias wptu='wp theme updatet' +alias wptu='wp theme update' # Transient From 275e5b13498e04173f703538bff32fc2c801b4d3 Mon Sep 17 00:00:00 2001 From: Ulrich Schreiner Date: Sun, 10 Mar 2019 17:36:51 +0100 Subject: [PATCH 0136/1098] allow kubectl commands against all namespaces (#7637) * allow kubectl commands against all namespaces * enhance the readme too --- plugins/kubectl/README.md | 1 + plugins/kubectl/kubectl.plugin.zsh | 3 +++ 2 files changed, 4 insertions(+) diff --git a/plugins/kubectl/README.md b/plugins/kubectl/README.md index b30f90548..3343f0195 100644 --- a/plugins/kubectl/README.md +++ b/plugins/kubectl/README.md @@ -14,6 +14,7 @@ plugins=(... kubectl) | Alias | Command | Description | |:--------|:------------------------------------|:-------------------------------------------------------------------------------------------------| | k | `kubectl` | The kubectl command | +| kca | `kubectl --all-namespaces` | The kubectl command targeting all namespaces | | kaf | `kubectl apply -f` | Apply a YML file | | keti | `kubectl exec -ti` | Drop into an interactive terminal on a container | | | | **Manage configuration quickly to switch contexts between local, dev and staging** | diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index d388d6543..ab7a1a0a4 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -13,6 +13,9 @@ fi # This command is used a LOT both below and in daily life alias k=kubectl +# Execute a kubectl command against all namespaces +alias kca='f(){ kubectl "$@" --all-namespaces; unset -f f; }; f' + # Apply a YML file alias kaf='kubectl apply -f' From 9509fd6a9193e32e5c2d460786253ba0e98fd741 Mon Sep 17 00:00:00 2001 From: Tieme van Veen Date: Sun, 10 Mar 2019 17:38:06 +0100 Subject: [PATCH 0137/1098] Add git reset to origin alias to git plugin (#7630) --- 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 12400ede4..4277ac664 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -220,6 +220,7 @@ alias grbm='git rebase master' alias grbs='git rebase --skip' alias grh='git reset' alias grhh='git reset --hard' +alias groh='git reset origin/$(git_current_branch) --hard' alias grm='git rm' alias grmc='git rm --cached' alias grmv='git remote rename' From 779ff24c2d0091ebbddae938d12b3f117123fc29 Mon Sep 17 00:00:00 2001 From: SomeDer <48731521+SomeDer@users.noreply.github.com> Date: Thu, 21 Mar 2019 19:25:41 +0000 Subject: [PATCH 0138/1098] init: notify user if plugin isn't found (#7679) --- oh-my-zsh.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 4f6bfd5a5..fbb10dd82 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -83,6 +83,8 @@ for plugin ($plugins); do source $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then source $ZSH/plugins/$plugin/$plugin.plugin.zsh + else + echo "Warning: plugin $plugin not found" fi done From de2395c678228a5bc6b22711d2bc1b17797d639d Mon Sep 17 00:00:00 2001 From: Konstantin Gizdov Date: Thu, 21 Mar 2019 21:35:00 +0200 Subject: [PATCH 0139/1098] compfix: fix check for empty string (#7674) --- lib/compfix.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compfix.zsh b/lib/compfix.zsh index 68decc1ed..b09b283f2 100644 --- a/lib/compfix.zsh +++ b/lib/compfix.zsh @@ -18,7 +18,7 @@ function handle_completion_insecurities() { insecure_dirs=( ${(f@):-"$(compaudit 2>/dev/null)"} ) # If no such directories exist, get us out of here. - (( ! ${#insecure_dirs} )) && return + [[ -z "${insecure_dirs}" ]] && return # List ownership and permissions of all insecure directories. print "[oh-my-zsh] Insecure completion-dependent directories detected:" From 8aa8405ea25f768a9bfb9a54d9a0dc05efb4efad Mon Sep 17 00:00:00 2001 From: Jeremy Armstrong Date: Thu, 21 Mar 2019 14:41:55 -0500 Subject: [PATCH 0140/1098] termsupport: add support for tmux* $TERM values (#7622) --- lib/termsupport.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 87d55ee89..aa14f3f07 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -21,7 +21,7 @@ function title { print -Pn "\e]2;$2:q\a" # set window name print -Pn "\e]1;$1:q\a" # set tab name ;; - screen*) + screen*|tmux*) print -Pn "\ek$1:q\e\\" # set screen hardstatus ;; *) From 1e11a3c112f47ee87f432a5410755239ff43b0bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Avi=20=D7=93?= Date: Fri, 22 Mar 2019 14:37:08 -0400 Subject: [PATCH 0141/1098] init: fix erroneous plugin not found warning (#7686) Co-authored-by: Se De --- oh-my-zsh.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index fbb10dd82..e080257c1 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -44,6 +44,7 @@ is_plugin() { test -f $base_dir/plugins/$name/$name.plugin.zsh \ || test -f $base_dir/plugins/$name/_$name } + # Add all defined plugins to fpath. This must be done # before running compinit. for plugin ($plugins); do @@ -51,6 +52,8 @@ for plugin ($plugins); do fpath=($ZSH_CUSTOM/plugins/$plugin $fpath) elif is_plugin $ZSH $plugin; then fpath=($ZSH/plugins/$plugin $fpath) + else + echo "Warning: plugin $plugin not found" fi done @@ -83,8 +86,6 @@ for plugin ($plugins); do source $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then source $ZSH/plugins/$plugin/$plugin.plugin.zsh - else - echo "Warning: plugin $plugin not found" fi done From 2b68600d50f2e75ab22583e8cb49fc8ee9a9675f Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Fri, 22 Mar 2019 20:32:29 +0100 Subject: [PATCH 0142/1098] suse: remove sudo from some zypper aliases (#7678) Closes #5564 --- plugins/suse/README.md | 40 ++++++++++++++++++------------------ plugins/suse/suse.plugin.zsh | 40 ++++++++++++++++++------------------ 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/plugins/suse/README.md b/plugins/suse/README.md index 0e8a7f7ba..b9b069574 100644 --- a/plugins/suse/README.md +++ b/plugins/suse/README.md @@ -15,14 +15,14 @@ plugins=(... suse) | Alias | Commands | Description | | ---------------- | ----------------------------- | -------------------------------------------------------------- | | z | `sudo zypper` | call zypper | -| zh | `sudo zypper -h` | print help | -| zhse | `sudo zypper -h se` | print help for the search command | -| zlicenses | `sudo zypper licenses` | prints a report about licenses and EULAs of installed packages | +| zh | `zypper -h` | print help | +| zhse | `zypper -h se` | print help for the search command | +| zlicenses | `zypper licenses` | prints a report about licenses and EULAs of installed packages | | zps | `sudo zypper ps` | list process using deleted files | | zshell | `sudo zypper shell` | open a zypper shell session | | zsource-download | `sudo zypper source-download` | download source rpms for all installed packages | -| ztos | `sudo zypper tos` | shows the ID string of the target operating system | -| zvcmp | `sudo zypper vcmp` | tell whether version1 is older or newer than version2 | +| ztos | `zypper tos` | shows the ID string of the target operating system | +| zvcmp | `zypper vcmp` | tell whether version1 is older or newer than version2 | ## Packages commands @@ -39,8 +39,8 @@ plugins=(... suse) | Alias | Commands | Description | | ------ | ------------------- | ---------------------- | | zdup | `sudo zypper dup` | upgrade packages | -| zlp | `sudo zypper lp` | list necessary patches | -| zlu | `sudo zypper lu` | list updates | +| zlp | `zypper lp` | list necessary patches | +| zlu | `zypper lu` | list updates | | zpchk | `sudo zypper pchk` | check for patches | | zup | `sudo zypper up` | update packages | | zpatch | `sudo zypper patch` | install patches | @@ -49,16 +49,16 @@ plugins=(... suse) | Alias | Commands | Description | | ------------- | -------------------------- | ---------------------------------------------------- | -| zif | `sudo zypper if` | display info about packages | -| zpa | `sudo zypper pa` | list packages | -| zpatch-info | `sudo zypper patch-info` | display info about patches | -| zpattern-info | `sudo zypper pattern-info` | display info about patterns | -| zproduct-info | `sudo zypper product-info` | display info about products | -| zpch | `sudo zypper pch` | list all patches | -| zpd | `sudo zypper pd` | list products | -| zpt | `sudo zypper pt` | list patterns | -| zse | `sudo zypper se` | search for packages | -| zwp | `sudo zypper wp` | list all packages providing the specified capability | +| zif | `zypper if` | display info about packages | +| zpa | `zypper pa` | list packages | +| zpatch-info | `zypper patch-info` | display info about patches | +| zpattern-info | `zypper pattern-info` | display info about patterns | +| zproduct-info | `zypper product-info` | display info about products | +| zpch | `zypper pch` | list all patches | +| zpd | `zypper pd` | list products | +| zpt | `zypper pt` | list patterns | +| zse | `zypper se` | search for packages | +| zwp | `zypper wp` | list all packages providing the specified capability | ## Repositories commands @@ -66,7 +66,7 @@ plugins=(... suse) | ----- | ------------------- | ---------------------------------------- | | zar | `sudo zypper ar` | add a repository | | zcl | `sudo zypper clean` | clean cache | -| zlr | `sudo zypper lr` | list repositories | +| zlr | `zypper lr` | list repositories | | zmr | `sudo zypper mr` | modify repositories | | znr | `sudo zypper nr` | rename repositories (for the alias only) | | zref | `sudo zypper ref` | refresh repositories | @@ -79,12 +79,12 @@ plugins=(... suse) | zms | `sudo zypper ms` | modify properties of specified services | | zrefs | `sudo zypper refs` | refreshing a service mean executing the service's special task | | zrs | `sudo zypper rs` | remove specified repository index service from the system | -| zls | `sudo zypper ls` | list services defined on the system | +| zls | `zypper ls` | list services defined on the system | ## Package Locks Management commands | Alias | Commands | Description | | ----- | ---------------- | ----------------------------------- | | zal | `sudo zypper al` | add a package lock | | zcl | `sudo zypper cl` | remove unused locks | -| zll | `sudo zypper ll` | list currently active package locks | +| zll | `zypper ll` | list currently active package locks | | zrl | `sudo zypper rl` | remove specified package lock | diff --git a/plugins/suse/suse.plugin.zsh b/plugins/suse/suse.plugin.zsh index 60f7042eb..dcfeccb03 100644 --- a/plugins/suse/suse.plugin.zsh +++ b/plugins/suse/suse.plugin.zsh @@ -1,13 +1,13 @@ #Main commands alias z='sudo zypper' -alias zh='sudo zypper -h' -alias zhse='sudo zypper -h se' -alias zlicenses='sudo zypper licenses' +alias zh='zypper -h' +alias zhse='zypper -h se' +alias zlicenses='zypper licenses' alias zps='sudo zypper ps' alias zshell='sudo zypper shell' alias zsource-download='sudo zypper source-download' -alias ztos='sudo zypper tos' -alias zvcmp='sudo zypper vcmp' +alias ztos='zypper tos' +alias zvcmp='zypper vcmp' #Packages commands alias zin='sudo zypper in' @@ -18,28 +18,28 @@ alias zve='sudo zypper ve' #Updates commands alias zdup='sudo zypper dup' -alias zlp='sudo zypper lp' -alias zlu='sudo zypper lu' +alias zlp='zypper lp' +alias zlu='zypper lu' alias zpchk='sudo zypper pchk' alias zup='sudo zypper up' alias zpatch='sudo zypper patch' #Request commands -alias zif='sudo zypper if' -alias zpa='sudo zypper pa' -alias zpatch-info='sudo zypper patch-info' -alias zpattern-info='sudo zypper pattern-info' -alias zproduct-info='sudo zypper product-info' -alias zpch='sudo zypper pch' -alias zpd='sudo zypper pd' -alias zpt='sudo zypper pt' -alias zse='sudo zypper se' -alias zwp='sudo zypper wp' +alias zif='zypper if' +alias zpa='zypper pa' +alias zpatch-info='zypper patch-info' +alias zpattern-info='zypper pattern-info' +alias zproduct-info='zypper product-info' +alias zpch='zypper pch' +alias zpd='zypper pd' +alias zpt='zypper pt' +alias zse='zypper se' +alias zwp='zypper wp' #Repositories commands alias zar='sudo zypper ar' alias zcl='sudo zypper clean' -alias zlr='sudo zypper lr' +alias zlr='zypper lr' alias zmr='sudo zypper mr' alias znr='sudo zypper nr' alias zref='sudo zypper ref' @@ -50,10 +50,10 @@ alias zas='sudo zypper as' alias zms='sudo zypper ms' alias zrefs='sudo zypper refs' alias zrs='sudo zypper rs' -alias zls='sudo zypper ls' +alias zls='zypper ls' #Package Locks Management commands alias zal='sudo zypper al' alias zcl='sudo zypper cl' -alias zll='sudo zypper ll' +alias zll='zypper ll' alias zrl='sudo zypper rl' From 6fe4ac024a0373a847b3a4c1b59e9509d5832c25 Mon Sep 17 00:00:00 2001 From: Zixu Wang Date: Sat, 23 Mar 2019 08:57:46 -0700 Subject: [PATCH 0143/1098] web-search: update alias for stackoverflow (#7660) Changed from `stack` because it conflicts with Haskell Tool Stack Fixes #7659 --- plugins/web-search/README.md | 1 + plugins/web-search/web-search.plugin.zsh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/web-search/README.md b/plugins/web-search/README.md index d790d944d..5b09b8980 100644 --- a/plugins/web-search/README.md +++ b/plugins/web-search/README.md @@ -37,6 +37,7 @@ Available search contexts are: | `ecosia` | `https://www.ecosia.org/search?q=` | | `goodreads` | `https://www.goodreads.com/search?q=` | | `qwant` | `https://www.qwant.com/?q=` | +| `stackoverflow` | `https://stackoverflow.com/search?q=` | Also there are aliases for bang-searching DuckDuckGo: diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh index 18cc0614a..9a70d7bc6 100644 --- a/plugins/web-search/web-search.plugin.zsh +++ b/plugins/web-search/web-search.plugin.zsh @@ -52,7 +52,7 @@ alias baidu='web_search baidu' alias ecosia='web_search ecosia' alias goodreads='web_search goodreads' alias qwant='web_search qwant' -alias stack='web_search stackoverflow' +alias stackoverflow='web_search stackoverflow' #add your own !bang searches here alias wiki='web_search duckduckgo \!w' From 9975b16297e3c5619bdb88cc8f029a90ee80bb27 Mon Sep 17 00:00:00 2001 From: Peter Theill Date: Sat, 23 Mar 2019 17:03:45 +0100 Subject: [PATCH 0144/1098] web-search: add Givero (supports good causes) as search engine (#7581) Adds "givero" as a keyword for searching Givero, a relative new search engine donating revenue to good causes around the world. --- plugins/web-search/README.md | 1 + plugins/web-search/web-search.plugin.zsh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/plugins/web-search/README.md b/plugins/web-search/README.md index 5b09b8980..d04042506 100644 --- a/plugins/web-search/README.md +++ b/plugins/web-search/README.md @@ -37,6 +37,7 @@ Available search contexts are: | `ecosia` | `https://www.ecosia.org/search?q=` | | `goodreads` | `https://www.goodreads.com/search?q=` | | `qwant` | `https://www.qwant.com/?q=` | +| `givero` | `https://www.givero.com/search?q=` | | `stackoverflow` | `https://stackoverflow.com/search?q=` | Also there are aliases for bang-searching DuckDuckGo: diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh index 9a70d7bc6..5b76eeae2 100644 --- a/plugins/web-search/web-search.plugin.zsh +++ b/plugins/web-search/web-search.plugin.zsh @@ -17,6 +17,7 @@ function web_search() { ecosia "https://www.ecosia.org/search?q=" goodreads "https://www.goodreads.com/search?q=" qwant "https://www.qwant.com/?q=" + givero "https://www.givero.com/search?q=" stackoverflow "https://stackoverflow.com/search?q=" ) @@ -52,6 +53,7 @@ alias baidu='web_search baidu' alias ecosia='web_search ecosia' alias goodreads='web_search goodreads' alias qwant='web_search qwant' +alias givero='web_search givero' alias stackoverflow='web_search stackoverflow' #add your own !bang searches here From f03aa42cbb2ef401f723557bbd2be5c72b1cba21 Mon Sep 17 00:00:00 2001 From: Erik Date: Sat, 23 Mar 2019 12:49:15 -0400 Subject: [PATCH 0145/1098] react-native: add iPad and Apple TV simulator aliases (#7603) --- plugins/react-native/README.md | 67 ++++++++++++-------- plugins/react-native/react-native.plugin.zsh | 17 +++++ 2 files changed, 59 insertions(+), 25 deletions(-) diff --git a/plugins/react-native/README.md b/plugins/react-native/README.md index d1fce0fc2..0cfaa36b4 100644 --- a/plugins/react-native/README.md +++ b/plugins/react-native/README.md @@ -11,28 +11,45 @@ plugins=(... react-native) ## Aliases -| Alias | React Native command | -| :------------ | :------------------------------------------------- | -| **rn** | `react-native` | -| **rns** | `react-native start` | -| **rnlink** | `react-native link` | -| _App testing_ | -| **rnand** | `react-native run-android` | -| **rnios** | `react-native run-ios` | -| **rnios4s** | `react-native run-ios --simulator "iPhone 4s"` | -| **rnios5** | `react-native run-ios --simulator "iPhone 5"` | -| **rnios5s** | `react-native run-ios --simulator "iPhone 5s"` | -| **rnios6** | `react-native run-ios --simulator "iPhone 6"` | -| **rnios6s** | `react-native run-ios --simulator "iPhone 6s"` | -| **rnios7** | `react-native run-ios --simulator "iPhone7"` | -| **rnios7p** | `react-native run-ios --simulator "iPhone 7 Plus"` | -| **rnios8** | `react-native run-ios --simulator "iPhone 8"` | -| **rnios8p** | `react-native run-ios --simulator "iPhone 8 Plus"` | -| **rniosse** | `react-native run-ios --simulator "iPhone SE"` | -| **rniosx** | `react-native run-ios --simulator "iPhone X"` | -| **rniosxs** | `react-native run-ios --simulator "iPhone XS"` | -| **rniosxsm** | `react-native run-ios --simulator "iPhone XS Max"` | -| **rniosxr** | `react-native run-ios --simulator "iPhone XR"` | -| _Logging_ | -| **rnland** | `react-native log-android` | -| **rnlios** | `react-native log-ios` | +| Alias | React Native command | +| :------------ | :------------------------------------------------- | +| **rn** | `react-native` | +| **rns** | `react-native start` | +| **rnlink** | `react-native link` | +| _App testing_ | +| **rnand** | `react-native run-android` | +| **rnios** | `react-native run-ios` | +| **rnios4s** | `react-native run-ios --simulator "iPhone 4s"` | +| **rnios5** | `react-native run-ios --simulator "iPhone 5"` | +| **rnios5s** | `react-native run-ios --simulator "iPhone 5s"` | +| **rnios6** | `react-native run-ios --simulator "iPhone 6"` | +| **rnios6s** | `react-native run-ios --simulator "iPhone 6s"` | +| **rnios7** | `react-native run-ios --simulator "iPhone7"` | +| **rnios7p** | `react-native run-ios --simulator "iPhone 7 Plus"` | +| **rnios8** | `react-native run-ios --simulator "iPhone 8"` | +| **rnios8p** | `react-native run-ios --simulator "iPhone 8 Plus"` | +| **rniosse** | `react-native run-ios --simulator "iPhone SE"` | +| **rniosx** | `react-native run-ios --simulator "iPhone X"` | +| **rniosxs** | `react-native run-ios --simulator "iPhone XS"` | +| **rniosxsm** | `react-native run-ios --simulator "iPhone XS Max"` | +| **rniosxr** | `react-native run-ios --simulator "iPhone XR"` | +| _iPads_ | | +| **rnipad2** | `react-native run-ios --simulator "iPad 2"` | +| **rnipadr** | `react-native run-ios --simulator "iPad Retina"` | +| **rnipada** | 'react-native run-ios --simulator "iPad Air"' | +| **rnipada2** | 'react-native run-ios --simulator "iPad Air 2"' | +| **rnipad5** | 'react-native run-ios --simulator "iPad (5th generation)"' | +| **rnipad9** | 'react-native run-ios --simulator "iPad Pro (9.7-inch)"' | +| **rnipad12** | 'react-native run-ios --simulator "iPad Pro (12.9-inch)"' | +| **rnipad122** | 'react-native run-ios --simulator "iPad Pro (12.9-inch) (2nd generation)"' | +| **rnipad10** | 'react-native run-ios --simulator "iPad Pro (10.5-inch)"' | +| **rnipad6** | 'react-native run-ios --simulator "iPad Pro (6th generation)"' | +| **rnipad11** | 'react-native run-ios --simulator "iPad Pro (11-inch)"' | +| **rnipad123** | 'react-native run-ios --simulator "iPad Pro (12.9-inch) (3rd generation)"' | +| _Apple TVs_ | | +| **rnatv** | `react-native run-ios --simulator "Apple TV"` | +| **rnatv4k** | `react-native run-ios --simulator "Apple TV 4K"` | +| **rnatv4k1080**| `react-native run-ios --simulator "Apple TV 4K (at 1080p)"` | +| _Logging_ | +| **rnland** | `react-native log-android` | +| **rnlios** | `react-native log-ios` | diff --git a/plugins/react-native/react-native.plugin.zsh b/plugins/react-native/react-native.plugin.zsh index 220aa2dce..a4092a694 100644 --- a/plugins/react-native/react-native.plugin.zsh +++ b/plugins/react-native/react-native.plugin.zsh @@ -19,5 +19,22 @@ alias rniosxs='react-native run-ios --simulator "iPhone XS"' alias rniosxsm='react-native run-ios --simulator "iPhone XS Max"' alias rniosxr='react-native run-ios --simulator "iPhone XR"' +alias rnipad2='react-native run-ios --simulator "iPad 2"' +alias rnipadr='react-native run-ios --simulator "iPad Retina"' +alias rnipada='react-native run-ios --simulator "iPad Air"' +alias rnipada2='react-native run-ios --simulator "iPad Air 2"' +alias rnipad5='react-native run-ios --simulator "iPad (5th generation)"' +alias rnipad9='react-native run-ios --simulator "iPad Pro (9.7-inch)"' +alias rnipad12='react-native run-ios --simulator "iPad Pro (12.9-inch)"' +alias rnipad122='react-native run-ios --simulator "iPad Pro (12.9-inch) (2nd generation)"' +alias rnipad10='react-native run-ios --simulator "iPad Pro (10.5-inch)"' +alias rnipad6='react-native run-ios --simulator "iPad Pro (6th generation)"' +alias rnipad11='react-native run-ios --simulator "iPad Pro (11-inch)"' +alias rnipad123='react-native run-ios --simulator "iPad Pro (12.9-inch) (3rd generation)"' + +alias rnatv='react-native run-ios --simulator "Apple TV"' +alias rnatv4k='react-native run-ios --simulator "Apple TV 4K"' +alias rnatv4k1080='react-native run-ios --simulator "Apple TV 4K (at 1080p)"' + alias rnland='react-native log-android' alias rnlios='react-native log-ios' From 83d11394321398b99911089901b905574807ccfb Mon Sep 17 00:00:00 2001 From: Rob Lugton Date: Sun, 24 Mar 2019 05:20:28 +1100 Subject: [PATCH 0146/1098] agnoster: show AWS_PROFILE in prompt (#6621) --- themes/agnoster.zsh-theme | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 0edb773aa..3c30a9e11 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -224,11 +224,25 @@ prompt_status() { [[ -n "$symbols" ]] && prompt_segment black default "$symbols" } +#AWS Profile: +# - display current AWS_PROFILE name +# - displays yellow on red if profile name contains 'production' or +# ends in '-prod' +# - displays black on green otherwise +prompt_aws() { + [[ -z "$AWS_PROFILE" ]] && return + case "$AWS_PROFILE" in + *-prod|*production*) prompt_segment red yellow "AWS: $AWS_PROFILE" ;; + *) prompt_segment green black "AWS: $AWS_PROFILE" ;; + esac +} + ## Main prompt build_prompt() { RETVAL=$? prompt_status prompt_virtualenv + prompt_aws prompt_context prompt_dir prompt_git From 1a2d930bca7966c44f1551ea2f0b8d7aecc80e56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 23 Mar 2019 19:52:31 +0100 Subject: [PATCH 0147/1098] aws: refactor completion sourcing logic (#7364) * Clean up Homebrew detection and add comments. Also changed some if flags. * Detect aws cli completion file from RPM --- plugins/aws/aws.plugin.zsh | 56 ++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index af27e669a..9cb69dd09 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -1,32 +1,9 @@ -_homebrew-installed() { - type brew &> /dev/null - _xit=$? - if [ $_xit -eq 0 ];then - # ok , we have brew installed - # speculatively we check default brew prefix - if [ -h /usr/local/opt/awscli ];then - _brew_prefix="/usr/local/opt/awscli" - else - # ok , it is not default prefix - # this call to brew is expensive ( about 400 ms ), so at least let's make it only once - _brew_prefix=$(brew --prefix awscli) - fi - return 0 - else - return $_xit - fi -} - -_awscli-homebrew-installed() { - [ -r $_brew_prefix/libexec/bin/aws_zsh_completer.sh ] &> /dev/null -} - function agp { echo $AWS_PROFILE } function asp { - local rprompt=${RPROMPT//} + local rprompt=${RPROMPT//} export AWS_DEFAULT_PROFILE=$1 export AWS_PROFILE=$1 @@ -39,11 +16,32 @@ function aws_profiles { } compctl -K aws_profiles asp -if which aws_zsh_completer.sh &>/dev/null; then - _aws_zsh_completer_path=$(which aws_zsh_completer.sh 2>/dev/null) -elif _homebrew-installed && _awscli-homebrew-installed; then + +# Load awscli completions + +_awscli-homebrew-installed() { + # check if Homebrew is installed + (( $+commands[brew] )) || return 1 + + # speculatively check default brew prefix + if [ -h /usr/local/opt/awscli ]; then + _brew_prefix=/usr/local/opt/awscli + else + # ok, it is not in the default prefix + # this call to brew is expensive (about 400 ms), so at least let's make it only once + _brew_prefix=$(brew --prefix awscli) + fi +} + +# get aws_zsh_completer.sh location from $PATH +_aws_zsh_completer_path="$commands[aws_zsh_completer.sh]" + +# otherwise check if installed via Homebrew +if [[ -z $_aws_zsh_completer_path ]] && _awscli-homebrew-installed; then _aws_zsh_completer_path=$_brew_prefix/libexec/bin/aws_zsh_completer.sh +else + _aws_zsh_completer_path=/usr/share/zsh/site-functions/aws_zsh_completer.sh fi -[ -n "$_aws_zsh_completer_path" ] && [ -x $_aws_zsh_completer_path ] && source $_aws_zsh_completer_path -unset _aws_zsh_completer_path +[[ -r $_aws_zsh_completer_path ]] && source $_aws_zsh_completer_path +unset _aws_zsh_completer_path _brew_prefix From 729c2f796d4945dfa2bcff144fea84afe5c4b0cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20M=C4=83gheru=C8=99an-Stanciu=20=40magheru=5Fsan?= Date: Sat, 23 Mar 2019 22:08:35 +0100 Subject: [PATCH 0148/1098] otp: added a plugin for oathtool one-time passwords (#3862) --- plugins/otp/otp.plugin.zsh | 54 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 plugins/otp/otp.plugin.zsh diff --git a/plugins/otp/otp.plugin.zsh b/plugins/otp/otp.plugin.zsh new file mode 100644 index 000000000..4bce34fd3 --- /dev/null +++ b/plugins/otp/otp.plugin.zsh @@ -0,0 +1,54 @@ +export OTP_HOME=~/.otp +mkdir -p $OTP_HOME + +function ot () { + if ! command -v oathtool > /dev/null 2>&1; then + echo "Note: you need to install oathtool or oath-toolkit, depending on your OS or distribution." + return 1 + fi + + if ! command -v gpg > /dev/null 2>&1; then + echo "Note: you need to install gpg and create an ID using 'gpg --gen-key', unless you have one already." + return 1 + fi + + if [[ `uname` == 'Darwin' ]] then # MacOS X + export COPY_CMD='pbcopy' + elif command -v xsel > /dev/null 2>&1; then # Any Unix with xsel installed + export COPY_CMD='xsel --clipboard --input' + else + COPY_CMD='true' + fi + + if [[ "x$1" == "x" ]]; then + echo "usage: otpw " + return 1 + elif [ ! -f $OTP_HOME/$1.otp.asc ]; then + echo "missing profile $1, you might need to create it first using otp_add_device" + return 1 + else + totpkey=$(gpg --decrypt $OTP_HOME/$1.otp.asc) + oathtool --totp --b $totpkey | tee /dev/stderr | `echo $COPY_CMD` + if [[ $COPY_CMD == 'true' ]] then + echo "Note: you might consider installing xsel for clipboard integration" + fi + fi +} + +function otp_add_device () { + if [[ "x$1" == "x" ]] then + echo "usage: otp_add " + return 1 + else + echo "Enter an email address attached to your GPG private key, then paste the secret configuration key followed by ^D" + + rm -f $OTP_HOME/$1.otp.asc + gpg --armor --encrypt --output $OTP_HOME/$1.otp.asc /dev/stdin + fi +} + +function otp_devices () { + reply=($(find $OTP_HOME -name \*.otp.asc | xargs basename -s .otp.asc)) +} + +compctl -K otp_devices ot From a055930cf862c74159218d0acfd09b64f1e09ed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 24 Mar 2019 11:27:25 +0100 Subject: [PATCH 0149/1098] Fix README --- plugins/lighthouse/README.md | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/plugins/lighthouse/README.md b/plugins/lighthouse/README.md index 0dd0003f1..0db29b4e5 100644 --- a/plugins/lighthouse/README.md +++ b/plugins/lighthouse/README.md @@ -1,6 +1,6 @@ # Lighthouse plugin -This plugin issue lighthouse tickets. +This plugin adds commands to manage [Lighthouse](https://lighthouseapp.com/). To use it, add `lighthouse` to the plugins array in your zshrc file: @@ -8,8 +8,19 @@ To use it, add `lighthouse` to the plugins array in your zshrc file: plugins=(... lighthouse) ``` -## Aliases +## Commands -| Alias | Command | Description | -|-------|----------------------------------------|------------------------------------------------------| -| lho | `open_lighthouse_ticket` | Opening lighthouse ticket | \ No newline at end of file +* `open_lighthouse_ticket ` (alias: `lho`): + + Opens the URL to the issue passed as an argument. To use it, add a `.lighthouse-url` + file in your directory with the URL to the individual project. + + Example: + ```zsh + $ cat .lighthouse-url + https://rails.lighthouseapp.com/projects/8994 + + $ lho 23 + Opening ticket #23 + # The browser goes to https://rails.lighthouseapp.com/projects/8994/tickets/23 + ``` From e4189b9a963a323b5e4e2a5a440e69a01f18479f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 24 Mar 2019 11:29:35 +0100 Subject: [PATCH 0150/1098] Clean up lighthouse plugin --- plugins/lighthouse/lighthouse.plugin.zsh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/plugins/lighthouse/lighthouse.plugin.zsh b/plugins/lighthouse/lighthouse.plugin.zsh index 4a47b6010..3fca2bf4f 100644 --- a/plugins/lighthouse/lighthouse.plugin.zsh +++ b/plugins/lighthouse/lighthouse.plugin.zsh @@ -1,16 +1,12 @@ -# To use: add a .lighthouse file into your directory with the URL to the -# individual project. For example: -# https://rails.lighthouseapp.com/projects/8994 -# Example usage: https://screencast.com/t/ZDgwNDUwNT open_lighthouse_ticket () { if [ ! -f .lighthouse-url ]; then echo "There is no .lighthouse-url file in the current directory..." - return 0; - else - lighthouse_url=$(cat .lighthouse-url); - echo "Opening ticket #$1"; - open_command "$lighthouse_url/tickets/$1"; + return 0 fi + + lighthouse_url=$(cat .lighthouse-url) + echo "Opening ticket #$1" + open_command "$lighthouse_url/tickets/$1" } alias lho='open_lighthouse_ticket' From 5ff21efad72117377c7b6cabd850d6b2b01ee31a Mon Sep 17 00:00:00 2001 From: shellbye Date: Mon, 25 Mar 2019 00:25:26 +0800 Subject: [PATCH 0151/1098] Add pygmalion-virtualenv theme (#5139) --- themes/pygmalion-virtualenv.zsh-theme | 50 +++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 themes/pygmalion-virtualenv.zsh-theme diff --git a/themes/pygmalion-virtualenv.zsh-theme b/themes/pygmalion-virtualenv.zsh-theme new file mode 100644 index 000000000..ea28e125a --- /dev/null +++ b/themes/pygmalion-virtualenv.zsh-theme @@ -0,0 +1,50 @@ +# Yay! High voltage and arrows! + + +function _virtualenv_prompt_info { + if [[ -n "$(whence virtualenv_prompt_info)" ]]; then + if [ -n "$(whence pyenv_prompt_info)" ]; then + if [ "$1" = "inline" ]; then + ZSH_THEME_VIRTUAL_ENV_PROMPT_PREFIX=%{$fg[blue]%}"::%{$fg[red]%}" + ZSH_THEME_VIRTUAL_ENV_PROMPT_SUFFIX="" + virtualenv_prompt_info + fi + [ "$(pyenv_prompt_info)" = "${PYENV_PROMPT_DEFAULT_VERSION}" ] && virtualenv_prompt_info + else + virtualenv_prompt_info + fi + fi +} + +prompt_setup_pygmalion(){ + ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" + ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " + ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}" + ZSH_THEME_GIT_PROMPT_CLEAN="" + + base_prompt='$(_virtualenv_prompt_info)%{$fg[magenta]%}%n%{$reset_color%}%{$fg[cyan]%}@%{$reset_color%}%{$fg[yellow]%}%m%{$reset_color%}%{$fg[red]%}:%{$reset_color%}%{$fg[cyan]%}%0~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}' + post_prompt='%{$fg[cyan]%}⇒%{$reset_color%} ' + + base_prompt_nocolor=$(echo "$base_prompt" | perl -pe "s/%\{[^}]+\}//g") + post_prompt_nocolor=$(echo "$post_prompt" | perl -pe "s/%\{[^}]+\}//g") + + precmd_functions+=(prompt_pygmalion_precmd) +} + +prompt_pygmalion_precmd(){ + local gitinfo=$(git_prompt_info) + local gitinfo_nocolor=$(echo "$gitinfo" | perl -pe "s/%\{[^}]+\}//g") + local exp_nocolor="$(print -P \"$base_prompt_nocolor$gitinfo_nocolor$post_prompt_nocolor\")" + local prompt_length=${#exp_nocolor} + + local nl="" + + if [[ $prompt_length -gt 40 ]]; then + nl=$'\n%{\r%}'; + fi + PROMPT="$base_prompt$gitinfo$nl$post_prompt" +} + +prompt_setup_pygmalion + + From 532a784b806375370022605d8be17c1116553572 Mon Sep 17 00:00:00 2001 From: David Kane Date: Sun, 24 Mar 2019 18:37:07 +0000 Subject: [PATCH 0152/1098] aws: refactor AWS plugin (#7615) * Update the AWS plugin to support disabling RPROMT display: Use a $SHOW_AWS_PROMPT option. * Refactoring aws plugin: Exposing customizable aws_prompt_info function to be used in themes. * Set aws prompt prefix and suffix to original values and fix README Co-authored-by: "Vassilis S. Moustakas" --- plugins/aws/README.md | 25 +++++++++++++++++++------ plugins/aws/aws.plugin.zsh | 20 +++++++++++++++++--- 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/plugins/aws/README.md b/plugins/aws/README.md index 8a45199b8..57ab1e5ac 100644 --- a/plugins/aws/README.md +++ b/plugins/aws/README.md @@ -1,8 +1,7 @@ # aws This plugin provides completion support for [awscli](https://docs.aws.amazon.com/cli/latest/reference/index.html) -and a few utilities to manage AWS profiles: a function to change profiles with autocompletion support -and a function to get the current AWS profile. The current AWS profile is also displayed in `RPROMPT`. +and a few utilities to manage AWS profiles and display them in the prompt. To use it, add `aws` to the plugins array in your zshrc file. @@ -12,9 +11,23 @@ plugins=(... aws) ## Plugin commands -* `asp `: Sets `AWS_PROFILE` and `AWS_DEFAULT_PROFILE` (legacy) to ``. -It also adds it to your RPROMPT. +* `asp []`: Sets `$AWS_PROFILE` and `$AWS_DEFAULT_PROFILE` (legacy) to ``. + Run `asp` without arguments to clear the profile. -* `agp`: Gets the current value of `AWS_PROFILE`. +* `agp`: Gets the current value of `$AWS_PROFILE`. -* `aws_profiles`: Lists the available profiles in the file referenced in `AWS_CONFIG_FILE` (default: ~/.aws/config). Used to provide completion for the `asp` function. +* `aws_profiles`: Lists the available profiles in the `$AWS_CONFIG_FILE` (default: `~/.aws/config`). + Used to provide completion for the `asp` function. + +## Plugin options + +* Set `SHOW_AWS_PROMPT=false` in your zshrc file if you want to prevent the plugin from modifying your RPROMPT. + +## Theme + +The plugin creates an `aws_prompt_info` function that you can use in your theme, which displays +the current `$AWS_PROFILE`. It uses two variables to control how that is shown: + +- ZSH_THEME_AWS_PREFIX: sets the prefix of the AWS_PROFILE. Defaults to ``. diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index 9cb69dd09..2fb351812 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -1,14 +1,16 @@ +# AWS profile selection + function agp { echo $AWS_PROFILE } function asp { - local rprompt=${RPROMPT//} - export AWS_DEFAULT_PROFILE=$1 export AWS_PROFILE=$1 - export RPROMPT="$rprompt" + if [[ -z "$1" ]]; then + echo AWS profile cleared. + fi } function aws_profiles { @@ -17,6 +19,18 @@ function aws_profiles { compctl -K aws_profiles asp +# AWS prompt + +function aws_prompt_info() { + [[ -z $AWS_PROFILE ]] && return + echo "${ZSH_THEME_AWS_PREFIX:=}" +} + +if [ "$SHOW_AWS_PROMPT" != false ]; then + export RPROMPT='$(aws_prompt_info)'"$RPROMPT" +fi + + # Load awscli completions _awscli-homebrew-installed() { From 8cbdd79517d710e5bab6ce7aca0754b37462f2ee Mon Sep 17 00:00:00 2001 From: Logan Lindquist Date: Sun, 24 Mar 2019 13:46:27 -0500 Subject: [PATCH 0153/1098] aws: set AWS_EB_PROFILE for the EB CLI (#7388) Added AWS_EB_PROFILE environment variable to the AWS Plugin. The EB CLI uses this variable instead of the primary AWS_PROFILE variable to keep track of what profile it is using. https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-configuration.html --- plugins/aws/README.md | 1 + plugins/aws/aws.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/aws/README.md b/plugins/aws/README.md index 57ab1e5ac..45e6de937 100644 --- a/plugins/aws/README.md +++ b/plugins/aws/README.md @@ -12,6 +12,7 @@ plugins=(... aws) ## Plugin commands * `asp []`: Sets `$AWS_PROFILE` and `$AWS_DEFAULT_PROFILE` (legacy) to ``. + It also sets `$AWS_EB_PROFILE` to `` for the Elastic Beanstalk CLI. Run `asp` without arguments to clear the profile. * `agp`: Gets the current value of `$AWS_PROFILE`. diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index 2fb351812..944557e14 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -7,6 +7,7 @@ function agp { function asp { export AWS_DEFAULT_PROFILE=$1 export AWS_PROFILE=$1 + export AWS_EB_PROFILE=$1 if [[ -z "$1" ]]; then echo AWS profile cleared. From 4f4985fddc632a1d9745aec94ce95bea10006f97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20M=C4=83gheru=C8=99an-Stanciu?= Date: Wed, 30 Jul 2014 14:59:00 +0200 Subject: [PATCH 0154/1098] aws: added an alias for changing the AWS access key set on a profile --- plugins/aws/aws.plugin.zsh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index 944557e14..7005af2d6 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -14,10 +14,25 @@ function asp { fi } +function aws_change_access_key { + if [[ "x$1" == "x" ]] then + echo "usage: $0 " + return 1 + else + echo "Insert the credentials when asked." + asp $1 + aws iam create-access-key + aws configure --profile $1 + echo "You can now safely delete the old access key running 'aws iam delete-access-key --access-key-id ID'" + echo "Your current keys are:" + aws iam list-access-keys + fi +} + function aws_profiles { reply=($(grep '\[profile' "${AWS_CONFIG_FILE:-$HOME/.aws/config}"|sed -e 's/.*profile \([a-zA-Z0-9_\.-]*\).*/\1/')) } -compctl -K aws_profiles asp +compctl -K aws_profiles asp aws_change_access_key # AWS prompt From 5f893dcd209fdad920a1450355acbd4c10faabf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 23 Mar 2019 20:56:55 +0100 Subject: [PATCH 0155/1098] aws: clean up aws_change_access_key function --- plugins/aws/aws.plugin.zsh | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index 7005af2d6..6de329bb8 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -15,18 +15,19 @@ function asp { } function aws_change_access_key { - if [[ "x$1" == "x" ]] then - echo "usage: $0 " + if [[ -z "$1" ]] then + echo "usage: $0 " return 1 - else - echo "Insert the credentials when asked." - asp $1 - aws iam create-access-key - aws configure --profile $1 - echo "You can now safely delete the old access key running 'aws iam delete-access-key --access-key-id ID'" - echo "Your current keys are:" - aws iam list-access-keys fi + + echo Insert the credentials when asked. + asp "$1" + aws iam create-access-key + aws configure --profile "$1" + + echo You can now safely delete the old access key running \`aws iam delete-access-key --access-key-id ID\` + echo Your current keys are: + aws iam list-access-keys } function aws_profiles { From 6d143d42ea2e16610855e5b1e912b2962d44d9ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 24 Mar 2019 19:54:56 +0100 Subject: [PATCH 0156/1098] aws: document aws_change_access_key and fix README --- plugins/aws/README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/aws/README.md b/plugins/aws/README.md index 45e6de937..a52024128 100644 --- a/plugins/aws/README.md +++ b/plugins/aws/README.md @@ -11,13 +11,15 @@ plugins=(... aws) ## Plugin commands -* `asp []`: Sets `$AWS_PROFILE` and `$AWS_DEFAULT_PROFILE` (legacy) to ``. +* `asp []`: sets `$AWS_PROFILE` and `$AWS_DEFAULT_PROFILE` (legacy) to ``. It also sets `$AWS_EB_PROFILE` to `` for the Elastic Beanstalk CLI. Run `asp` without arguments to clear the profile. -* `agp`: Gets the current value of `$AWS_PROFILE`. +* `agp`: gets the current value of `$AWS_PROFILE`. -* `aws_profiles`: Lists the available profiles in the `$AWS_CONFIG_FILE` (default: `~/.aws/config`). +* `aws_change_access_key`: changes the AWS access key of a profile. + +* `aws_profiles`: lists the available profiles in the `$AWS_CONFIG_FILE` (default: `~/.aws/config`). Used to provide completion for the `asp` function. ## Plugin options From c56fa996e7cb1500dca97723d525e4c97af33c75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 25 Mar 2019 10:12:43 +0100 Subject: [PATCH 0157/1098] rake-fast: remove brackets from completion entries Fixes #5653 --- plugins/rake-fast/rake-fast.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/rake-fast/rake-fast.plugin.zsh b/plugins/rake-fast/rake-fast.plugin.zsh index ca80d86e1..19dab154b 100644 --- a/plugins/rake-fast/rake-fast.plugin.zsh +++ b/plugins/rake-fast/rake-fast.plugin.zsh @@ -20,7 +20,7 @@ _tasks_changed () { } _rake_generate () { - rake --silent --tasks | cut -d " " -f 2 > .rake_tasks + rake --silent --tasks | cut -d " " -f 2 | sed 's/\[.*\]//g' > .rake_tasks } _rake () { From e59cc94805ebe76b0eb57de0b84e403583ebd4db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 25 Mar 2019 17:05:50 +0100 Subject: [PATCH 0158/1098] themes: fix prompt verbosity on window resize %_ is a prompt expansion sequence that expands to the status of the parser. This means that on window resize, the status of the execution of the window resize hook (TRAPWINCH) would be displayed while reloading the prompt line. This looked like cmdand cursh$ or then$ depending on the body of the TRAPWINCH function. Fixes #7262 --- themes/dst.zsh-theme | 2 +- themes/gentoo.zsh-theme | 2 +- themes/tjkirch.zsh-theme | 2 +- themes/tjkirch_mod.zsh-theme | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/themes/dst.zsh-theme b/themes/dst.zsh-theme index 3e2539d57..6b2f8767d 100644 --- a/themes/dst.zsh-theme +++ b/themes/dst.zsh-theme @@ -11,6 +11,6 @@ function prompt_char { PROMPT='%(?, ,%{$fg[red]%}FAIL%{$reset_color%} ) %{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info) -%_ $(prompt_char) ' +$(prompt_char) ' RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}' diff --git a/themes/gentoo.zsh-theme b/themes/gentoo.zsh-theme index ee205d248..5f2427c7a 100644 --- a/themes/gentoo.zsh-theme +++ b/themes/gentoo.zsh-theme @@ -2,7 +2,7 @@ function prompt_char { if [ $UID -eq 0 ]; then echo "#"; else echo $; fi } -PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%}%n@)%m %{$fg_bold[blue]%}%(!.%1~.%~) $(git_prompt_info)%_$(prompt_char)%{$reset_color%} ' +PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%}%n@)%m %{$fg_bold[blue]%}%(!.%1~.%~) $(git_prompt_info)$(prompt_char)%{$reset_color%} ' ZSH_THEME_GIT_PROMPT_PREFIX="(" ZSH_THEME_GIT_PROMPT_SUFFIX=") " diff --git a/themes/tjkirch.zsh-theme b/themes/tjkirch.zsh-theme index 446cde724..c51609860 100644 --- a/themes/tjkirch.zsh-theme +++ b/themes/tjkirch.zsh-theme @@ -10,6 +10,6 @@ function prompt_char { PROMPT='%(?, ,%{$fg[red]%}FAIL: $?%{$reset_color%} ) %{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info) -%_$(prompt_char) ' +$(prompt_char) ' RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}' diff --git a/themes/tjkirch_mod.zsh-theme b/themes/tjkirch_mod.zsh-theme index 1b206a7e1..2dd060ea1 100644 --- a/themes/tjkirch_mod.zsh-theme +++ b/themes/tjkirch_mod.zsh-theme @@ -8,6 +8,6 @@ function prompt_char { } PROMPT='%(?,,%{$fg[red]%}FAIL: $?%{$reset_color%} -)%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info) %_$(prompt_char) ' +)%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info) $(prompt_char) ' RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}' From f6a9a0a49855666f3311a2db040b9b27969da2bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 25 Mar 2019 18:46:18 +0100 Subject: [PATCH 0159/1098] git: fix grt on path with spaces Fixes #7682 --- 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 4277ac664..6fc9b078b 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -226,7 +226,7 @@ alias grmc='git rm --cached' alias grmv='git remote rename' alias grrm='git remote remove' alias grset='git remote set-url' -alias grt='cd $(git rev-parse --show-toplevel || echo ".")' +alias grt='cd "$(git rev-parse --show-toplevel || echo .)"' alias gru='git reset --' alias grup='git remote update' alias grv='git remote -v' From 647537f15bb31f8a50699db239e9a98343d5d280 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 27 Sep 2018 18:26:48 +0200 Subject: [PATCH 0160/1098] Added a new plugin which adds completion for fd (fd-find) Based on the existing "cargo" plugin. --- plugins/fd/README.md | 13 +++++++ plugins/fd/_fd | 83 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 plugins/fd/README.md create mode 100644 plugins/fd/_fd diff --git a/plugins/fd/README.md b/plugins/fd/README.md new file mode 100644 index 000000000..aabd624b8 --- /dev/null +++ b/plugins/fd/README.md @@ -0,0 +1,13 @@ +# fd + +This plugin adds completion for the file search tool [`fd`](https://github.com/sharkdp/fd), also known as `fd-find`. + +To use it, add `fd` to the plugins array in your zshrc file: + +```zsh +plugins=(... fd) +``` + +Completion is taken from the fd release [`7.3.0`](https://github.com/sharkdp/fd/releases/tag/v7.3.0). + +Updated on Febrary 13th, 2019. diff --git a/plugins/fd/_fd b/plugins/fd/_fd new file mode 100644 index 000000000..7d65c7856 --- /dev/null +++ b/plugins/fd/_fd @@ -0,0 +1,83 @@ +#compdef fd + +autoload -U is-at-least + +_fd() { + typeset -A opt_args + typeset -a _arguments_options + local ret=1 + + if is-at-least 5.2; then + _arguments_options=(-s -S -C) + else + _arguments_options=(-s -C) + fi + + local context curcontext="$curcontext" state line + _arguments "${_arguments_options[@]}" \ +'-d+[Set maximum search depth (default: none)]' \ +'--max-depth=[Set maximum search depth (default: none)]' \ +'--maxdepth=[See --max-depth]' \ +'*-t+[Filter by type: file (f), directory (d), symlink (l), +executable (x), empty (e)]: :(f file d directory l symlink x executable e empty)' \ +'*--type=[Filter by type: file (f), directory (d), symlink (l), +executable (x), empty (e)]: :(f file d directory l symlink x executable e empty)' \ +'*-e+[Filter by file extension]' \ +'*--extension=[Filter by file extension]' \ +'-x+[Execute a command for each search result]' \ +'--exec=[Execute a command for each search result]' \ +'(-x --exec)-X+[Execute a command with all search results at once]' \ +'(-x --exec)--exec-batch=[Execute a command with all search results at once]' \ +'*-E+[Exclude entries that match the given glob pattern]' \ +'*--exclude=[Exclude entries that match the given glob pattern]' \ +'*--ignore-file=[Add a custom ignore-file in .gitignore format]' \ +'-c+[When to use colors: never, *auto*, always]: :(never auto always)' \ +'--color=[When to use colors: never, *auto*, always]: :(never auto always)' \ +'-j+[Set number of threads to use for searching & executing]' \ +'--threads=[Set number of threads to use for searching & executing]' \ +'*-S+[Limit results based on the size of files.]' \ +'*--size=[Limit results based on the size of files.]' \ +'--max-buffer-time=[the time (in ms) to buffer, before streaming to the console]' \ +'--changed-within=[Filter by file modification time (newer than)]' \ +'--changed-before=[Filter by file modification time (older than)]' \ +'*--search-path=[(hidden)]' \ +'-H[Search hidden files and directories]' \ +'--hidden[Search hidden files and directories]' \ +'-I[Do not respect .(git|fd)ignore files]' \ +'--no-ignore[Do not respect .(git|fd)ignore files]' \ +'--no-ignore-vcs[Do not respect .gitignore files]' \ +'*-u[Alias for no-ignore and/or hidden]' \ +'-s[Case-sensitive search (default: smart case)]' \ +'--case-sensitive[Case-sensitive search (default: smart case)]' \ +'-i[Case-insensitive search (default: smart case)]' \ +'--ignore-case[Case-insensitive search (default: smart case)]' \ +'-F[Treat the pattern as a literal string]' \ +'--fixed-strings[Treat the pattern as a literal string]' \ +'-a[Show absolute instead of relative paths]' \ +'--absolute-path[Show absolute instead of relative paths]' \ +'-L[Follow symbolic links]' \ +'--follow[Follow symbolic links]' \ +'-p[Search full path (default: file-/dirname only)]' \ +'--full-path[Search full path (default: file-/dirname only)]' \ +'-0[Separate results by the null character]' \ +'--print0[Separate results by the null character]' \ +'--show-errors[Enable display of filesystem errors]' \ +'-h[Prints help information]' \ +'--help[Prints help information]' \ +'-V[Prints version information]' \ +'--version[Prints version information]' \ +'::pattern -- the search pattern, a regular expression (optional):_files' \ +'::path -- the root directory for the filesystem search (optional):_files' \ +&& ret=0 + +} + +(( $+functions[_fd_commands] )) || +_fd_commands() { + local commands; commands=( + + ) + _describe -t commands 'fd commands' commands "$@" +} + +_fd "$@" From 9538eae3d732f6c1e59136f0fb2dce7f98a129a1 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 27 Sep 2018 18:27:51 +0200 Subject: [PATCH 0161/1098] Added a new plugin which adds completion for ripgrep (rg) Based on the existing "cargo" plugin. --- plugins/ripgrep/README.md | 13 ++ plugins/ripgrep/_ripgrep | 433 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 446 insertions(+) create mode 100644 plugins/ripgrep/README.md create mode 100644 plugins/ripgrep/_ripgrep diff --git a/plugins/ripgrep/README.md b/plugins/ripgrep/README.md new file mode 100644 index 000000000..794b105ee --- /dev/null +++ b/plugins/ripgrep/README.md @@ -0,0 +1,13 @@ +# ripgrep + +This plugin adds completion for the text search tool [`ripgrep`](https://github.com/BurntSushi/ripgrep), also known as `rg`. + +To use it, add `ripgrep` to the plugins array in your zshrc file: + +```zsh +plugins=(... ripgrep) +``` + +Completion is taken from the ripgrep release [`0.10.0`](https://github.com/BurntSushi/ripgrep/releases/tag/0.10.0). + +Updated on September 27th, 2018. diff --git a/plugins/ripgrep/_ripgrep b/plugins/ripgrep/_ripgrep new file mode 100644 index 000000000..53f135dde --- /dev/null +++ b/plugins/ripgrep/_ripgrep @@ -0,0 +1,433 @@ +#compdef rg + +## +# zsh completion function for ripgrep +# +# Originally based on code from the zsh-users project — see copyright notice +# below. + +_rg() { + local curcontext=$curcontext no='!' descr ret=1 + local -a context line state state_descr args tmp suf + local -A opt_args + + # ripgrep has many options which negate the effect of a more common one — for + # example, `--no-column` to negate `--column`, and `--messages` to negate + # `--no-messages`. There are so many of these, and they're so infrequently + # used, that some users will probably find it irritating if they're completed + # indiscriminately, so let's not do that unless either the current prefix + # matches one of those negation options or the user has the `complete-all` + # style set. Note that this prefix check has to be updated manually to account + # for all of the potential negation options listed below! + if + # We also want to list all of these options during testing + [[ $_RG_COMPLETE_LIST_ARGS == (1|t*|y*) ]] || + # (--[imnp]* => --ignore*, --messages, --no-*, --pcre2-unicode) + [[ $PREFIX$SUFFIX == --[imnp]* ]] || + zstyle -t ":complete:$curcontext:*" complete-all + then + no= + fi + + # We make heavy use of argument groups here to prevent the option specs from + # growing unwieldy. These aren't supported in zsh <5.4, though, so we'll strip + # them out below if necessary. This makes the exclusions inaccurate on those + # older versions, but oh well — it's not that big a deal + args=( + + '(exclusive)' # Misc. fully exclusive options + '(: * -)'{-h,--help}'[display help information]' + '(: * -)'{-V,--version}'[display version information]' + + + '(buffered)' # buffering options + '--line-buffered[force line buffering]' + $no"--no-line-buffered[don't force line buffering]" + '--block-buffered[force block buffering]' + $no"--no-block-buffered[don't force block buffering]" + + + '(case)' # Case-sensitivity options + {-i,--ignore-case}'[search case-insensitively]' + {-s,--case-sensitive}'[search case-sensitively]' + {-S,--smart-case}'[search case-insensitively if pattern is all lowercase]' + + + '(context-a)' # Context (after) options + '(context-c)'{-A+,--after-context=}'[specify lines to show after each match]:number of lines' + + + '(context-b)' # Context (before) options + '(context-c)'{-B+,--before-context=}'[specify lines to show before each match]:number of lines' + + + '(context-c)' # Context (combined) options + '(context-a context-b)'{-C+,--context=}'[specify lines to show before and after each match]:number of lines' + + + '(column)' # Column options + '--column[show column numbers for matches]' + $no"--no-column[don't show column numbers for matches]" + + + '(count)' # Counting options + {-c,--count}'[only show count of matching lines for each file]' + '--count-matches[only show count of individual matches for each file]' + + + '(encoding)' # Encoding options + {-E+,--encoding=}'[specify text encoding of files to search]: :_rg_encodings' + $no'--no-encoding[use default text encoding]' + + + file # File-input options + '(1)*'{-f+,--file=}'[specify file containing patterns to search for]: :_files' + + + '(file-match)' # Files with/without match options + '(stats)'{-l,--files-with-matches}'[only show names of files with matches]' + '(stats)--files-without-match[only show names of files without matches]' + + + '(file-name)' # File-name options + {-H,--with-filename}'[show file name for matches]' + "--no-filename[don't show file name for matches]" + + + '(file-system)' # File system options + "--one-file-system[don't descend into directories on other file systems]" + $no'--no-one-file-system[descend into directories on other file systems]' + + + '(fixed)' # Fixed-string options + {-F,--fixed-strings}'[treat pattern as literal string instead of regular expression]' + $no"--no-fixed-strings[don't treat pattern as literal string]" + + + '(follow)' # Symlink-following options + {-L,--follow}'[follow symlinks]' + $no"--no-follow[don't follow symlinks]" + + + glob # File-glob options + '*'{-g+,--glob=}'[include/exclude files matching specified glob]:glob' + '*--iglob=[include/exclude files matching specified case-insensitive glob]:glob' + + + '(heading)' # Heading options + '(pretty-vimgrep)--heading[show matches grouped by file name]' + "(pretty-vimgrep)--no-heading[don't show matches grouped by file name]" + + + '(hidden)' # Hidden-file options + '--hidden[search hidden files and directories]' + $no"--no-hidden[don't search hidden files and directories]" + + + '(ignore)' # Ignore-file options + "(--no-ignore-global --no-ignore-parent --no-ignore-vcs)--no-ignore[don't respect ignore files]" + $no'(--ignore-global --ignore-parent --ignore-vcs)--ignore[respect ignore files]' + + + '(ignore-global)' # Global ignore-file options + "--no-ignore-global[don't respect global ignore files]" + $no'--ignore-global[respect global ignore files]' + + + '(ignore-parent)' # Parent ignore-file options + "--no-ignore-parent[don't respect ignore files in parent directories]" + $no'--ignore-parent[respect ignore files in parent directories]' + + + '(ignore-vcs)' # VCS ignore-file options + "--no-ignore-vcs[don't respect version control ignore files]" + $no'--ignore-vcs[respect version control ignore files]' + + + '(json)' # JSON options + '--json[output results in JSON Lines format]' + $no"--no-json[don't output results in JSON Lines format]" + + + '(line-number)' # Line-number options + {-n,--line-number}'[show line numbers for matches]' + {-N,--no-line-number}"[don't show line numbers for matches]" + + + '(line-terminator)' # Line-terminator options + '--crlf[use CRLF as line terminator]' + $no"--no-crlf[don't use CRLF as line terminator]" + '(text)--null-data[use NUL as line terminator]' + + + '(max-depth)' # Directory-depth options + '--max-depth=[specify max number of directories to descend]:number of directories' + '!--maxdepth=:number of directories' + + + '(messages)' # Error-message options + '(--no-ignore-messages)--no-messages[suppress some error messages]' + $no"--messages[don't suppress error messages affected by --no-messages]" + + + '(messages-ignore)' # Ignore-error message options + "--no-ignore-messages[don't show ignore-file parse error messages]" + $no'--ignore-messages[show ignore-file parse error messages]' + + + '(mmap)' # mmap options + '--mmap[search using memory maps when possible]' + "--no-mmap[don't search using memory maps]" + + + '(multiline)' # Multiline options + {-U,--multiline}'[permit matching across multiple lines]' + $no'(multiline-dotall)--no-multiline[restrict matches to at most one line each]' + + + '(multiline-dotall)' # Multiline DOTALL options + '(--no-multiline)--multiline-dotall[allow "." to match newline (with -U)]' + $no"(--no-multiline)--no-multiline-dotall[don't allow \".\" to match newline (with -U)]" + + + '(only)' # Only-match options + {-o,--only-matching}'[show only matching part of each line]' + + + '(passthru)' # Pass-through options + '(--vimgrep)--passthru[show both matching and non-matching lines]' + '!(--vimgrep)--passthrough' + + + '(pcre2)' # PCRE2 options + {-P,--pcre2}'[enable matching with PCRE2]' + $no'(pcre2-unicode)--no-pcre2[disable matching with PCRE2]' + + + '(pcre2-unicode)' # PCRE2 Unicode options + $no'(--no-pcre2 --no-pcre2-unicode)--pcre2-unicode[enable PCRE2 Unicode mode (with -P)]' + '(--no-pcre2 --pcre2-unicode)--no-pcre2-unicode[disable PCRE2 Unicode mode (with -P)]' + + + '(pre)' # Preprocessing options + '(-z --search-zip)--pre=[specify preprocessor utility]:preprocessor utility:_command_names -e' + $no'--no-pre[disable preprocessor utility]' + + + pre-glob # Preprocessing glob options + '*--pre-glob[include/exclude files for preprocessing with --pre]' + + + '(pretty-vimgrep)' # Pretty/vimgrep display options + '(heading)'{-p,--pretty}'[alias for --color=always --heading -n]' + '(heading passthru)--vimgrep[show results in vim-compatible format]' + + + regexp # Explicit pattern options + '(1 file)*'{-e+,--regexp=}'[specify pattern]:pattern' + + + '(replace)' # Replacement options + {-r+,--replace=}'[specify string used to replace matches]:replace string' + + + '(sort)' # File-sorting options + '(threads)--sort=[sort results in ascending order (disables parallelism)]:sort method:(( + none\:"no sorting" + path\:"sort by file path" + modified\:"sort by last modified time" + accessed\:"sort by last accessed time" + created\:"sort by creation time" + ))' + '(threads)--sortr=[sort results in descending order (disables parallelism)]:sort method:(( + none\:"no sorting" + path\:"sort by file path" + modified\:"sort by last modified time" + accessed\:"sort by last accessed time" + created\:"sort by creation time" + ))' + '!(threads)--sort-files[sort results by file path (disables parallelism)]' + + + '(stats)' # Statistics options + '(--files file-match)--stats[show search statistics]' + $no"--no-stats[don't show search statistics]" + + + '(text)' # Binary-search options + {-a,--text}'[search binary files as if they were text]' + $no"(--null-data)--no-text[don't search binary files as if they were text]" + + + '(threads)' # Thread-count options + '(sort)'{-j+,--threads=}'[specify approximate number of threads to use]:number of threads' + + + '(trim)' # Trim options + '--trim[trim any ASCII whitespace prefix from each line]' + $no"--no-trim[don't trim ASCII whitespace prefix from each line]" + + + type # Type options + '*'{-t+,--type=}'[only search files matching specified type]: :_rg_types' + '*--type-add=[add new glob for specified file type]: :->typespec' + '*--type-clear=[clear globs previously defined for specified file type]: :_rg_types' + # This should actually be exclusive with everything but other type options + '(: *)--type-list[show all supported file types and their associated globs]' + '*'{-T+,--type-not=}"[don't search files matching specified file type]: :_rg_types" + + + '(word-line)' # Whole-word/line match options + {-w,--word-regexp}'[only show matches surrounded by word boundaries]' + {-x,--line-regexp}'[only show matches surrounded by line boundaries]' + + + '(zip)' # Compression options + '(--pre)'{-z,--search-zip}'[search in compressed files]' + $no"--no-search-zip[don't search in compressed files]" + + + misc # Other options — no need to separate these at the moment + '(-b --byte-offset)'{-b,--byte-offset}'[show 0-based byte offset for each matching line]' + '--color=[specify when to use colors in output]:when:(( + never\:"never use colors" + auto\:"use colors or not based on stdout, TERM, etc." + always\:"always use colors" + ansi\:"always use ANSI colors (even on Windows)" + ))' + '*--colors=[specify color and style settings]: :->colorspec' + '--context-separator=[specify string used to separate non-continuous context lines in output]:separator' + '--debug[show debug messages]' + '--dfa-size-limit=[specify upper size limit of generated DFA]:DFA size (bytes)' + "(1 stats)--files[show each file that would be searched (but don't search)]" + '*--ignore-file=[specify additional ignore file]:ignore file:_files' + '(-v --invert-match)'{-v,--invert-match}'[invert matching]' + '(-M --max-columns)'{-M+,--max-columns=}'[specify max length of lines to print]:number of bytes' + '(-m --max-count)'{-m+,--max-count=}'[specify max number of matches per file]:number of matches' + '--max-filesize=[specify size above which files should be ignored]:file size (bytes)' + "--no-config[don't load configuration files]" + '(-0 --null)'{-0,--null}'[print NUL byte after file names]' + '--path-separator=[specify path separator to use when printing file names]:separator' + '(-q --quiet)'{-q,--quiet}'[suppress normal output]' + '--regex-size-limit=[specify upper size limit of compiled regex]:regex size (bytes)' + '*'{-u,--unrestricted}'[reduce level of "smart" searching]' + + + operand # Operands + '(--files --type-list file regexp)1: :_guard "^-*" pattern' + '(--type-list)*: :_files' + ) + + # This is used with test_complete.sh to verify that there are no options + # listed in the help output that aren't also defined here + [[ $_RG_COMPLETE_LIST_ARGS == (1|t*|y*) ]] && { + print -rl - $args + return 0 + } + + # Strip out argument groups where unsupported (see above) + [[ $ZSH_VERSION == (4|5.<0-3>)(.*)# ]] && + args=( ${(@)args:#(#i)(+|[a-z0-9][a-z0-9_-]#|\([a-z0-9][a-z0-9_-]#\))} ) + + _arguments -C -s -S : $args && ret=0 + + case $state in + colorspec) + if [[ ${IPREFIX#--*=}$PREFIX == [^:]# ]]; then + suf=( -qS: ) + tmp=( + 'column:specify coloring for column numbers' + 'line:specify coloring for line numbers' + 'match:specify coloring for match text' + 'path:specify coloring for file names' + ) + descr='color/style type' + elif [[ ${IPREFIX#--*=}$PREFIX == (column|line|match|path):[^:]# ]]; then + suf=( -qS: ) + tmp=( + 'none:clear color/style for type' + 'bg:specify background color' + 'fg:specify foreground color' + 'style:specify text style' + ) + descr='color/style attribute' + elif [[ ${IPREFIX#--*=}$PREFIX == [^:]##:(bg|fg):[^:]# ]]; then + tmp=( black blue green red cyan magenta yellow white ) + descr='color name or r,g,b' + elif [[ ${IPREFIX#--*=}$PREFIX == [^:]##:style:[^:]# ]]; then + tmp=( {,no}bold {,no}intense {,no}underline ) + descr='style name' + else + _message -e colorspec 'no more arguments' + fi + + (( $#tmp )) && { + compset -P '*:' + _describe -t colorspec $descr tmp $suf && ret=0 + } + ;; + + typespec) + if compset -P '[^:]##:include:'; then + _sequence -s , _rg_types && ret=0 + # @todo This bit in particular could be better, but it's a little + # complex, and attempting to solve it seems to run us up against a crash + # bug — zsh # 40362 + elif compset -P '[^:]##:'; then + _message 'glob or include directive' && ret=1 + elif [[ ! -prefix *:* ]]; then + _rg_types -qS : && ret=0 + fi + ;; + esac + + return ret +} + +# Complete encodings +_rg_encodings() { + local -a expl + local -aU _encodings + + # This is impossible to read, but these encodings rarely if ever change, so it + # probably doesn't matter. They are derived from the list given here: + # https://encoding.spec.whatwg.org/#concept-encoding-get + _encodings=( + {{,us-}ascii,arabic,chinese,cyrillic,greek{,8},hebrew,korean} + logical visual mac {,cs}macintosh x-mac-{cyrillic,roman,ukrainian} + 866 ibm{819,866} csibm866 + big5{,-hkscs} {cn-,cs}big5 x-x-big5 + cp{819,866,125{0..8}} x-cp125{0..8} + csiso2022{jp,kr} csiso8859{6,8}{e,i} + csisolatin{{1..6},9} csisolatin{arabic,cyrillic,greek,hebrew} + ecma-{114,118} asmo-708 elot_928 sun_eu_greek + euc-{jp,kr} x-euc-jp cseuckr cseucpkdfmtjapanese + {,x-}gbk csiso58gb231280 gb18030 {,cs}gb2312 gb_2312{,-80} hz-gb-2312 + iso-2022-{cn,cn-ext,jp,kr} + iso8859{,-}{{1..11},13,14,15} + iso-8859-{{1..11},{6,8}-{e,i},13,14,15,16} iso_8859-{{1..9},15} + iso_8859-{1,2,6,7}:1987 iso_8859-{3,4,5,8}:1988 iso_8859-9:1989 + iso-ir-{58,100,101,109,110,126,127,138,144,148,149,157} + koi{,8,8-r,8-ru,8-u,8_r} cskoi8r + ks_c_5601-{1987,1989} ksc{,_}5691 csksc56011987 + latin{1..6} l{{1..6},9} + shift{-,_}jis csshiftjis {,x-}sjis ms_kanji ms932 + utf{,-}8 utf-16{,be,le} unicode-1-1-utf-8 + windows-{31j,874,949,125{0..8}} dos-874 tis-620 ansi_x3.4-1968 + x-user-defined auto + ) + + _wanted encodings expl encoding compadd -a "$@" - _encodings +} + +# Complete file types +_rg_types() { + local -a expl + local -aU _types + + _types=( ${(@)${(f)"$( _call_program types rg --type-list )"}%%:*} ) + + _wanted types expl 'file type' compadd -a "$@" - _types +} + +_rg "$@" + + +# ------------------------------------------------------------------------------ +# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the zsh-users nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ------------------------------------------------------------------------------ +# Description +# ----------- +# +# Completion script for ripgrep +# +# ------------------------------------------------------------------------------ +# Authors +# ------- +# +# * arcizan +# * MaskRay +# +# ------------------------------------------------------------------------------ + +# Local Variables: +# mode: shell-script +# coding: utf-8-unix +# indent-tabs-mode: nil +# sh-indentation: 2 +# sh-basic-offset: 2 +# End: +# vim: ft=zsh sw=2 ts=2 et From d79415b17d1c730b87bcbf76e691e344c9cb4694 Mon Sep 17 00:00:00 2001 From: SomeDer <48731521+SomeDer@users.noreply.github.com> Date: Mon, 25 Mar 2019 21:19:46 +0000 Subject: [PATCH 0162/1098] command-not-found: add support for NixOS (#7701) --- plugins/command-not-found/README.md | 1 + plugins/command-not-found/command-not-found.plugin.zsh | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/plugins/command-not-found/README.md b/plugins/command-not-found/README.md index df62d1f07..1cf4ba66e 100644 --- a/plugins/command-not-found/README.md +++ b/plugins/command-not-found/README.md @@ -27,5 +27,6 @@ It works out of the box with the command-not-found packages for: - [Arch Linux](https://wiki.archlinux.org/index.php/Pkgfile#Command_not_found) - [macOS (Homebrew)](https://github.com/Homebrew/homebrew-command-not-found) - [Fedora](https://fedoraproject.org/wiki/Features/PackageKitCommandNotFound) +- [NixOS](https://github.com/NixOS/nixpkgs/tree/master/nixos/modules/programs/command-not-found) You can add support for other platforms by submitting a Pull Request. diff --git a/plugins/command-not-found/command-not-found.plugin.zsh b/plugins/command-not-found/command-not-found.plugin.zsh index ba1262de6..dd1186e44 100644 --- a/plugins/command-not-found/command-not-found.plugin.zsh +++ b/plugins/command-not-found/command-not-found.plugin.zsh @@ -31,3 +31,10 @@ if type brew &> /dev/null; then eval "$(brew command-not-found-init)"; fi fi + +# NixOS command-not-found support +if [ -x /run/current-system/sw/bin/command-not-found ]; then + command_not_found_handler () { + /run/current-system/sw/bin/command-not-found $@ + } +fi From ae7d0bcdb9d22a2de4150f2f00a5c0a26b857c48 Mon Sep 17 00:00:00 2001 From: Andrey Skurlatov Date: Tue, 26 Mar 2019 00:36:46 +0300 Subject: [PATCH 0163/1098] golang: mod and list commands completion (#7665) Also, add `gom` alias to `go mod`. --- plugins/golang/golang.plugin.zsh | 79 +++++++++++++++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/plugins/golang/golang.plugin.zsh b/plugins/golang/golang.plugin.zsh index 8284ab83c..47b10988e 100644 --- a/plugins/golang/golang.plugin.zsh +++ b/plugins/golang/golang.plugin.zsh @@ -28,6 +28,7 @@ __go_tool_complete() { 'help[display help]' 'install[compile and install packages and dependencies]' 'list[list packages]' + 'mod[modules maintenance]' 'run[compile and run Go program]' 'test[test packages]' 'tool[run specified go tool]' @@ -83,7 +84,7 @@ __go_tool_complete() { "-x[print remove commands as it executes them]" \ "*:importpaths:__go_packages" ;; - fix|fmt|list|vet) + fix|fmt|vet) _alternative ':importpaths:__go_packages' ':files:_path_files -g "*.go"' ;; install) @@ -124,6 +125,81 @@ __go_tool_complete() { "-memprofilerate[set heap profiling rate]:number" \ "*:args:{ _alternative ':importpaths:__go_packages' ':files:_path_files -g \"*.go\"' }" ;; + list) + _arguments -s -w : \ + "-f[alternative format for the list]:format" \ + "-json[print data in json format]" \ + "-compiled[set CompiledGoFiles to the Go source files presented to the compiler]" \ + "-deps[iterate over not just the named packages but also all their dependencies]" \ + "-e[change the handling of erroneous packages]" \ + "-export[set the Export field to the name of a file containing up-to-date export information for the given package]" \ + "-find[identify the named packages but not resolve their dependencies]" \ + "-test[report not only the named packages but also their test binaries]" \ + "-m[list modules instead of packages]" \ + "-u[adds information about available upgrades]" \ + "-versions[set the Module's Versions field to a list of all known versions of that module]:number" \ + "*:importpaths:__go_packages" + ;; + mod) + typeset -a mod_commands + mod_commands+=( + 'download[download modules to local cache]' + 'edit[edit go.mod from tools or scripts]' + 'graph[print module requirement graph]' + 'init[initialize new module in current directory]' + 'tidy[add missing and remove unused modules]' + 'vendor[make vendored copy of dependencies]' + 'verify[verify dependencies have expected content]' + 'why[explain why packages or modules are needed]' + ) + if (( CURRENT == 3 )); then + _values 'go mod commands' ${mod_commands[@]} "help[display help]" + return + fi + case ${words[3]} in + help) + _values 'go mod commands' ${mod_commands[@]} + ;; + download) + _arguments -s -w : \ + "-json[print a sequence of JSON objects standard output]" \ + "*:flags" + ;; + edit) + _arguments -s -w : \ + "-fmt[reformat the go.mod file]" \ + "-module[change the module's path]" \ + "-replace[=old{@v}=new{@v} add a replacement of the given module path and version pair]:name" \ + "-dropreplace[=old{@v}=new{@v} drop a replacement of the given module path and version pair]:name" \ + "-go[={version} set the expected Go language version]:number" \ + "-print[print the final go.mod in its text format]" \ + "-json[print the final go.mod file in JSON format]" \ + "*:flags" + ;; + graph) + ;; + init) + ;; + tidy) + _arguments -s -w : \ + "-v[print information about removed modules]" \ + "*:flags" + ;; + vendor) + _arguments -s -w : \ + "-v[print the names of vendored]" \ + "*:flags" + ;; + verify) + ;; + why) + _arguments -s -w : \ + "-m[treats the arguments as a list of modules and finds a path to any package in each of the modules]" \ + "-vendor[exclude tests of dependencies]" \ + "*:importpaths:__go_packages" + ;; + esac + ;; help) _values "${commands[@]}" \ 'environment[show Go environment variables available]' \ @@ -189,6 +265,7 @@ alias gofa='go fmt ./...' alias gog='go get' alias goi='go install' alias gol='go list' +alias gom='go mod' alias gop='cd $GOPATH' alias gopb='cd $GOPATH/bin' alias gops='cd $GOPATH/src' From a441f64d090d30856a1f56a10820b219ffc10e18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 25 Mar 2019 22:40:50 +0100 Subject: [PATCH 0164/1098] Update _cargo completion to 0.34.0 version --- plugins/cargo/_cargo | 195 ++++++++++++++++++++++--------------------- 1 file changed, 100 insertions(+), 95 deletions(-) diff --git a/plugins/cargo/_cargo b/plugins/cargo/_cargo index a8c58ecc5..395c517cd 100644 --- a/plugins/cargo/_cargo +++ b/plugins/cargo/_cargo @@ -1,23 +1,37 @@ #compdef cargo -typeset -A opt_args autoload -U regexp-replace -_cargo() { +zstyle -T ':completion:*:*:cargo:*' tag-order && \ + zstyle ':completion:*:*:cargo:*' tag-order 'common-commands' +_cargo() { +local context state state_descr line +typeset -A opt_args + +# leading items in parentheses are an exclusion list for the arguments following that arg +# See: http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Completion-Functions +# - => exclude all other options +# 1 => exclude positional arg 1 +# * => exclude all other args +# +blah => exclude +blah _arguments \ '(- 1 *)'{-h,--help}'[show help message]' \ + '(- 1 *)--list[list installed commands]' \ '(- 1 *)'{-V,--version}'[show version information]' \ - '(- 1 *)'--list'[list installed commands]' \ - '(- 1 *)'--explain'[Run `rustc --explain CODE`]' \ - '(- 1 *)'{-v,--verbose}'[use verbose output]' \ - '(- 1 *)'--color'[colorization option]' \ - '(- 1 *)'--frozen'[Require Cargo.lock and cache are up to date]' \ - '(- 1 *)'--locked'[Require Cargo.lock is up to date]' \ - '1: :_cargo_cmds' \ + {-v,--verbose}'[use verbose output]' \ + --color'[colorization option]' \ + '(+beta +nightly)+stable[use the stable toolchain]' \ + '(+stable +nightly)+beta[use the beta toolchain]' \ + '(+stable +beta)+nightly[use the nightly toolchain]' \ + '1: :->command' \ '*:: :->args' case $state in + command) + _alternative 'common-commands:common:_cargo_cmds' 'all-commands:all:_cargo_all_cmds' + ;; + args) case $words[1] in bench) @@ -31,11 +45,10 @@ case $state in '--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]: :_get_targets' \ + '--target=[target triple]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--message-format=[error format]:format option:(human json)' \ - '--color=[coloring]:colorization option:(auto always never)' \ + '--color=:colorization option:(auto always never)' \ ;; build) @@ -49,11 +62,27 @@ case $state in '--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]: :_get_targets' \ + '--target=[target triple]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--message-format=[error format]:format option:(human json)' \ - '--color=[coloring]:colorization option:(auto always never)' \ + '--color=:colorization option:(auto always never)' \ + ;; + + check) + _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 check the default features]' \ + '(-p,--package)'{-p=,--package=}'[package to check]:packages:_get_package_names' \ + '--release=[check 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) @@ -63,9 +92,9 @@ case $state in '(-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)]: :_get_targets' \ + '--target=[target triple(default:all)]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=[coloring]:colorization option:(auto always never)' \ + '--color=:colorization option:(auto always never)' \ ;; doc) @@ -81,9 +110,9 @@ case $state in '(-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]: :_get_targets' \ + '--target=[build for the target triple]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=[coloring]:colorization option:(auto always never)' \ + '--color=:colorization option:(auto always never)' \ ;; fetch) @@ -92,7 +121,7 @@ case $state in '--manifest-path=[path to manifest]: :_files -/' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=[coloring]:colorization option:(auto always never)' \ + '--color=:colorization option:(auto always never)' \ ;; generate-lockfile) @@ -101,17 +130,17 @@ case $state in '--manifest-path=[path to manifest]: :_files -/' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=[coloring]:colorization option:(auto always never)' \ + '--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]' \ + '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ '--reference=[REF]' \ '--url=[URL]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=[coloring]:colorization option:(auto always never)' \ + '--color=:colorization option:(auto always never)' \ ;; help) @@ -128,14 +157,14 @@ case $state in '--name=[set the resulting package name]' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=[coloring]:colorization option:(auto always never)' \ + '--color=:colorization option:(auto always never)' \ ;; install) _arguments \ '--bin=[only install the specified binary]' \ '--branch=[branch to use when installing from git]' \ - '--color=[coloring]:colorization option:(auto always never)' \ + '--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]' \ @@ -144,10 +173,10 @@ case $state in '(-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]' \ + '--path=[local filesystem path to crate to install]: :_files -/' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ '--rev=[specific commit to use when installing from git]' \ - '--root=[directory to install packages into]' \ + '--root=[directory to install packages into]: :_files -/' \ '--tag=[tag to use when installing from git]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ '--vers=[version to install from crates.io]' \ @@ -165,7 +194,7 @@ case $state in '--host=[Host to set the token for]' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=[coloring]:colorization option:(auto always never)' \ + '--color=:colorization option:(auto always never)' \ ;; metadata) @@ -179,7 +208,7 @@ case $state in '--features=[space separated feature list]' \ '--all-features[enable all available features]' \ '--format-version=[format version(default: 1)]' \ - '--color=[coloring]:colorization option:(auto always never)' \ + '--color=:colorization option:(auto always never)' \ ;; new) @@ -190,7 +219,7 @@ case $state in '--name=[set the resulting package name]' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=[coloring]:colorization option:(auto always never)' \ + '--color=:colorization option:(auto always never)' \ ;; owner) @@ -203,7 +232,7 @@ case $state in '(-r, --remove)'{-r,--remove}'[remove owner LOGIN]' \ '--token[API token to use when authenticating]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=[coloring]:colorization option:(auto always never)' \ + '--color=:colorization option:(auto always never)' \ ;; package) @@ -215,7 +244,7 @@ case $state in '--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=[coloring]:colorization option:(auto always never)' \ + '--color=:colorization option:(auto always never)' \ ;; pkgid) @@ -224,7 +253,7 @@ case $state in '--manifest-path=[path to manifest]: :_files -/' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=[coloring]:colorization option:(auto always never)' \ + '--color=:colorization option:(auto always never)' \ ;; publish) @@ -236,7 +265,7 @@ case $state in '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ '--token[token to use when uploading]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=[coloring]:colorization option:(auto always never)' \ + '--color=:colorization option:(auto always never)' \ ;; read-manifest) @@ -244,7 +273,7 @@ case $state in '(-h, --help)'{-h,--help}'[show help message]' \ '--manifest-path=[path to manifest]: :_files -/' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=[coloring]:colorization option:(auto always never)' \ + '--color=:colorization option:(auto always never)' \ ;; run) @@ -261,52 +290,49 @@ case $state in '--release=[build in release mode]' \ '--target=[target triple]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--message-format=[error format]:format option:(human json)' \ - '--color=[coloring]:colorization option:(auto always never)' \ + '--color=:colorization option:(auto always never)' \ '*: :_normal' \ ;; rustc) _arguments \ - '--message-format=[error format]:format option:(human json)' \ - '--color=[coloring]:colorization option:(auto always never)' \ + '--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]' \ + '--manifest-path=[path to the manifest to fetch dependencies for]: :_files -/' \ '--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]: :_get_targets' \ + '--target=[target triple which compiles will be for]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ "${command_scope_spec[@]}" \ ;; rustdoc) _arguments \ - '--message-format=[error format]:format option:(human json)' \ - '--color=[coloring]:colorization option:(auto always never)' \ + '--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]' \ + '--manifest-path=[path to the manifest to document]: :_files -/' \ '--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]: :_get_targets' \ + '--target=[build for the target triple]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ "${command_scope_spec[@]}" \ ;; search) _arguments \ - '--color=[coloring]:colorization option:(auto always never)' \ + '--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]' \ @@ -328,20 +354,28 @@ case $state in '(-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]: :_get_targets' \ + '--target=[target triple]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--message-format=[error format]:format option:(human json)' \ - '--color=[coloring]:colorization option:(auto always never)' \ + '--color=:colorization option:(auto always never)' \ '1: :_test_names' \ + '(--doc --bin --example --test --bench)--lib[only test library]' \ + '(--lib --bin --example --test --bench)--doc[only test documentation]' \ + '(--lib --doc --example --test --bench)--bin=[binary name]' \ + '(--lib --doc --bin --test --bench)--example=[example name]' \ + '(--lib --doc --bin --example --bench)--test=[test name]' \ + '(--lib --doc --bin --example --test)--bench=[benchmark name]' \ + '--message-format:error format:(human json short)' \ + '--frozen[require lock and cache up to date]' \ + '--locked[require lock up to date]' ;; uninstall) _arguments \ '--bin=[only uninstall the binary NAME]' \ - '--color=[coloring]:colorization option:(auto always never)' \ + '--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]' \ + '--root=[directory to uninstall packages from]: :_files -/' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ ;; @@ -354,7 +388,7 @@ case $state in '--precise=[update single dependency to PRECISE]: :' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=[coloring]:colorization option:(auto always never)' \ + '--color=:colorization option:(auto always never)' \ ;; verify-project) @@ -363,14 +397,14 @@ case $state in '--manifest-path=[path to manifest]: :_files -/' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=[coloring]:colorization option:(auto always never)' \ + '--color=:colorization option:(auto always never)' \ ;; version) _arguments \ '(-h, --help)'{-h,--help}'[show help message]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=[coloring]:colorization option:(auto always never)' \ + '--color=:colorization option:(auto always never)' \ ;; yank) @@ -381,7 +415,7 @@ case $state in '--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=[coloring]:colorization option:(auto always never)' \ + '--color=:colorization option:(auto always never)' \ '--vers[yank version]' \ ;; esac @@ -390,22 +424,22 @@ esac } _cargo_cmds(){ -local IFS=$'\n' local -a commands;commands=( 'bench:execute all benchmarks of a local package' -'build:compile the current project' +'build:compile the current package' +'check:check the current package without compiling' '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' +'init:create new package 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' +'metadata:the metadata for a package in json' +'new:create a new package' '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' @@ -421,10 +455,13 @@ local -a commands;commands=( 'verify-project:check Cargo.toml' 'version:show version information' 'yank:remove pushed file from index' -$( cargo --list | sed -n '1!p' | tr -s ' ' | cut -d ' ' -f 2 | egrep -v "^bench$|^build$|^clean$|^doc$|^fetch$|^generate-lockfile$|^git-checkout$|^help$|^init$|^install$|^locate-project$|^login$|^metadata$|^new$|^owner$|^package$|^pkgid$|^publish$|^read-manifest$|^run$|^rustc$|^rustdoc$|^search$|^test$|^uninstall$|^update$|^verify-project$|^version$|^yank$" | sed "s/\(.*\)/echo \"\1:$\(cargo help \1 2>\&1 | head -n 1\)\"/" | sh ) ) -_describe 'command' commands +_describe -t common-commands 'common commands' commands +} +_cargo_all_cmds(){ +local -a commands;commands=($(cargo --list)) +_describe -t all-commands 'all commands' commands } @@ -492,38 +529,7 @@ _benchmark_names() _get_names_from_array "bench" } -#Gets the target names from config files -_get_targets() -{ - local CURRENT_PATH - if [[ $(uname -o) = "Cygwin" && -f "$PWD"/Cargo.toml ]]; then - CURRENT_PATH=$PWD - else - CURRENT_PATH=$(_locate_manifest) - fi - if [[ -z "$CURRENT_PATH" ]]; then - return 1 - fi - local -a TARGETS - local -a FIND_PATHS=( "/" ) - local -a FLINES - local FIND_PATH FLINE - while [[ "$CURRENT_PATH" != "/" ]]; do - FIND_PATHS+=( "$CURRENT_PATH" ) - CURRENT_PATH=$(dirname $CURRENT_PATH) - done - for FIND_PATH in ${FIND_PATHS[@]}; do - if [[ -f "$FIND_PATH"/.cargo/config ]]; then - FLINES=( `grep "$FIND_PATH"/.cargo/config -e "^\[target\."` ) - for FLINE in ${FLINES[@]}; do - TARGETS+=(`sed 's/^\[target\.\(.*\)\]$/\1/' <<< $FLINE`) - done - fi - done - _describe 'target' TARGETS -} - -# These flags are mutally exclusive specifiers for the scope of a command; as +# These flags are mutually 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 @@ -535,5 +541,4 @@ command_scope_spec=( '(--bench --bin --example --lib)--test=[test name]' ) - _cargo From 61a7bc2d4aa1012ca46d4a4bc8d0e7c20af675b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 25 Mar 2019 22:42:38 +0100 Subject: [PATCH 0165/1098] Update README --- plugins/cargo/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/cargo/README.md b/plugins/cargo/README.md index 5fa688d21..31bae4efe 100644 --- a/plugins/cargo/README.md +++ b/plugins/cargo/README.md @@ -1,6 +1,6 @@ # cargo -This plugin adds completion for the Rust build tool [`cargo`](https://github.com/rust-lang/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: @@ -8,4 +8,4 @@ To use it, add `cargo` to the plugins array in your zshrc file: plugins=(... cargo) ``` -Updated on October 4th, 2016. +Updated on March 3rd, 2019, from [Cargo 0.34.0](https://github.com/rust-lang/cargo/releases/tag/0.34.0). From b7b40b0b68c791d57d91c7f4e17ed681d01d5c75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=81uczy=C5=84ski?= Date: Tue, 26 Mar 2019 14:44:58 +0100 Subject: [PATCH 0166/1098] fd: fix fd-find completions for debian (#7704) In debian package, fd executable is renamed to fdfind. --- plugins/fd/_fd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/fd/_fd b/plugins/fd/_fd index 7d65c7856..7a4c38753 100644 --- a/plugins/fd/_fd +++ b/plugins/fd/_fd @@ -1,4 +1,4 @@ -#compdef fd +#compdef fd fdfind autoload -U is-at-least From 7fe353ccb64017abb4de43b7e947115b8ec58871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 25 Mar 2019 16:55:28 +0100 Subject: [PATCH 0167/1098] ubuntu: clean up plugin and README --- plugins/ubuntu/README.md | 66 +++++++++++++---------- plugins/ubuntu/ubuntu.plugin.zsh | 91 ++++++++++---------------------- 2 files changed, 66 insertions(+), 91 deletions(-) diff --git a/plugins/ubuntu/README.md b/plugins/ubuntu/README.md index caa6a90b4..fd03f6afe 100644 --- a/plugins/ubuntu/README.md +++ b/plugins/ubuntu/README.md @@ -2,7 +2,7 @@ This plugin adds completions and aliases for [Ubuntu](https://www.ubuntu.com/). -To use it, add `ubuntu` to the plugins array in your zshrc file: +To use it, add `ubuntu` to the plugins array in your zshrc file: ```zsh plugins=(... ubuntu) @@ -10,34 +10,34 @@ plugins=(... ubuntu) ## Aliases -Commands that use `$APT` will use apt if installed or defer to apt-get otherwise. +Commands that use `$APT` will use `apt` if installed or defer to `apt-get` otherwise. -| Alias | Command | Description | -|---------|------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------| -| acs | `apt-cache search` | Search the apt-cache with the specified criteria | -| acp | `apt-cache policy` | Display the package source priorities | -| afs | `apt-file search --regexp` | Perform a regular expression apt-file search | -| afu | `sudo apt-file update` | Generates or updates the apt-file package database | -| ag | `sudo $APT` | Run apt-get with sudo | -| aga | `sudo $APT autoclean` | Clears out the local reposityory of retrieved package files that can no longer be downloaded | -| agb | `sudo $APT build-dep ` | Installs/Removes packages to satisfy the dependencies of a specified build pkg | -| agc | `sudo $APT clean` | Clears out the local repository of retrieved package files leaving everything from the lock files | -| agd | `sudo $APT dselect-upgrade` | Follows dselect choices for package installation | -| agi | `sudo $APT install ` | Install the specified package | -| agli | `apt list --installed` | List the installed packages | -| aglu | `sudo apt-get -u upgrade --assume-no` | Run an apt-get upgrade assuming no to all prompts | -| agp | `sudo $APT purge ` | Remove a package including any configuration files | -| agr | `sudo $APT remove ` | Remove a package | -| ags | `$APT source ` | Fetch the source for the specified package | -| agu | `sudo $APT update` | Update package list | -| agud | `sudo $APT update && sudo $APT dist-upgrade` | Update packages list and perform a distribution upgrade | -| agug | `sudo $APT upgrade` | Upgrade available packages | -| agar | `sudo $APT autoremove` | Remove automatically installed packages no longer needed | -| aguu | `sudo $APT update && sudo $APT upgrade` | Update packages list and upgrade available packages | -| allpkgs | `dpkg --get-selections \| grep -v deinstall` | Print all installed packages | -| kclean | `sudo aptitude remove -P ?and(~i~nlinux-(ima\|hea) ?not(~n$(uname -r)))` |Remove ALL kernel images and headers EXCEPT the one in use | -| mydeb | `time dpkg-buildpackage -rfakeroot -us -uc` | Create a basic .deb package | -| ppap | `sudo ppa-purge ` | Remove the specified PPA | +| Alias | Command | Description | +|---------|--------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------| +| acs | `apt-cache search` | Search the apt-cache with the specified criteria | +| acp | `apt-cache policy` | Display the package source priorities | +| afs | `apt-file search --regexp` | Perform a regular expression apt-file search | +| afu | `sudo apt-file update` | Generates or updates the apt-file package database | +| ag | `sudo $APT` | Run apt-get with sudo | +| aga | `sudo $APT autoclean` | Clears out the local reposityory of retrieved package files that can no longer be downloaded | +| agb | `sudo $APT build-dep ` | Installs/Removes packages to satisfy the dependencies of a specified build pkg | +| agc | `sudo $APT clean` | Clears out the local repository of retrieved package files leaving everything from the lock files | +| agd | `sudo $APT dselect-upgrade` | Follows dselect choices for package installation | +| agi | `sudo $APT install ` | Install the specified package | +| agli | `apt list --installed` | List the installed packages | +| aglu | `sudo apt-get -u upgrade --assume-no` | Run an apt-get upgrade assuming no to all prompts | +| agp | `sudo $APT purge ` | Remove a package including any configuration files | +| agr | `sudo $APT remove ` | Remove a package | +| ags | `$APT source ` | Fetch the source for the specified package | +| agu | `sudo $APT update` | Update package list | +| agud | `sudo $APT update && sudo $APT dist-upgrade` | Update packages list and perform a distribution upgrade | +| agug | `sudo $APT upgrade` | Upgrade available packages | +| agar | `sudo $APT autoremove` | Remove automatically installed packages no longer needed | +| aguu | `sudo $APT update && sudo $APT upgrade` | Update packages list and upgrade available packages | +| allpkgs | `dpkg --get-selections \| grep -v deinstall` | Print all installed packages | +| kclean | `sudo aptitude remove -P ?and(~i~nlinux-(ima\|hea) ?not(~n$(uname -r)))` |Remove ALL kernel images and headers EXCEPT the one in use | +| mydeb | `time dpkg-buildpackage -rfakeroot -us -uc` | Create a basic .deb package | +| ppap | `sudo ppa-purge ` | Remove the specified PPA | ## Functions @@ -47,6 +47,14 @@ Commands that use `$APT` will use apt if installed or defer to apt-get otherwise | aar | `aar ppa:xxxxxx/xxxxxx [packagename]` | apt-add-repository with automatic install/upgrade of the desired package | | apt-history | `apt-history ` | Prints the Apt history of the specified action | | apt-list-packages | `apt-list-packages` | List packages by size | -| kerndeb | `kerndeb` | Kernel-package building shortcut | +| kerndeb | `kerndeb` | Kernel-package building shortcut | +## Authors: +- [@AlexBio](https://github.com/AlexBio) +- [@dbb](https://github.com/dbb) +- [@Mappleconfusers](https://github.com/Mappleconfusers) +- [@trinaldi](https://github.com/trinaldi) +- [Nicolas Jonas](https://nextgenthemes.com) +- [@loctauxphilippe](https://github.com/loctauxphilippe) +- [@HaraldNordgren](https://github.com/HaraldNordgren) diff --git a/plugins/ubuntu/ubuntu.plugin.zsh b/plugins/ubuntu/ubuntu.plugin.zsh index 198f06743..6481fa371 100644 --- a/plugins/ubuntu/ubuntu.plugin.zsh +++ b/plugins/ubuntu/ubuntu.plugin.zsh @@ -1,76 +1,43 @@ -# Authors: -# https://github.com/AlexBio -# https://github.com/dbb -# https://github.com/Mappleconfusers -# https://github.com/trinaldi -# Nicolas Jonas nextgenthemes.com -# https://github.com/loctauxphilippe -# https://github.com/HaraldNordgren -# -# Debian, Ubuntu and friends related zsh aliases and functions for zsh - (( $+commands[apt] )) && APT=apt || APT=apt-get alias acs='apt-cache search' -compdef _acs acs='apt-cache search' alias afs='apt-file search --regexp' -compdef _afs afs='apt-file search --regexp' # These are apt/apt-get only -alias ags="$APT source" # asrc -compdef _ags ags="$APT source" +alias ags="$APT source" -alias acp='apt-cache policy' # app -compdef _acp acp='apt-cache policy' +alias acp='apt-cache policy' #List all installed packages alias agli='apt list --installed' -compdef _agli agli='apt list --installed' # superuser operations ###################################################### # List available updates only alias aglu='sudo apt-get -u upgrade --assume-no' -compdef _aglu aglu='sudo apt-get -u upgrade --assume-no' alias afu='sudo apt-file update' -compdef _afu afu='sudo apt-file update' alias ppap='sudo ppa-purge' -compdef _ppap ppap='sudo ppa-purge' -alias ag="sudo $APT" # age - but without sudo -alias aga="sudo $APT autoclean" # aac -alias agb="sudo $APT build-dep" # abd -alias agc="sudo $APT clean" # adc -alias agd="sudo $APT dselect-upgrade" # ads -alias agi="sudo $APT install" # ai -alias agp="sudo $APT purge" # ap -alias agr="sudo $APT remove" # ar -alias agu="sudo $APT update" # ad -alias agud="sudo $APT update && sudo $APT dist-upgrade" #adu -alias agug="sudo $APT upgrade" # ag -alias aguu="sudo $APT update && sudo $APT upgrade" #adg +alias ag="sudo $APT" +alias aga="sudo $APT autoclean" +alias agb="sudo $APT build-dep" +alias agc="sudo $APT clean" +alias agd="sudo $APT dselect-upgrade" +alias agi="sudo $APT install" +alias agp="sudo $APT purge" +alias agr="sudo $APT remove" +alias agu="sudo $APT update" +alias agud="sudo $APT update && sudo $APT dist-upgrade" +alias agug="sudo $APT upgrade" +alias aguu="sudo $APT update && sudo $APT upgrade" alias agar="sudo $APT autoremove" -compdef _ag ag="sudo $APT" -compdef _aga aga="sudo $APT autoclean" -compdef _agb agb="sudo $APT build-dep" -compdef _agc agc="sudo $APT clean" -compdef _agd agd="sudo $APT dselect-upgrade" -compdef _agi agi="sudo $APT install" -compdef _agp agp="sudo $APT purge" -compdef _agr agr="sudo $APT remove" -compdef _agu agu="sudo $APT update" -compdef _agud agud="sudo $APT update && sudo $APT dist-upgrade" -compdef _agug agug="sudo $APT upgrade" -compdef _aguu aguu="sudo $APT update && sudo $APT upgrade" -compdef _agar agar="sudo $APT autoremove" # Remove ALL kernel images and headers EXCEPT the one in use -alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \ - ?not(~n`uname -r`))' +alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) ?not(~n`uname -r`))' # Misc. ##################################################################### # print all installed packages @@ -89,11 +56,11 @@ aar() { else read "PACKAGE?Type in the package name to install/upgrade with this ppa [${1##*/}]: " fi - + if [ -z "$PACKAGE" ]; then PACKAGE=${1##*/} fi - + sudo apt-add-repository $1 && sudo $APT update sudo $APT install $PACKAGE } @@ -136,22 +103,22 @@ apt-history () { # Kernel-package building shortcut kerndeb () { - # temporarily unset MAKEFLAGS ( '-j3' will fail ) - MAKEFLAGS=$( print - $MAKEFLAGS | perl -pe 's/-j\s*[\d]+//g' ) - print '$MAKEFLAGS set to '"'$MAKEFLAGS'" - appendage='-custom' # this shows up in $ (uname -r ) - revision=$(date +"%Y%m%d") # this shows up in the .deb file name + # temporarily unset MAKEFLAGS ( '-j3' will fail ) + MAKEFLAGS=$( print - $MAKEFLAGS | perl -pe 's/-j\s*[\d]+//g' ) + print '$MAKEFLAGS set to '"'$MAKEFLAGS'" + appendage='-custom' # this shows up in $(uname -r) + revision=$(date +"%Y%m%d") # this shows up in the .deb file name - make-kpkg clean + make-kpkg clean - time fakeroot make-kpkg --append-to-version "$appendage" --revision \ - "$revision" kernel_image kernel_headers + time fakeroot make-kpkg --append-to-version "$appendage" --revision \ + "$revision" kernel_image kernel_headers } # List packages by size function apt-list-packages { - dpkg-query -W --showformat='${Installed-Size} ${Package} ${Status}\n' | \ - grep -v deinstall | \ - sort -n | \ - awk '{print $1" "$2}' + dpkg-query -W --showformat='${Installed-Size} ${Package} ${Status}\n' | \ + grep -v deinstall | \ + sort -n | \ + awk '{print $1" "$2}' } From 7d27843e892e0906e70b7392c20ddde149636553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 25 Mar 2019 16:56:52 +0100 Subject: [PATCH 0168/1098] ubuntu: rename ag to age to avoid conflict with The Silver Searcher Fixes #3866 --- plugins/ubuntu/README.md | 2 +- plugins/ubuntu/ubuntu.plugin.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/ubuntu/README.md b/plugins/ubuntu/README.md index fd03f6afe..f72182f5c 100644 --- a/plugins/ubuntu/README.md +++ b/plugins/ubuntu/README.md @@ -14,11 +14,11 @@ Commands that use `$APT` will use `apt` if installed or defer to `apt-get` other | Alias | Command | Description | |---------|--------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------| +| age | `sudo $APT` | Run apt-get with sudo | | acs | `apt-cache search` | Search the apt-cache with the specified criteria | | acp | `apt-cache policy` | Display the package source priorities | | afs | `apt-file search --regexp` | Perform a regular expression apt-file search | | afu | `sudo apt-file update` | Generates or updates the apt-file package database | -| ag | `sudo $APT` | Run apt-get with sudo | | aga | `sudo $APT autoclean` | Clears out the local reposityory of retrieved package files that can no longer be downloaded | | agb | `sudo $APT build-dep ` | Installs/Removes packages to satisfy the dependencies of a specified build pkg | | agc | `sudo $APT clean` | Clears out the local repository of retrieved package files leaving everything from the lock files | diff --git a/plugins/ubuntu/ubuntu.plugin.zsh b/plugins/ubuntu/ubuntu.plugin.zsh index 6481fa371..d589096c3 100644 --- a/plugins/ubuntu/ubuntu.plugin.zsh +++ b/plugins/ubuntu/ubuntu.plugin.zsh @@ -21,7 +21,7 @@ alias afu='sudo apt-file update' alias ppap='sudo ppa-purge' -alias ag="sudo $APT" +alias age="sudo $APT" alias aga="sudo $APT autoclean" alias agb="sudo $APT build-dep" alias agc="sudo $APT clean" From 15f29aacc2b6d30a767e72e7b751fa39f929a0ae Mon Sep 17 00:00:00 2001 From: Janek <27jf@web.de> Date: Fri, 29 Mar 2019 22:16:29 +0100 Subject: [PATCH 0169/1098] gradle: also support settings files (#7014) --- plugins/gradle/gradle.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/gradle/gradle.plugin.zsh b/plugins/gradle/gradle.plugin.zsh index 8df62c2e2..8d578e27b 100644 --- a/plugins/gradle/gradle.plugin.zsh +++ b/plugins/gradle/gradle.plugin.zsh @@ -156,7 +156,7 @@ _gradle_parse_and_extract_tasks () { # Discover the gradle tasks by running "gradle tasks --all" ############################################################################ _gradle_tasks () { - if [[ -f build.gradle || -f build.gradle.kts ]]; then + if [[ -f build.gradle || -f build.gradle.kts || -f settings.gradle || -f settings.gradle.kts ]]; then _gradle_arguments if _gradle_does_task_list_need_generating; then _gradle_parse_and_extract_tasks "$(gradle tasks --all)" > .gradletasknamecache @@ -166,7 +166,7 @@ _gradle_tasks () { } _gradlew_tasks () { - if [[ -f build.gradle || -f build.gradle.kts ]]; then + if [[ -f build.gradle || -f build.gradle.kts || -f settings.gradle || -f settings.gradle.kts ]]; then _gradle_arguments if _gradle_does_task_list_need_generating; then _gradle_parse_and_extract_tasks "$(./gradlew tasks --all)" > .gradletasknamecache From a43cef34043dae63d73cd40b7e887a43e7b93680 Mon Sep 17 00:00:00 2001 From: Oleg Smelov Date: Fri, 29 Mar 2019 23:17:19 +0200 Subject: [PATCH 0170/1098] pyenv: detect pyenv from Homebrew faster (#7670) --- plugins/pyenv/pyenv.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/pyenv/pyenv.plugin.zsh b/plugins/pyenv/pyenv.plugin.zsh index dbc7da472..4e92b8017 100644 --- a/plugins/pyenv/pyenv.plugin.zsh +++ b/plugins/pyenv/pyenv.plugin.zsh @@ -4,7 +4,7 @@ FOUND_PYENV=$+commands[pyenv] if [[ $FOUND_PYENV -ne 1 ]]; then - pyenvdirs=("$HOME/.pyenv" "/usr/local/pyenv" "/opt/pyenv") + pyenvdirs=("$HOME/.pyenv" "/usr/local/pyenv" "/opt/pyenv" "/usr/local/opt/pyenv") for dir in $pyenvdirs; do if [[ -d $dir/bin ]]; then export PATH="$PATH:$dir/bin" From f1799de0c92357cfafd501c3f74375d197a1708c Mon Sep 17 00:00:00 2001 From: "Lucas A. Rodrigues" Date: Fri, 29 Mar 2019 18:39:52 -0300 Subject: [PATCH 0171/1098] Add drush plugin (#4490) --- plugins/drush/README.md | 83 +++++++++++++++++++++++++ plugins/drush/drush.complete.sh | 50 +++++++++++++++ plugins/drush/drush.plugin.zsh | 104 ++++++++++++++++++++++++++++++++ 3 files changed, 237 insertions(+) create mode 100644 plugins/drush/README.md create mode 100644 plugins/drush/drush.complete.sh create mode 100644 plugins/drush/drush.plugin.zsh diff --git a/plugins/drush/README.md b/plugins/drush/README.md new file mode 100644 index 000000000..df7b82bdd --- /dev/null +++ b/plugins/drush/README.md @@ -0,0 +1,83 @@ +# Drush + +## Description +This plugin offers aliases and functions to make the work with drush easier and more productive. + +To enable it, add the `drush` to your `plugins` array in `~/.zshrc`: + +``` +plugins=(... drush) +``` + +## Aliases +| Alias | Description | Command | +|-------|-----------------------------------------------------------------------|-----------------------------| +| dr | Display drush help | drush | +| drca | Clear all drupal caches. | drush cc all | +| drcb | Clear block cache. | drush cc block | +| drcg | Clear registry cache. | drush cc registry | +| drcj | Clear css-js cache. | drush cc css-js | +| drcm | Clear menu cache. | drush cc menu | +| drcml | Clear module-list cache. | drush cc module-list | +| drcr | Run all cron hooks in all active modules for specified site. | drush core-cron | +| drct | Clear theme-registry cache. | drush cc theme-registry | +| drcv | Clear views cache. (Make sure that the views module is enabled) | drush cc views | +| drdmp | Backup database in a new dump.sql file | drush drush sql-dump --ordered-dump --result-file=dump.sql| +| drf | Display features status | drush features | +| drfr | Revert a feature module on your site. | drush features-revert -y | +| drfu | Update a feature module on your site. | drush features-update -y | +| drfra | Revert all enabled feature module on your site. | drush features-revert-all | +| drif | Flush all derived images. | drush image-flush --all | +| drpm | Show a list of available modules. | drush pm-list --type=module | +| drst | Provides a birds-eye view of the current Drupal installation, if any. | drush core-status | +| drup | Apply any database updates required (as with running update.php). | drush updatedb | +| drups | List any pending database updates. | drush updatedb-status | +| drv | Show drush version. | drush version | +| drvd | Delete a variable. | drush variable-del | +| drvg | Get a list of some or all site variables and values. | drush variable-get | +| drvs | Set a variable. | drush variable-set | + +## Functions + +### dren +Download and enable one or more extensions (modules or themes). +Must be invoked with one or more parameters. e.g.: +`dren devel` or `dren devel module_filter views` + +### drf +Edit drushrc, site alias, and Drupal settings.php files. +Can be invoked with one or without parameters. e.g.: +`drf 1` + +### dris +Disable one or more extensions (modules or themes) +Must be invoked with one or more parameters. e.g.: +`dris devel` or `dris devel module_filter views` + +### drpu +Uninstall one or more modules. +Must be invoked with one or more parameters. e.g.: +`drpu devel` or `drpu devel module_filter views` + +### drnew +Creates a brand new drupal website. +Note: As soon as the installation is complete, drush will print a username and a random password into the terminal: +``` +Installation complete. User name: admin User password: cf7t8yqNEm +``` + +## Additional features + +### Autocomplete +The [completion script for drush](https://github.com/drush-ops/drush/blob/8.0.1/drush.complete.sh) comes enabled with this plugin. +So, it is possible to type a command: +``` +drush sql +``` + +And as soon as the tab key is pressed, the script will display the available commands: +``` +drush sql +sqlc sql-conf sql-create sql-dump sql-query sql-sanitize +sql-cli sql-connect sql-drop sqlq sqlsan sql-sync +``` diff --git a/plugins/drush/drush.complete.sh b/plugins/drush/drush.complete.sh new file mode 100644 index 000000000..38b882ec3 --- /dev/null +++ b/plugins/drush/drush.complete.sh @@ -0,0 +1,50 @@ +# BASH completion script for Drush. +# +# Place this in your /etc/bash_completion.d/ directory or source it from your +# ~/.bash_completion or ~/.bash_profile files. Alternatively, source +# examples/example.bashrc instead, as it will automatically find and source +# this file. +# +# If you're using ZSH instead of BASH, add the following to your ~/.zshrc file +# and source it. +# +# autoload bashcompinit +# bashcompinit +# source /path/to/your/drush.complete.sh + +# Ensure drush is available. +which drush > /dev/null || alias drush &> /dev/null || return + +__drush_ps1() { + f="${TMPDIR:-/tmp/}/drush-env-${USER}/drush-drupal-site-$$" + if [ -f $f ] + then + __DRUPAL_SITE=$(cat "$f") + else + __DRUPAL_SITE="$DRUPAL_SITE" + fi + + # Set DRUSH_PS1_SHOWCOLORHINTS to a non-empty value and define a + # __drush_ps1_colorize_alias() function for color hints in your Drush PS1 + # prompt. See example.prompt.sh for an example implementation. + if [ -n "${__DRUPAL_SITE-}" ] && [ -n "${DRUSH_PS1_SHOWCOLORHINTS-}" ]; then + __drush_ps1_colorize_alias + fi + + [[ -n "$__DRUPAL_SITE" ]] && printf "${1:- (%s)}" "$__DRUPAL_SITE" +} + +# Completion function, uses the "drush complete" command to retrieve +# completions for a specific command line COMP_WORDS. +_drush_completion() { + # Set IFS to newline (locally), since we only use newline separators, and + # need to retain spaces (or not) after completions. + local IFS=$'\n' + # The '< /dev/null' is a work around for a bug in php libedit stdin handling. + # Note that libedit in place of libreadline in some distributions. See: + # https://bugs.launchpad.net/ubuntu/+source/php5/+bug/322214 + COMPREPLY=( $(drush --early=includes/complete.inc "${COMP_WORDS[@]}" < /dev/null 2> /dev/null) ) +} + +# Register our completion function. We include common short aliases for Drush. +complete -o bashdefault -o default -o nospace -F _drush_completion d dr drush drush5 drush6 drush7 drush8 drush.php diff --git a/plugins/drush/drush.plugin.zsh b/plugins/drush/drush.plugin.zsh new file mode 100644 index 000000000..8a20d79f2 --- /dev/null +++ b/plugins/drush/drush.plugin.zsh @@ -0,0 +1,104 @@ +# Drush support. + +function dren() { + drush en $@ -y +} + +function dris() { + drush pm-disable $@ -y +} + +function drpu() { + drush pm-uninstall $@ -y +} + +function drf() { + if [[ $1 == "" ]] then + drush core-config + else + drush core-config --choice=$1 + fi +} + +function drfi() { + if [[ $1 == "fields" ]]; then + drush field-info fields + elif [[ $1 == "types" ]]; then + drush field-info types + else + drush field-info + fi +} + +function drnew() { + + cd ~ + echo "Website's name: " + read WEBSITE_NAME + + HOST=http://$(hostname -i)/ + + if [[ $WEBSITE_NAME == "" ]] then + MINUTES=$(date +%M:%S) + WEBSITE_NAME="Drupal-$MINUTES" + echo "Your website will be named: $WEBSITE_NAME" + fi + + drush dl drupal --drupal-project-rename=$WEBSITE_NAME + + echo "Type your localhost directory: (Leave empty for /var/www/html/)" + read DIRECTORY + + if [[ $DIRECTORY == "" ]] then + DIRECTORY="/var/www/html/" + fi + + echo "Moving to $DIRECTORY$WEBSITE_NAME" + sudo mv $WEBSITE_NAME $DIRECTORY + cd $DIRECTORY$WEBSITE_NAME + + echo "Database's user: " + read DATABASE_USR + echo "Database's password: " + read -s DATABASE_PWD + echo "Database's name for your project: " + read DATABASE + + DB_URL="mysql://$DATABASE_USR:$DATABASE_PWD@localhost/$DATABASE" + drush site-install standard --db-url=$DB_URL --site-name=$WEBSITE_NAME + + open_command $HOST$WEBSITE_NAME + echo "Done" + +} + +# Aliases, sorted alphabetically. +alias dr="drush" +alias drca="drush cc all" # Deprecated for Drush 8 +alias drcb="drush cc block" # Deprecated for Drush 8 +alias drcg="drush cc registry" # Deprecated for Drush 8 +alias drcj="drush cc css-js" +alias drcm="drush cc menu" +alias drcml="drush cc module-list" +alias drcr="drush core-cron" +alias drct="drush cc theme-registry" +alias drcv="drush cc views" +alias drdmp="drush sql-dump --ordered-dump --result-file=dump.sql" +alias drf="drush features" +alias drfr="drush features-revert -y" +alias drfu="drush features-update -y" +alias drfra="drush features-revert-all" +alias drif="drush image-flush --all" +alias drpm="drush pm-list --type=module" +alias drst="drush core-status" +alias drup="drush updatedb" +alias drups="drush updatedb-status" +alias drv="drush version" +alias drvd="drush variable-del" +alias drvg="drush variable-get" +alias drvs="drush variable-set" + +# Enable drush autocomplete support +autoload bashcompinit +bashcompinit +source $(dirname $0)/drush.complete.sh From 0e0789fb7aedd1afd8ae07dfc9609f6a7f2e407f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ch=C3=A1bek?= Date: Fri, 29 Mar 2019 22:56:59 +0100 Subject: [PATCH 0172/1098] git: delete branches in `gbda` only if there are any (#6079) It doesn't make sense to run `git branch -d $BRANCH` if the `$BRANCH` is empty. --- 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 6fc9b078b..8eccc9cee 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -50,7 +50,7 @@ alias gap='git apply' alias gb='git branch' alias gba='git branch -a' alias gbd='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 gbda='git branch --no-color --merged | command grep -vE "^(\*|\s*(master|develop|dev)\s*$)" | command xargs -r -n 1 git branch -d' alias gbD='git branch -D' alias gbl='git blame -b -w' alias gbnm='git branch --no-merged' From 4b82b8606442c5ff0235ea95d0fc11f151638dc3 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Fri, 29 Mar 2019 22:59:37 +0100 Subject: [PATCH 0173/1098] git: add `--no-gpg-sign` to gwip (#6031) --- 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 8eccc9cee..302377153 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -261,4 +261,4 @@ alias gupav='git pull --rebase --autostash -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 --no-verify -m "--wip-- [skip ci]"' +alias gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]"' From 93cbc1614c9900f310a48de69447e035df84e1cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 31 Mar 2019 15:56:35 +0200 Subject: [PATCH 0174/1098] git: use interactive mode in gclean Fixes #7716 --- 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 302377153..8482c4d54 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -73,7 +73,7 @@ alias gcsm='git commit -s -m' alias gcb='git checkout -b' alias gcf='git config --list' alias gcl='git clone --recurse-submodules' -alias gclean='git clean -fd' +alias gclean='git clean -id' alias gpristine='git reset --hard && git clean -dfx' alias gcm='git checkout master' alias gcd='git checkout develop' From 831fba4ee4bc28d1d0a3a3f94d5b4dcdfce04588 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 2 Apr 2019 19:05:52 +0200 Subject: [PATCH 0175/1098] Revert "git: delete branches in `gbda` only if there are any (#6079)" (#7724) This reverts commit 0e0789fb7aedd1afd8ae07dfc9609f6a7f2e407f. --- 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 8482c4d54..5bef95bd5 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -50,7 +50,7 @@ alias gap='git apply' alias gb='git branch' alias gba='git branch -a' alias gbd='git branch -d' -alias gbda='git branch --no-color --merged | command grep -vE "^(\*|\s*(master|develop|dev)\s*$)" | command xargs -r -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 gbD='git branch -D' alias gbl='git blame -b -w' alias gbnm='git branch --no-merged' From 3a6bf6bd26b809577d42cb606e05e9ea75373d5e Mon Sep 17 00:00:00 2001 From: Greg Date: Wed, 3 Apr 2019 12:20:16 +0100 Subject: [PATCH 0176/1098] init: more informative warning if plugin not found (#7727) --- oh-my-zsh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index e080257c1..b1460b1d7 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -53,7 +53,7 @@ for plugin ($plugins); do elif is_plugin $ZSH $plugin; then fpath=($ZSH/plugins/$plugin $fpath) else - echo "Warning: plugin $plugin not found" + echo "[oh-my-zsh] plugin '$plugin' not found" fi done From 4ddb2e384ab0840b1d8a6d4c95770ef8a6c25fcc Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 4 Apr 2019 09:45:00 -0700 Subject: [PATCH 0177/1098] Introducing a Code of Conduct based on the Contributor Covenant project. Adding links from the README and CONTRIBUTING pages to this, too, along with an email address for reporting abusive behavior to. Closes #7733 (#7734) --- CODE_OF_CONDUCT.md | 76 ++++++++++++++++++++++++++++++++++++++++++++++ CONTRIBUTING.md | 4 ++- README.md | 6 +++- 3 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..20ad1ccee --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies within all project spaces, and it also applies when +an individual is representing the project or its community in public spaces. +Examples of representing a project or community include using an official +project e-mail address, posting via an official social media account, or acting +as an appointed representative at an online or offline event. Representation of +a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at ohmyzsh@planetargon.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ac263fd18..f575157c2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,8 +1,10 @@ # CONTRIBUTING GUIDELINES -Oh-My-Zsh is a community-driven project. Contribution is welcome, encouraged and appreciated. +Oh-My-Zsh is a community-driven project. Contribution is welcome, encouraged, and appreciated. It is also essential for the development of the project. +First, please take a moment to review our [code of conduct](CODE_OF_CONDUCT.md). + These guidelines are an attempt at better addressing the huge amount of pending issues and pull requests. Please read them closely. diff --git a/README.md b/README.md index 511e6aeff..dd330d19e 100644 --- a/README.md +++ b/README.md @@ -213,12 +213,16 @@ Oh My Zsh isn't for everyone. We'll miss you, but we want to make this an easy b If you want to uninstall `oh-my-zsh`, just run `uninstall_oh_my_zsh` from the command-line. It will remove itself and revert your previous `bash` or `zsh` configuration. -## Contributing +## How do I contribute to Oh My Zsh? + +Before you participate in our delightful community, please read the [code of conduct](CODE_OF_CONDUCT.md). I'm far from being a [Zsh](https://www.zsh.org/) expert and suspect there are many ways to improve – if you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests! We also need people to test out pull-requests. So take a look through [the open issues](https://github.com/robbyrussell/oh-my-zsh/issues) and help where you can. +See [Contributing](CONTRIBUTING.md) for more details. + ### Do NOT send us themes We have (more than) enough themes for the time being. Please add your theme to the [external themes](https://github.com/robbyrussell/oh-my-zsh/wiki/External-themes) wiki page. From 67e0ef7aa6a494b2357c64a204214f7b19fb52e7 Mon Sep 17 00:00:00 2001 From: "GIL B. Chan" Date: Sun, 7 Apr 2019 18:48:22 +0900 Subject: [PATCH 0178/1098] edit colorize plugin: add `-f terminal` option The option (`pygmentize -f terminal <...>`) lets pygments use terminal color scheme. Otherwise, it would use its default colors, which might be unbalanced with that of terminal (e.g. not harmonious with background color of terminal). --- plugins/colorize/colorize.plugin.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/colorize/colorize.plugin.zsh b/plugins/colorize/colorize.plugin.zsh index 8eede9a94..d52e95c49 100644 --- a/plugins/colorize/colorize.plugin.zsh +++ b/plugins/colorize/colorize.plugin.zsh @@ -9,7 +9,7 @@ colorize_via_pygmentize() { # pygmentize stdin if no arguments passed if [ $# -eq 0 ]; then - pygmentize -g + pygmentize -f terminal -g return $? fi @@ -20,9 +20,9 @@ colorize_via_pygmentize() { do lexer=$(pygmentize -N "$FNAME") if [[ $lexer != text ]]; then - pygmentize -l "$lexer" "$FNAME" + pygmentize -f terminal -l "$lexer" "$FNAME" else - pygmentize -g "$FNAME" + pygmentize -f terminal -g "$FNAME" fi done } From 046d49f7827c994916a55d1531e70564682307af Mon Sep 17 00:00:00 2001 From: Asatur Meltonyan Date: Sun, 7 Apr 2019 16:17:22 +0400 Subject: [PATCH 0179/1098] git: add 'gtl' alias to list tags matching a pattern (#7629) 1. List the tags that match the pattern(s) passed through the argument. 2. Displays the first line of the annotation message along with the tag, or the line of the first commit message if the tag is not annotated. 3. Sorts and displays tags in descending order. --- 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 5bef95bd5..a4b6eb977 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -251,6 +251,7 @@ alias gsu='git submodule update' alias gts='git tag -s' alias gtv='git tag | sort -V' +alias gtl='gtl(){ git tag --sort=-v:refname -n -l ${1}* }; noglob gtl' alias gunignore='git update-index --no-assume-unchanged' alias gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1' From 3cfcf5e0aa71bddcf7ab45d3880f142654f22266 Mon Sep 17 00:00:00 2001 From: sheveko <28670374+sheveko@users.noreply.github.com> Date: Sun, 7 Apr 2019 20:21:54 +0200 Subject: [PATCH 0180/1098] git-prompt: run git status with LANG=C (#6087) As described in #6086 there will be an error when one set another language than English. --- plugins/git-prompt/gitstatus.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git-prompt/gitstatus.py b/plugins/git-prompt/gitstatus.py index a4d07cde6..5243af23c 100644 --- a/plugins/git-prompt/gitstatus.py +++ b/plugins/git-prompt/gitstatus.py @@ -30,7 +30,7 @@ def get_tagname_or_hash(): # `git status --porcelain --branch` can collect all information # branch, remote_branch, untracked, staged, changed, conflicts, ahead, behind -po = Popen(['git', 'status', '--porcelain', '--branch'], stdout=PIPE, stderr=PIPE) +po = Popen(['git', 'status', '--porcelain', '--branch'], env={"LANG": "C"}, stdout=PIPE, stderr=PIPE) stdout, sterr = po.communicate() if po.returncode != 0: sys.exit(0) # Not a git repository From a85ce89a3dc7fc63b4e8518a923f9c718561eb0b Mon Sep 17 00:00:00 2001 From: Kevin Kuhl <1747773+alph486@users.noreply.github.com> Date: Sun, 7 Apr 2019 13:31:28 -0500 Subject: [PATCH 0181/1098] refined: reset command exec time (#6117) Fixes #6116 --- themes/refined.zsh-theme | 1 + 1 file changed, 1 insertion(+) diff --git a/themes/refined.zsh-theme b/themes/refined.zsh-theme index 0e5681cc7..2a4188c9d 100644 --- a/themes/refined.zsh-theme +++ b/themes/refined.zsh-theme @@ -72,6 +72,7 @@ preexec() { precmd() { vcs_info # Get version control info before we start outputting stuff print -P "\n$(repo_information) %F{yellow}$(cmd_exec_time)%f" + unset cmd_timestamp #Reset cmd exec time. } # Define prompts From c23ab00990c8528a3334d178b9ec9135385cc99f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 7 Apr 2019 20:39:25 +0200 Subject: [PATCH 0182/1098] upgrade: fix lock-out on first upgrade check This early return made it so the lock wasn't removed, therefore locking out the upgrade script from ever entering the upgrade routine. Fixes #6138 Note: the logic needs some rework. --- tools/check_for_upgrade.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index 05b31e8d4..c8dedcf77 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -34,7 +34,9 @@ if mkdir "$ZSH/log/update.lock" 2>/dev/null; then . ${ZSH_CACHE_DIR}/.zsh-update if [[ -z "$LAST_EPOCH" ]]; then - _update_zsh_update && return 0 + _update_zsh_update + rmdir $ZSH/log/update.lock # TODO: fix later + return 0 fi epoch_diff=$(($(_current_epoch) - $LAST_EPOCH)) From 651856d4a3b37467cd26a5c5d8de52bd76a9be7f Mon Sep 17 00:00:00 2001 From: Roman Dzieciol Date: Sun, 7 Apr 2019 23:26:43 +0100 Subject: [PATCH 0183/1098] Update the swiftpm plugin autocompletion for Swift 5.0 --- plugins/swiftpm/README.md | 19 +++ plugins/swiftpm/_swift | 327 ++++++++++++++++++++++++-------------- 2 files changed, 229 insertions(+), 117 deletions(-) diff --git a/plugins/swiftpm/README.md b/plugins/swiftpm/README.md index 07ca25651..d9462fb7f 100644 --- a/plugins/swiftpm/README.md +++ b/plugins/swiftpm/README.md @@ -20,3 +20,22 @@ plugins=(... swiftpm) | `spx` | Generates an Xcode project | `swift package generate-xcodeproj` | | `sps` | Print the resolved dependency graph | `swift package show-dependencies` | | `spd` | Print parsed Package.swift as JSON | `swift package dump-package` | + +## Autocompletion + +The `_swift` file enables autocompletion for Swift Package Manager. Current version supports Swift 5.0 + + +### Updating the autocompletion for new version of Swift + +To update autocompletion to the Swift version present on your system: +``` +swift package completion-tool generate-zsh-script > ~/.oh-my-zsh/plugins/swiftpm/_swift +``` + +### Known issues + +If `swiftpm` is not added to your zsh plugins list, autocompletion will still be triggered but will result in errors: +``` +_values:compvalues:10: not enough arguments +``` diff --git a/plugins/swiftpm/_swift b/plugins/swiftpm/_swift index bed6e13a7..1366b4d9c 100644 --- a/plugins/swiftpm/_swift +++ b/plugins/swiftpm/_swift @@ -72,16 +72,23 @@ _swift_build() { "--build-path[Specify build/cache directory ]:Specify build/cache directory :_files" "(--chdir -C)"{--chdir,-C}"[]: :_files" "--package-path[Change working directory before any other operation]:Change working directory before any other operation:_files" - "--sanitize[Turn on runtime checks for erroneous behavior]: :{_values '' 'address[enable Address sanitizer]' 'thread[enable Thread sanitizer]'}" + "--sanitize[Turn on runtime checks for erroneous behavior]: :{_values '' 'address[enable Address sanitizer]' 'thread[enable Thread sanitizer]' 'undefined[enable Undefined Behavior sanitizer]'}" "--disable-prefetching[]" "--skip-update[Skip updating dependencies from their remote during a resolution]" "--disable-sandbox[Disable using the sandbox when executing subprocesses]" + "--disable-package-manifest-caching[Disable caching Package.swift manifests]" "--version[]" "--destination[]: :_files" "(--verbose -v)"{--verbose,-v}"[Increase verbosity of informational output]" "--no-static-swift-stdlib[Do not link Swift stdlib statically \[default\]]" "--static-swift-stdlib[Link Swift stdlib statically]" - "--enable-build-manifest-caching[Enable llbuild manifest caching \[Experimental\]]" + "--enable-llbuild-library[Enable building with the llbuild library]" + "--force-resolved-versions[]" + "--disable-automatic-resolution[Disable automatic resolution if Package.resolved file is out-of-date]" + "--enable-index-store[Enable indexing-while-building feature]" + "--disable-index-store[Disable indexing-while-building feature]" + "--enable-pubgrub-resolver[\[Experimental\] Enable the new Pubgrub dependency resolver]" + "--enable-parseable-module-interfaces[]" "--build-tests[Build both source and test targets]" "--product[Build the specified product]:Build the specified product: " "--target[Build the specified target]:Build the specified target: " @@ -108,17 +115,26 @@ _swift_run() { "--build-path[Specify build/cache directory ]:Specify build/cache directory :_files" "(--chdir -C)"{--chdir,-C}"[]: :_files" "--package-path[Change working directory before any other operation]:Change working directory before any other operation:_files" - "--sanitize[Turn on runtime checks for erroneous behavior]: :{_values '' 'address[enable Address sanitizer]' 'thread[enable Thread sanitizer]'}" + "--sanitize[Turn on runtime checks for erroneous behavior]: :{_values '' 'address[enable Address sanitizer]' 'thread[enable Thread sanitizer]' 'undefined[enable Undefined Behavior sanitizer]'}" "--disable-prefetching[]" "--skip-update[Skip updating dependencies from their remote during a resolution]" "--disable-sandbox[Disable using the sandbox when executing subprocesses]" + "--disable-package-manifest-caching[Disable caching Package.swift manifests]" "--version[]" "--destination[]: :_files" "(--verbose -v)"{--verbose,-v}"[Increase verbosity of informational output]" "--no-static-swift-stdlib[Do not link Swift stdlib statically \[default\]]" "--static-swift-stdlib[Link Swift stdlib statically]" - "--enable-build-manifest-caching[Enable llbuild manifest caching \[Experimental\]]" + "--enable-llbuild-library[Enable building with the llbuild library]" + "--force-resolved-versions[]" + "--disable-automatic-resolution[Disable automatic resolution if Package.resolved file is out-of-date]" + "--enable-index-store[Enable indexing-while-building feature]" + "--disable-index-store[Disable indexing-while-building feature]" + "--enable-pubgrub-resolver[\[Experimental\] Enable the new Pubgrub dependency resolver]" + "--enable-parseable-module-interfaces[]" "--skip-build[Skip building the executable product]" + "--build-tests[Build both source and test targets]" + "--repl[Launch Swift REPL for the package]" ) _arguments $arguments && return } @@ -140,16 +156,23 @@ _swift_package() { "--build-path[Specify build/cache directory ]:Specify build/cache directory :_files" "(--chdir -C)"{--chdir,-C}"[]: :_files" "--package-path[Change working directory before any other operation]:Change working directory before any other operation:_files" - "--sanitize[Turn on runtime checks for erroneous behavior]: :{_values '' 'address[enable Address sanitizer]' 'thread[enable Thread sanitizer]'}" + "--sanitize[Turn on runtime checks for erroneous behavior]: :{_values '' 'address[enable Address sanitizer]' 'thread[enable Thread sanitizer]' 'undefined[enable Undefined Behavior sanitizer]'}" "--disable-prefetching[]" "--skip-update[Skip updating dependencies from their remote during a resolution]" "--disable-sandbox[Disable using the sandbox when executing subprocesses]" + "--disable-package-manifest-caching[Disable caching Package.swift manifests]" "--version[]" "--destination[]: :_files" "(--verbose -v)"{--verbose,-v}"[Increase verbosity of informational output]" "--no-static-swift-stdlib[Do not link Swift stdlib statically \[default\]]" "--static-swift-stdlib[Link Swift stdlib statically]" - "--enable-build-manifest-caching[Enable llbuild manifest caching \[Experimental\]]" + "--enable-llbuild-library[Enable building with the llbuild library]" + "--force-resolved-versions[]" + "--disable-automatic-resolution[Disable automatic resolution if Package.resolved file is out-of-date]" + "--enable-index-store[Enable indexing-while-building feature]" + "--disable-index-store[Disable indexing-while-building feature]" + "--enable-pubgrub-resolver[\[Experimental\] Enable the new Pubgrub dependency resolver]" + "--enable-parseable-module-interfaces[]" '(-): :->command' '(-)*:: :->arg' ) @@ -158,139 +181,85 @@ _swift_package() { (command) local modes modes=( - 'edit:Put a package in editable mode' - 'clean:Delete build artifacts' - 'init:Initialize a new package' - 'dump-package:Print parsed Package.swift as JSON' - 'describe:Describe the current package' - 'unedit:Remove a package from editable mode' 'update:Update package dependencies' - 'completion-tool:Completion tool (for shell completions)' - 'tools-version:Manipulate tools version of the current package' - 'reset:Reset the complete cache/build directory' + 'describe:Describe the current package' 'resolve:Resolve package dependencies' - 'generate-xcodeproj:Generates an Xcode project' - 'fetch:' + 'tools-version:Manipulate tools version of the current package' + 'unedit:Remove a package from editable mode' 'show-dependencies:Print the resolved dependency graph' + 'fetch:' + 'dump-package:Print parsed Package.swift as JSON' + 'edit:Put a package in editable mode' + 'config:Manipulate configuration of the package' + 'completion-tool:Completion tool (for shell completions)' + 'clean:Delete build artifacts' + 'generate-xcodeproj:Generates an Xcode project' + 'reset:Reset the complete cache/build directory' + 'init:Initialize a new package' ) _describe "mode" modes ;; (arg) case ${words[1]} in - (edit) - _swift_package_edit - ;; - (clean) - _swift_package_clean - ;; - (init) - _swift_package_init - ;; - (dump-package) - _swift_package_dump-package + (update) + _swift_package_update ;; (describe) _swift_package_describe ;; - (unedit) - _swift_package_unedit - ;; - (update) - _swift_package_update - ;; - (completion-tool) - _swift_package_completion-tool + (resolve) + _swift_package_resolve ;; (tools-version) _swift_package_tools-version ;; - (reset) - _swift_package_reset - ;; - (resolve) - _swift_package_resolve - ;; - (generate-xcodeproj) - _swift_package_generate-xcodeproj - ;; - (fetch) - _swift_package_fetch + (unedit) + _swift_package_unedit ;; (show-dependencies) _swift_package_show-dependencies ;; + (fetch) + _swift_package_fetch + ;; + (dump-package) + _swift_package_dump-package + ;; + (edit) + _swift_package_edit + ;; + (config) + _swift_package_config + ;; + (completion-tool) + _swift_package_completion-tool + ;; + (clean) + _swift_package_clean + ;; + (generate-xcodeproj) + _swift_package_generate-xcodeproj + ;; + (reset) + _swift_package_reset + ;; + (init) + _swift_package_init + ;; esac ;; esac } -_swift_package_edit() { - arguments=( - ":The name of the package to edit:_swift_dependency" - "--revision[The revision to edit]:The revision to edit: " - "--branch[The branch to create]:The branch to create: " - "--path[Create or use the checkout at this path]:Create or use the checkout at this path:_files" - ) - _arguments $arguments && return -} - -_swift_package_clean() { - arguments=( - ) - _arguments $arguments && return -} - -_swift_package_init() { - arguments=( - "--type[empty|library|executable|system-module]: :{_values '' 'empty[generates an empty project]' 'library[generates project for a dynamic library]' 'executable[generates a project for a cli executable]' 'system-module[generates a project for a system module]'}" - ) - _arguments $arguments && return -} - -_swift_package_dump-package() { - arguments=( - ) - _arguments $arguments && return -} - -_swift_package_describe() { - arguments=( - "--type[json|text]: :{_values '' 'text[describe using text format]' 'json[describe using JSON format]'}" - ) - _arguments $arguments && return -} - -_swift_package_unedit() { - arguments=( - ":The name of the package to unedit:_swift_dependency" - "--force[Unedit the package even if it has uncommited and unpushed changes.]" - ) - _arguments $arguments && return -} - _swift_package_update() { arguments=( ) _arguments $arguments && return } -_swift_package_completion-tool() { - arguments=( - ": :{_values '' 'generate-bash-script[generate Bash completion script]' 'generate-zsh-script[generate Bash completion script]' 'list-dependencies[list all dependencies' names]' 'list-executables[list all executables' names]'}" - ) - _arguments $arguments && return -} - -_swift_package_tools-version() { - arguments=( - "--set[Set tools version of package to the given value]:Set tools version of package to the given value: " - "--set-current[Set tools version of package to the current tools version in use]" - ) - _arguments $arguments && return -} - -_swift_package_reset() { +_swift_package_describe() { arguments=( + "--type[json|text]: :{_values '' 'text[describe using text format]' 'json[describe using JSON format]'}" ) _arguments $arguments && return } @@ -305,13 +274,25 @@ _swift_package_resolve() { _arguments $arguments && return } -_swift_package_generate-xcodeproj() { +_swift_package_tools-version() { arguments=( - "--xcconfig-overrides[Path to xcconfig file]:Path to xcconfig file:_files" - "--enable-code-coverage[Enable code coverage in the generated project]" - "--output[Path where the Xcode project should be generated]:Path where the Xcode project should be generated:_files" - "--legacy-scheme-generator[Use the legacy scheme generator]" - "--watch[Watch for changes to the Package manifest to regenerate the Xcode project]" + "--set[Set tools version of package to the given value]:Set tools version of package to the given value: " + "--set-current[Set tools version of package to the current tools version in use]" + ) + _arguments $arguments && return +} + +_swift_package_unedit() { + arguments=( + ":The name of the package to unedit:_swift_dependency" + "--force[Unedit the package even if it has uncommited and unpushed changes.]" + ) + _arguments $arguments && return +} + +_swift_package_show-dependencies() { + arguments=( + "--format[text|dot|json|flatlist]: :{_values '' 'text[list dependencies using text format]' 'dot[list dependencies using dot format]' 'json[list dependencies using JSON format]'}" ) _arguments $arguments && return } @@ -322,9 +303,112 @@ _swift_package_fetch() { _arguments $arguments && return } -_swift_package_show-dependencies() { +_swift_package_dump-package() { arguments=( - "--format[text|dot|json|flatlist]: :{_values '' 'text[list dependencies using text format]' 'dot[list dependencies using dot format]' 'json[list dependencies using JSON format]'}" + ) + _arguments $arguments && return +} + +_swift_package_edit() { + arguments=( + ":The name of the package to edit:_swift_dependency" + "--revision[The revision to edit]:The revision to edit: " + "--branch[The branch to create]:The branch to create: " + "--path[Create or use the checkout at this path]:Create or use the checkout at this path:_files" + ) + _arguments $arguments && return +} + +_swift_package_config() { + arguments=( + '(-): :->command' + '(-)*:: :->arg' + ) + _arguments $arguments && return + case $state in + (command) + local modes + modes=( + 'unset-mirror:Remove an existing mirror' + 'set-mirror:Set a mirror for a dependency' + 'get-mirror:Print mirror configuration for the given package dependency' + ) + _describe "mode" modes + ;; + (arg) + case ${words[1]} in + (unset-mirror) + _swift_package_config_unset-mirror + ;; + (set-mirror) + _swift_package_config_set-mirror + ;; + (get-mirror) + _swift_package_config_get-mirror + ;; + esac + ;; + esac +} + +_swift_package_config_unset-mirror() { + arguments=( + "--package-url[The package dependency url]:The package dependency url: " + "--mirror-url[The mirror url]:The mirror url: " + ) + _arguments $arguments && return +} + +_swift_package_config_set-mirror() { + arguments=( + "--package-url[The package dependency url]:The package dependency url: " + "--mirror-url[The mirror url]:The mirror url: " + ) + _arguments $arguments && return +} + +_swift_package_config_get-mirror() { + arguments=( + "--package-url[The package dependency url]:The package dependency url: " + ) + _arguments $arguments && return +} + +_swift_package_completion-tool() { + arguments=( + ": :{_values '' 'generate-bash-script[generate Bash completion script]' 'generate-zsh-script[generate Bash completion script]' 'list-dependencies[list all dependencies' names]' 'list-executables[list all executables' names]'}" + ) + _arguments $arguments && return +} + +_swift_package_clean() { + arguments=( + ) + _arguments $arguments && return +} + +_swift_package_generate-xcodeproj() { + arguments=( + "--xcconfig-overrides[Path to xcconfig file]:Path to xcconfig file:_files" + "--enable-code-coverage[Enable code coverage in the generated project]" + "--output[Path where the Xcode project should be generated]:Path where the Xcode project should be generated:_files" + "--legacy-scheme-generator[Use the legacy scheme generator]" + "--watch[Watch for changes to the Package manifest to regenerate the Xcode project]" + "--skip-extra-files[Do not add file references for extra files to the generated Xcode project]" + ) + _arguments $arguments && return +} + +_swift_package_reset() { + arguments=( + ) + _arguments $arguments && return +} + +_swift_package_init() { + arguments=( + "--type[empty|library|executable|system-module]: :{_values '' 'empty[generates an empty project]' 'library[generates project for a dynamic library]' 'executable[generates a project for a cli executable]' 'system-module[generates a project for a system module]'}" + "--name[Provide custom package name]:Provide custom package name: " ) _arguments $arguments && return } @@ -346,23 +430,32 @@ _swift_test() { "--build-path[Specify build/cache directory ]:Specify build/cache directory :_files" "(--chdir -C)"{--chdir,-C}"[]: :_files" "--package-path[Change working directory before any other operation]:Change working directory before any other operation:_files" - "--sanitize[Turn on runtime checks for erroneous behavior]: :{_values '' 'address[enable Address sanitizer]' 'thread[enable Thread sanitizer]'}" + "--sanitize[Turn on runtime checks for erroneous behavior]: :{_values '' 'address[enable Address sanitizer]' 'thread[enable Thread sanitizer]' 'undefined[enable Undefined Behavior sanitizer]'}" "--disable-prefetching[]" "--skip-update[Skip updating dependencies from their remote during a resolution]" "--disable-sandbox[Disable using the sandbox when executing subprocesses]" + "--disable-package-manifest-caching[Disable caching Package.swift manifests]" "--version[]" "--destination[]: :_files" "(--verbose -v)"{--verbose,-v}"[Increase verbosity of informational output]" "--no-static-swift-stdlib[Do not link Swift stdlib statically \[default\]]" "--static-swift-stdlib[Link Swift stdlib statically]" - "--enable-build-manifest-caching[Enable llbuild manifest caching \[Experimental\]]" + "--enable-llbuild-library[Enable building with the llbuild library]" + "--force-resolved-versions[]" + "--disable-automatic-resolution[Disable automatic resolution if Package.resolved file is out-of-date]" + "--enable-index-store[Enable indexing-while-building feature]" + "--disable-index-store[Disable indexing-while-building feature]" + "--enable-pubgrub-resolver[\[Experimental\] Enable the new Pubgrub dependency resolver]" + "--enable-parseable-module-interfaces[]" "--skip-build[Skip building the test target]" "(--list-tests -l)"{--list-tests,-l}"[Lists test methods in specifier format]" "--generate-linuxmain[Generate LinuxMain.swift entries for the package]" "--parallel[Run the tests in parallel.]" + "--num-workers[Number of tests to execute in parallel.]:Number of tests to execute in parallel.: " "(--specifier -s)"{--specifier,-s}"[]: : " "--xunit-output[]: :_files" "--filter[Run test cases matching regular expression, Format: . or ./]:Run test cases matching regular expression, Format: . or ./: " + "--enable-code-coverage[Test with code coverage enabled]" ) _arguments $arguments && return } From 9981479900e3d3ff86bff0b3313c8e45891e880c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 8 Apr 2019 17:34:59 +0200 Subject: [PATCH 0184/1098] zshrc: remove SSH_KEY_PATH comment Fixes #5741 --- templates/zshrc.zsh-template | 3 --- 1 file changed, 3 deletions(-) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index abd2c8812..bc892ff38 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -83,9 +83,6 @@ source $ZSH/oh-my-zsh.sh # Compilation flags # export ARCHFLAGS="-arch x86_64" -# ssh -# export SSH_KEY_PATH="~/.ssh/rsa_id" - # Set personal aliases, overriding those provided by oh-my-zsh libs, # plugins, and themes. Aliases can be placed here, though oh-my-zsh # users are encouraged to define aliases within the ZSH_CUSTOM folder. From 728c8e717435b31cb7db90168e1e7bd27b95e3f5 Mon Sep 17 00:00:00 2001 From: Sascha Bratton Date: Mon, 8 Apr 2019 11:58:27 -0400 Subject: [PATCH 0185/1098] nvm: load nvm script only if command doesn't already exist (#5454) Fixes #5453. --- plugins/nvm/nvm.plugin.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/nvm/nvm.plugin.zsh b/plugins/nvm/nvm.plugin.zsh index 9dde3a266..4bab8e9d7 100644 --- a/plugins/nvm/nvm.plugin.zsh +++ b/plugins/nvm/nvm.plugin.zsh @@ -1,5 +1,8 @@ # Set NVM_DIR if it isn't already defined [[ -z "$NVM_DIR" ]] && export NVM_DIR="$HOME/.nvm" -# Load nvm if it exists -[[ -f "$NVM_DIR/nvm.sh" ]] && source "$NVM_DIR/nvm.sh" +# Try to load nvm only if command not already available +if ! type "nvm" &> /dev/null; then + # Load nvm if it exists + [[ -f "$NVM_DIR/nvm.sh" ]] && source "$NVM_DIR/nvm.sh" +fi From 8c95c2b6cb339379dda5e39a0eef795cab1dae7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 8 Apr 2019 20:06:17 +0200 Subject: [PATCH 0186/1098] gitfast: update plugin (#7152) * Stop loading git plugin * Update completion and git-prompt to v2.10 * Update completion to v2.14 --- plugins/gitfast/_git | 11 +- plugins/gitfast/git-completion.bash | 913 ++++++++++++++++++++++------ plugins/gitfast/git-prompt.sh | 9 +- plugins/gitfast/gitfast.plugin.zsh | 7 +- 4 files changed, 747 insertions(+), 193 deletions(-) diff --git a/plugins/gitfast/_git b/plugins/gitfast/_git index 6d1b4ecc7..78a6dbb3d 100644 --- a/plugins/gitfast/_git +++ b/plugins/gitfast/_git @@ -9,7 +9,7 @@ # # If your script is somewhere else, you can configure it on your ~/.zshrc: # -# zstyle ':completion:*:*:git:*' script ~/.git-completion.sh +# zstyle ':completion:*:*:git:*' script ~/.git-completion.zsh # # The recommended way to install this script is to copy to '~/.zsh/_git', and # then add the following to your ~/.zshrc file: @@ -67,6 +67,15 @@ __gitcomp () esac } +__gitcomp_direct () +{ + emulate -L zsh + + local IFS=$'\n' + compset -P '*[=:]' + compadd -Q -- ${=1} && _ret=0 +} + __gitcomp_nl () { emulate -L zsh diff --git a/plugins/gitfast/git-completion.bash b/plugins/gitfast/git-completion.bash index 8ce6b5c5f..d93441747 100644 --- a/plugins/gitfast/git-completion.bash +++ b/plugins/gitfast/git-completion.bash @@ -28,27 +28,55 @@ # completion style. For example '!f() { : git commit ; ... }; f' will # tell the completion to use commit completion. This also works with aliases # of form "!sh -c '...'". For example, "!sh -c ': git commit ; ... '". +# +# You can set the following environment variables to influence the behavior of +# the completion routines: +# +# GIT_COMPLETION_CHECKOUT_NO_GUESS +# +# When set to "1", do not include "DWIM" suggestions in git-checkout +# completion (e.g., completing "foo" when "origin/foo" exists). case "$COMP_WORDBREAKS" in *:*) : great ;; *) COMP_WORDBREAKS="$COMP_WORDBREAKS:" esac +# Discovers the path to the git repository taking any '--git-dir=' and +# '-C ' options into account and stores it in the $__git_repo_path +# variable. +__git_find_repo_path () +{ + if [ -n "$__git_repo_path" ]; then + # we already know where it is + return + fi + + if [ -n "${__git_C_args-}" ]; then + __git_repo_path="$(git "${__git_C_args[@]}" \ + ${__git_dir:+--git-dir="$__git_dir"} \ + rev-parse --absolute-git-dir 2>/dev/null)" + elif [ -n "${__git_dir-}" ]; then + test -d "$__git_dir" && + __git_repo_path="$__git_dir" + elif [ -n "${GIT_DIR-}" ]; then + test -d "${GIT_DIR-}" && + __git_repo_path="$GIT_DIR" + elif [ -d .git ]; then + __git_repo_path=.git + else + __git_repo_path="$(git rev-parse --git-dir 2>/dev/null)" + fi +} + +# Deprecated: use __git_find_repo_path() and $__git_repo_path instead # __gitdir accepts 0 or 1 arguments (i.e., location) # returns location of .git repo __gitdir () { if [ -z "${1-}" ]; then - if [ -n "${__git_dir-}" ]; then - echo "$__git_dir" - elif [ -n "${GIT_DIR-}" ]; then - test -d "${GIT_DIR-}" || return 1 - echo "$GIT_DIR" - elif [ -d .git ]; then - echo .git - else - git rev-parse --git-dir 2>/dev/null - fi + __git_find_repo_path || return 1 + echo "$__git_repo_path" elif [ -d "$1/.git" ]; then echo "$1/.git" else @@ -56,6 +84,14 @@ __gitdir () fi } +# Runs git with all the options given as argument, respecting any +# '--git-dir=' and '-C ' options present on the command line +__git () +{ + git ${__git_C_args:+"${__git_C_args[@]}"} \ + ${__git_dir:+--git-dir="$__git_dir"} "$@" 2>/dev/null +} + # The following function is based on code from: # # bash_completion - programmable completion functions for bash 3.2+ @@ -185,6 +221,20 @@ _get_comp_words_by_ref () } fi +# Fills the COMPREPLY array with prefiltered words without any additional +# processing. +# Callers must take care of providing only words that match the current word +# to be completed and adding any prefix and/or suffix (trailing space!), if +# necessary. +# 1: List of newline-separated matching completion words, complete with +# prefix and suffix. +__gitcomp_direct () +{ + local IFS=$'\n' + + COMPREPLY=($1) +} + __gitcompappend () { local x i=${#COMPREPLY[@]} @@ -283,11 +333,11 @@ __gitcomp_file () __git_ls_files_helper () { if [ "$2" == "--committable" ]; then - git -C "$1" diff-index --name-only --relative HEAD + __git -C "$1" diff-index --name-only --relative HEAD else # NOTE: $2 is not quoted in order to support multiple options - git -C "$1" ls-files --exclude-standard $2 - fi 2>/dev/null + __git -C "$1" ls-files --exclude-standard $2 + fi } @@ -299,99 +349,195 @@ __git_ls_files_helper () # slash. __git_index_files () { - local dir="$(__gitdir)" root="${2-.}" file + local root="${2-.}" file - if [ -d "$dir" ]; then - __git_ls_files_helper "$root" "$1" | - while read -r file; do - case "$file" in - ?*/*) echo "${file%%/*}" ;; - *) echo "$file" ;; - esac - done | sort | uniq - fi + __git_ls_files_helper "$root" "$1" | + while read -r file; do + case "$file" in + ?*/*) echo "${file%%/*}" ;; + *) echo "$file" ;; + esac + done | sort | uniq } +# Lists branches from the local repository. +# 1: A prefix to be added to each listed branch (optional). +# 2: List only branches matching this word (optional; list all branches if +# unset or empty). +# 3: A suffix to be appended to each listed branch (optional). __git_heads () { - local dir="$(__gitdir)" - if [ -d "$dir" ]; then - git --git-dir="$dir" for-each-ref --format='%(refname:short)' \ - refs/heads - return - fi + local pfx="${1-}" cur_="${2-}" sfx="${3-}" + + __git for-each-ref --format="${pfx//\%/%%}%(refname:strip=2)$sfx" \ + "refs/heads/$cur_*" "refs/heads/$cur_*/**" } +# Lists tags from the local repository. +# Accepts the same positional parameters as __git_heads() above. __git_tags () { - local dir="$(__gitdir)" - if [ -d "$dir" ]; then - git --git-dir="$dir" for-each-ref --format='%(refname:short)' \ - refs/tags - return - fi + local pfx="${1-}" cur_="${2-}" sfx="${3-}" + + __git for-each-ref --format="${pfx//\%/%%}%(refname:strip=2)$sfx" \ + "refs/tags/$cur_*" "refs/tags/$cur_*/**" } -# __git_refs accepts 0, 1 (to pass to __gitdir), or 2 arguments -# presence of 2nd argument means use the guess heuristic employed -# by checkout for tracking branches +# Lists refs from the local (by default) or from a remote repository. +# It accepts 0, 1 or 2 arguments: +# 1: The remote to list refs from (optional; ignored, if set but empty). +# Can be the name of a configured remote, a path, or a URL. +# 2: In addition to local refs, list unique branches from refs/remotes/ for +# 'git checkout's tracking DWIMery (optional; ignored, if set but empty). +# 3: A prefix to be added to each listed ref (optional). +# 4: List only refs matching this word (optional; list all refs if unset or +# empty). +# 5: A suffix to be appended to each listed ref (optional; ignored, if set +# but empty). +# +# Use __git_complete_refs() instead. __git_refs () { - local i hash dir="$(__gitdir "${1-}")" track="${2-}" + local i hash dir track="${2-}" + local list_refs_from=path remote="${1-}" local format refs - if [ -d "$dir" ]; then - case "$cur" in + local pfx="${3-}" cur_="${4-$cur}" sfx="${5-}" + local match="${4-}" + local fer_pfx="${pfx//\%/%%}" # "escape" for-each-ref format specifiers + + __git_find_repo_path + dir="$__git_repo_path" + + if [ -z "$remote" ]; then + if [ -z "$dir" ]; then + return + fi + else + if __git_is_configured_remote "$remote"; then + # configured remote takes precedence over a + # local directory with the same name + list_refs_from=remote + elif [ -d "$remote/.git" ]; then + dir="$remote/.git" + elif [ -d "$remote" ]; then + dir="$remote" + else + list_refs_from=url + fi + fi + + if [ "$list_refs_from" = path ]; then + if [[ "$cur_" == ^* ]]; then + pfx="$pfx^" + fer_pfx="$fer_pfx^" + cur_=${cur_#^} + match=${match#^} + fi + case "$cur_" in refs|refs/*) format="refname" - refs="${cur%/*}" + refs=("$match*" "$match*/**") track="" ;; *) for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD; do - if [ -e "$dir/$i" ]; then echo $i; fi + case "$i" in + $match*) + if [ -e "$dir/$i" ]; then + echo "$pfx$i$sfx" + fi + ;; + esac done - format="refname:short" - refs="refs/tags refs/heads refs/remotes" + format="refname:strip=2" + refs=("refs/tags/$match*" "refs/tags/$match*/**" + "refs/heads/$match*" "refs/heads/$match*/**" + "refs/remotes/$match*" "refs/remotes/$match*/**") ;; esac - git --git-dir="$dir" for-each-ref --format="%($format)" \ - $refs + __git_dir="$dir" __git for-each-ref --format="$fer_pfx%($format)$sfx" \ + "${refs[@]}" if [ -n "$track" ]; then # employ the heuristic used by git checkout # Try to find a remote branch that matches the completion word # but only output if the branch name is unique - local ref entry - git --git-dir="$dir" for-each-ref --shell --format="ref=%(refname:short)" \ - "refs/remotes/" | \ - while read -r entry; do - eval "$entry" - ref="${ref#*/}" - if [[ "$ref" == "$cur"* ]]; then - echo "$ref" - fi - done | sort | uniq -u + __git for-each-ref --format="$fer_pfx%(refname:strip=3)$sfx" \ + --sort="refname:strip=3" \ + "refs/remotes/*/$match*" "refs/remotes/*/$match*/**" | \ + uniq -u fi return fi - case "$cur" in + case "$cur_" in refs|refs/*) - git ls-remote "$dir" "$cur*" 2>/dev/null | \ + __git ls-remote "$remote" "$match*" | \ while read -r hash i; do case "$i" in *^{}) ;; - *) echo "$i" ;; + *) echo "$pfx$i$sfx" ;; esac done ;; *) - echo "HEAD" - git for-each-ref --format="%(refname:short)" -- \ - "refs/remotes/$dir/" 2>/dev/null | sed -e "s#^$dir/##" + if [ "$list_refs_from" = remote ]; then + case "HEAD" in + $match*) echo "${pfx}HEAD$sfx" ;; + esac + __git for-each-ref --format="$fer_pfx%(refname:strip=3)$sfx" \ + "refs/remotes/$remote/$match*" \ + "refs/remotes/$remote/$match*/**" + else + local query_symref + case "HEAD" in + $match*) query_symref="HEAD" ;; + esac + __git ls-remote "$remote" $query_symref \ + "refs/tags/$match*" "refs/heads/$match*" \ + "refs/remotes/$match*" | + while read -r hash i; do + case "$i" in + *^{}) ;; + refs/*) echo "$pfx${i#refs/*/}$sfx" ;; + *) echo "$pfx$i$sfx" ;; # symbolic refs + esac + done + fi ;; esac } +# Completes refs, short and long, local and remote, symbolic and pseudo. +# +# Usage: __git_complete_refs [