From c1446b4750a31506daba7fc7d41957dd515e8022 Mon Sep 17 00:00:00 2001 From: Erik Demaine Date: Sat, 6 Jul 2019 12:10:30 -0400 Subject: Automatic title: Replace fg with description from jobs --- lib/termsupport.zsh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index aa14f3f07..a74ad9922 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -72,7 +72,19 @@ function omz_termsupport_preexec { local CMD=${1[(wr)^(*=*|sudo|ssh|mosh|rake|-*)]:gs/%/%%} local LINE="${2:gs/%/%%}" - title '$CMD' '%100>...>$LINE%<<' + if [[ "$CMD" = fg ]]; then + # replace fg, possibly with argument, with description from jobs + local JOB + if [[ ${(z)1} = fg ]]; then # no arguments + JOB="$(jobs %%)" + else # arguments + JOB="$(jobs ${${(z)1}[2]})" + fi + JOB="${${(z)JOB}[4,$]}" # trim job number, +, pid, status + title ${JOB:gs/%/%%} ${JOB:gs/%/%%} + else + title '$CMD' '%100>...>$LINE%<<' + fi } precmd_functions+=(omz_termsupport_precmd) -- cgit v1.2.3-70-g09d2 From 902e3172c9b991ca0995a0dcd658caa29b918d8e Mon Sep 17 00:00:00 2001 From: Erik Demaine Date: Sun, 7 Jul 2019 10:48:36 -0400 Subject: Avoid error messages when there is no job --- lib/termsupport.zsh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index a74ad9922..59a1efb02 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -72,19 +72,22 @@ function omz_termsupport_preexec { local CMD=${1[(wr)^(*=*|sudo|ssh|mosh|rake|-*)]:gs/%/%%} local LINE="${2:gs/%/%%}" + # replace fg, possibly with argument, with description from jobs if [[ "$CMD" = fg ]]; then - # replace fg, possibly with argument, with description from jobs local JOB if [[ ${(z)1} = fg ]]; then # no arguments - JOB="$(jobs %%)" + JOB="$(jobs %% 2>/dev/null)" else # arguments - JOB="$(jobs ${${(z)1}[2]})" + JOB="$(jobs ${${(z)1}[2]} 2>/dev/null)" + fi + if [[ $? -eq 0 ]]; then + JOB="${${(z)JOB}[4,$]}" # trim job number, +, pid, status + title ${JOB:gs/%/%%} ${JOB:gs/%/%%} + return fi - JOB="${${(z)JOB}[4,$]}" # trim job number, +, pid, status - title ${JOB:gs/%/%%} ${JOB:gs/%/%%} - else - title '$CMD' '%100>...>$LINE%<<' fi + + title '$CMD' '%100>...>$LINE%<<' } precmd_functions+=(omz_termsupport_precmd) -- cgit v1.2.3-70-g09d2 From 08b04f5df2b9a4747b8f8975785bdcd523d85445 Mon Sep 17 00:00:00 2001 From: mickk-on-cpp Date: Fri, 28 Feb 2020 17:27:16 +0100 Subject: fancy-ctrl-z: ensure widgets are called with full context (#4838) This allows other plugins that hook e.g. accept-line to identify the fancy-ctrl-z widget as the caller and take appropriate steps when necessary. See https://github.com/tarruda/zsh-autosuggestions/issues/82#issuecomment-181133379 --- plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh b/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh index 8ab297913..82b968894 100644 --- a/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh +++ b/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh @@ -1,10 +1,10 @@ fancy-ctrl-z () { if [[ $#BUFFER -eq 0 ]]; then BUFFER="fg" - zle accept-line + zle accept-line -w else - zle push-input - zle clear-screen + zle push-input -w + zle clear-screen -w fi } zle -N fancy-ctrl-z -- cgit v1.2.3-70-g09d2 From 3e16d6434778ee9e1d7d5369c53d1e9c6b0517cb Mon Sep 17 00:00:00 2001 From: Ján Koščo <640131+s7anley@users.noreply.github.com> Date: Fri, 28 Feb 2020 17:29:11 +0100 Subject: geeknote: update completion (#4986) Fixes Completion only working for first parameter --- plugins/geeknote/README.md | 17 ++- plugins/geeknote/_geeknote | 267 ++++++++++++++++++++++++--------------------- 2 files changed, 156 insertions(+), 128 deletions(-) diff --git a/plugins/geeknote/README.md b/plugins/geeknote/README.md index 3f2353112..99c1fbf5b 100644 --- a/plugins/geeknote/README.md +++ b/plugins/geeknote/README.md @@ -1,12 +1,19 @@ -## ZSH-Geeknote +ZSH-Geeknote +============ [Geeknote](https://github.com/VitaliyRodnenko/geeknote) plugin for oh-my-zsh. Plugins provides: -- auto completion of commands and their options -- alias `gn` +* auto completion of commands and their options +* alias `gn` -You can find information how to install Geeknote and it's available commands on the [project website](http://www.geeknote.me/). +## Installation -Maintainer : Ján Koščo ([@s7anley](https://twitter.com/s7anley)) +### oh-my-zsh +This plugin is already bundled in oh-my-zsh. To enable just configure plugin definition + + plugins=( ... geeknote ...) + +### Antigen +Use [Antigen's](https://github.com/zsh-users/antigen) bundle command to install by adding `antigen bundle s7anley/zsh-geeknote` to your `.zshrc` along with your other plugins. diff --git a/plugins/geeknote/_geeknote b/plugins/geeknote/_geeknote index cf1a187d2..a34be59b1 100644 --- a/plugins/geeknote/_geeknote +++ b/plugins/geeknote/_geeknote @@ -1,136 +1,157 @@ #compdef geeknote -# --------------- ------------------------------------------------------------ -# Name : _geeknote -# Synopsis : zsh completion for geeknote -# Author : Ján Koščo <3k.stanley@gmail.com> -# HomePage : http://www.geeknote.me -# Version : 0.1 -# Tag : [ shell, zsh, completion, evernote ] -# Copyright : © 2014 by Ján Koščo, -# Released under current GPL license. -# --------------- ------------------------------------------------------------ + +# Geeknote Autocomplete plugin for Zsh +# Requires: Geeknote installed +# Author : Ján Koščo (@s7anley) + +__login() { + # no arguments +} + +__logout() { + _arguments \ + '--force[Do not ask about logging out.]' +} + +__settings() { + _arguments \ + "--editor+[Set the editor, which use to edit and create notes.]::" +} + +__create() { + _arguments \ + '--title+[The note title.]::' \ + '--content+[The note content.]::' \ + '--tags+[One tag or the list of tags which will be added to the note.]::' \ + '--notebook+[Set the notebook where to save note.]::' \ + '--resource+[Add a resource to the note.]::' +} + +__edit() { + _arguments \ + '--note+[The name or ID from the previous search of a note to edit.]::' \ + '--title+[Set new title of the note.]::' \ + '--content+[Set new content of the note.]::' \ + '--tags+[Set new list o tags for the note.]::' \ + '--notebook+[Assign new notebook for the note.]::' \ + '--resource+[Add a resource to the note.]::' +} + +__find() { + _arguments \ + '--search+[Text to search.]::' \ + '--tags+[Notes with which tag/tags to search.]::' \ + '--notebook+[In which notebook search the note.]::' \ + '--date+[Set date in format dd.mm.yyyy or date range dd.mm.yyyy-dd.mm.yyyy.]::' \ + '--count+[How many notes show in the result list.]::' \ + '--with-url[Add direct url of each note in results to Evernote web-version.]' \ + '--content-search[Search by content, not by title.]' \ + '--exact-entry[Search for exact entry of the request.]' +} + +__show() { + _arguments \ + '--note+[The name or ID from the previous search of a note to show.]::' \ + '--raw[Show the raw note body.]' +} + +__remove() { + _arguments \ + '--note+[The name or ID from the previous search of a note to remove.]::' \ + '--force[Do not ask about removing.]' +} + +__notebook-list() { + # no arguments +} + +__notebook-create() { + _arguments \ + '--title+[Set the title of new notebook.]::' +} + +__notebook-edit() { + _arguments \ + '--title+[Set the title of new notebook.]::' \ + '--notebook+[The name of a notebook to rename.]::' +} + +__tag-list() { + # no arguments +} + +__tag-create() { + _arguments \ + '--title+[Set the title of new tag.]::' +} + +__tag-edit() { + _arguments \ + '--tagname+[The name of a tag to rename.]::' \ + '--title+[Set the new name of tag.]::' +} + +__user() { + _arguments \ + '--full[Show full information.]' +} local -a _1st_arguments _1st_arguments=( - 'login' - 'logout' - 'settings' - 'create' - 'edit' - 'find' - 'show' - 'remove' - 'notebook-list' - 'notebook-create' - 'notebook-edit' - 'tag-list' - 'tag-create' - 'tag-edit' - 'tag-remove' - 'gnsync' - 'user' + 'login':'Authorize in Evernote.' + 'logout':'Logout from Evernote.' + 'settings':'Show and edit current settings.' + 'create':'Create note in Evernote.' + 'edit':'Edit note in Evernote.' + 'find':'Search notes in Evernote.' + 'show':'Output note in the terminal.' + 'remove':'Remove note from Evernote.' + 'notebook-list':'Show the list of existing notebooks in your Evernote.' + 'notebook-create':'Create new notebook.' + 'notebook-edit':'Edit/rename notebook.' + 'tag-list':'Show the list of existing tags in your Evernote.' + 'tag-create':'Create new tag.' + 'tag-edit':'Edit/rename tag.' + 'user':'Show information about active user.' ) _arguments '*:: :->command' if (( CURRENT == 1 )); then - _describe -t commands "geeknote command" _1st_arguments - return + _describe -t commands "geeknote command" _1st_arguments + return fi local -a _command_args case "$words[1]" in - user) - _command_args=( - '(--full)--full' \ - ) - ;; - logout) - _command_args=( - '(--force)--force' \ - ) - ;; - settings) - _command_args=( - '(--editor)--editor' \ - ) - ;; - create) - _command_args=( - '(-t|--title)'{-t,--title}'[note title]' \ - '(-c|--content)'{-c,--content}'[note content]' \ - '(-tg|--tags)'{-tg,--tags}'[one tag or the list of tags which will be added to the note]' \ - '(-nb|--notebook)'{-nb,--notebook}'[name of notebook where to save note]' \ - ) - ;; - edit) - _command_args=( - '(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \ - '(-t|--title)'{-t,--title}'[note title]' \ - '(-c|--content)'{-c,--content}'[note content]' \ - '(-tg|--tags)'{-tg,--tags}'[one tag or the list of tags which will be added to the note]' \ - '(-nb|--notebook)'{-nb,--notebook}'[name of notebook where to save note]' \ - ) - ;; - remove) - _command_args=( - '(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \ - '(--force)--force' \ - ) - ;; - show) - _command_args=( - '(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \ - ) - ;; - find) - _command_args=( - '(-s|--search)'{-s,--search}'[text to search]' \ - '(-tg|--tags)'{-tg,--tags}'[notes with which tag/tags to search]' \ - '(-nb|--notebook)'{-nb,--notebook}'[in which notebook search the note]' \ - '(-d|--date)'{-d,--date}'[date in format dd.mm.yyyy or date range dd.mm.yyyy-dd.mm.yyyy]' \ - '(-cn|--count)'{-cn,--count}'[how many notes show in the result list]' \ - '(-uo|--url-only)'{-uo,--url-only}'[add direct url of each note in results to Evernote web-version]' \ - '(-ee|--exact-entry)'{-ee,--exact-entry}'[search for exact entry of the request]' \ - '(-cs|--content-search)'{-cs,--content-search}'[search by content, not by title]' \ - ) - ;; - notebook-create) - _command_args=( - '(-t|--title)'{-t,--title}'[notebook title]' \ - ) - ;; - notebook-edit) - _command_args=( - '(-nb|--notebook)'{-nb,--notebook}'[name of notebook to rename]' \ - '(-t|--title)'{-t,--title}'[new notebook title]' \ - ) - ;; - notebook-remove) - _command_args=( - '(-nb|--notebook)'{-nb,--notebook}'[name of notebook to remove]' \ - '(--force)--force' \ - ) - ;; - tag-create) - _command_args=( - '(-t|--title)'{-t,--title}'[title of tag]' \ - ) - ;; - tag-edit) - _command_args=( - '(-tgn|--tagname)'{-tgn,--tagname}'[tag to edit]' \ - '(-t|--title)'{-t,--title}'[new tag name]' \ - ) - ;; - tag-remove) - _command_args=( - '(-tgn|--tagname)'{-tgn,--tagname}'[tag to remove]' \ - '(--force)--force' \ - ) - ;; - esac - -_arguments \ - $_command_args \ - && return 0 + login) + __login ;; + logout) + __logout ;; + settings) + __settings ;; + create) + __create ;; + edit) + __edit ;; + find) + __find ;; + show) + __show ;; + remove) + __remove ;; + notebook-list) + __notebook-list ;; + notebook-create) + __notebook-create ;; + notebook-edit) + __notebook-edit ;; + tag-list) + __tag-list ;; + tag-create) + __tag-create ;; + tag-edit) + __tag-edit ;; + user) + __user ;; +esac -- cgit v1.2.3-70-g09d2 From 888ab9091c4fb5bbadd1329524abfe9aa7a84451 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Fri, 28 Feb 2020 19:07:05 +0100 Subject: lib: add support for clippaste in WSL using powershell Source: https://github.com/microsoft/WSL/issues/4852#issuecomment-579616808 --- lib/clipboard.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/clipboard.zsh b/lib/clipboard.zsh index 808f2ea2d..122145f15 100644 --- a/lib/clipboard.zsh +++ b/lib/clipboard.zsh @@ -83,7 +83,7 @@ function detect-clipboard() { function clippaste() { tmux save-buffer -; } elif [[ $(uname -r) = *icrosoft* ]]; then function clipcopy() { clip.exe < "${1:-/dev/stdin}"; } - function clippaste() { _retry_clipboard_detection_or_fail clippaste "$@"; } + function clippaste() { powershell.exe -noprofile -command Get-Clipboard; } else function _retry_clipboard_detection_or_fail() { local clipcmd="${1}"; shift -- cgit v1.2.3-70-g09d2 From 6f85dc2389b415011b844ff2a8cbd948be566ec3 Mon Sep 17 00:00:00 2001 From: Gustavo Maia Date: Fri, 28 Feb 2020 15:23:36 -0300 Subject: kitchen: change sed regex in completion to capture all commands (#5820) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marc Cornellà --- plugins/kitchen/_kitchen | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/kitchen/_kitchen b/plugins/kitchen/_kitchen index 29a3125e4..d93d93d78 100644 --- a/plugins/kitchen/_kitchen +++ b/plugins/kitchen/_kitchen @@ -67,7 +67,7 @@ _kitchen() { _kitchen_commands() { local commands - commands=("${(@f)$(_call_program commands $service help | sed -n 's/^ kitchen \([[:alpha:]]*\) [ [].*# \(.*\)$/\1:\2/p')}") + commands=("${(@f)$(_call_program commands $service help | sed -n 's/^ kitchen \([[:alpha:]]*\) [ A-Z[].*# \(.*\)$/\1:\2/p')}") _describe -t commands 'kitchen commands' commands } -- cgit v1.2.3-70-g09d2 From 864b441688efee6573d233b21075a6f23a903097 Mon Sep 17 00:00:00 2001 From: Thomas Ruiz Date: Fri, 28 Feb 2020 19:28:55 +0100 Subject: composer: keep composer autocompletion when using global (#5933) --- plugins/composer/composer.plugin.zsh | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh index 634961023..fb53da113 100644 --- a/plugins/composer/composer.plugin.zsh +++ b/plugins/composer/composer.plugin.zsh @@ -15,20 +15,16 @@ _composer_get_required_list () { } _composer () { - local curcontext="$curcontext" state line - typeset -A opt_args - _arguments \ - '1: :->command'\ - '*: :->args' - - case $state in - command) - compadd $(_composer_get_command_list) - ;; - *) - compadd $(_composer_get_required_list) - ;; - esac + local curcontext="$curcontext" state line + typeset -A opt_args + _arguments \ + '*:: :->subcmds' + + if (( CURRENT == 1 )) || ( ((CURRENT == 2)) && [ "$words[1]" = "global" ] ) ; then + compadd $(_composer_get_command_list) + else + compadd $(_composer_get_required_list) + fi } compdef _composer composer -- cgit v1.2.3-70-g09d2 From a2cad16790aeb7e775da47fd11f1f7cee1e03c90 Mon Sep 17 00:00:00 2001 From: Stephen Heuer Date: Fri, 28 Feb 2020 12:50:17 -0600 Subject: lib: urlencode hostname in update_terminalapp_cwd (#6245) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apple's Terminal doesn't open a new tab in your current directory if your hostname has UTF-8 characters in it. Percent encoding the host in addition to the path in update_terminalapp_cwd appears to solve this issue. Co-authored-by: Marc Cornellà --- lib/termsupport.zsh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index f5e367fcb..19fd57b9d 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -91,12 +91,13 @@ if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then function update_terminalapp_cwd() { emulate -L zsh - # Percent-encode the pathname. - local URL_PATH="$(omz_urlencode -P $PWD)" - [[ $? != 0 ]] && return 1 + # Percent-encode the host and path names. + local URL_HOST URL_PATH + URL_HOST="$(omz_urlencode -P $HOST)" || return 1 + URL_PATH="$(omz_urlencode -P $PWD)" || return 1 # Undocumented Terminal.app-specific control sequence - printf '\e]7;%s\a' "file://$HOST$URL_PATH" + printf '\e]7;%s\a' "file://$URL_HOST$URL_PATH" } # Use a precmd hook instead of a chpwd hook to avoid contaminating output -- cgit v1.2.3-70-g09d2 From 5023a4787bee5da4a47a3155f3f7a3ee3cee155c Mon Sep 17 00:00:00 2001 From: Joshua Pratt Date: Sat, 29 Feb 2020 05:59:33 +1100 Subject: stack: use builtin completion command (#6230) --- plugins/stack/stack.plugin.zsh | 39 ++------------------------------------- 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/plugins/stack/stack.plugin.zsh b/plugins/stack/stack.plugin.zsh index a149208d0..4e812880e 100644 --- a/plugins/stack/stack.plugin.zsh +++ b/plugins/stack/stack.plugin.zsh @@ -1,37 +1,2 @@ -function _stack_commands() { - local ret=1 state - _arguments ':subcommand:->subcommand' && ret=0 - - case $state in - subcommand) - subcommands=( - "build:Build the project(s) in this directory/configuration" - "install:Build executables and install to a user path" - "test:Build and test the project(s) in this directory/configuration" - "bench:Build and benchmark the project(s) in this directory/configuration" - "haddock:Generate haddocks for the project(s) in this directory/configuration" - "new:Create a brand new project" - "init:Initialize a stack project based on one or more stack packages" - "solver:Use a dependency solver to try and determine missing extra-deps" - "setup:Get the appropriate ghc for your project" - "path:Print out handy path information" - "unpack:Unpack one or more packages locally" - "update:Update the package index" - "upgrade:Upgrade to the latest stack (experimental)" - "upload:Upload a package to Hackage" - "dot:Visualize your project's dependency graph using Graphviz dot" - "exec:Execute a command" - "ghc:Run ghc" - "ghci:Run ghci in the context of project(s)" - "ide:Run ide-backend-client with the correct arguments" - "runghc:Run runghc" - "clean:Clean the local packages" - "docker:Subcommands specific to Docker use" - ) - _describe -t subcommands 'stack subcommands' subcommands && ret=0 - esac - - return ret -} - -compdef _stack_commands stack +autoload -U +X bashcompinit && bashcompinit +source <(stack --bash-completion-script stack) -- cgit v1.2.3-70-g09d2 From c3984a775994645b8fb9ef7f714a92edb7baf5ac Mon Sep 17 00:00:00 2001 From: Ville Lautanala Date: Fri, 28 Feb 2020 21:01:14 +0200 Subject: fasd: cache full fasd initialisation script (#6097) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using `fasd —-init auto` will first detect terminal and then call fasd again to generate the final initialisation script. Caching that gives a more significant performance boost. --- plugins/fasd/fasd.plugin.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/fasd/fasd.plugin.zsh b/plugins/fasd/fasd.plugin.zsh index ec2e5183a..cdf99708c 100644 --- a/plugins/fasd/fasd.plugin.zsh +++ b/plugins/fasd/fasd.plugin.zsh @@ -1,7 +1,8 @@ if [ $commands[fasd] ]; then # check if fasd is installed fasd_cache="${ZSH_CACHE_DIR}/fasd-init-cache" if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then - fasd --init auto >| "$fasd_cache" + fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install \ + zsh-wcomp zsh-wcomp-install >| "$fasd_cache" fi source "$fasd_cache" unset fasd_cache -- cgit v1.2.3-70-g09d2 From 389de86cf5e4976bdda4259b27987c44d401ae96 Mon Sep 17 00:00:00 2001 From: Sven Hergenhahn Date: Fri, 28 Feb 2020 20:29:44 +0100 Subject: pass: update completion to upstream version (675a002e) (#6475) --- plugins/pass/_pass | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/pass/_pass b/plugins/pass/_pass index 5f3b8f541..75f3feb4f 100644 --- a/plugins/pass/_pass +++ b/plugins/pass/_pass @@ -10,6 +10,14 @@ # Please visit https://git.zx2c4.com/password-store/tree/COPYING for more information. +# If you use multiple repositories, you can configure completion like this: +# +# compdef _pass workpass +# zstyle ':completion::complete:workpass::' prefix "$HOME/work/pass" +# workpass() { +# PASSWORD_STORE_DIR=$HOME/work/pass pass $@ +# } + # If you use multiple repositories, you can configure completion like this: # # compdef _pass workpass -- cgit v1.2.3-70-g09d2 From e61228282acced09d9b245b3fc337fd079dc26a8 Mon Sep 17 00:00:00 2001 From: Wenbing Li Date: Fri, 28 Feb 2020 11:35:19 -0800 Subject: gradle: fix command option name in completion (#6586) It should be `--rerun-tasks`, the original one miss a 's' at the end. See https://docs.gradle.org/current/userguide/command_line_interface.html --- plugins/gradle/gradle.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/gradle/gradle.plugin.zsh b/plugins/gradle/gradle.plugin.zsh index c651b91ca..bba6ad4e9 100644 --- a/plugins/gradle/gradle.plugin.zsh +++ b/plugins/gradle/gradle.plugin.zsh @@ -83,7 +83,7 @@ function _gradle_arguments() { '--quiet[Log errors only]' \ '--recompile-scripts[Forces scripts to be recompiled, bypassing caching]' \ '--refresh-dependencies[Refresh the state of dependencies]' \ - '--rerun-task[Specifies that any task optimization is ignored]' \ + '--rerun-tasks[Specifies that any task optimization is ignored]' \ '--settings-file[Specifies the settings file]' \ '--stacktrace[Print out the stacktrace also for user exceptions]' \ '--status[Print Gradle Daemon status]' \ -- cgit v1.2.3-70-g09d2 From f94e55a1a91492662e87ae6e96e3c36ae08d18dd Mon Sep 17 00:00:00 2001 From: Cody Fuller Date: Fri, 28 Feb 2020 13:42:18 -0600 Subject: mix: add format option to completion (#7256) --- plugins/mix/_mix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/mix/_mix b/plugins/mix/_mix index 61fa1cf25..c0fe68c91 100644 --- a/plugins/mix/_mix +++ b/plugins/mix/_mix @@ -34,6 +34,7 @@ _1st_arguments=( 'firmware:Nerves - Build a firmware image for the selected target platform' 'firmware.burn:Nerves - Writes the generated firmware image to an attached SDCard or file' 'firmware.image:Nerves - Create a firmware image file that can be copied byte-for-byte' + 'format:Formats the given files and patterns' 'help:Print help information for tasks' 'hex:Print hex help information' 'hex.config:Read or update hex config' @@ -92,7 +93,7 @@ __task_list () local expl declare -a tasks - tasks=(app.start archive archive.build archive.install archive.uninstall clean cmd compile compile.protocols deps deps.clean deps.compile deps.get deps.unlock deps.update do escript.build help hex hex.config hex.docs hex.info hex.key hex.outdated hex.owner hex.publish hex.search hex.user loadconfig local local.hex local.rebar new phoenix.digest phoenix.gen.channel phoenix.gen.html phoenix.gen.json phoenix.gen.model phoenix.gen.secret phoenix.new phoenix.routes phoenix.server phx.digest phx.digest.clean phx.gen.channel phx.gen.context phx.gen.embedded phx.gen.html phx.gen.json phx.gen.presence phx.gen.schema phx.gen.secret phx.new phx.new.ecto phx.new.web phx.routes phx.server run test) + tasks=(app.start archive archive.build archive.install archive.uninstall clean cmd compile compile.protocols deps deps.clean deps.compile deps.get deps.unlock deps.update do escript.build format help hex hex.config hex.docs hex.info hex.key hex.outdated hex.owner hex.publish hex.search hex.user loadconfig local local.hex local.rebar new phoenix.digest phoenix.gen.channel phoenix.gen.html phoenix.gen.json phoenix.gen.model phoenix.gen.secret phoenix.new phoenix.routes phoenix.server phx.digest phx.digest.clean phx.gen.channel phx.gen.context phx.gen.embedded phx.gen.html phx.gen.json phx.gen.presence phx.gen.schema phx.gen.secret phx.new phx.new.ecto phx.new.web phx.routes phx.server run test) _wanted tasks expl 'help' compadd $tasks } -- cgit v1.2.3-70-g09d2 From dddbb5c9ebe0805750c0b8c0282ca86f1c6b1818 Mon Sep 17 00:00:00 2001 From: Michal Kielan Date: Fri, 28 Feb 2020 11:51:38 -0800 Subject: mercurial: add hga alias to README (#7547) --- plugins/mercurial/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/mercurial/README.md b/plugins/mercurial/README.md index f42212d68..68c7d0f43 100644 --- a/plugins/mercurial/README.md +++ b/plugins/mercurial/README.md @@ -26,6 +26,7 @@ Update .zshrc: ### What's inside? #### Adds handy aliases: ###### general +* `hga` - 'hg add` * `hgc` - `hg commit` * `hgb` - `hg branch` * `hgba` - `hg branches` -- cgit v1.2.3-70-g09d2 From befdb4649b3894cb2c545182810f228e8cb721ae Mon Sep 17 00:00:00 2001 From: Gianluca Recchia Date: Fri, 28 Feb 2020 21:00:44 +0100 Subject: gitignore: add newline to `gi` output (#7586) * Add trailing new line at the end of output * Double-quote variable expansion --- plugins/gitignore/gitignore.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/gitignore/gitignore.plugin.zsh b/plugins/gitignore/gitignore.plugin.zsh index 15e38d3b7..a687f5cce 100644 --- a/plugins/gitignore/gitignore.plugin.zsh +++ b/plugins/gitignore/gitignore.plugin.zsh @@ -1,4 +1,4 @@ -function gi() { curl -fL https://www.gitignore.io/api/${(j:,:)@} } +function gi() { curl -fLw '\n' https://www.gitignore.io/api/"${(j:,:)@}" } _gitignoreio_get_command_list() { curl -sfL https://www.gitignore.io/api/list | tr "," "\n" -- cgit v1.2.3-70-g09d2 From 1689e9bb907ab184d7418dd88bc2639a794c916d Mon Sep 17 00:00:00 2001 From: Alexander Schlarb <246386+alexander255@users.noreply.github.com> Date: Fri, 28 Feb 2020 20:01:35 +0000 Subject: zsh_reload: respect `$ZDOTDIR` when searching for `.zshrc` (#7706) --- plugins/zsh_reload/zsh_reload.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/zsh_reload/zsh_reload.plugin.zsh b/plugins/zsh_reload/zsh_reload.plugin.zsh index 51048ba9d..83f8da733 100644 --- a/plugins/zsh_reload/zsh_reload.plugin.zsh +++ b/plugins/zsh_reload/zsh_reload.plugin.zsh @@ -3,7 +3,7 @@ src() { autoload -U compinit zrecompile compinit -i -d "$cache/zcomp-$HOST" - for f in ~/.zshrc "$cache/zcomp-$HOST"; do + for f in ${ZDOTDIR:-~}/.zshrc "$cache/zcomp-$HOST"; do zrecompile -p $f && command rm -f $f.zwc.old done -- cgit v1.2.3-70-g09d2 From 14b4f62e65b3d94c275ea8892f252deae9ce619a Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sat, 29 Feb 2020 14:53:06 +0100 Subject: updater: fix --autostash argument. Works for git > 1.7.1 See https://github.com/ohmyzsh/ohmyzsh/pull/7172#issuecomment-592875226 --- tools/upgrade.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 0dc84e214..9ecaed2ef 100644 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -38,7 +38,7 @@ if [ -n "$remote" ]; then fi printf "${BLUE}%s${NORMAL}\n" "Updating Oh My Zsh" -if git pull --rebase --autostash --stat origin master +if git -c rebase.autoStash=true pull --rebase --stat origin master then printf '%s' "$GREEN" printf '%s\n' ' __ __ ' -- cgit v1.2.3-70-g09d2 From 498cd722b39215be04468f291a23b6a76b75b095 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sat, 29 Feb 2020 14:56:37 +0100 Subject: Add git version requirement in documentation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 187cceb7d..2ab859a6a 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://twi * A Unix-like operating system: macOS, Linux, BSD. On Windows: WSL is preferred, but cygwin or msys also mostly work. * [Zsh](https://www.zsh.org) should be installed (v4.3.9 or more recent). If not pre-installed (run `zsh --version` to confirm), check the following instructions here: [Installing ZSH](https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH) * `curl` or `wget` should be installed -* `git` should be installed +* `git` should be installed (recommended v1.7.2 or higher) ### Basic Installation -- cgit v1.2.3-70-g09d2 From b6f2cfdb93627ca82ced24aaddb122b3a76a2638 Mon Sep 17 00:00:00 2001 From: Vital Kolas Date: Thu, 12 May 2016 10:40:24 +0300 Subject: Exclude .idea folder from grep search scope --- lib/grep.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/grep.zsh b/lib/grep.zsh index abc1650a1..886e36a8d 100644 --- a/lib/grep.zsh +++ b/lib/grep.zsh @@ -10,13 +10,13 @@ if grep-flag-available --color=auto; then GREP_OPTIONS+=" --color=auto" fi -# ignore VCS folders (if the necessary grep flags are available) -VCS_FOLDERS="{.bzr,CVS,.git,.hg,.svn}" +# ignore these folders (if the necessary grep flags are available) +EXC_FOLDERS="{.bzr,CVS,.git,.hg,.svn,.idea}" if grep-flag-available --exclude-dir=.cvs; then - GREP_OPTIONS+=" --exclude-dir=$VCS_FOLDERS" + GREP_OPTIONS+=" --exclude-dir=$EXC_FOLDERS" elif grep-flag-available --exclude=.cvs; then - GREP_OPTIONS+=" --exclude=$VCS_FOLDERS" + GREP_OPTIONS+=" --exclude=$EXC_FOLDERS" fi # export grep settings @@ -24,5 +24,5 @@ alias grep="grep $GREP_OPTIONS" # clean up unset GREP_OPTIONS -unset VCS_FOLDERS +unset EXC_FOLDERS unfunction grep-flag-available -- cgit v1.2.3-70-g09d2 From b4b50f20ac7a6645d04993ba8ca8695a41b8db7a Mon Sep 17 00:00:00 2001 From: Peter Vandenberk Date: Wed, 10 Oct 2018 17:21:06 +0100 Subject: Also set options for egrep and fgrep --- lib/grep.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/grep.zsh b/lib/grep.zsh index 886e36a8d..bd9dad41f 100644 --- a/lib/grep.zsh +++ b/lib/grep.zsh @@ -19,8 +19,10 @@ elif grep-flag-available --exclude=.cvs; then GREP_OPTIONS+=" --exclude=$EXC_FOLDERS" fi -# export grep settings +# export grep, egrep and fgrep settings alias grep="grep $GREP_OPTIONS" +alias egrep="egrep $GREP_OPTIONS" +alias fgrep="fgrep $GREP_OPTIONS" # clean up unset GREP_OPTIONS -- cgit v1.2.3-70-g09d2 From a8ed1c4e7ab7e7df3a1e903cde30f94bf6da3e39 Mon Sep 17 00:00:00 2001 From: Shi Yan Date: Fri, 30 Nov 2018 15:44:41 +1100 Subject: Ignore .tox folder in grep --- lib/grep.zsh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/grep.zsh b/lib/grep.zsh index bd9dad41f..09042e13b 100644 --- a/lib/grep.zsh +++ b/lib/grep.zsh @@ -11,7 +11,7 @@ if grep-flag-available --color=auto; then fi # ignore these folders (if the necessary grep flags are available) -EXC_FOLDERS="{.bzr,CVS,.git,.hg,.svn,.idea}" +EXC_FOLDERS="{.bzr,CVS,.git,.hg,.svn,.idea,.tox}" if grep-flag-available --exclude-dir=.cvs; then GREP_OPTIONS+=" --exclude-dir=$EXC_FOLDERS" @@ -25,6 +25,5 @@ alias egrep="egrep $GREP_OPTIONS" alias fgrep="fgrep $GREP_OPTIONS" # clean up -unset GREP_OPTIONS -unset EXC_FOLDERS +unset GREP_OPTIONS EXC_FOLDERS unfunction grep-flag-available -- cgit v1.2.3-70-g09d2 From 57b178102c0016f5c433054ce981a80dd4b4b73f Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Sat, 30 Nov 2019 13:49:23 -0500 Subject: Performance enhancement for lib/grep - Use $ZSH_CACHE_DIR to store the grep alias with all the right features - Expire the cache after 24 hours - See issue #8444 --- lib/grep.zsh | 57 ++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/lib/grep.zsh b/lib/grep.zsh index 09042e13b..df9146aa4 100644 --- a/lib/grep.zsh +++ b/lib/grep.zsh @@ -1,29 +1,40 @@ -# is x grep argument available? -grep-flag-available() { - echo | grep $1 "" >/dev/null 2>&1 -} +# see if we already cached the grep alias in past day +_grep_alias_cache=("$ZSH_CACHE_DIR"/grep_alias.zsh(Nm-24)) +if (( $#_grep_alias_cache )); then + source "$ZSH_CACHE_DIR"/grep_alias.zsh +else + # is x grep argument available? + grep-flag-available() { + echo | grep $1 "" >/dev/null 2>&1 + } -GREP_OPTIONS="" + GREP_OPTIONS="" -# color grep results -if grep-flag-available --color=auto; then - GREP_OPTIONS+=" --color=auto" -fi + # color grep results + if grep-flag-available --color=auto; then + GREP_OPTIONS+=" --color=auto" + fi -# ignore these folders (if the necessary grep flags are available) -EXC_FOLDERS="{.bzr,CVS,.git,.hg,.svn,.idea,.tox}" + # ignore these folders (if the necessary grep flags are available) + EXC_FOLDERS="{.bzr,CVS,.git,.hg,.svn,.idea,.tox}" -if grep-flag-available --exclude-dir=.cvs; then - GREP_OPTIONS+=" --exclude-dir=$EXC_FOLDERS" -elif grep-flag-available --exclude=.cvs; then - GREP_OPTIONS+=" --exclude=$EXC_FOLDERS" -fi + if grep-flag-available --exclude-dir=.cvs; then + GREP_OPTIONS+=" --exclude-dir=$EXC_FOLDERS" + elif grep-flag-available --exclude=.cvs; then + GREP_OPTIONS+=" --exclude=$EXC_FOLDERS" + fi -# export grep, egrep and fgrep settings -alias grep="grep $GREP_OPTIONS" -alias egrep="egrep $GREP_OPTIONS" -alias fgrep="fgrep $GREP_OPTIONS" + { + # export grep, egrep and fgrep settings + echo alias grep="'grep $GREP_OPTIONS'" + echo alias egrep="'egrep $GREP_OPTIONS'" + echo alias fgrep="'fgrep $GREP_OPTIONS'" + } > "$ZSH_CACHE_DIR/grep_alias.zsh" -# clean up -unset GREP_OPTIONS EXC_FOLDERS -unfunction grep-flag-available + source "$ZSH_CACHE_DIR/grep_alias.zsh" + + # clean up + unset GREP_OPTIONS EXC_FOLDERS + unfunction grep-flag-available +fi +unset _grep_alias_cache -- cgit v1.2.3-70-g09d2 From 8d814fdff6f57e83a2b0c9430f61f7093a95bd04 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sun, 1 Mar 2020 14:02:06 +0100 Subject: Fast algorithm to determine grep alias flags This version tries whether grep supports all the flags together and progressively checks older flags if the grep test fails. This means only one grep call if all flags are supported, and one additional call for every flag that's not supported, up to a maximum of 3 calls. --- lib/grep.zsh | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/lib/grep.zsh b/lib/grep.zsh index df9146aa4..933de2990 100644 --- a/lib/grep.zsh +++ b/lib/grep.zsh @@ -4,37 +4,36 @@ if (( $#_grep_alias_cache )); then source "$ZSH_CACHE_DIR"/grep_alias.zsh else # is x grep argument available? - grep-flag-available() { - echo | grep $1 "" >/dev/null 2>&1 + grep-flags-available() { + echo | grep "$@" "" >/dev/null 2>&1 } GREP_OPTIONS="" - # color grep results - if grep-flag-available --color=auto; then - GREP_OPTIONS+=" --color=auto" - fi - # ignore these folders (if the necessary grep flags are available) EXC_FOLDERS="{.bzr,CVS,.git,.hg,.svn,.idea,.tox}" - if grep-flag-available --exclude-dir=.cvs; then - GREP_OPTIONS+=" --exclude-dir=$EXC_FOLDERS" - elif grep-flag-available --exclude=.cvs; then - GREP_OPTIONS+=" --exclude=$EXC_FOLDERS" + if grep-flags-available --color=auto --exclude-dir=.cvs; then + GREP_OPTIONS+="--color=auto --exclude-dir=$EXC_FOLDERS" + elif grep-flags-available --color=auto --exclude=.cvs; then + GREP_OPTIONS+="--color=auto --exclude=$EXC_FOLDERS" + elif grep-flags-available --color=auto; then + GREP_OPTIONS+="--color=auto" fi { - # export grep, egrep and fgrep settings - echo alias grep="'grep $GREP_OPTIONS'" - echo alias egrep="'egrep $GREP_OPTIONS'" - echo alias fgrep="'fgrep $GREP_OPTIONS'" + if [[ -n "$GREP_OPTIONS" ]]; then + # export grep, egrep and fgrep settings + echo alias grep="'grep $GREP_OPTIONS'" + echo alias egrep="'egrep $GREP_OPTIONS'" + echo alias fgrep="'fgrep $GREP_OPTIONS'" + fi } > "$ZSH_CACHE_DIR/grep_alias.zsh" source "$ZSH_CACHE_DIR/grep_alias.zsh" # clean up unset GREP_OPTIONS EXC_FOLDERS - unfunction grep-flag-available + unfunction grep-flags-available fi unset _grep_alias_cache -- cgit v1.2.3-70-g09d2 From dc190d872aa37dc0440284bee6c6bd7744007bf0 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sun, 1 Mar 2020 20:17:38 +0100 Subject: Refactor grep.zsh file - Move grep-alias path to variable. - Use <<< "" instead of piped echo to check grep flags. - Remove check for --color only since it's the same release as --exclude. --- lib/grep.zsh | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/lib/grep.zsh b/lib/grep.zsh index 933de2990..1d94eb978 100644 --- a/lib/grep.zsh +++ b/lib/grep.zsh @@ -1,39 +1,37 @@ -# see if we already cached the grep alias in past day -_grep_alias_cache=("$ZSH_CACHE_DIR"/grep_alias.zsh(Nm-24)) -if (( $#_grep_alias_cache )); then - source "$ZSH_CACHE_DIR"/grep_alias.zsh -else - # is x grep argument available? +__GREP_CACHE_FILE="$ZSH_CACHE_DIR"/grep-alias + +# See if there's a cache file modified in the last day +__GREP_ALIAS_CACHES=("$__GREP_CACHE_FILE"(Nm-1)) +if [[ -z "$__GREP_ALIAS_CACHES" ]]; then grep-flags-available() { - echo | grep "$@" "" >/dev/null 2>&1 + command grep "$@" "" &>/dev/null <<< "" } - GREP_OPTIONS="" - - # ignore these folders (if the necessary grep flags are available) + # Ignore these folders (if the necessary grep flags are available) EXC_FOLDERS="{.bzr,CVS,.git,.hg,.svn,.idea,.tox}" + # Check for --exclude-dir, otherwise check for --exclude. If --exclude + # isn't available, --color won't be either (they were released at the same + # time (v2.5): http://git.savannah.gnu.org/cgit/grep.git/tree/NEWS?id=1236f007 if grep-flags-available --color=auto --exclude-dir=.cvs; then - GREP_OPTIONS+="--color=auto --exclude-dir=$EXC_FOLDERS" + GREP_OPTIONS="--color=auto --exclude-dir=$EXC_FOLDERS" elif grep-flags-available --color=auto --exclude=.cvs; then - GREP_OPTIONS+="--color=auto --exclude=$EXC_FOLDERS" - elif grep-flags-available --color=auto; then - GREP_OPTIONS+="--color=auto" + GREP_OPTIONS="--color=auto --exclude=$EXC_FOLDERS" fi { if [[ -n "$GREP_OPTIONS" ]]; then # export grep, egrep and fgrep settings - echo alias grep="'grep $GREP_OPTIONS'" - echo alias egrep="'egrep $GREP_OPTIONS'" - echo alias fgrep="'fgrep $GREP_OPTIONS'" + echo "alias grep='grep $GREP_OPTIONS'" + echo "alias egrep='egrep $GREP_OPTIONS'" + echo "alias fgrep='fgrep $GREP_OPTIONS'" fi - } > "$ZSH_CACHE_DIR/grep_alias.zsh" + } > "$__GREP_CACHE_FILE" - source "$ZSH_CACHE_DIR/grep_alias.zsh" - - # clean up + # Clean up unset GREP_OPTIONS EXC_FOLDERS unfunction grep-flags-available fi -unset _grep_alias_cache + +source "$__GREP_CACHE_FILE" +unset __GREP_CACHE_FILE __GREP_ALIAS_CACHES -- cgit v1.2.3-70-g09d2 From 9ce7de9f16ba894423bc5105c7e959894ca2e751 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sun, 1 Mar 2020 22:53:33 +0100 Subject: Document ZSH_THEME_RANDOM_BLACKLIST setting --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 2ab859a6a..38cfd9f4e 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,12 @@ ZSH_THEME_RANDOM_CANDIDATES=( ) ``` +If you only know which themes you don't like, you can add them similarly to a blacklist: + +```shell +ZSH_THEME_RANDOM_BLACKLIST=(pygmalion tjkirch_mod) +``` + ### FAQ If you have some more questions or issues, you might find a solution in our [FAQ](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ). -- cgit v1.2.3-70-g09d2 From d3dfc1371693d2b64ccec249511ea9178b088015 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Mon, 2 Mar 2020 12:35:58 +0100 Subject: lib: use grep-alias cache only if ZSH_CACHE_DIR is writable Fixes #8693 --- lib/grep.zsh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/lib/grep.zsh b/lib/grep.zsh index 1d94eb978..a725e0f26 100644 --- a/lib/grep.zsh +++ b/lib/grep.zsh @@ -2,7 +2,9 @@ __GREP_CACHE_FILE="$ZSH_CACHE_DIR"/grep-alias # See if there's a cache file modified in the last day __GREP_ALIAS_CACHES=("$__GREP_CACHE_FILE"(Nm-1)) -if [[ -z "$__GREP_ALIAS_CACHES" ]]; then +if [[ -n "$__GREP_ALIAS_CACHES" ]]; then + source "$__GREP_CACHE_FILE" +else grep-flags-available() { command grep "$@" "" &>/dev/null <<< "" } @@ -12,26 +14,28 @@ if [[ -z "$__GREP_ALIAS_CACHES" ]]; then # Check for --exclude-dir, otherwise check for --exclude. If --exclude # isn't available, --color won't be either (they were released at the same - # time (v2.5): http://git.savannah.gnu.org/cgit/grep.git/tree/NEWS?id=1236f007 + # time (v2.5): https://git.savannah.gnu.org/cgit/grep.git/tree/NEWS?id=1236f007 if grep-flags-available --color=auto --exclude-dir=.cvs; then GREP_OPTIONS="--color=auto --exclude-dir=$EXC_FOLDERS" elif grep-flags-available --color=auto --exclude=.cvs; then GREP_OPTIONS="--color=auto --exclude=$EXC_FOLDERS" fi - { - if [[ -n "$GREP_OPTIONS" ]]; then - # export grep, egrep and fgrep settings - echo "alias grep='grep $GREP_OPTIONS'" - echo "alias egrep='egrep $GREP_OPTIONS'" - echo "alias fgrep='fgrep $GREP_OPTIONS'" + if [[ -n "$GREP_OPTIONS" ]]; then + # export grep, egrep and fgrep settings + alias grep="grep $GREP_OPTIONS" + alias egrep="egrep $GREP_OPTIONS" + alias fgrep="fgrep $GREP_OPTIONS" + + # write to cache file if cache directory is writable + if [[ -w "$ZSH_CACHE_DIR" ]]; then + alias -L grep egrep fgrep >| "$__GREP_CACHE_FILE" fi - } > "$__GREP_CACHE_FILE" + fi # Clean up unset GREP_OPTIONS EXC_FOLDERS unfunction grep-flags-available fi -source "$__GREP_CACHE_FILE" unset __GREP_CACHE_FILE __GREP_ALIAS_CACHES -- cgit v1.2.3-70-g09d2 From e42683b8c5e20ca3d9c0fde1cb748cd8c8169619 Mon Sep 17 00:00:00 2001 From: Dan D'Avella Date: Mon, 2 Mar 2020 07:17:16 -0500 Subject: pip: add local Python package files to completion (#7442) --- plugins/pip/_pip | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/pip/_pip b/plugins/pip/_pip index 607f68e58..a5adead4a 100644 --- a/plugins/pip/_pip +++ b/plugins/pip/_pip @@ -89,6 +89,7 @@ case "$words[1]" in if [[ "$state" == packages ]]; then _pip_all _wanted piplist expl 'packages' compadd -a piplist + _files -g "*.(tar.gz|whl)" fi ;; uninstall) _pip_installed -- cgit v1.2.3-70-g09d2 From 74420341df46fab5cf34f24917927d675d717102 Mon Sep 17 00:00:00 2001 From: Pavel Fokin Date: Mon, 2 Mar 2020 14:20:28 +0200 Subject: minikube: cache command completions (#7446) --- plugins/minikube/minikube.plugin.zsh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/minikube/minikube.plugin.zsh b/plugins/minikube/minikube.plugin.zsh index d8ebe79af..f7b365c7f 100644 --- a/plugins/minikube/minikube.plugin.zsh +++ b/plugins/minikube/minikube.plugin.zsh @@ -1,6 +1,13 @@ # Autocompletion for Minikube. # +if (( $+commands[minikube] )); then + __MINICUBE_COMPLETION_FILE="${ZSH_CACHE_DIR}/minicube_completion" -if [ $commands[minikube] ]; then - source <(minikube completion zsh) + if [[ ! -f $__MINICUBE_COMPLETION_FILE ]]; then + minikube completion zsh >! $__MINICUBE_COMPLETION_FILE + fi + + [[ -f $__MINICUBE_COMPLETION_FILE ]] && source $__MINICUBE_COMPLETION_FILE + + unset __MINICUBE_COMPLETION_FILE fi -- cgit v1.2.3-70-g09d2 From e65bce849580fbb96c436b1a2a3739cb8c27c299 Mon Sep 17 00:00:00 2001 From: "Pavel N. Krivitsky" Date: Mon, 2 Mar 2020 23:30:52 +1100 Subject: shrink-path: add minimum length and ellipsis symbol options (#7382) * Added minimum length and ellipsis symbol options for the shrink-path plugin. * Replaced tab indentation with space indentation for the shrink-path plugin. * Added handling of multicharacter ellipsis, and updated documentation and README for the shrink-path plugin. --- plugins/shrink-path/README.md | 8 ++++++- plugins/shrink-path/shrink-path.plugin.zsh | 37 ++++++++++++++++++++++++++---- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/plugins/shrink-path/README.md b/plugins/shrink-path/README.md index b990aea91..54bc351d3 100644 --- a/plugins/shrink-path/README.md +++ b/plugins/shrink-path/README.md @@ -20,6 +20,8 @@ here are the results of calling `shrink_path