From 1a657c6c4d44dbfcffb4c633a58e623f4d692706 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Tue, 10 Jul 2018 21:23:25 +0200 Subject: yarn: use zsh-completions completion (ff73f40) Version: ff73f40 (2018-05-02) Fixes #5859 Fixes #5878 Fixes #5983 Fixes #6013 --- plugins/yarn/_yarn | 345 +++++++++++++++++++++++++++++++++++++++++++ plugins/yarn/yarn.plugin.zsh | 92 ------------ 2 files changed, 345 insertions(+), 92 deletions(-) create mode 100644 plugins/yarn/_yarn diff --git a/plugins/yarn/_yarn b/plugins/yarn/_yarn new file mode 100644 index 000000000..382f58a0a --- /dev/null +++ b/plugins/yarn/_yarn @@ -0,0 +1,345 @@ +#compdef yarn +# ------------------------------------------------------------------------------ +# 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 yarn (https://yarnpkg.com/) +# +# ------------------------------------------------------------------------------ +# Authors +# ------- +# +# * Massimiliano Torromeo +# +# ------------------------------------------------------------------------------ + +_commands=( + 'access' + 'autoclean:Clean and remove unnecessary files from package dependencies' + 'cache:List or clean every cached package' + "check:Verify package dependencies agains yarn's lock file" + 'config:Manages the yarn configuration files' + 'generate-lock-entry:Generates a lock file entry' + 'global:Install packages globally on your operating system' + 'help:Show information about a command' + 'import:Generate yarn.lock from an existing npm-installed node_modules folder' + 'info:Show information about a package' + 'init:Interactively creates or updates a package.json file' + 'install:Install all the dependencies listed within package.json' + 'licenses:List licenses for installed packages' + 'link:Symlink a package folder during development' + 'list:List installed packages' + 'login:Store registry username and email' + 'logout:Clear registry username and email' + 'outdated:Check for outdated package dependencies' + 'owner:Manage package owners' + 'pack:Create a compressed gzip archive of package dependencies' + 'publish:Publish a package to the npm registry' + 'run:Run a defined package script' + 'tag:Add, remove, or list tags on a package' + 'team:Maintain team memberships' + 'unlink:Unlink a previously created symlink for a package' + 'version:Update the package version' + 'versions:Display version information of currently installed Yarn, Node.js, and its dependencies' + 'why:Show information about why a package is installed' +) + +_global_commands=( + 'add:Installs a package and any packages that it depends on' + 'bin:Displays the location of the yarn bin folder' + 'remove:Remove installed package from dependencies updating package.json' + 'upgrade:Upgrades packages to their latest version based on the specified range' + 'upgrade-interactive' +) + +_yarn_commands_scripts() { + local -a scripts + scripts=($(yarn run --json 2>/dev/null | sed -E '/Commands available|possibleCommands/!d;s/.*Commands available from binary scripts: ([^"]+)".*/\1/;s/.*"items":\[([^]]+).*/\1/;s/[" ]//g' | tr , '\n' | sed -e 's/:/\\:/g')) + _describe 'command or script' _commands -- _global_commands -- scripts +} + +_yarn_scripts() { + local -a scripts + scripts=($(yarn run --json 2>/dev/null | sed -E '/Commands available|possibleCommands/!d;s/.*Commands available from binary scripts: ([^"]+)".*/\1/;s/.*"items":\[([^]]+).*/\1/;s/[" ]//g' | tr , '\n' | sed -e 's/:/\\:/g')) + _describe 'script' scripts +} + +_yarn_global_commands() { + local -a cmds + cmds=('ls:List installed packages') + _describe 'command' _global_commands +} + +_yarn_commands() { + _describe 'command' _commands -- _global_commands +} + +_yarn() { + local context state state_descr line + typeset -A opt_args + + _arguments \ + '(-h --help)'{-h,--help}'[output usage information]' \ + '(-V --version)'{-V,--version}'[output the version number]' \ + '--verbose[output verbose messages on internal operations]' \ + '--offline[trigger an error if any required dependencies are not available in local cache]' \ + '--prefer-offline[use network only if dependencies are not available in local cache]' \ + '--strict-semver' \ + '--json' \ + "--ignore-scripts[don't run lifecycle scripts]" \ + '--har[save HAR output of network traffic]' \ + '--ignore-platform[ignore platform checks]' \ + '--ignore-engines[ignore engines check]' \ + '--ignore-optional[ignore optional dependencies]' \ + '--force[install and build packages even if they were built before, overwrite lockfile]' \ + '--skip-integrity-check[run install without checking if node_modules is installed]' \ + '--check-files[install will verify file tree of packages for consistency]' \ + "--no-bin-links[don't generate bin links when setting up packages]" \ + '--flat[only allow one version of a package]' \ + '(--prod --production)'{--prod,--production} \ + "--no-lockfile[don't read or generate a lockfile]" \ + "--pure-lockfile[don't generate a lockfile]" \ + "--frozen-lockfile[don't generate a lockfile and fail if an update is needed]" \ + '--link-duplicates[create hardlinks to the repeated modules in node_modules]' \ + '--global-folder=[modules folder]:folder:_files -/' \ + '--modules-folder=[rather than installing modules into the node_modules folder relative to the cwd, output them here]:folder:_files -/' \ + '--cache-folder=[specify a custom folder to store the yarn cache]:folder:_files -/' \ + '--mutex=[use a mutex to ensure only one yarn instance is executing]:type[\:specifier]' \ + '--no-emoji[disable emoji in output]' \ + '(-s --silent)'{-s,--silent}'[skip Yarn console logs, other types of logs (script output) will be printed]' \ + '--proxy=:host:_hosts' \ + '--https-proxy=:host:_hosts' \ + '--no-progress[disable progress bar]' \ + '--network-concurrency=[maximum number of concurrent network requests]:number' \ + '--network-timeout=[TCP timeout for network requests]:milliseconds' \ + '--non-interactive[do not show interactive prompts]' \ + '1: :_yarn_commands_scripts' \ + '*:: :->command_args' + + + case $state in + command_args) + case $words[1] in + help) + _arguments \ + '1: :_yarn_commands' \ + ;; + + access) + _arguments \ + '1: :(public restricted grant revoke ls-packages ls-collaborators edit)' + ;; + + add) + _arguments \ + '(-D --dev)'{-D,--dev}'[install packages in devDependencies]' \ + '(-P --peer)'{-P,--peer}'[install packages in peerDependencies]' \ + '(-O --optional)'{-O,--optional}'[install packages in optionalDependencies]' \ + '(-E --exact)'{-E,--exact}'[install packages as exact versions]' \ + '(-T --tilde)'{-T,--tilde}'[install the most recent release of the packages that have the same minor version]' \ + '*:package-name:' + ;; + + cache) + _arguments \ + '1: :(ls dir clean)' + ;; + + check) + _arguments \ + '--integrity' \ + '--verify-tree' + ;; + + config) + _arguments \ + '1: :(set get delete list)' \ + '*:: :->config_args' + ;; + + global) + _arguments \ + '--prefix=[bin prefix to use to install binaries]' \ + '1: :_yarn_global_commands' \ + '*:: :->command_args' + ;; + + info) + _arguments \ + '1:package:' \ + '2:field' + ;; + + init) + _arguments \ + '(-y --yes)'{-y,--yes}'[install packages in devDependencies]' + ;; + + licenses) + _arguments \ + '1: :(ls generate-disclaimer)' \ + ;; + + link|unlink|outdated) + _arguments \ + '1:package' \ + ;; + + list) + _arguments \ + '--depth[Limit the depth of the shown dependencies]:depth' + ;; + + owner) + _arguments \ + '1: :(ls add rm)' \ + '*:: :->owner_args' + ;; + + pack) + _arguments \ + '(-f --filename)'{-f,--filename}':filename:_files' + ;; + + publish) + _arguments \ + '--new-version:version:' \ + '--message:message:' \ + '--no-git-tag-version' \ + '--access:access:' \ + '--tag:tag:' \ + '1: :_files' + ;; + + remove|upgrade) + _arguments \ + '*:package:' + ;; + + run) + _arguments \ + '1: :_yarn_scripts' + ;; + + tag) + _arguments \ + '1: :(ls add rm)' \ + '*:: :->tag_args' + ;; + + team) + _arguments \ + '1: :(create destroy add rm ls)' \ + '*:: :->team_args' + ;; + + version) + _arguments \ + '--new-version:version:' \ + '--message:message:' \ + '--no-git-tag-version' + ;; + + why) + _arguments \ + '1:query:_files' + ;; + esac + ;; + esac + + case $state in + config_args) + case $words[1] in + get|delete) + _arguments \ + '1:key:' + ;; + + set) + _arguments \ + '(-g --global)'{-g,--global} \ + '1:key:' \ + '2:value:' + ;; + esac + ;; + + owner_args) + case $words[1] in + ls) + _arguments \ + '1:package:' + ;; + + add|rm) + _arguments \ + '1:user:' \ + '2:package:' + ;; + esac + ;; + + tag_args) + case $words[1] in + ls) + _arguments \ + '1:package' + ;; + + add|rm) + _arguments \ + '1:package:' \ + '2:tag:' + ;; + esac + ;; + + team_args) + case $words[1] in + create|destroy|ls) + _arguments \ + '1:scope\:team:' + ;; + + add|rm) + _arguments \ + '1:scope\:team:' \ + '2:user:' + ;; + esac + ;; + esac +} + +_yarn "$@" + +# Local Variables: +# mode: Shell-Script +# sh-indentation: 2 +# indent-tabs-mode: nil +# sh-basic-offset: 2 +# End: +# vim: ft=zsh sw=2 ts=2 et diff --git a/plugins/yarn/yarn.plugin.zsh b/plugins/yarn/yarn.plugin.zsh index eee811b16..7a9a7e4d4 100644 --- a/plugins/yarn/yarn.plugin.zsh +++ b/plugins/yarn/yarn.plugin.zsh @@ -1,98 +1,6 @@ -# Alias sorted alphabetically - alias y="yarn " alias ya="yarn add" alias ycc="yarn cache clean" alias yh="yarn help" alias yout="yarn outdated" alias yui="yarn upgrade-interactive" - -_yarn () -{ - local -a _1st_arguments _dopts _dev _production - local expl - typeset -A opt_args - - _dopts=( - '(--force)--force[This refetches all packages, even ones that were previously installed.]' - ) - - _installopts=( - '(--flat)--flat[Only allow one version of a package. On the first run this will prompt you to choose a single version for each package that is depended on at multiple version ranges.]' - '(--har)--har[Outputs an HTTP archive from all the network requests performed during the installation.]' - '(--no-lockfile)--no-lockfile[Don’t read or generate a yarn.lock lockfile.]' - '(--pure-lockfile)--pure-lockfile[Don’t generate a yarn.lock lockfile.]' - ) - - _dev=('(--dev)--dev[Save installed packages into the project"s package.json devDependencies]') - - _production=('(--production)--production[Do not install project devDependencies]') - - _upgrade=( - '(--exact)--exact[Install exact version]' - '(--tilde)--tilde[Install most recent release with the same minor version]' - ) - - _1st_arguments=( - 'help:Display help information about yarn' \ - 'init:Initialize for the development of a package' \ - 'add:Add a package to use in your current package' \ - 'install:Install all the dependencies listed within package.json in the local node_modules folder' \ - 'publish:Publish a package to a package manager' \ - 'remove:Remove a package that will no longer be used in your current package' \ - 'cache:Clear the local cache. It will be populated again the next time yarn or yarn install is run' \ - 'clean:Frees up space by removing unnecessary files and folders from dependencies' \ - 'check:Verifies that versions of the package dependencies in the current project’s package.json matches that of yarn’s lock file' \ - 'ls:List all installed packages' \ - 'global:Makes binaries available to use on your operating system' \ - 'info: [] - fetch information about a package and return it in a tree format' \ - 'outdated:Checks for outdated package dependencies' \ - 'run:Runs a defined package script' \ - 'self-update:Updates Yarn to the latest version' \ - 'upgrade:Upgrades packages to their latest version based on the specified range' \ - 'upgrade-interactive:Selectively upgrades specific packages in a simple way' \ - 'why: - Show information about why a package is installed' - ) - _arguments \ - '*:: :->subcmds' && return 0 - - if (( CURRENT == 1 )); then - _describe -t commands "yarn subcommand" _1st_arguments - return - fi - - case "$words[1]" in - add) - _arguments \ - $_dopts \ - $_dev \ - $_production - ;; - install) - _arguments \ - $_installopts \ - $_dopts \ - $_dev \ - $_no_color \ - $_production - ;; - update) - _arguments \ - $_dopts - ;; - remove) - _arguments \ - $_dopts - ;; - upgrade-interactive) - _arguments \ - $_upgrade - ;; - *) - _arguments \ - ;; - esac - -} - -compdef _yarn yarn -- cgit v1.2.3-70-g09d2 From 344b13c4a5f4fb69817efe148c9ed63fa428c5f3 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Wed, 11 Jul 2018 21:21:01 +0200 Subject: yarn: add aliases for common commands Fixes #5722 Fixes #5864 Fixes #5920 Fixes #6566 Fixes #6579 Fixes #6686 Fixes #6740 --- plugins/yarn/yarn.plugin.zsh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/plugins/yarn/yarn.plugin.zsh b/plugins/yarn/yarn.plugin.zsh index 7a9a7e4d4..fe752357f 100644 --- a/plugins/yarn/yarn.plugin.zsh +++ b/plugins/yarn/yarn.plugin.zsh @@ -1,6 +1,18 @@ -alias y="yarn " +alias y="yarn" alias ya="yarn add" +alias yad="yarn add --dev" +alias yap="yarn add --peer" +alias yb="yarn build" alias ycc="yarn cache clean" +alias ygu="yarn global upgrade" alias yh="yarn help" +alias yin="yarn install" +alias yls="yarn list" alias yout="yarn outdated" +alias yrm="yarn remove" +alias yrun="yarn run" +alias yst="yarn start" +alias yt="yarn test" +alias yuc="yarn global upgrade && yarn cache clean" alias yui="yarn upgrade-interactive" +alias yup="yarn upgrade" -- cgit v1.2.3-70-g09d2 From 4c0b82b482be7fd36d5abceefe9901ea5ab3da9e Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Wed, 11 Jul 2018 21:40:24 +0200 Subject: yarn: add README --- plugins/yarn/README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 plugins/yarn/README.md diff --git a/plugins/yarn/README.md b/plugins/yarn/README.md new file mode 100644 index 000000000..c4e6d6da5 --- /dev/null +++ b/plugins/yarn/README.md @@ -0,0 +1,33 @@ +# Yarn plugin + +This plugin adds completion for the [Yarn package manager](https://yarnpkg.com/en/), +as well as some aliases for common Yarn commands. + +To use it, add `yarn` to the plugins array in your zshrc file: + +```zsh +plugins=(... yarn) +``` + +## Aliases + +| Alias | Command | Description | +|-------|-------------------------------------------|-------------------------------------------------------------| +| y | `yarn` | The Yarn command | +| ya | `yarn add` | Install a package in dependencies (`package.json`) | +| yad | `yarn add --dev` | Install a package in devDependencies (`package.json`) | +| 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 | +| ygu | `yarn global upgrade` | Upgrade packages installed globally to their latest version | +| yh | `yarn help` | Show help for a yarn command | +| yin | `yarn install` | Install dependencies defined in `package.json` | +| yls | `yarn list` | List installed packages | +| yout | `yarn outdated` | Check for outdated package dependencies | +| yrm | `yarn remove` | Remove installed packages | +| yrun | `yarn run` | Run a defined package script | +| 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 | +| yui | `yarn upgrade-interactive` | Prompt for which outdated packages to upgrade | +| yup | `yarn upgrade` | Upgrade packages to their latest version | -- cgit v1.2.3-70-g09d2 From f88396e3271b2459e92dfef37ed773fd01c446b8 Mon Sep 17 00:00:00 2001 From: Arun Sathiya Date: Fri, 13 Jul 2018 02:38:22 +0530 Subject: wp-cli: fix README typo for wptu command (#6987) --- plugins/wp-cli/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/wp-cli/README.md b/plugins/wp-cli/README.md index da398ed1a..4d8cad452 100644 --- a/plugins/wp-cli/README.md +++ b/plugins/wp-cli/README.md @@ -75,7 +75,7 @@ This plugin adds [tab completion](http://wp-cli.org/#complete) for `wp-cli` as w - wptp='wp theme path' - wpts='wp theme search' - wptst='wp theme status' -- wptu='wp theme updatet' +- wptu='wp theme update' ### User - wpuac='wp user add-cap' -- cgit v1.2.3-70-g09d2 From d3e3b2dd0d7c7574d2a47c0d3a0d79583c58b2b8 Mon Sep 17 00:00:00 2001 From: Cristian Consonni Date: Fri, 13 Jul 2018 13:14:15 +0200 Subject: Add support for custom timestamp format in history (#6770) --- lib/history.zsh | 3 ++- templates/zshrc.zsh-template | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/history.zsh b/lib/history.zsh index 7d4e59d00..62e02648b 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -23,7 +23,8 @@ case $HIST_STAMPS in "mm/dd/yyyy") alias history='omz_history -f' ;; "dd.mm.yyyy") alias history='omz_history -E' ;; "yyyy-mm-dd") alias history='omz_history -i' ;; - *) alias history='omz_history' ;; + "") alias history='omz_history' ;; + *) alias history="omz_history -t '$HIST_STAMPS'" ;; esac ## History file configuration diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index bba2d370d..5f98fb211 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -48,7 +48,10 @@ ZSH_THEME="robbyrussell" # Uncomment the following line if you want to change the command execution time # stamp shown in the history command output. -# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# You can set one of the optional three formats: +# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# or set a custom format using the strftime function format specifications, +# see 'man strftime' for details. # HIST_STAMPS="mm/dd/yyyy" # Would you like to use another custom folder than $ZSH/custom? -- cgit v1.2.3-70-g09d2 From d302e3eebeb5e3dd25811fae7035c2427739be91 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Wed, 18 Jul 2018 23:34:38 +0200 Subject: bundler: fix bundle version git error It seems that `bundle version` calls git to know the commit sha, while `bundle --version` only shows the version of bundler. Fixes #6988 --- plugins/bundler/bundler.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index ea199d09a..b0b286af5 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -55,7 +55,7 @@ done bundle_install() { if _bundler-installed && _within-bundled-project; then - local bundler_version=`bundle version | cut -d' ' -f3` + local bundler_version=`bundle --version | cut -d' ' -f3` if [[ $bundler_version > '1.4.0' || $bundler_version = '1.4.0' ]]; then if [[ "$OSTYPE" = (darwin|freebsd)* ]] then -- cgit v1.2.3-70-g09d2 From a3ab45db8b10a44329d7b715e2457fdd666c696e Mon Sep 17 00:00:00 2001 From: Jon Mosco <1970496+jonmosco@users.noreply.github.com> Date: Thu, 19 Jul 2018 10:32:31 -0400 Subject: updating kube-ps1 to align with upstream changes (#6995) --- plugins/kube-ps1/README.md | 49 ++++++++------- plugins/kube-ps1/kube-ps1.plugin.zsh | 112 +++++++++++++++++++++-------------- 2 files changed, 95 insertions(+), 66 deletions(-) diff --git a/plugins/kube-ps1/README.md b/plugins/kube-ps1/README.md index a572773a3..fcb73cd2d 100644 --- a/plugins/kube-ps1/README.md +++ b/plugins/kube-ps1/README.md @@ -1,13 +1,12 @@ -Kubernetes prompt for zsh -========================= +# Kubernetes prompt for zsh -A Kubernetes (k8s) zsh prompt that displays the current cluster cluster +A Kubernetes zsh prompt that displays the current cluster cluster and the namespace. Inspired by several tools used to simplify usage of kubectl -NOTE: If you are not using zsh, check out [kube-ps1](https://github.com/jonmosco/kube-ps1) designed for bash -as well as zsh. +NOTE: If you are not using zsh, check out [kube-ps1](https://github.com/jonmosco/kube-ps1) +designed for bash as well as zsh. ## Requirements @@ -32,28 +31,33 @@ fast switching between clusters and namespaces. The prompt layout is: ``` -(|:) +(|:) ``` -Supported platforms: -* k8s - Kubernetes -* ocp - OpenShift +## Enabling -## Install +In order to use kube-ps1 with Oh My Zsh, you'll need to enable them in the +.zshrc file. You'll find the zshrc file in your $HOME directory. Open it with +your favorite text editor and you'll see a spot to list all the plugins you +want to load. -1. Clone this repository -2. Source the kube-ps1.zsh in your ~./.zshrc - -ZSH: +```shell +vim $HOME/.zshrc ``` -source path/kube-ps1.sh -PROMPT='$(kube_ps1) ' + +Add kube-ps1 to the list of enabled plugins: + +```shell +plugins=( + git + kube-ps1 +) ``` ## Colors -The colors are of my opinion. Blue was used as the prefix to match the Kubernetes -color as closely as possible. Red was chosen as the cluster name to stand out, and cyan +Blue was used as the prefix to match the Kubernetes color as closely as +possible. Red was chosen as the cluster name to stand out, and cyan for the namespace. These can of course be changed. ## Customization @@ -62,14 +66,15 @@ The default settings can be overridden in ~/.zshrc | Variable | Default | Meaning | | :------- | :-----: | ------- | -| `KUBE_PS1_DEFAULT` | `true` | Default settings for the prompt | +| `KUBE_PS1_BINARY` | `kubectl` | Default Kubernetes binary | | `KUBE_PS1_PREFIX` | `(` | Prompt opening character | -| `KUBE_PS1_DEFAULT_LABEL` | `⎈ ` | Default prompt symbol | +| `KUBE_PS1_SYMBOL_ENABLE` | `true ` | Display the prompt Symbol. If set to `false`, this will also disable `KUBE_PS1_SEPARATOR` | +| `KUBE_PS1_SYMBOL_DEFAULT` | `⎈ ` | Default prompt symbol. Unicode `\u2388` | +| `KUBE_PS1_SYMBOL_USE_IMG` | `false` | ☸️ , Unicode `\u2638` as the prompt symbol | +| `KUBE_PS1_NS_ENABLE` | `true` | Display the namespace. If set to `false`, this will also disable `KUBE_PS1_DIVIDER` | | `KUBE_PS1_SEPERATOR` | `\|` | Separator between symbol and cluster name | -| `KUBE_PS1_PLATFORM` | `kubectl` | Cluster type and binary to use | | `KUBE_PS1_DIVIDER` | `:` | Separator between cluster and namespace | | `KUBE_PS1_SUFFIX` | `)` | Prompt closing character | -| `KUBE_PS1_DEFAULT_LABEL_IMG` | `false` | Use Kubernetes img as the label: ☸️ | ## Contributors diff --git a/plugins/kube-ps1/kube-ps1.plugin.zsh b/plugins/kube-ps1/kube-ps1.plugin.zsh index e1cb4339d..fadef80d7 100644 --- a/plugins/kube-ps1/kube-ps1.plugin.zsh +++ b/plugins/kube-ps1/kube-ps1.plugin.zsh @@ -1,9 +1,10 @@ #!/bin/zsh # Kubernetes prompt helper for bash/zsh +# ported to oh-my-zsh # Displays current context and namespace -# Copyright 2017 Jon Mosco +# Copyright 2018 Jon Mosco # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,32 +22,39 @@ [[ -n $DEBUG ]] && set -x setopt PROMPT_SUBST -add-zsh-hook precmd _kube_ps1_load +autoload -U add-zsh-hook +add-zsh-hook precmd _kube_ps1_update_cache zmodload zsh/stat +zmodload zsh/datetime # Default values for the prompt -# Override these values in ~/.zshrc or ~/.bashrc -KUBE_PS1_DEFAULT="${KUBE_PS1_DEFAULT:=true}" -KUBE_PS1_PREFIX="(" -KUBE_PS1_DEFAULT_LABEL="${KUBE_PS1_DEFAULT_LABEL:="⎈ "}" -KUBE_PS1_DEFAULT_LABEL_IMG="${KUBE_PS1_DEFAULT_LABEL_IMG:=false}" -KUBE_PS1_SEPERATOR="|" -KUBE_PS1_PLATFORM="${KUBE_PS1_PLATFORM:="kubectl"}" -KUBE_PS1_DIVIDER=":" -KUBE_PS1_SUFFIX=")" -KUBE_PS1_UNAME=$(uname) +# Override these values in ~/.zshrc +KUBE_PS1_BINARY="${KUBE_PS1_BINARY:-kubectl}" +KUBE_PS1_SYMBOL_ENABLE="${KUBE_PS1_SYMBOL_ENABLE:-true}" +KUBE_PS1_SYMBOL_DEFAULT="${KUBE_PS1_SYMBOL_DEFAULT:-\u2388 }" +KUBE_PS1_SYMBOL_USE_IMG="${KUBE_PS1_SYMBOL_USE_IMG:-false}" +KUBE_PS1_NS_ENABLE="${KUBE_PS1_NS_ENABLE:-true}" +KUBE_PS1_SEPARATOR="${KUBE_PS1_SEPARATOR-|}" +KUBE_PS1_DIVIDER="${KUBE_PS1_DIVIDER-:}" +KUBE_PS1_PREFIX="${KUBE_PS1_PREFIX-(}" +KUBE_PS1_SUFFIX="${KUBE_PS1_SUFFIX-)}" KUBE_PS1_LAST_TIME=0 -kube_ps1_label () { +_kube_ps1_binary_check() { + command -v "$1" >/dev/null +} - [[ "${KUBE_PS1_DEFAULT_LABEL_IMG}" == false ]] && return +_kube_ps1_symbol() { + [[ "${KUBE_PS1_SYMBOL_ENABLE}" == false ]] && return - if [[ "${KUBE_PS1_DEFAULT_LABEL_IMG}" == true ]]; then - local KUBE_LABEL="☸️ " - fi + KUBE_PS1_SYMBOL="${KUBE_PS1_SYMBOL_DEFAULT}" + KUBE_PS1_SYMBOL_IMG="\u2638 " - KUBE_PS1_DEFAULT_LABEL="${KUBE_LABEL}" + if [[ "${KUBE_PS1_SYMBOL_USE_IMG}" == true ]]; then + KUBE_PS1_SYMBOL="${KUBE_PS1_SYMBOL_IMG}" + fi + echo "${KUBE_PS1_SYMBOL}" } _kube_ps1_split() { @@ -56,23 +64,45 @@ _kube_ps1_split() { } _kube_ps1_file_newer_than() { - local mtime local file=$1 local check_time=$2 - mtime=$(stat +mtime "${file}") - [ "${mtime}" -gt "${check_time}" ] + zmodload -e "zsh/stat" + if [[ "$?" -eq 0 ]]; then + mtime=$(stat +mtime "${file}") + elif stat -c "%s" /dev/null &> /dev/null; then + # GNU stat + mtime=$(stat -c %Y "${file}") + else + # BSD stat + mtime=$(stat -f %m "$file") + fi + [[ "${mtime}" -gt "${check_time}" ]] } -_kube_ps1_load() { - # kubectl will read the environment variable $KUBECONFIG - # otherwise set it to ~/.kube/config +_kube_ps1_update_cache() { KUBECONFIG="${KUBECONFIG:=$HOME/.kube/config}" + if ! _kube_ps1_binary_check "${KUBE_PS1_BINARY}"; then + # No ability to fetch context/namespace; display N/A. + KUBE_PS1_CONTEXT="BINARY-N/A" + KUBE_PS1_NAMESPACE="N/A" + return + fi - for conf in $(_kube_ps1_split : "${KUBECONFIG}"); do - # TODO: check existence of $conf + if [[ "${KUBECONFIG}" != "${KUBE_PS1_KUBECONFIG_CACHE}" ]]; then + # User changed KUBECONFIG; unconditionally refetch. + KUBE_PS1_KUBECONFIG_CACHE=${KUBECONFIG} + _kube_ps1_get_context_ns + return + fi + + # kubectl will read the environment variable $KUBECONFIG + # otherwise set it to ~/.kube/config + local conf + for conf in $(_kube_ps1_split : "${KUBECONFIG:-${HOME}/.kube/config}"); do + [[ -r "${conf}" ]] || continue if _kube_ps1_file_newer_than "${conf}" "${KUBE_PS1_LAST_TIME}"; then _kube_ps1_get_context_ns return @@ -83,26 +113,20 @@ _kube_ps1_load() { _kube_ps1_get_context_ns() { # Set the command time - KUBE_PS1_LAST_TIME=$(date +%s) - - if [[ "${KUBE_PS1_DEFAULT}" == true ]]; then - local KUBE_BINARY="${KUBE_PS1_PLATFORM}" - elif [[ "${KUBE_PS1_DEFAULT}" == false ]] && [[ "${KUBE_PS1_PLATFORM}" == "kubectl" ]];then - local KUBE_BINARY="kubectl" - elif [[ "${KUBE_PS1_PLATFORM}" == "oc" ]]; then - local KUBE_BINARY="oc" + KUBE_PS1_LAST_TIME=$EPOCHSECONDS + + KUBE_PS1_CONTEXT="$(${KUBE_PS1_BINARY} config current-context 2>/dev/null)" + if [[ -z "${KUBE_PS1_CONTEXT}" ]]; then + KUBE_PS1_CONTEXT="N/A" + KUBE_PS1_NAMESPACE="N/A" + return + elif [[ "${KUBE_PS1_NS_ENABLE}" == true ]]; then + KUBE_PS1_NAMESPACE="$(${KUBE_PS1_BINARY} config view --minify --output 'jsonpath={..namespace}' 2>/dev/null)" + # Set namespace to 'default' if it is not defined + KUBE_PS1_NAMESPACE="${KUBE_PS1_NAMESPACE:-default}" fi - - KUBE_PS1_CONTEXT="$(${KUBE_BINARY} config current-context)" - KUBE_PS1_NAMESPACE="$(${KUBE_BINARY} config view --minify --output 'jsonpath={..namespace}')" - # Set namespace to default if it is not defined - KUBE_PS1_NAMESPACE="${KUBE_PS1_NAMESPACE:-default}" - } -# source our symbol -kube_ps1_label - # Build our prompt kube_ps1 () { local reset_color="%f" @@ -111,7 +135,7 @@ kube_ps1 () { local cyan="%F{cyan}" KUBE_PS1="${reset_color}$KUBE_PS1_PREFIX" - KUBE_PS1+="${blue}$KUBE_PS1_DEFAULT_LABEL" + KUBE_PS1+="${blue}$(_kube_ps1_symbol)" KUBE_PS1+="${reset_color}$KUBE_PS1_SEPERATOR" KUBE_PS1+="${red}$KUBE_PS1_CONTEXT${reset_color}" KUBE_PS1+="$KUBE_PS1_DIVIDER" -- cgit v1.2.3-70-g09d2 From 626b30b2a3d99a03058fea167281163d8d96d6f9 Mon Sep 17 00:00:00 2001 From: Johan Kaving Date: Thu, 19 Jul 2018 16:53:19 +0200 Subject: Update git-flow-avh to 0.6.0 (#6498) This updates the git-flow-avh plugin to the latest version from https://github.com/petervanderdoes/git-flow-completion (0.6.0 at the time of this commit). This mainly adds support for the "git flow bugfix" command. This PR replaces #4626 as well as #4705, both of which adds support for the bugfix command but doesn't use the official version from https://github.com/petervanderdoes/git-flow-completion Fixes #4705 Fixes #4626 Fixes #5903 --- plugins/git-flow-avh/git-flow-avh.plugin.zsh | 819 ++++++++++++++++----------- 1 file changed, 474 insertions(+), 345 deletions(-) mode change 100644 => 100755 plugins/git-flow-avh/git-flow-avh.plugin.zsh diff --git a/plugins/git-flow-avh/git-flow-avh.plugin.zsh b/plugins/git-flow-avh/git-flow-avh.plugin.zsh old mode 100644 new mode 100755 index ba98fff01..1f3fa1e28 --- a/plugins/git-flow-avh/git-flow-avh.plugin.zsh +++ b/plugins/git-flow-avh/git-flow-avh.plugin.zsh @@ -22,398 +22,527 @@ _git-flow () { - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - 'init:Initialize a new git repo with support for the branching model.' - 'feature:Manage your feature branches.' - 'config:Manage your configuration.' - 'release:Manage your release branches.' - 'hotfix:Manage your hotfix branches.' - 'support:Manage your support branches.' - 'version:Shows version information.' - 'finish:Finish the branch you are currently on.' - 'delete:Delete the branch you are currently on.' - 'publish:Publish the branch you are currently on.' - ) - _describe -t commands 'git flow' subcommands - ;; - - (options) - case $line[1] in - - (init) - _arguments \ - -f'[Force setting of gitflow branches, even if already configured]' - ;; - - (version) - ;; - - (hotfix) - __git-flow-hotfix - ;; - - (release) - __git-flow-release - ;; - - (feature) - __git-flow-feature - ;; - (config) - __git-flow-config - ;; - - esac - ;; - esac + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + + local -a subcommands + subcommands=( + 'init:Initialize a new git repo with support for the branching model.' + 'feature:Manage your feature branches.' + 'bugfix:Manage your bugfix branches.' + 'config:Manage your configuration.' + 'release:Manage your release branches.' + 'hotfix:Manage your hotfix branches.' + 'support:Manage your support branches.' + 'version:Shows version information.' + 'finish:Finish the branch you are currently on.' + 'delete:Delete the branch you are currently on.' + 'publish:Publish the branch you are currently on.' + 'rebase:Rebase the branch you are currently on.' + ) + _describe -t commands 'git flow' subcommands + ;; + + (options) + case $line[1] in + + (init) + _arguments \ + -f'[Force setting of gitflow branches, even if already configured]' + ;; + + (version) + ;; + + (hotfix) + __git-flow-hotfix + ;; + + (release) + __git-flow-release + ;; + + (feature) + __git-flow-feature + ;; + (bugfix) + __git-flow-bugfix + ;; + + (config) + __git-flow-config + ;; + + esac + ;; + esac } __git-flow-release () { - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - 'start:Start a new release branch.' - 'finish:Finish a release branch.' - 'list:List all your release branches. (Alias to `git flow release`)' - 'publish:Publish release branch to remote.' - 'track:Checkout remote release branch.' - 'delete:Delete a release branch.' - ) - _describe -t commands 'git flow release' subcommands - _arguments \ - -v'[Verbose (more) output]' - ;; - - (options) - case $line[1] in - - (start) - _arguments \ - -F'[Fetch from origin before performing finish]'\ - ':version:__git_flow_version_list' - ;; - - (finish) - _arguments \ - -F'[Fetch from origin before performing finish]' \ - -s'[Sign the release tag cryptographically]'\ - -u'[Use the given GPG-key for the digital signature (implies -s)]'\ - -m'[Use the given tag message]'\ - -p'[Push to $ORIGIN after performing finish]'\ - ':version:__git_flow_version_list' - ;; - - (delete) - _arguments \ - -f'[Force deletion]' \ - -r'[Delete remote branch]' \ - ':version:__git_flow_version_list' - ;; - - (publish) - _arguments \ - ':version:__git_flow_version_list' - ;; - - (track) - _arguments \ - ':version:__git_flow_version_list' - ;; - - *) - _arguments \ - -v'[Verbose (more) output]' - ;; - esac - ;; - esac + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + + local -a subcommands + subcommands=( + 'start:Start a new release branch.' + 'finish:Finish a release branch.' + 'list:List all your release branches. (Alias to `git flow release`)' + 'publish:Publish release branch to remote.' + 'track:Checkout remote release branch.' + 'rebase:Rebase from integration branch.' + 'delete:Delete a release branch.' + ) + _describe -t commands 'git flow release' subcommands + _arguments \ + -v'[Verbose (more) output]' + ;; + + (options) + case $line[1] in + + (start) + _arguments \ + -F'[Fetch from origin before performing finish]'\ + ':version:__git_flow_version_list' + ;; + + (finish) + _arguments \ + -F'[Fetch from origin before performing finish]' \ + -s'[Sign the release tag cryptographically]'\ + -u'[Use the given GPG-key for the digital signature (implies -s)]'\ + -m'[Use the given tag message]'\ + -p'[Push to $ORIGIN after performing finish]'\ + ':version:__git_flow_version_list' + ;; + + (delete) + _arguments \ + -f'[Force deletion]' \ + -r'[Delete remote branch]' \ + ':version:__git_flow_version_list' + ;; + + (publish) + _arguments \ + ':version:__git_flow_version_list' + ;; + + (track) + _arguments \ + ':version:__git_flow_version_list' + ;; + + (rebase) + _arguments \ + -i'[Do an interactive rebase]' \ + ':branch:__git_branch_names' + ;; + + *) + _arguments \ + -v'[Verbose (more) output]' + ;; + esac + ;; + esac } __git-flow-hotfix () { - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - 'start:Start a new hotfix branch.' - 'finish:Finish a hotfix branch.' - 'delete:Delete a hotfix branch.' - 'list:List all your hotfix branches. (Alias to `git flow hotfix`)' - ) - _describe -t commands 'git flow hotfix' subcommands - _arguments \ - -v'[Verbose (more) output]' - ;; - - (options) - case $line[1] in - - (start) - _arguments \ - -F'[Fetch from origin before performing finish]'\ - ':hotfix:__git_flow_version_list'\ - ':branch-name:__git_branch_names' - ;; - - (finish) - _arguments \ - -F'[Fetch from origin before performing finish]' \ - -s'[Sign the release tag cryptographically]'\ - -u'[Use the given GPG-key for the digital signature (implies -s)]'\ - -m'[Use the given tag message]'\ - -p'[Push to $ORIGIN after performing finish]'\ - ':hotfix:__git_flow_hotfix_list' - ;; - - (delete) - _arguments \ - -f'[Force deletion]' \ - -r'[Delete remote branch]' \ - ':hotfix:__git_flow_hotfix_list' - ;; - - *) - _arguments \ - -v'[Verbose (more) output]' - ;; - esac - ;; - esac + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + + local -a subcommands + subcommands=( + 'start:Start a new hotfix branch.' + 'finish:Finish a hotfix branch.' + 'delete:Delete a hotfix branch.' + 'rebase:Rebase from integration branch.' + 'list:List all your hotfix branches. (Alias to `git flow hotfix`)' + 'rename:Rename a hotfix branch.' + ) + _describe -t commands 'git flow hotfix' subcommands + _arguments \ + -v'[Verbose (more) output]' + ;; + + (options) + case $line[1] in + + (start) + _arguments \ + -F'[Fetch from origin before performing finish]'\ + ':hotfix:__git_flow_version_list'\ + ':branch-name:__git_branch_names' + ;; + + (finish) + _arguments \ + -F'[Fetch from origin before performing finish]' \ + -s'[Sign the release tag cryptographically]'\ + -u'[Use the given GPG-key for the digital signature (implies -s)]'\ + -m'[Use the given tag message]'\ + -p'[Push to $ORIGIN after performing finish]'\ + ':hotfix:__git_flow_hotfix_list' + ;; + + (delete) + _arguments \ + -f'[Force deletion]' \ + -r'[Delete remote branch]' \ + ':hotfix:__git_flow_hotfix_list' + ;; + + (rebase) + _arguments \ + -i'[Do an interactive rebase]' \ + ':branch:__git_branch_names' + ;; + + *) + _arguments \ + -v'[Verbose (more) output]' + ;; + esac + ;; + esac } __git-flow-feature () { - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - 'start:Start a new feature branch.' - 'finish:Finish a feature branch.' - 'delete:Delete a feature branch.' - 'list:List all your feature branches. (Alias to `git flow feature`)' - 'publish:Publish feature branch to remote.' - 'track:Checkout remote feature branch.' - 'diff:Show all changes.' - 'rebase:Rebase from integration branch.' - 'checkout:Checkout local feature branch.' - 'pull:Pull changes from remote.' - ) - _describe -t commands 'git flow feature' subcommands - _arguments \ - -v'[Verbose (more) output]' - ;; - - (options) - case $line[1] in - - (start) - _arguments \ - -F'[Fetch from origin before performing finish]'\ - ':feature:__git_flow_feature_list'\ - ':branch-name:__git_branch_names' - ;; - - (finish) - _arguments \ - -F'[Fetch from origin before performing finish]' \ - -r'[Rebase instead of merge]'\ - ':feature:__git_flow_feature_list' - ;; - - (delete) - _arguments \ - -f'[Force deletion]' \ - -r'[Delete remote branch]' \ - ':feature:__git_flow_feature_list' - ;; - - (publish) - _arguments \ - ':feature:__git_flow_feature_list'\ - ;; - - (track) - _arguments \ - ':feature:__git_flow_feature_list'\ - ;; - - (diff) - _arguments \ - ':branch:__git_branch_names'\ - ;; - - (rebase) - _arguments \ - -i'[Do an interactive rebase]' \ - ':branch:__git_branch_names' - ;; - - (checkout) - _arguments \ - ':branch:__git_flow_feature_list'\ - ;; - - (pull) - _arguments \ - ':remote:__git_remotes'\ - ':branch:__git_branch_names' - ;; - - *) - _arguments \ - -v'[Verbose (more) output]' - ;; - esac - ;; - esac + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + + local -a subcommands + subcommands=( + 'start:Start a new feature branch.' + 'finish:Finish a feature branch.' + 'delete:Delete a feature branch.' + 'list:List all your feature branches. (Alias to `git flow feature`)' + 'publish:Publish feature branch to remote.' + 'track:Checkout remote feature branch.' + 'diff:Show all changes.' + 'rebase:Rebase from integration branch.' + 'checkout:Checkout local feature branch.' + 'pull:Pull changes from remote.' + 'rename:Rename a feature branch.' + ) + _describe -t commands 'git flow feature' subcommands + _arguments \ + -v'[Verbose (more) output]' + ;; + + (options) + case $line[1] in + + (start) + _arguments \ + -F'[Fetch from origin before performing finish]'\ + ':feature:__git_flow_feature_list'\ + ':branch-name:__git_branch_names' + ;; + + (finish) + _arguments \ + -F'[Fetch from origin before performing finish]' \ + -r'[Rebase instead of merge]'\ + ':feature:__git_flow_feature_list' + ;; + + (delete) + _arguments \ + -f'[Force deletion]' \ + -r'[Delete remote branch]' \ + ':feature:__git_flow_feature_list' + ;; + + (publish) + _arguments \ + ':feature:__git_flow_feature_list'\ + ;; + + (track) + _arguments \ + ':feature:__git_flow_feature_list'\ + ;; + + (diff) + _arguments \ + ':branch:__git_branch_names'\ + ;; + + (rebase) + _arguments \ + -i'[Do an interactive rebase]' \ + ':branch:__git_branch_names' + ;; + + (checkout) + _arguments \ + ':branch:__git_flow_feature_list'\ + ;; + + (pull) + _arguments \ + ':remote:__git_remotes'\ + ':branch:__git_branch_names' + ;; + + *) + _arguments \ + -v'[Verbose (more) output]' + ;; + esac + ;; + esac +} + +__git-flow-bugfix () +{ + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + + local -a subcommands + subcommands=( + 'start:Start a new bugfix branch.' + 'finish:Finish a bugfix branch.' + 'delete:Delete a bugfix branch.' + 'list:List all your bugfix branches. (Alias to `git flow bugfix`)' + 'publish:Publish bugfix branch to remote.' + 'track:Checkout remote bugfix branch.' + 'diff:Show all changes.' + 'rebase:Rebase from integration branch.' + 'checkout:Checkout local bugfix branch.' + 'pull:Pull changes from remote.' + 'rename:Rename a bugfix branch.' + ) + _describe -t commands 'git flow bugfix' subcommands + _arguments \ + -v'[Verbose (more) output]' + ;; + + (options) + case $line[1] in + + (start) + _arguments \ + -F'[Fetch from origin before performing finish]'\ + ':bugfix:__git_flow_bugfix_list'\ + ':branch-name:__git_branch_names' + ;; + + (finish) + _arguments \ + -F'[Fetch from origin before performing finish]' \ + -r'[Rebase instead of merge]'\ + ':bugfix:__git_flow_bugfix_list' + ;; + + (delete) + _arguments \ + -f'[Force deletion]' \ + -r'[Delete remote branch]' \ + ':bugfix:__git_flow_bugfix_list' + ;; + + (publish) + _arguments \ + ':bugfix:__git_flow_bugfix_list'\ + ;; + + (track) + _arguments \ + ':bugfix:__git_flow_bugfix_list'\ + ;; + + (diff) + _arguments \ + ':branch:__git_branch_names'\ + ;; + + (rebase) + _arguments \ + -i'[Do an interactive rebase]' \ + ':branch:__git_branch_names' + ;; + + (checkout) + _arguments \ + ':branch:__git_flow_bugfix_list'\ + ;; + + (pull) + _arguments \ + ':remote:__git_remotes'\ + ':branch:__git_branch_names' + ;; + + *) + _arguments \ + -v'[Verbose (more) output]' + ;; + esac + ;; + esac } __git-flow-config () { - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - 'list:List the configuration. (Alias to `git flow config`)' - 'set:Set the configuration option' - ) - _describe -t commands 'git flow config' subcommands - ;; - - (options) - case $line[1] in - - (set) - _arguments \ - --local'[Use repository config file]' \ - --global'[Use global config file]'\ - --system'[Use system config file]'\ - --file'[Use given config file]'\ - ':option:(master develop feature hotfix release support versiontagprefix)' - ;; - - *) - _arguments \ - --local'[Use repository config file]' \ - --global'[Use global config file]'\ - --system'[Use system config file]'\ - --file'[Use given config file]' - ;; - esac - ;; - esac + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + + local -a subcommands + subcommands=( + 'list:List the configuration. (Alias to `git flow config`)' + 'set:Set the configuration option' + ) + _describe -t commands 'git flow config' subcommands + ;; + + (options) + case $line[1] in + + (set) + _arguments \ + --local'[Use repository config file]' \ + --global'[Use global config file]'\ + --system'[Use system config file]'\ + --file'[Use given config file]'\ + ':option:(master develop feature hotfix release support versiontagprefix)' + ;; + + *) + _arguments \ + --local'[Use repository config file]' \ + --global'[Use global config file]'\ + --system'[Use system config file]'\ + --file'[Use given config file]' + ;; + esac + ;; + esac } __git_flow_version_list () { - local expl - declare -a versions + local expl + declare -a versions - versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}}) - __git_command_successful || return + versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}}) + __git_command_successful || return - _wanted versions expl 'version' compadd $versions + _wanted versions expl 'version' compadd $versions } __git_flow_feature_list () { - local expl - declare -a features + local expl + declare -a features + + features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}}) + __git_command_successful || return + + _wanted features expl 'feature' compadd $features +} + +__git_flow_bugfix_list () +{ + local expl + declare -a bugfixes - features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}}) - __git_command_successful || return + bugfixes=(${${(f)"$(_call_program bugfixes git flow bugfix list 2> /dev/null | tr -d ' |*')"}}) + __git_command_successful || return - _wanted features expl 'feature' compadd $features + _wanted bugfixes expl 'bugfix' compadd $bugfixes } __git_remotes () { - local expl gitdir remotes + local expl gitdir remotes - gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null) - __git_command_successful || return + gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null) + __git_command_successful || return - remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]}) - __git_command_successful || return + remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]}) + __git_command_successful || return - # TODO: Should combine the two instead of either or. - if (( $#remotes > 0 )); then - _wanted remotes expl remote compadd $* - $remotes - else - _wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*" - fi + # TODO: Should combine the two instead of either or. + if (( $#remotes > 0 )); then + _wanted remotes expl remote compadd $* - $remotes + else + _wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*" + fi } __git_flow_hotfix_list () { - local expl - declare -a hotfixes + local expl + declare -a hotfixes - hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}}) - __git_command_successful || return + hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}}) + __git_command_successful || return - _wanted hotfixes expl 'hotfix' compadd $hotfixes + _wanted hotfixes expl 'hotfix' compadd $hotfixes } __git_branch_names () { - local expl - declare -a branch_names + local expl + declare -a branch_names - branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/}) - __git_command_successful || return + branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/}) + __git_command_successful || return - _wanted branch-names expl branch-name compadd $* - $branch_names + _wanted branch-names expl branch-name compadd $* - $branch_names } __git_command_successful () { - if (( ${#pipestatus:#0} > 0 )); then - _message 'not a git repository' - return 1 - fi - return 0 + if (( ${#pipestatus:#0} > 0 )); then + _message 'not a git repository' + return 1 + fi + return 0 } zstyle ':completion:*:*:git:*' user-commands flow:'provide high-level repository operations' -- cgit v1.2.3-70-g09d2 From 6ca57e035cc7c199ca7c1d893594270ec570f4d3 Mon Sep 17 00:00:00 2001 From: Thi Date: Fri, 20 Jul 2018 00:20:45 +0900 Subject: [plugins/xcode] Fix opening project using a wrong Xcode version (#6829) --- plugins/xcode/xcode.plugin.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/xcode/xcode.plugin.zsh b/plugins/xcode/xcode.plugin.zsh index b46e05f2f..b80c3e36d 100644 --- a/plugins/xcode/xcode.plugin.zsh +++ b/plugins/xcode/xcode.plugin.zsh @@ -22,8 +22,11 @@ function xc { fi return 1 else - echo "Found ${xcode_proj[1]}" - open "${xcode_proj[1]}" + local active_path + active_path=$(xcode-select -p) + active_path=${active_path%%/Contents/Developer*} + echo "Found ${xcode_proj[1]}. Opening with ${active_path}" + open -a "$active_path" "${xcode_proj[1]}" fi } -- cgit v1.2.3-70-g09d2 From a1448e9f8a62164caae47a2f48f9c9766c1eaa60 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Thu, 19 Jul 2018 23:02:25 +0200 Subject: example: move example theme to custom folder --- custom/themes/example.zsh-theme | 3 +++ themes/example.zsh-theme | 5 ----- 2 files changed, 3 insertions(+), 5 deletions(-) delete mode 100644 themes/example.zsh-theme diff --git a/custom/themes/example.zsh-theme b/custom/themes/example.zsh-theme index 6f9c9db8c..ef8f1c630 100644 --- a/custom/themes/example.zsh-theme +++ b/custom/themes/example.zsh-theme @@ -1 +1,4 @@ # Put your custom themes in this folder. +# Example: + +PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% " diff --git a/themes/example.zsh-theme b/themes/example.zsh-theme deleted file mode 100644 index dbd9dc9c9..000000000 --- a/themes/example.zsh-theme +++ /dev/null @@ -1,5 +0,0 @@ -# Found on the ZshWiki -# http://zshwiki.org/home/config/prompt -# - -PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% " \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 9544316ef95c2aa1e75101a7dce545b4604b3ca6 Mon Sep 17 00:00:00 2001 From: Lars Schneider Date: Tue, 24 Jul 2018 22:55:48 +0200 Subject: add -F and -X to default $LESS environment variable (#6611) The option '-F' causes 'less' to automatically quit if the contents fit the screen and the option '-X' causes 'less' to not clear the screen after quit. I think both options are generally useful for terminal applications. They are in particular useful for Git as it runs all output through a pager. Git will run 'less' with '-FRX' by default if the environment variable $LESS is not defined [1]. Since oh-my-zsh used to set $LESS to '-R', Git would not override this setting. Consequently, Git would display even a single line of output in a pager and the user would need to explicitly quit that pager (see mailing list discussion [2]). Therefore, lets change the oh-my-zsh default value for $LESS to '-FRX'. This would be useful for oh-my-zsh Git users and likely for users of other applications that use 'less' too. [1] https://github.com/git/git/blob/36438dc19dd2a305dddebd44bf7a65f1a220075b/Documentation/config.txt#L819-L821 [2] https://public-inbox.org/git/2412A603-4382-4AF5-97D0-D16D5FAAFE28@eluvio.com/ --- lib/misc.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/misc.zsh b/lib/misc.zsh index 3052b7710..90a8d62f3 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -20,7 +20,7 @@ setopt long_list_jobs ## pager env_default PAGER 'less' -env_default LESS '-R' +env_default LESS '-FRX' ## super user alias alias _='sudo' -- cgit v1.2.3-70-g09d2 From a24a0b1a8e464fd4c6ab6c2f95ef5a8f025ff093 Mon Sep 17 00:00:00 2001 From: MarkPochert Date: Sun, 29 Jul 2018 17:43:15 +0200 Subject: Update z to latest version (#7021) --- plugins/z/z.1 | 6 ++++- plugins/z/z.sh | 75 ++++++++++++++++++++++++++++++++-------------------------- 2 files changed, 47 insertions(+), 34 deletions(-) diff --git a/plugins/z/z.1 b/plugins/z/z.1 index bbc1bf5df..d4cac1ac2 100644 --- a/plugins/z/z.1 +++ b/plugins/z/z.1 @@ -22,6 +22,9 @@ OPTIONS \fB\-c\fR restrict matches to subdirectories of the current directory .TP +\fB\-e\fR +echo the best match, don't cd +.TP \fB\-h\fR show a brief help message .TP @@ -90,7 +93,8 @@ Set \fB$_Z_OWNER\fR to allow usage when in 'sudo -s' mode. (These settings should go in .bashrc/.zshrc before the line added above.) .RE .RS -Install the provided man page \fBz.1\fR somewhere like \fB/usr/local/man/man1\fR. +Install the provided man page \fBz.1\fR somewhere in your \f$MANPATH, like +\fB/usr/local/man/man1\fR. .RE .SS Aging: diff --git a/plugins/z/z.sh b/plugins/z/z.sh index d0eeb97ef..4fc75dc6a 100644 --- a/plugins/z/z.sh +++ b/plugins/z/z.sh @@ -1,4 +1,4 @@ -# Copyright (c) 2009 rupa deadwyler under the WTFPL license +# Copyright (c) 2009 rupa deadwyler. Licensed under the WTFPL license, Version 2 # maintains a jump-list of the directories you actually use # @@ -21,6 +21,7 @@ # * z -r foo # cd to highest ranked dir matching foo # * z -t foo # cd to most recently accessed dir matching foo # * z -l foo # list matches instead of cd +# * z -e foo # echo the best match, don't cd # * z -c foo # restrict matches to subdirs of $PWD [ -d "${_Z_DATA:-$HOME/.z}" ] && { @@ -31,9 +32,21 @@ _z() { local datafile="${_Z_DATA:-$HOME/.z}" + # if symlink, dereference + [ -h "$datafile" ] && datafile=$(readlink "$datafile") + # bail if we don't own ~/.z and $_Z_OWNER not set [ -z "$_Z_OWNER" -a -f "$datafile" -a ! -O "$datafile" ] && return + _z_dirs () { + local line + while read line; do + # only count directories + [ -d "${line%%\|*}" ] && echo "$line" + done < "$datafile" + return 0 + } + # add entries if [ "$1" = "--add" ]; then shift @@ -49,10 +62,7 @@ _z() { # maintain the data file local tempfile="$datafile.$RANDOM" - while read line; do - # only count directories - [ -d "${line%%\|*}" ] && echo $line - done < "$datafile" | awk -v path="$*" -v now="$(date +%s)" -F"|" ' + _z_dirs | awk -v path="$*" -v now="$(date +%s)" -F"|" ' BEGIN { rank[path] = 1 time[path] = now @@ -75,7 +85,7 @@ _z() { } else for( x in rank ) print x "|" rank[x] "|" time[x] } ' 2>/dev/null >| "$tempfile" - # do our best to avoid clobbering the datafile in a race condition + # do our best to avoid clobbering the datafile in a race condition. if [ $? -ne 0 -a -f "$datafile" ]; then env rm -f "$tempfile" else @@ -85,17 +95,15 @@ _z() { # tab completion elif [ "$1" = "--complete" -a -s "$datafile" ]; then - while read line; do - [ -d "${line%%\|*}" ] && echo $line - done < "$datafile" | awk -v q="$2" -F"|" ' + _z_dirs | awk -v q="$2" -F"|" ' BEGIN { - if( q == tolower(q) ) imatch = 1 q = substr(q, 3) - gsub(" ", ".*", q) + if( q == tolower(q) ) imatch = 1 + gsub(/ /, ".*", q) } { if( imatch ) { - if( tolower($1) ~ tolower(q) ) print $1 + if( tolower($1) ~ q ) print $1 } else if( $1 ~ q ) print $1 } ' 2>/dev/null @@ -106,11 +114,12 @@ _z() { --) while [ "$1" ]; do shift; local fnd="$fnd${fnd:+ }$1";done;; -*) local opt=${1:1}; while [ "$opt" ]; do case ${opt:0:1} in c) local fnd="^$PWD $fnd";; - h) echo "${_Z_CMD:-z} [-chlrtx] args" >&2; return;; - x) sed -i -e "\:^${PWD}|.*:d" "$datafile";; + e) local echo=1;; + h) echo "${_Z_CMD:-z} [-cehlrtx] args" >&2; return;; l) local list=1;; r) local typ="rank";; t) local typ="recent";; + x) sed -i -e "\:^${PWD}|.*:d" "$datafile";; esac; opt=${opt:1}; done;; *) local fnd="$fnd${fnd:+ }$1";; esac; local last=$1; [ "$#" -gt 0 ] && shift; done @@ -119,16 +128,14 @@ _z() { # if we hit enter on a completion just go there case "$last" in # completions will always start with / - /*) [ -z "$list" -a -d "$last" ] && cd "$last" && return;; + /*) [ -z "$list" -a -d "$last" ] && builtin cd "$last" && return;; esac # no file yet [ -f "$datafile" ] || return local cd - cd="$(while read line; do - [ -d "${line%%\|*}" ] && echo $line - done < "$datafile" | awk -v t="$(date +%s)" -v list="$list" -v typ="$typ" -v q="$fnd" -F"|" ' + cd="$( < <( _z_dirs ) awk -v t="$(date +%s)" -v list="$list" -v typ="$typ" -v q="$fnd" -F"|" ' function frecent(rank, time) { # relate frequency and time dx = t - time @@ -137,19 +144,21 @@ _z() { if( dx < 604800 ) return rank / 2 return rank / 4 } - function output(files, out, common) { + function output(matches, best_match, common) { # list or return the desired directory if( list ) { cmd = "sort -n >&2" - for( x in files ) { - if( files[x] ) printf "%-10s %s\n", files[x], x | cmd + for( x in matches ) { + if( matches[x] ) { + printf "%-10s %s\n", matches[x], x | cmd + } } if( common ) { printf "%-10s %s\n", "common:", common > "/dev/stderr" } } else { - if( common ) out = common - print out + if( common ) best_match = common + print best_match } } function common(matches) { @@ -160,11 +169,9 @@ _z() { } } if( short == "/" ) return - # use a copy to escape special characters, as we want to return - # the original. yeah, this escaping is awful. - clean_short = short - gsub(/\[\(\)\[\]\|\]/, "\\\\&", clean_short) - for( x in matches ) if( matches[x] && x !~ clean_short ) return + for( x in matches ) if( matches[x] && index(x, short) != 1 ) { + return + } return short } BEGIN { @@ -197,8 +204,10 @@ _z() { } } ')" - [ $? -gt 0 ] && return - [ "$cd" ] && cd "$cd" + + [ $? -eq 0 ] && [ "$cd" ] && { + if [ "$echo" ]; then echo "$cd"; else builtin cd "$cd"; fi + } fi } @@ -212,11 +221,11 @@ if type compctl >/dev/null 2>&1; then # populate directory list, avoid clobbering any other precmds. if [ "$_Z_NO_RESOLVE_SYMLINKS" ]; then _z_precmd() { - _z --add "${PWD:a}" + (_z --add "${PWD:a}" &) } else _z_precmd() { - _z --add "${PWD:A}" + (_z --add "${PWD:A}" &) } fi [[ -n "${precmd_functions[(r)_z_precmd]}" ]] || { @@ -237,7 +246,7 @@ elif type complete >/dev/null 2>&1; then [ "$_Z_NO_PROMPT_COMMAND" ] || { # populate directory list. avoid clobbering other PROMPT_COMMANDs. grep "_z --add" <<< "$PROMPT_COMMAND" >/dev/null || { - PROMPT_COMMAND="$PROMPT_COMMAND"$'\n''_z --add "$(command pwd '$_Z_RESOLVE_SYMLINKS' 2>/dev/null)" 2>/dev/null;' + PROMPT_COMMAND="$PROMPT_COMMAND"$'\n''(_z --add "$(command pwd '$_Z_RESOLVE_SYMLINKS' 2>/dev/null)" 2>/dev/null &);' } } fi -- cgit v1.2.3-70-g09d2 From 5fa7824ea59ec12a976f348a83399e66699456ea Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Sun, 29 Jul 2018 11:45:35 -0400 Subject: git-prompt: fix error when multiple tags exist (#6998) When a commit has multiple tags associated to it, the git-prompt will throw the following error: git_super_status:[:4: integer expression expected: v0.21.x\ntags/v0.21.5, git_super_status:[:7: integer expression expected: origin/v0.21.x, git_super_status:[:11: integer expression expected: origin/v0.21.x, git_super_status:[:14: integer expression expected: v0.21.x git_super_status:[:23: integer expression expected: v0.21.x This is due to the prompt expecting the tag field to be a single word with no spaces in between but if there are multiple tags the python script returns a string with ', ' space separated list of tags. This throws off the parser. The solution is to ensure that the python script returns a space-less string ensuring the git-prompt parser to properly parse the data. Signed-off-by: Thanh Ha --- 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 14d875973..a4d07cde6 100644 --- a/plugins/git-prompt/gitstatus.py +++ b/plugins/git-prompt/gitstatus.py @@ -22,7 +22,7 @@ def get_tagname_or_hash(): tagname = 'tags/' + output[m.start()+len('tag: '): m.end()-1] if tagname: - return tagname + return tagname.replace(' ', '') elif hash_: return hash_ return None -- cgit v1.2.3-70-g09d2 From 106f826075979ef1a6875cedd2d098e601f2e3f2 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Thu, 2 Aug 2018 21:21:20 +0200 Subject: Revert "add -F and -X to default $LESS environment variable (#6611)" This reverts commit 9544316ef95c2aa1e75101a7dce545b4604b3ca6. This setting broke mouse / touchpad scroll on programs using `less` output due to it not using the alternate screen buffer. Fixes #7025 --- lib/misc.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/misc.zsh b/lib/misc.zsh index 90a8d62f3..3052b7710 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -20,7 +20,7 @@ setopt long_list_jobs ## pager env_default PAGER 'less' -env_default LESS '-FRX' +env_default LESS '-R' ## super user alias alias _='sudo' -- cgit v1.2.3-70-g09d2 From f33691fbb60ae38e51b121f06d90b22912cc8569 Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Sun, 27 Sep 2015 22:06:58 -0400 Subject: tmux: detabify source code Also changes the tmux detection test to do an early exit if tmux is absent, to reduce the indentation level of the main body of code. --- plugins/tmux/tmux.plugin.zsh | 147 +++++++++++++++++++++---------------------- 1 file changed, 70 insertions(+), 77 deletions(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index fb514a44c..4c4e62f54 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -10,89 +10,82 @@ alias tksv='tmux kill-server' alias tkss='tmux kill-session -t' # Only run if tmux is actually installed -if which tmux &> /dev/null - then - # Configuration variables - # - # Automatically start tmux - [[ -n "$ZSH_TMUX_AUTOSTART" ]] || ZSH_TMUX_AUTOSTART=false - # Only autostart once. If set to false, tmux will attempt to - # autostart every time your zsh configs are reloaded. - [[ -n "$ZSH_TMUX_AUTOSTART_ONCE" ]] || ZSH_TMUX_AUTOSTART_ONCE=true - # Automatically connect to a previous session if it exists - [[ -n "$ZSH_TMUX_AUTOCONNECT" ]] || ZSH_TMUX_AUTOCONNECT=true - # Automatically close the terminal when tmux exits - [[ -n "$ZSH_TMUX_AUTOQUIT" ]] || ZSH_TMUX_AUTOQUIT=$ZSH_TMUX_AUTOSTART - # Set term to screen or screen-256color based on current terminal support - [[ -n "$ZSH_TMUX_FIXTERM" ]] || ZSH_TMUX_FIXTERM=true - # Set '-CC' option for iTerm2 tmux integration - [[ -n "$ZSH_TMUX_ITERM2" ]] || ZSH_TMUX_ITERM2=false - # The TERM to use for non-256 color terminals. - # Tmux states this should be screen, but you may need to change it on - # systems without the proper terminfo - [[ -n "$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR" ]] || ZSH_TMUX_FIXTERM_WITHOUT_256COLOR="screen" - # The TERM to use for 256 color terminals. - # Tmux states this should be screen-256color, but you may need to change it on - # systems without the proper terminfo - [[ -n "$ZSH_TMUX_FIXTERM_WITH_256COLOR" ]] || ZSH_TMUX_FIXTERM_WITH_256COLOR="screen-256color" +if ! which tmux &> /dev/null; then + print "zsh tmux plugin: tmux not found. Please install tmux before using this plugin." + return 1 +fi + +# Configuration variables +# +# Automatically start tmux +[[ -n "$ZSH_TMUX_AUTOSTART" ]] || ZSH_TMUX_AUTOSTART=false +# Only autostart once. If set to false, tmux will attempt to +# autostart every time your zsh configs are reloaded. +[[ -n "$ZSH_TMUX_AUTOSTART_ONCE" ]] || ZSH_TMUX_AUTOSTART_ONCE=true +# Automatically connect to a previous session if it exists +[[ -n "$ZSH_TMUX_AUTOCONNECT" ]] || ZSH_TMUX_AUTOCONNECT=true +# Automatically close the terminal when tmux exits +[[ -n "$ZSH_TMUX_AUTOQUIT" ]] || ZSH_TMUX_AUTOQUIT=$ZSH_TMUX_AUTOSTART +# Set term to screen or screen-256color based on current terminal support +[[ -n "$ZSH_TMUX_FIXTERM" ]] || ZSH_TMUX_FIXTERM=true +# Set '-CC' option for iTerm2 tmux integration +[[ -n "$ZSH_TMUX_ITERM2" ]] || ZSH_TMUX_ITERM2=false +# The TERM to use for non-256 color terminals. +# Tmux states this should be screen, but you may need to change it on +# systems without the proper terminfo +[[ -n "$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR" ]] || ZSH_TMUX_FIXTERM_WITHOUT_256COLOR="screen" +# The TERM to use for 256 color terminals. +# Tmux states this should be screen-256color, but you may need to change it on +# systems without the proper terminfo +[[ -n "$ZSH_TMUX_FIXTERM_WITH_256COLOR" ]] || ZSH_TMUX_FIXTERM_WITH_256COLOR="screen-256color" - # Get the absolute path to the current directory - local zsh_tmux_plugin_path="$(cd "$(dirname "$0")" && pwd)" +# Get the absolute path to the current directory +local zsh_tmux_plugin_path="$(cd "$(dirname "$0")" && pwd)" - # Determine if the terminal supports 256 colors - if [[ `tput colors` == "256" ]] - then - export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITH_256COLOR - else - export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR - fi +# Determine if the terminal supports 256 colors +if [[ `tput colors` == "256" ]]; then + export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITH_256COLOR +else + export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR +fi - # Set the correct local config file to use. - if [[ "$ZSH_TMUX_ITERM2" == "false" ]] && [[ -f $HOME/.tmux.conf || -h $HOME/.tmux.conf ]] - then - #use this when they have a ~/.tmux.conf - export _ZSH_TMUX_FIXED_CONFIG="$zsh_tmux_plugin_path/tmux.extra.conf" - else - #use this when they don't have a ~/.tmux.conf - export _ZSH_TMUX_FIXED_CONFIG="$zsh_tmux_plugin_path/tmux.only.conf" - fi +# Set the correct local config file to use. +if [[ "$ZSH_TMUX_ITERM2" == "false" ]] && [[ -f $HOME/.tmux.conf || -h $HOME/.tmux.conf ]]; then + #use this when they have a ~/.tmux.conf + export _ZSH_TMUX_FIXED_CONFIG="$zsh_tmux_plugin_path/tmux.extra.conf" +else + #use this when they don't have a ~/.tmux.conf + export _ZSH_TMUX_FIXED_CONFIG="$zsh_tmux_plugin_path/tmux.only.conf" +fi - # Wrapper function for tmux. - function _zsh_tmux_plugin_run() - { - # We have other arguments, just run them - if [[ -n "$@" ]] - then - \tmux $@ - # Try to connect to an existing session. - elif [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] - then - \tmux `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` attach || \tmux `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG` new-session - [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit - # Just run tmux, fixing the TERM variable if requested. - else - \tmux `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG` - [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit - fi - } +# Wrapper function for tmux. +function _zsh_tmux_plugin_run() { + # We have other arguments, just run them + if [[ -n "$@" ]]; then + \tmux $@ + # Try to connect to an existing session. + elif [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]]; then + \tmux `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` attach || \tmux `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG` new-session + [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit + # Just run tmux, fixing the TERM variable if requested. + else + \tmux `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG` + [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit + fi +} - # Use the completions for tmux for our function - compdef _tmux _zsh_tmux_plugin_run +# Use the completions for tmux for our function +compdef _tmux _zsh_tmux_plugin_run - # Alias tmux to our wrapper function. - alias tmux=_zsh_tmux_plugin_run +# Alias tmux to our wrapper function. +alias tmux=_zsh_tmux_plugin_run - # Autostart if not already in tmux and enabled. - if [[ ! -n "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" ]] - then - # Actually don't autostart if we already did and multiple autostarts are disabled. - if [[ "$ZSH_TMUX_AUTOSTART_ONCE" == "false" || "$ZSH_TMUX_AUTOSTARTED" != "true" ]] - then - export ZSH_TMUX_AUTOSTARTED=true - _zsh_tmux_plugin_run - fi - fi -else - print "zsh tmux plugin: tmux not found. Please install tmux before using this plugin." +# Autostart if not already in tmux and enabled. +if [[ ! -n "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" ]]; then + # Actually don't autostart if we already did and multiple autostarts are disabled. + if [[ "$ZSH_TMUX_AUTOSTART_ONCE" == "false" || "$ZSH_TMUX_AUTOSTARTED" != "true" ]]; then + export ZSH_TMUX_AUTOSTARTED=true + _zsh_tmux_plugin_run + fi fi -- cgit v1.2.3-70-g09d2 From 19716a8e3df053f26500db126a03a8a471436bc8 Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Sun, 27 Sep 2015 22:22:50 -0400 Subject: tmux: refactor - Consolidates the switch-adding logic for readability. - Replaces "[[ ... ]] && ..." with "if [[ ... ]]; then ..." in some cases to avoid a spurious nonzero exit status from _zsh_tmux_plugin_run. - Puts error message on stderr instead of stdout --- plugins/tmux/tmux.plugin.zsh | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 4c4e62f54..1b97cae73 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -11,7 +11,7 @@ alias tkss='tmux kill-session -t' # Only run if tmux is actually installed if ! which tmux &> /dev/null; then - print "zsh tmux plugin: tmux not found. Please install tmux before using this plugin." + print "zsh tmux plugin: tmux not found. Please install tmux before using this plugin." >&2 return 1 fi @@ -40,9 +40,6 @@ fi [[ -n "$ZSH_TMUX_FIXTERM_WITH_256COLOR" ]] || ZSH_TMUX_FIXTERM_WITH_256COLOR="screen-256color" -# Get the absolute path to the current directory -local zsh_tmux_plugin_path="$(cd "$(dirname "$0")" && pwd)" - # Determine if the terminal supports 256 colors if [[ `tput colors` == "256" ]]; then export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITH_256COLOR @@ -53,25 +50,33 @@ fi # Set the correct local config file to use. if [[ "$ZSH_TMUX_ITERM2" == "false" ]] && [[ -f $HOME/.tmux.conf || -h $HOME/.tmux.conf ]]; then #use this when they have a ~/.tmux.conf - export _ZSH_TMUX_FIXED_CONFIG="$zsh_tmux_plugin_path/tmux.extra.conf" + export _ZSH_TMUX_FIXED_CONFIG="${0:h:a}/tmux.extra.conf" else #use this when they don't have a ~/.tmux.conf - export _ZSH_TMUX_FIXED_CONFIG="$zsh_tmux_plugin_path/tmux.only.conf" + export _ZSH_TMUX_FIXED_CONFIG="${0:h:a}/tmux.only.conf" fi # Wrapper function for tmux. function _zsh_tmux_plugin_run() { - # We have other arguments, just run them + local tmux_cmd + tmux_cmd=(command tmux) + [[ "$ZSH_TMUX_ITERM2" == "true" ]] && tmux_cmd+="-CC" + [[ "$ZSH_TMUX_FIXTERM" == "true" ]] && tmux_cmd+=(-f $_ZSH_TMUX_FIXED_CONFIG) if [[ -n "$@" ]]; then + # We have other arguments, just run them \tmux $@ - # Try to connect to an existing session. elif [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]]; then - \tmux `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` attach || \tmux `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG` new-session - [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit - # Just run tmux, fixing the TERM variable if requested. + # Try to connect to an existing session. + $tmux_cmd attach || $tmux_cmd new-session + if [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]]; then + exit + fi else - \tmux `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG` - [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit + # Just run tmux, fixing the TERM variable if requested. + $tmux_cmd + if [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]]; then + exit + fi fi } -- cgit v1.2.3-70-g09d2 From f584de5930467fd53e8b7d2e51f5227bc405e4b2 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Fri, 3 Aug 2018 22:06:26 +0200 Subject: tmux: refactor and simplify tmux function logic --- plugins/tmux/tmux.plugin.zsh | 82 ++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 44 deletions(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 1b97cae73..2d161c377 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -1,6 +1,9 @@ -# -# Aliases -# +if ! (( $+commands[tmux] )); then + print "zsh tmux plugin: tmux not found. Please install tmux before using this plugin." >&2 + return 1 +fi + +# ALIASES alias ta='tmux attach -t' alias tad='tmux attach -d -t' @@ -9,85 +12,76 @@ alias tl='tmux list-sessions' alias tksv='tmux kill-server' alias tkss='tmux kill-session -t' -# Only run if tmux is actually installed -if ! which tmux &> /dev/null; then - print "zsh tmux plugin: tmux not found. Please install tmux before using this plugin." >&2 - return 1 -fi - -# Configuration variables -# +# CONFIGURATION VARIABLES # Automatically start tmux -[[ -n "$ZSH_TMUX_AUTOSTART" ]] || ZSH_TMUX_AUTOSTART=false +: ${ZSH_TMUX_AUTOSTART:=false} # Only autostart once. If set to false, tmux will attempt to # autostart every time your zsh configs are reloaded. -[[ -n "$ZSH_TMUX_AUTOSTART_ONCE" ]] || ZSH_TMUX_AUTOSTART_ONCE=true +: ${ZSH_TMUX_AUTOSTART_ONCE:=true} # Automatically connect to a previous session if it exists -[[ -n "$ZSH_TMUX_AUTOCONNECT" ]] || ZSH_TMUX_AUTOCONNECT=true +: ${ZSH_TMUX_AUTOCONNECT:=true} # Automatically close the terminal when tmux exits -[[ -n "$ZSH_TMUX_AUTOQUIT" ]] || ZSH_TMUX_AUTOQUIT=$ZSH_TMUX_AUTOSTART +: ${ZSH_TMUX_AUTOQUIT:=$ZSH_TMUX_AUTOSTART} # Set term to screen or screen-256color based on current terminal support -[[ -n "$ZSH_TMUX_FIXTERM" ]] || ZSH_TMUX_FIXTERM=true +: ${ZSH_TMUX_FIXTERM:=true} # Set '-CC' option for iTerm2 tmux integration -[[ -n "$ZSH_TMUX_ITERM2" ]] || ZSH_TMUX_ITERM2=false +: ${ZSH_TMUX_ITERM2:=false} # The TERM to use for non-256 color terminals. # Tmux states this should be screen, but you may need to change it on # systems without the proper terminfo -[[ -n "$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR" ]] || ZSH_TMUX_FIXTERM_WITHOUT_256COLOR="screen" +: ${ZSH_TMUX_FIXTERM_WITHOUT_256COLOR:=screen} # The TERM to use for 256 color terminals. # Tmux states this should be screen-256color, but you may need to change it on # systems without the proper terminfo -[[ -n "$ZSH_TMUX_FIXTERM_WITH_256COLOR" ]] || ZSH_TMUX_FIXTERM_WITH_256COLOR="screen-256color" - +: ${ZSH_TMUX_FIXTERM_WITH_256COLOR:=screen-256color} # Determine if the terminal supports 256 colors -if [[ `tput colors` == "256" ]]; then +if [[ $(tput colors) == 256 ]]; then export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITH_256COLOR else export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR fi # Set the correct local config file to use. -if [[ "$ZSH_TMUX_ITERM2" == "false" ]] && [[ -f $HOME/.tmux.conf || -h $HOME/.tmux.conf ]]; then - #use this when they have a ~/.tmux.conf +if [[ "$ZSH_TMUX_ITERM2" == "false" && -e "$HOME/.tmux.conf" ]]; then export _ZSH_TMUX_FIXED_CONFIG="${0:h:a}/tmux.extra.conf" else - #use this when they don't have a ~/.tmux.conf export _ZSH_TMUX_FIXED_CONFIG="${0:h:a}/tmux.only.conf" fi # Wrapper function for tmux. function _zsh_tmux_plugin_run() { - local tmux_cmd - tmux_cmd=(command tmux) - [[ "$ZSH_TMUX_ITERM2" == "true" ]] && tmux_cmd+="-CC" - [[ "$ZSH_TMUX_FIXTERM" == "true" ]] && tmux_cmd+=(-f $_ZSH_TMUX_FIXED_CONFIG) if [[ -n "$@" ]]; then - # We have other arguments, just run them - \tmux $@ - elif [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]]; then - # Try to connect to an existing session. - $tmux_cmd attach || $tmux_cmd new-session - if [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]]; then - exit - fi - else - # Just run tmux, fixing the TERM variable if requested. - $tmux_cmd - if [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]]; then - exit - fi + command tmux "$@" + return $? + fi + + local -a tmux_cmd=(command tmux) + [[ "$ZSH_TMUX_ITERM2" == "true" ]] && tmux_cmd+=(-CC) + + # Try to connect to an existing session. + if [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]]; then + $tmux_cmd attach + fi + + # If failed, just run tmux, fixing the TERM variable if requested. + if [[ $? -ne 0 ]]; then + [[ "$ZSH_TMUX_FIXTERM" == "true" ]] && tmux_cmd+=(-f "$_ZSH_TMUX_FIXED_CONFIG") + $tmux_cmd new-session + fi + + if [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]]; then + exit fi } # Use the completions for tmux for our function compdef _tmux _zsh_tmux_plugin_run - # Alias tmux to our wrapper function. alias tmux=_zsh_tmux_plugin_run # Autostart if not already in tmux and enabled. -if [[ ! -n "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" ]]; then +if [[ -z "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" ]]; then # Actually don't autostart if we already did and multiple autostarts are disabled. if [[ "$ZSH_TMUX_AUTOSTART_ONCE" == "false" || "$ZSH_TMUX_AUTOSTARTED" != "true" ]]; then export ZSH_TMUX_AUTOSTARTED=true -- cgit v1.2.3-70-g09d2 From 76d3eedf7fa47886658c79884884f4077ce09107 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Tue, 7 Aug 2018 00:40:18 +0200 Subject: tmux: fix regression after f584de5 Fixes #7041 --- plugins/tmux/tmux.plugin.zsh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 2d161c377..ff7de746b 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -60,9 +60,7 @@ function _zsh_tmux_plugin_run() { [[ "$ZSH_TMUX_ITERM2" == "true" ]] && tmux_cmd+=(-CC) # Try to connect to an existing session. - if [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]]; then - $tmux_cmd attach - fi + [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] && $tmux_cmd attach # If failed, just run tmux, fixing the TERM variable if requested. if [[ $? -ne 0 ]]; then -- cgit v1.2.3-70-g09d2 From 91b771914bc7c43dd7c7a43b586c5de2c225ceb7 Mon Sep 17 00:00:00 2001 From: kapsh Date: Wed, 28 Jun 2017 11:03:55 +0300 Subject: extract: check file extension as lowercase (#6158) Fixes #6157 --- plugins/extract/extract.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index 34f8d8710..d56044805 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -29,7 +29,7 @@ extract() { success=0 extract_dir="${1:t:r}" - case "$1" in + case "${1:l}" in (*.tar.gz|*.tgz) (( $+commands[pigz] )) && { pigz -dc "$1" | tar xv } || tar zxvf "$1" ;; (*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;; (*.tar.xz|*.txz) @@ -45,7 +45,7 @@ extract() { (*.bz2) bunzip2 "$1" ;; (*.xz) unxz "$1" ;; (*.lzma) unlzma "$1" ;; - (*.Z) uncompress "$1" ;; + (*.z) uncompress "$1" ;; (*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk) unzip "$1" -d $extract_dir ;; (*.rar) unrar x -ad "$1" ;; (*.7z) 7za x "$1" ;; -- cgit v1.2.3-70-g09d2 From 05713785b0774f78e0aeb4cc4d793fdb529307db Mon Sep 17 00:00:00 2001 From: John Burwell Date: Tue, 7 Aug 2018 12:10:35 -0400 Subject: asdf: add Homebrew and completion support (#6749) * Modifies the search logic for asdf to include Homebrew when it is installed. The implementation is adapted from the pyenv plugin. --- plugins/asdf/asdf.plugin.zsh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/plugins/asdf/asdf.plugin.zsh b/plugins/asdf/asdf.plugin.zsh index d563cf5f8..75395c718 100644 --- a/plugins/asdf/asdf.plugin.zsh +++ b/plugins/asdf/asdf.plugin.zsh @@ -1,12 +1,17 @@ -# Find where asdf should be installed. +# Find where asdf should be installed ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}" -# Load asdf, if found. -if [ -f $ASDF_DIR/asdf.sh ]; then - . $ASDF_DIR/asdf.sh +# If not found, check for Homebrew package +if [[ ! -d $ASDF_DIR ]] && (( $+commands[brew] )); then + ASDF_DIR="$(brew --prefix asdf)" fi -# Load asdf completions, if found. -if [ -f $ASDF_DIR/completions/asdf.bash ]; then - . $ASDF_DIR/completions/asdf.bash +# Load command +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" + fi fi -- cgit v1.2.3-70-g09d2 From e934624b32f8c370306355ab8a78667a5a6240d3 Mon Sep 17 00:00:00 2001 From: Tony Lotts Date: Wed, 8 Aug 2018 00:14:38 +0800 Subject: Add function to search Dash.app (#2557) * Add function to search Dash * Pass all arguements instead of just the first * Adding docset completion with help from @kapeli and [arx] --- plugins/dash/dash.plugin.zsh | 86 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 plugins/dash/dash.plugin.zsh diff --git a/plugins/dash/dash.plugin.zsh b/plugins/dash/dash.plugin.zsh new file mode 100644 index 000000000..5d0ec9a97 --- /dev/null +++ b/plugins/dash/dash.plugin.zsh @@ -0,0 +1,86 @@ +# Usage: dash [keyword:]query +dash() { open dash://"$*" } +compdef _dash dash + +_dash() { + # No sense doing this for anything except the 2nd position and if we haven't + # specified which docset to query against + if [[ $CURRENT -eq 2 && ! "$words[2]" =~ ":" ]]; then + local -a _all_docsets + _all_docsets=() + # Use defaults to get the array of docsets from preferences + # Have to smash it into one big line so that each docset is an element of + # our DOCSETS array + DOCSETS=("${(@f)$(defaults read com.kapeli.dash docsets | tr -d '\n' | grep -oE '\{.*?\}')}") + + # remove all newlines since defaults prints so pretty like + # Now get each docset and output each on their own line + for doc in "$DOCSETS[@]"; do + # Only output docsets that are actually enabled + if [[ "`echo $doc | grep -Eo \"isEnabled = .*?;\" | sed 's/[^01]//g'`" == "0" ]]; then + continue + fi + + keyword='' + + # Order of preference as explained to me by @kapeli via email + KEYWORD_LOCATORS=(keyword suggestedKeyword platform) + for locator in "$KEYWORD_LOCATORS[@]"; do + # Echo the docset, try to find the appropriate keyword + # Strip doublequotes and colon from any keyword so that everything has the + # same format when output (we'll add the colon in the completion) + keyword=`echo $doc | grep -Eo "$locator = .*?;" | sed -e "s/$locator = \(.*\);/\1/" -e "s/[\":]//g"` + if [[ ! -z "$keyword" ]]; then + # if we fall back to platform, we should do some checking per @kapeli + if [[ "$locator" == "platform" ]]; then + # Since these are the only special cases right now, let's not do the + # expensive processing unless we have to + if [[ "$keyword" == "python" || "$keyword" == "java" || \ + "$keyword" == "qt" || "$keyword" == "cocs2d" ]]; then + docsetName=`echo $doc | grep -Eo "docsetName = .*?;" | sed -e "s/docsetName = \(.*\);/\1/" -e "s/[\":]//g"` + if [[ "$keyword" == "python" ]]; then + if [[ "$docsetName" == "Python 2" ]]; then + keyword="python2" + elif [[ "$docsetName" == "Python 3" ]]; then + keyword="python3" + fi + elif [[ "$keyword" == "java" ]]; then + if [[ "$docsetName" == "Java SE7" ]]; then + keyword="java7" + elif [[ "$docsetName" == "Java SE6" ]]; then + keyword="java6" + elif [[ "$docsetName" == "Java SE8" ]]; then + keyword="java8" + fi + elif [[ "$keyword" == "qt" ]]; then + if [[ "$docsetName" == "Qt 5" ]]; then + keyword="qt5" + elif [[ "$docsetName" == "Qt 4" ]]; then + keyword="qt4" + elif [[ "$docsetName" == "Qt" ]]; then + keyword="qt4" + fi + elif [[ "$keyword" == "cocos2d" ]]; then + if [[ "$docsetName" == "Cocos3D" ]]; then + keyword="cocos3d" + fi + fi + fi + fi + + # Bail once we have a match + break + fi + done + + # If we have a keyword, add it to the list! + if [[ ! -z "$keyword" ]]; then + _all_docsets+=($keyword) + fi + done + + # special thanks to [arx] on #zsh for getting me sorted on this piece + compadd -qS: -- "$_all_docsets[@]" + return + fi +} -- cgit v1.2.3-70-g09d2 From 19b925e741fa46d2222210469a4dffc34a634ebd Mon Sep 17 00:00:00 2001 From: Janosch Schwalm Date: Tue, 7 Aug 2018 20:42:02 +0200 Subject: use https everywhere (#6574) * use https everywhere * use https links on the files that are left Also, removed some broken links and updated redirections. --- lib/spectrum.zsh | 2 +- lib/termsupport.zsh | 2 +- plugins/bbedit/README.md | 6 +++--- plugins/bgnotify/README.md | 2 +- plugins/bwana/bwana.plugin.zsh | 4 ++-- plugins/catimg/catimg.plugin.zsh | 2 +- plugins/catimg/catimg.sh | 2 +- plugins/coffee/_coffee | 4 ++-- .../command-not-found/command-not-found.plugin.zsh | 2 +- plugins/debian/debian.plugin.zsh | 2 +- plugins/docker/_docker | 2 +- plugins/dotenv/README.md | 2 +- plugins/droplr/README.md | 2 +- plugins/ember-cli/README.md | 4 ++-- plugins/ember-cli/ember-cli.plugin.zsh | 2 +- plugins/emoji/README.md | 6 +++--- plugins/emoji/emoji-data.txt | 4 ++-- plugins/emoji/update_emoji.pl | 12 +++++------ plugins/forklift/README.md | 2 +- plugins/frontend-search/README.md | 12 +++++------ plugins/frontend-search/frontend-search.plugin.zsh | 10 ++++----- plugins/geeknote/README.md | 2 +- plugins/git-extras/README.md | 2 +- plugins/git-extras/git-extras.plugin.zsh | 6 +++--- plugins/git-flow-avh/git-flow-avh.plugin.zsh | 4 ++-- plugins/git-hubflow/git-hubflow.plugin.zsh | 2 +- plugins/git-prompt/git-prompt.plugin.zsh | 2 +- plugins/github/README.md | 6 +++--- plugins/github/github.plugin.zsh | 4 ++-- plugins/globalias/README.md | 2 +- plugins/hanami/README.md | 4 ++-- plugins/history-substring-search/README.md | 6 +++--- plugins/httpie/README.md | 4 ++-- plugins/jake-node/jake-node.plugin.zsh | 4 ++-- plugins/kitchen/_kitchen | 4 ++-- plugins/kube-ps1/kube-ps1.plugin.zsh | 2 +- plugins/lighthouse/lighthouse.plugin.zsh | 2 +- plugins/lol/lol.plugin.zsh | 4 ++-- plugins/mix-fast/README.md | 4 ++-- plugins/osx/osx.plugin.zsh | 2 +- plugins/osx/spotify | 2 +- plugins/pass/_pass | 2 +- plugins/per-directory-history/README.md | 24 +++++++++++----------- .../per-directory-history.zsh | 2 +- plugins/percol/README.md | 3 --- plugins/perl/perl.plugin.zsh | 2 +- plugins/pod/_pod | 2 +- plugins/pow/pow.plugin.zsh | 2 +- plugins/rake-fast/README.md | 2 +- plugins/repo/README.md | 2 +- plugins/safe-paste/safe-paste.plugin.zsh | 4 ++-- plugins/scala/_scala | 4 ++-- plugins/scd/README.md | 4 ++-- plugins/scw/_scw | 2 +- plugins/shrink-path/README.md | 6 +++--- plugins/shrink-path/shrink-path.plugin.zsh | 6 +++--- plugins/spring/README.md | 10 ++++----- plugins/sprunge/sprunge.plugin.zsh | 22 ++++++++++---------- plugins/ssh-agent/README.md | 2 +- plugins/sublime/README.md | 2 +- plugins/svn/README.md | 2 +- plugins/systemadmin/systemadmin.plugin.zsh | 1 - plugins/taskwarrior/README.md | 2 +- plugins/taskwarrior/_task | 2 +- plugins/textastic/README.md | 4 ++-- plugins/ubuntu/ubuntu.plugin.zsh | 2 +- plugins/urltools/urltools.plugin.zsh | 2 +- plugins/vault/README.md | 8 ++++---- plugins/wp-cli/README.md | 6 +++--- plugins/wp-cli/wp-cli.plugin.zsh | 2 +- plugins/xcode/xcode.plugin.zsh | 2 +- plugins/zsh-navigation-tools/LICENSE | 8 ++++---- themes/adben.zsh-theme | 6 +++--- themes/agnoster.zsh-theme | 2 +- themes/arrow.zsh-theme | 2 +- themes/avit.zsh-theme | 2 +- themes/bira.zsh-theme | 2 +- themes/clean.zsh-theme | 2 +- themes/duellj.zsh-theme | 2 +- themes/funky.zsh-theme | 4 ++-- themes/gnzh.zsh-theme | 1 - themes/half-life.zsh-theme | 4 ++-- themes/itchy.zsh-theme | 2 -- themes/jreese.zsh-theme | 2 -- themes/lambda.zsh-theme | 2 -- themes/lukerandall.zsh-theme | 2 +- themes/macovsky-ruby.zsh-theme | 2 +- themes/macovsky.zsh-theme | 2 +- themes/mh.zsh-theme | 4 ++-- themes/michelebologna.zsh-theme | 10 ++++----- themes/mikeh.zsh-theme | 4 ++-- themes/philips.zsh-theme | 2 +- themes/pmcgee.zsh-theme | 2 +- themes/rkj.zsh-theme | 2 +- themes/sorin.zsh-theme | 8 ++++---- themes/sporty_256.zsh-theme | 2 +- themes/steeef.zsh-theme | 4 ++-- themes/sunaku.zsh-theme | 1 - themes/tonotdo.zsh-theme | 4 ++-- themes/xiong-chiamiov-plus.zsh-theme | 2 +- themes/xiong-chiamiov.zsh-theme | 2 +- tools/theme_chooser.sh | 2 +- 102 files changed, 187 insertions(+), 199 deletions(-) diff --git a/lib/spectrum.zsh b/lib/spectrum.zsh index 87092d8ae..312ab2248 100644 --- a/lib/spectrum.zsh +++ b/lib/spectrum.zsh @@ -1,7 +1,7 @@ #! /bin/zsh # A script to make using 256 colors in zsh less painful. # P.C. Shyamshankar -# Copied from http://github.com/sykora/etc/blob/master/zsh/functions/spectrum/ +# Copied from https://github.com/sykora/etc/blob/master/zsh/functions/spectrum/ typeset -AHg FX FG BG diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 871ab28df..87d55ee89 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -80,7 +80,7 @@ preexec_functions+=(omz_termsupport_preexec) # Keep Apple Terminal.app's current working directory updated -# Based on this answer: http://superuser.com/a/315029 +# Based on this answer: https://superuser.com/a/315029 # With extra fixes to handle multibyte chars and non-UTF-8 locales if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then diff --git a/plugins/bbedit/README.md b/plugins/bbedit/README.md index ec2b743d6..263c54c47 100644 --- a/plugins/bbedit/README.md +++ b/plugins/bbedit/README.md @@ -1,11 +1,11 @@ ## bbedit -Plugin for BBEdit, an HTML and text editor for Mac OS X +Plugin for BBEdit, an HTML and text editor for Mac OS X ### Requirements - * [BBEdit](http://www.barebones.com/products/bbedit/) - * [BBEdit Command-Line Tools](http://www.barebones.com/support/bbedit/cmd-line-tools.html) + * [BBEdit](https://www.barebones.com/products/bbedit/) + * [BBEdit Command-Line Tools](https://www.barebones.com/support/bbedit/cmd-line-tools.html) ### Usage diff --git a/plugins/bgnotify/README.md b/plugins/bgnotify/README.md index fad299159..1d8fac54d 100644 --- a/plugins/bgnotify/README.md +++ b/plugins/bgnotify/README.md @@ -13,7 +13,7 @@ Just add bgnotify to your plugins list in your `.zshrc` - On OS X you'll need [terminal-notifier](https://github.com/alloy/terminal-notifier) * `brew install terminal-notifier` (or `gem install terminal-notifier`) - On ubuntu you're already all set! -- On windows you can use [notifu](http://www.paralint.com/projects/notifu/) or the Cygwin Ports libnotify package +- On windows you can use [notifu](https://www.paralint.com/projects/notifu/) or the Cygwin Ports libnotify package ## Screenshots diff --git a/plugins/bwana/bwana.plugin.zsh b/plugins/bwana/bwana.plugin.zsh index 455da8621..b9a04793f 100644 --- a/plugins/bwana/bwana.plugin.zsh +++ b/plugins/bwana/bwana.plugin.zsh @@ -1,5 +1,5 @@ # -# Requires http://www.bruji.com/bwana/ +# Requires https://www.bruji.com/bwana/ # if [[ -e /Applications/Bwana.app ]] || ( system_profiler -detailLevel mini SPApplicationsDataType | grep -q Bwana ) @@ -9,5 +9,5 @@ then } else echo "Bwana lets you read man files in Safari through a man: URI scheme" - echo "To use it within Zsh, install it from http://www.bruji.com/bwana/" + echo "To use it within Zsh, install it from https://www.bruji.com/bwana/" fi diff --git a/plugins/catimg/catimg.plugin.zsh b/plugins/catimg/catimg.plugin.zsh index cb92f5986..5f58ecde3 100644 --- a/plugins/catimg/catimg.plugin.zsh +++ b/plugins/catimg/catimg.plugin.zsh @@ -1,6 +1,6 @@ ################################################################################ # catimg script by Eduardo San Martin Morote aka Posva # -# http://posva.net # +# https://posva.net # # # # Ouput the content of an image to the stdout using the 256 colors of the # # terminal. # diff --git a/plugins/catimg/catimg.sh b/plugins/catimg/catimg.sh index cd0f2e333..83ccf6a95 100755 --- a/plugins/catimg/catimg.sh +++ b/plugins/catimg/catimg.sh @@ -1,6 +1,6 @@ ################################################################################ # catimg script by Eduardo San Martin Morote aka Posva # -# http://posva.net # +# https://posva.net # # # # Ouput the content of an image to the stdout using the 256 colors of the # # terminal. # diff --git a/plugins/coffee/_coffee b/plugins/coffee/_coffee index 10b6b8164..5e52b30e6 100644 --- a/plugins/coffee/_coffee +++ b/plugins/coffee/_coffee @@ -1,6 +1,6 @@ #compdef coffee # ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users +# Copyright (c) 2011 Github zsh-users - https://github.com/zsh-users # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -28,7 +28,7 @@ # Description # ----------- # -# Completion script for Coffee.js v0.6.11 (http://coffeejs.org) +# Completion script for Coffee.js v0.6.11 (https://coffeescript.org) # # ------------------------------------------------------------------------------ # Authors diff --git a/plugins/command-not-found/command-not-found.plugin.zsh b/plugins/command-not-found/command-not-found.plugin.zsh index 0e2f2133f..ba1262de6 100644 --- a/plugins/command-not-found/command-not-found.plugin.zsh +++ b/plugins/command-not-found/command-not-found.plugin.zsh @@ -1,5 +1,5 @@ # Uses the command-not-found package zsh support -# as seen in http://www.porcheron.info/command-not-found-for-zsh/ +# as seen in https://www.porcheron.info/command-not-found-for-zsh/ # this is installed in Ubuntu [[ -e /etc/zsh_command_not_found ]] && source /etc/zsh_command_not_found diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh index 42690e53e..654b692d2 100644 --- a/plugins/debian/debian.plugin.zsh +++ b/plugins/debian/debian.plugin.zsh @@ -179,7 +179,7 @@ apt-copy() { # apt-history remove # apt-history rollback # apt-history list -# Based On: http://linuxcommando.blogspot.com/2008/08/how-to-show-apt-log-history.html +# Based On: https://linuxcommando.blogspot.com/2008/08/how-to-show-apt-log-history.html apt-history () { case "$1" in install) diff --git a/plugins/docker/_docker b/plugins/docker/_docker index 32ad4848a..df4b44961 100644 --- a/plugins/docker/_docker +++ b/plugins/docker/_docker @@ -1,6 +1,6 @@ #compdef docker dockerd # -# zsh completion for docker (http://docker.com) +# zsh completion for docker (https://docker.com) # # version: 0.3.0 # github: https://github.com/felixr/docker-zsh-completion diff --git a/plugins/dotenv/README.md b/plugins/dotenv/README.md index e0e75571f..e880e9d69 100644 --- a/plugins/dotenv/README.md +++ b/plugins/dotenv/README.md @@ -2,7 +2,7 @@ Automatically load your project ENV variables from `.env` file when you `cd` into project root directory. -Storing configuration in the environment is one of the tenets of a [twelve-factor app](http://www.12factor.net). Anything that is likely to change between deployment environments, such as resource handles for databases or credentials for external services, should be extracted from the code into environment variables. +Storing configuration in the environment is one of the tenets of a [twelve-factor app](https://www.12factor.net). Anything that is likely to change between deployment environments, such as resource handles for databases or credentials for external services, should be extracted from the code into environment variables. ## Installation diff --git a/plugins/droplr/README.md b/plugins/droplr/README.md index 25cf61db7..6daa2540d 100644 --- a/plugins/droplr/README.md +++ b/plugins/droplr/README.md @@ -16,4 +16,4 @@ Author: [Fabio Fernandes](https://github.com/fabiofl) - Upload a file: `droplr ./path/to/file/` -- Shorten a link: `droplr http://example.com` +- Shorten a link: `droplr https://example.com` diff --git a/plugins/ember-cli/README.md b/plugins/ember-cli/README.md index 1f92bba32..2e4ed7068 100644 --- a/plugins/ember-cli/README.md +++ b/plugins/ember-cli/README.md @@ -1,8 +1,8 @@ # Ember CLI -**Maintainers:** [BilalBudhani](http://www.github.com/BilalBudhani), [eubenesa](http://www.github.com/eubenesa) +**Maintainers:** [BilalBudhani](https://github.com/BilalBudhani), [eubenesa](https://github.com/eubenesa) -Ember CLI (http://www.ember-cli.com/) +Ember CLI (https://www.ember-cli.com/) ### List of Aliases diff --git a/plugins/ember-cli/ember-cli.plugin.zsh b/plugins/ember-cli/ember-cli.plugin.zsh index a0f346829..3d06fd2f5 100644 --- a/plugins/ember-cli/ember-cli.plugin.zsh +++ b/plugins/ember-cli/ember-cli.plugin.zsh @@ -1,5 +1,5 @@ # Ember CLI -# Visit http://www.ember-cli.com/ to view user guide +# Visit https://www.ember-cli.com/ to view user guide alias es='ember serve' alias ea='ember addon' diff --git a/plugins/emoji/README.md b/plugins/emoji/README.md index 889e567e6..8b8860a86 100644 --- a/plugins/emoji/README.md +++ b/plugins/emoji/README.md @@ -71,7 +71,7 @@ PROMPT="$surfer > " ## Technical Details -The emoji names and codes are sourced from Unicode Technical Report \#51, which provides information on emoji support in Unicode. It can be found at http://www.unicode.org/reports/tr51/index.html. +The emoji names and codes are sourced from Unicode Technical Report \#51, which provides information on emoji support in Unicode. It can be found at https://www.unicode.org/reports/tr51/index.html. The group definitions are added by this OMZ plugin. They are not based on external definitions. (As far as I can tell. -apjanke) @@ -108,7 +108,7 @@ The `$emoji_skintone` associative array maps skin tone IDs to the variation sele echo "$emoji[smiling_face_with_open_mouth]$emoji_skintone[4]" ``` -Note that `$emoji_skintone` is an associative array, and its keys are the *names* of "Fitzpatrick Skin Type" groups, not linear indexes into a normal array. The names are `1_2`, `3`, `4`, `5`, and `6`. (Types 1 and 2 are combined into a single color.) See the [Diversity section in Unicode TR 51](http://www.unicode.org/reports/tr51/index.html#Diversity) for details. +Note that `$emoji_skintone` is an associative array, and its keys are the *names* of "Fitzpatrick Skin Type" groups, not linear indexes into a normal array. The names are `1_2`, `3`, `4`, `5`, and `6`. (Types 1 and 2 are combined into a single color.) See the [Diversity section in Unicode TR 51](https://www.unicode.org/reports/tr51/index.html#Diversity) for details. ## TODO @@ -130,6 +130,6 @@ This does *not* mean that it should use Gemoji at run time. None of the `zsh` pl #### ZWJ combining function -One of the newer features of Unicode emoji is the ability to use the "Zero-Width Joiner" character to compose multiple emoji characters in to a single "emoji ligature" glyph. For example, this is [how Apple supports "family" emoji with various genders and skin tones](http://www.unicode.org/reports/tr51/index.html#ZWJ_Sequences). +One of the newer features of Unicode emoji is the ability to use the "Zero-Width Joiner" character to compose multiple emoji characters in to a single "emoji ligature" glyph. For example, this is [how Apple supports "family" emoji with various genders and skin tones](https://www.unicode.org/reports/tr51/index.html#ZWJ_Sequences). These are a pain to write out (and probably worse to read), and it might be convenient to have a couple functions for concisely composing them, if wider support for them appears. diff --git a/plugins/emoji/emoji-data.txt b/plugins/emoji/emoji-data.txt index 7b4c015f7..2d6d64e2b 100644 --- a/plugins/emoji/emoji-data.txt +++ b/plugins/emoji/emoji-data.txt @@ -17,7 +17,7 @@ # none: not applicable # Field 4 — Emoji_Sources: # one or more values from {z, a, j, w, x} -# see the key in http://www.unicode.org/draft/reports/tr51/tr51.html#Major_Sources +# see the key in https://www.unicode.org/draft/reports/tr51/tr51.html#Major_Sources # NA: not applicable # Comment — currently contains the version where the character was first encoded, # followed by: @@ -1200,7 +1200,7 @@ 1F1F2 1F1ED ; emoji ; L2 ; none ; x # V6.0 (🇲🇭) flag for Marshall Islands 1F1F2 1F1F0 ; emoji ; L2 ; none ; x # V6.0 (🇲🇰) flag for Macedonia 1F1F2 1F1F1 ; emoji ; L2 ; none ; x # V6.0 (🇲🇱) flag for Mali -1F1F2 1F1F2 ; emoji ; L2 ; none ; x # V6.0 (🇲🇲) flag for Myanmar +1F1F2 1F1F2 ; emoji ; L2 ; none ; x # V6.0 (🇲🇲) flag for Myanmar 1F1F2 1F1F3 ; emoji ; L2 ; none ; x # V6.0 (🇲🇳) flag for Mongolia 1F1F2 1F1F4 ; emoji ; L2 ; none ; x # V6.0 (🇲🇴) flag for Macau 1F1F2 1F1F5 ; emoji ; L2 ; none ; x # V6.0 (🇲🇵) flag for Northern Mariana Islands diff --git a/plugins/emoji/update_emoji.pl b/plugins/emoji/update_emoji.pl index 04f3ce8e7..8034052b7 100644 --- a/plugins/emoji/update_emoji.pl +++ b/plugins/emoji/update_emoji.pl @@ -5,15 +5,15 @@ # This script generates the emoji.plugin.zsh emoji definitions from the Unicode # character data for the emoji characters. # -# The data file can be found at http://unicode.org/Public/emoji/latest/emoji-data.txt -# as referenced in Unicode TR51 (http://www.unicode.org/reports/tr51/index.html). +# The data file can be found at https://unicode.org/Public/emoji/latest/emoji-data.txt +# as referenced in Unicode TR51 (https://www.unicode.org/reports/tr51/index.html). # # This is known to work with the data file from version 1.0. It may not work with later # versions if the format changes. In particular, this reads line comments to get the # emoji character name and unicode version. # # Country names have punctuation and other non-letter characters removed from their name, -# to avoid possible complications with having to escape the strings when using them as +# to avoid possible complications with having to escape the strings when using them as # array subscripts. The definition file seems to use some combining characters like accents # that get stripped during this process. @@ -41,7 +41,7 @@ sub process_emoji_data_file { # # This contains the definition for: # \$emoji - which maps character names to Unicode characters -# \$emoji_flags - maps country names to Unicode flag characters using region indicators +# \$emoji_flags - maps country names to Unicode flag characters using region indicators # Main emoji typeset -gAH emoji @@ -63,7 +63,7 @@ typeset -gAH emoji_mod next if /^\s*#/ or /^\s*$/; if (/^(\S.*?\S)\s*;\s*(\w+)\s*;\s*(\w+)\s*;\s*(\w+)\s*;\s*(\w.*?)\s*#\s*V(\S+)\s\(.*?\)\s*(\w.*\S)\s*$/) { - my ($code, $style, $level, $modifier_status, $sources, $version, $keycap_name) + my ($code, $style, $level, $modifier_status, $sources, $version, $keycap_name) = ($1, $2, $3, $4, $5, $6, $7); #print "code=$code style=$style level=$level modifier_status=$modifier_status sources=$sources version=$version name=$keycap_name\n"; my @code_points = split /\s+/, $code; @@ -84,7 +84,7 @@ typeset -gAH emoji_mod if ($flag_country) { $outfh->print("emoji_flags[$zsh_flag_country]=\$'$zsh_code'\n"); } else { - $outfh->print("emoji[$omz_name]=\$'$zsh_code'\n"); + $outfh->print("emoji[$omz_name]=\$'$zsh_code'\n"); } # Modifiers are included in both the main set and their separate map, # because they have a standalone representation as a color swatch. diff --git a/plugins/forklift/README.md b/plugins/forklift/README.md index 6c5cbab23..6c4ce1e81 100644 --- a/plugins/forklift/README.md +++ b/plugins/forklift/README.md @@ -4,7 +4,7 @@ Plugin for ForkLift, an FTP application for OS X. ### Requirements -* [ForkLift](http://www.binarynights.com/forklift/) +* [ForkLift](https://binarynights.com/) ### Usage diff --git a/plugins/frontend-search/README.md b/plugins/frontend-search/README.md index 4d956e38f..f06e79102 100644 --- a/plugins/frontend-search/README.md +++ b/plugins/frontend-search/README.md @@ -35,13 +35,13 @@ Available search contexts are: | angularjs | `https://google.com/search?as_sitesearch=angularjs.org&as_q=` | | aurajs | `http://aurajs.com/api/#stq=` | | bem | `https://google.com/search?as_sitesearch=bem.info&as_q=` | -| bootsnipp | `http://bootsnipp.com/search?q=` | -| caniuse | `http://caniuse.com/#search=` | -| codepen | `http://codepen.io/search?q=` | +| bootsnipp | `https://bootsnipp.com/search?q=` | +| caniuse | `https://caniuse.com/#search=` | +| codepen | `https://codepen.io/search?q=` | | compassdoc | `http://compass-style.org/search?q=` | | cssflow | `http://www.cssflow.com/search?q=` | | dartlang | `https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:` | -| emberjs | `http://emberjs.com/api/#stp=1&stq=` | +| emberjs | `https://emberjs.com/api/#stp=1&stq=` | | fontello | `http://fontello.com/#search=` | | html5please | `http://html5please.com/#` | | jquery | `https://api.jquery.com/?s=` | @@ -51,7 +51,7 @@ Available search contexts are: | qunit | `https://api.qunitjs.com/?s=` | | reactjs | `https://google.com/search?as_sitesearch=facebook.github.io/react&as_q=` | | smacss | `https://google.com/search?as_sitesearch=smacss.com&as_q=` | -| stackoverflow | `http://stackoverflow.com/search?q=` | +| stackoverflow | `https://stackoverflow.com/search?q=` | | unheap | `http://www.unheap.com/?s=` | If you want to have another context, open an Issue and tell us! @@ -62,4 +62,4 @@ If you want to have another context, open an Issue and tell us! **Wilson Mendes (willmendesneto)** + + -+ ++ diff --git a/plugins/frontend-search/frontend-search.plugin.zsh b/plugins/frontend-search/frontend-search.plugin.zsh index 3fd49ab8e..14877fb0d 100644 --- a/plugins/frontend-search/frontend-search.plugin.zsh +++ b/plugins/frontend-search/frontend-search.plugin.zsh @@ -29,13 +29,13 @@ function frontend() { angularjs 'https://google.com/search?as_sitesearch=angularjs.org&as_q=' aurajs 'http://aurajs.com/api/#stq=' bem 'https://google.com/search?as_sitesearch=bem.info&as_q=' - bootsnipp 'http://bootsnipp.com/search?q=' - caniuse 'http://caniuse.com/#search=' - codepen 'http://codepen.io/search?q=' + bootsnipp 'https://bootsnipp.com/search?q=' + caniuse 'https://caniuse.com/#search=' + codepen 'https://codepen.io/search?q=' compassdoc 'http://compass-style.org/search?q=' cssflow 'http://www.cssflow.com/search?q=' dartlang 'https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:' - emberjs 'http://emberjs.com/api/#stp=1&stq=' + emberjs 'https://emberjs.com/api/#stp=1&stq=' fontello 'http://fontello.com/#search=' html5please 'http://html5please.com/#' jquery 'https://api.jquery.com/?s=' @@ -45,7 +45,7 @@ function frontend() { qunit 'https://api.qunitjs.com/?s=' reactjs 'https://google.com/search?as_sitesearch=facebook.github.io/react&as_q=' smacss 'https://google.com/search?as_sitesearch=smacss.com&as_q=' - stackoverflow 'http://stackoverflow.com/search?q=' + stackoverflow 'https://stackoverflow.com/search?q=' unheap 'http://www.unheap.com/?s=' ) diff --git a/plugins/geeknote/README.md b/plugins/geeknote/README.md index a6b50e27f..3f2353112 100644 --- a/plugins/geeknote/README.md +++ b/plugins/geeknote/README.md @@ -1,6 +1,6 @@ ## ZSH-Geeknote -[Geeknote](https://github.com/VitaliyRodnenko/geeknote) plugin for [oh-my-zsh framework](http://github.com/robbyrussell/oh-my-zsh). +[Geeknote](https://github.com/VitaliyRodnenko/geeknote) plugin for oh-my-zsh. Plugins provides: diff --git a/plugins/git-extras/README.md b/plugins/git-extras/README.md index 8f12e297e..987f0d800 100644 --- a/plugins/git-extras/README.md +++ b/plugins/git-extras/README.md @@ -1,6 +1,6 @@ # git-extras -This plugin provides completion definitions for some of the commands defined by [git-extras](http://github.com/tj/git-extras). +This plugin provides completion definitions for some of the commands defined by [git-extras](https://github.com/tj/git-extras). ## Setup notes diff --git a/plugins/git-extras/git-extras.plugin.zsh b/plugins/git-extras/git-extras.plugin.zsh index 0dcd630e8..afc1679cc 100644 --- a/plugins/git-extras/git-extras.plugin.zsh +++ b/plugins/git-extras/git-extras.plugin.zsh @@ -2,7 +2,7 @@ # Description # ----------- # -# Completion script for git-extras (http://github.com/tj/git-extras). +# Completion script for git-extras (https://github.com/tj/git-extras). # # This depends on and reuses some of the internals of the _git completion # function that ships with zsh itself. It will not work with the _git that ships @@ -19,8 +19,8 @@ # Inspirations # ----------- # -# * git-extras (http://github.com/tj/git-extras) -# * git-flow-completion (http://github.com/bobthecow/git-flow-completion) +# * git-extras (https://github.com/tj/git-extras) +# * git-flow-completion (https://github.com/bobthecow/git-flow-completion) # # ------------------------------------------------------------------------------ diff --git a/plugins/git-flow-avh/git-flow-avh.plugin.zsh b/plugins/git-flow-avh/git-flow-avh.plugin.zsh index 1f3fa1e28..db8b5ff89 100755 --- a/plugins/git-flow-avh/git-flow-avh.plugin.zsh +++ b/plugins/git-flow-avh/git-flow-avh.plugin.zsh @@ -5,8 +5,8 @@ # # To achieve git-flow completion nirvana: # -# 0. Update your zsh's git-completion module to the newest verion. -# From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD +# 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: # diff --git a/plugins/git-hubflow/git-hubflow.plugin.zsh b/plugins/git-hubflow/git-hubflow.plugin.zsh index b0157c7a1..8d968229f 100644 --- a/plugins/git-hubflow/git-hubflow.plugin.zsh +++ b/plugins/git-hubflow/git-hubflow.plugin.zsh @@ -6,7 +6,7 @@ # To achieve git-hubflow completion nirvana: # # 0. Update your zsh's git-completion module to the newest version. -# From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD +# From here: https://github.com/zsh-users/zsh/blob/master/Completion/Unix/Command/_git # # 1. Install this file. Either: # diff --git a/plugins/git-prompt/git-prompt.plugin.zsh b/plugins/git-prompt/git-prompt.plugin.zsh index 5175bf70f..2776f297f 100644 --- a/plugins/git-prompt/git-prompt.plugin.zsh +++ b/plugins/git-prompt/git-prompt.plugin.zsh @@ -1,5 +1,5 @@ # ZSH Git Prompt Plugin from: -# http://github.com/olivierverdier/zsh-git-prompt +# https://github.com/olivierverdier/zsh-git-prompt __GIT_PROMPT_DIR="${0:A:h}" diff --git a/plugins/github/README.md b/plugins/github/README.md index fea607876..2b66e390f 100644 --- a/plugins/github/README.md +++ b/plugins/github/README.md @@ -11,14 +11,14 @@ This plugin supports working with GitHub from the command line. It provides a fe * `empty_gh` - Creates a new empty repo (with a `README.md`) and pushes it to GitHub * `new_gh` - Initializes an existing directory as a repo and pushes it to GitHub * `exist_gh` - Takes an existing repo and pushes it to GitHub -* `git.io` - Shortens a URL using [git.io](http://git.io) +* `git.io` - Shortens a URL using [git.io](https://git.io) ## Installation -[Hub](http://github.com/github/hub) needs to be installed if you want to use it. On OS X with Homebrew, this can be done with `brew install hub`. The `hub` completion definition needs to be added to your `$FPATH` before initializing OMZ. +[Hub](https://github.com/github/hub) needs to be installed if you want to use it. On OS X with Homebrew, this can be done with `brew install hub`. The `hub` completion definition needs to be added to your `$FPATH` before initializing OMZ. -The [`github` Ruby gem](http://github.com/defunkt/github-gem) needs to be installed if you want to use it. +The [`github` Ruby gem](https://github.com/defunkt/github-gem) needs to be installed if you want to use it. ### Configuration diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh index 077f07bd4..fd19fb524 100644 --- a/plugins/github/github.plugin.zsh +++ b/plugins/github/github.plugin.zsh @@ -1,4 +1,4 @@ -# Set up hub wrapper for git, if it is available; http://github.com/github/hub +# Set up hub wrapper for git, if it is available; https://github.com/github/hub if (( $+commands[hub] )); then alias git=hub fi @@ -63,7 +63,7 @@ exist_gh() { # [DIRECTORY] # git.io "GitHub URL" # # Shorten GitHub url, example: -# https://github.com/nvogel/dotzsh > http://git.io/8nU25w +# https://github.com/nvogel/dotzsh > https://git.io/8nU25w # source: https://github.com/nvogel/dotzsh # documentation: https://github.com/blog/985-git-io-github-url-shortener # diff --git a/plugins/globalias/README.md b/plugins/globalias/README.md index ba9888ccb..0b064105d 100644 --- a/plugins/globalias/README.md +++ b/plugins/globalias/README.md @@ -2,7 +2,7 @@ Expands all glob expressions, subcommands and aliases (including global). -Idea from: http://blog.patshead.com/2012/11/automatically-expaning-zsh-global-aliases---simplified.html. +Idea from: https://blog.patshead.com/2012/11/automatically-expaning-zsh-global-aliases---simplified.html. ## Usage diff --git a/plugins/hanami/README.md b/plugins/hanami/README.md index ef3451faf..3ac8defbb 100644 --- a/plugins/hanami/README.md +++ b/plugins/hanami/README.md @@ -1,12 +1,12 @@ # Hanami Plugin # -This plugin adds convenient ways to work with [Hanami](http://hanamirb.org/) via console. +This plugin adds convenient ways to work with [Hanami](https://hanamirb.org/) via console. It's inspired by Rails plugin, so if you've used it, you'll feel like home. ## Usage ## For example, type `hc` into your console when you're within Hanami project directory to run the application console. Have a look at available shortcuts below. You can read more about -these commands [on the official website](http://hanamirb.org/guides/command-line/applications/). +these commands [on the official website](https://hanamirb.org/guides/command-line/applications/). ## Aliases ## diff --git a/plugins/history-substring-search/README.md b/plugins/history-substring-search/README.md index 0c02e91b1..7fb0fa0b6 100644 --- a/plugins/history-substring-search/README.md +++ b/plugins/history-substring-search/README.md @@ -6,9 +6,9 @@ feature, where you can type in any part of any previously entered command and press the UP and DOWN arrow keys to cycle through the matching commands. You can also use K and J in VI mode or ^P and ^N in EMACS mode for the same. -[1]: http://fishshell.com -[2]: http://www.zsh.org/mla/users/2009/msg00818.html -[3]: http://sourceforge.net/projects/fizsh/ +[1]: https://fishshell.com +[2]: https://www.zsh.org/mla/users/2009/msg00818.html +[3]: https://sourceforge.net/projects/fizsh/ [4]: https://github.com/robbyrussell/oh-my-zsh/pull/215 [5]: https://github.com/zsh-users/zsh-history-substring-search [6]: https://github.com/zsh-users/zsh-syntax-highlighting diff --git a/plugins/httpie/README.md b/plugins/httpie/README.md index 1d4ec48bd..56aa6a8ca 100644 --- a/plugins/httpie/README.md +++ b/plugins/httpie/README.md @@ -1,6 +1,6 @@ ## HTTPie **Maintainer:** [lululau](https://github.com/lululau) -This plugin adds completion for HTTPie, which is a command line HTTP client, a user-friendly cURL replacement. +This plugin adds completion for HTTPie, which is a command line HTTP client, a user-friendly cURL replacement. -[HTTPie Homepage](http://httpie.org) +[HTTPie Homepage](https://httpie.org) diff --git a/plugins/jake-node/jake-node.plugin.zsh b/plugins/jake-node/jake-node.plugin.zsh index a9eef4029..3b692f899 100644 --- a/plugins/jake-node/jake-node.plugin.zsh +++ b/plugins/jake-node/jake-node.plugin.zsh @@ -3,7 +3,7 @@ # Warning : Jakefile should have the right case : Jakefile or jakefile # Tested on : MacOSX 10.7 (Lion), Ubuntu 11.10 # Author : Alexandre Lacheze (@al3xstrat) -# Inspiration : http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh +# Inspiration : https://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh function _jake () { if [ -f Jakefile ]||[ -f jakefile ]; then @@ -11,4 +11,4 @@ function _jake () { fi } -compdef _jake jake \ No newline at end of file +compdef _jake jake diff --git a/plugins/kitchen/_kitchen b/plugins/kitchen/_kitchen index dee5c5809..29a3125e4 100644 --- a/plugins/kitchen/_kitchen +++ b/plugins/kitchen/_kitchen @@ -1,6 +1,6 @@ #compdef kitchen # ------------------------------------------------------------------------------ -# Copyright (c) 2014 Github zsh-users - http://github.com/zsh-users +# Copyright (c) 2014 Github zsh-users - https://github.com/zsh-users # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -28,7 +28,7 @@ # Description # ----------- # -# Completion script for Test Kitchen (http://kitchen.ci/). +# Completion script for Test Kitchen (https://kitchen.ci/). # # ------------------------------------------------------------------------------ # Authors diff --git a/plugins/kube-ps1/kube-ps1.plugin.zsh b/plugins/kube-ps1/kube-ps1.plugin.zsh index fadef80d7..df7277a26 100644 --- a/plugins/kube-ps1/kube-ps1.plugin.zsh +++ b/plugins/kube-ps1/kube-ps1.plugin.zsh @@ -10,7 +10,7 @@ # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, diff --git a/plugins/lighthouse/lighthouse.plugin.zsh b/plugins/lighthouse/lighthouse.plugin.zsh index 48cddbccc..4a47b6010 100644 --- a/plugins/lighthouse/lighthouse.plugin.zsh +++ b/plugins/lighthouse/lighthouse.plugin.zsh @@ -1,7 +1,7 @@ # 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: http://screencast.com/t/ZDgwNDUwNT +# 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..." diff --git a/plugins/lol/lol.plugin.zsh b/plugins/lol/lol.plugin.zsh index e9a62a863..585f96e4f 100644 --- a/plugins/lol/lol.plugin.zsh +++ b/plugins/lol/lol.plugin.zsh @@ -1,5 +1,5 @@ # LOL!!1 -# Source: http://aur.archlinux.org/packages/lolbash/lolbash/lolbash.sh +# Source: https://aur.archlinux.org/packages/lolbash/lolbash/lolbash.sh alias wtf='dmesg' alias onoz='cat /var/log/errors.log' @@ -45,7 +45,7 @@ alias bringz='git pull' alias chicken='git add' alias oanward='git commit -m' alias ooanward='git commit -am' -alias yolo='git commit -m "$(curl -s whatthecommit.com/index.txt)"' +alias yolo='git commit -m "$(curl -s https://whatthecommit.com/index.txt)"' alias letcat='git checkout' alias violenz='git rebase' diff --git a/plugins/mix-fast/README.md b/plugins/mix-fast/README.md index 9a5eccc3f..644f12409 100644 --- a/plugins/mix-fast/README.md +++ b/plugins/mix-fast/README.md @@ -8,7 +8,7 @@ to update cache you should remove .mix_tasks file Inspired by and based on rake-fast zsh plugin. -This is entirely based on [this pull request by Ullrich Schäfer](https://github.com/robb/.dotfiles/pull/10/), which is inspired by [this Ruby on Rails trick from 2006](http://weblog.rubyonrails.org/2006/3/9/fast-mix-task-completion-for-zsh/). +This is entirely based on [this pull request by Ullrich Schäfer](https://github.com/robb/.dotfiles/pull/10/), which is inspired by [this Ruby on Rails trick from 2006](https://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh/). ## Installation @@ -25,4 +25,4 @@ You might consider adding `.mix_tasks` to your [global .gitignore](https://help. `mix`, then press tab -Currently maintained by [styx](https://github.com/styx/) \ No newline at end of file +Currently maintained by [styx](https://github.com/styx/) diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh index b7d6aca72..d99cf0b1e 100644 --- a/plugins/osx/osx.plugin.zsh +++ b/plugins/osx/osx.plugin.zsh @@ -241,7 +241,7 @@ if [[ ! -z "$playlist" ]]; then case "$state" in on|off) - # Inspired by: http://stackoverflow.com/a/14675583 + # Inspired by: https://stackoverflow.com/a/14675583 osascript 1>/dev/null 2>&1 <<-EOF tell application "System Events" to perform action "AXPress" of (menu item "${state}" of menu "Shuffle" of menu item "Shuffle" of menu "Controls" of menu bar item "Controls" of menu bar 1 of application process "iTunes" ) EOF diff --git a/plugins/osx/spotify b/plugins/osx/spotify index 69f6c5419..2ab98d3a0 100644 --- a/plugins/osx/spotify +++ b/plugins/osx/spotify @@ -408,7 +408,7 @@ while [ $# -gt 0 ]; do uri=`osascript -e 'tell application "Spotify" to spotify url of current track'`; remove='spotify:track:' url=${uri#$remove} - url="http://open.spotify.com/track/$url" + url="https://open.spotify.com/track/$url" if [ "$2" = "" ]; then cecho "Spotify URL: $url" diff --git a/plugins/pass/_pass b/plugins/pass/_pass index 7a9b1f955..715229e76 100644 --- a/plugins/pass/_pass +++ b/plugins/pass/_pass @@ -8,7 +8,7 @@ # All Rights Reserved. # # This file is licensed under the GPLv2+. -# Please visit http://git.zx2c4.com/password-store/tree/COPYING for more information. +# Please visit https://git.zx2c4.com/password-store/tree/COPYING for more information. # # Oh my zsh plugin maintainer: Santiago Borrazás diff --git a/plugins/per-directory-history/README.md b/plugins/per-directory-history/README.md index 196f74e6c..ea445d329 100644 --- a/plugins/per-directory-history/README.md +++ b/plugins/per-directory-history/README.md @@ -4,13 +4,13 @@ Per directory history for zsh, as well as global history, and the ability to toggle between them with ^G. -This is a implementation of per directory history for zsh, some -implementations of which exist in bash[1][],[2][]. It also implements -a per-directory-history-toggle-history function to change from using the -directory history to using the global history. In both cases the history is -always saved to both the global history and the directory history, so the -toggle state will not effect the saved histories. Being able to switch -between global and directory histories on the fly is a novel feature as far +This is a implementation of per directory history for zsh, some +implementations of which exist in bash[1][],[2][]. It also implements +a per-directory-history-toggle-history function to change from using the +directory history to using the global history. In both cases the history is +always saved to both the global history and the directory history, so the +toggle state will not effect the saved histories. Being able to switch +between global and directory histories on the fly is a novel feature as far as I am aware. This is a standalone repository for the script, however it is also included in @@ -34,7 +34,7 @@ Usage Configuration ------------------------------------------------------------------------------- -* HISTORY_BASE a global variable that defines the base directory in which the +* HISTORY_BASE a global variable that defines the base directory in which the directory histories are stored * per-directory-history-toggle-history is the function to toggle the history @@ -42,14 +42,14 @@ Configuration History ------------------------------------------------------------------------------- -The idea/inspiration for a per directory history is from [Stewart MacArthur][1] -and [Dieter][2], the implementation idea is from [Bart Schaefer][3]. The +The idea/inspiration for a per directory history is from [Stewart MacArthur][1] +and [Dieter][2], the implementation idea is from [Bart Schaefer][3]. The implementation is by [Jim Hester][5] in September 2012. [1]: http://www.compbiome.com/2010/07/bash-per-directory-bash-history.html [2]: http://dieter.plaetinck.be/per_directory_bash -[3]: http://www.zsh.org/mla/users/1997/msg00226.html +[3]: https://www.zsh.org/mla/users/1997/msg00226.html [4]: https://github.com/robbyrussell/oh-my-zsh [5]: http://jimhester.com -[6]: http://github.com/jimhester/per-directory-history +[6]: https://github.com/jimhester/per-directory-history diff --git a/plugins/per-directory-history/per-directory-history.zsh b/plugins/per-directory-history/per-directory-history.zsh index 1242dc420..53ad963e7 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]: http://www.zsh.org/mla/users/1997/msg00226.html +# [3]: https://www.zsh.org/mla/users/1997/msg00226.html # ################################################################################ # diff --git a/plugins/percol/README.md b/plugins/percol/README.md index 97cca6876..b262e414e 100644 --- a/plugins/percol/README.md +++ b/plugins/percol/README.md @@ -2,9 +2,6 @@ Provides some useful function to make [percol](https://github.com/mooz/percol) work with zsh history and [jump plugin](https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/jump/jump.plugin.zsh) -### Preview -![Preview](http://t1.qpic.cn/mblogpic/eb1c8f9d2b9f62d19fa8/2000.jpg) - ### Requirements ```shell diff --git a/plugins/perl/perl.plugin.zsh b/plugins/perl/perl.plugin.zsh index 1fbf7c122..678e88d97 100644 --- a/plugins/perl/perl.plugin.zsh +++ b/plugins/perl/perl.plugin.zsh @@ -21,7 +21,7 @@ alias pd='perldoc' alias ple='perl -wlne' # show the latest stable release of Perl -alias latest-perl='curl -s http://www.perl.org/get.html | perl -wlne '\''if (/perl\-([\d\.]+)\.tar\.gz/) { print $1; exit;}'\' +alias latest-perl='curl -s https://www.perl.org/get.html | perl -wlne '\''if (/perl\-([\d\.]+)\.tar\.gz/) { print $1; exit;}'\' diff --git a/plugins/pod/_pod b/plugins/pod/_pod index 508a47102..80d23daad 100644 --- a/plugins/pod/_pod +++ b/plugins/pod/_pod @@ -7,7 +7,7 @@ # ----------------------------------------------------------------------------- # FILE: _pod # DESCRIPTION: Cocoapods (0.33.1) autocomplete plugin for Oh-My-Zsh -# http://cocoapods.org +# https://cocoapods.org # Generated with `pod --completion-script # AUTHOR: Alexandre Joly (alexandre.joly@mekanics.ch) # GITHUB: https://github.com/mekanics diff --git a/plugins/pow/pow.plugin.zsh b/plugins/pow/pow.plugin.zsh index ded3336a7..0b8ccd15b 100644 --- a/plugins/pow/pow.plugin.zsh +++ b/plugins/pow/pow.plugin.zsh @@ -73,7 +73,7 @@ powed(){ } # Restart pow process -# taken from http://www.matthewratzloff.com/blog/2011/12/23/restarting-pow-when-dns-stops-responding +# taken from https://www.matthewratzloff.com repow(){ lsof | grep 20560 | awk '{print $2}' | xargs kill -9 launchctl unload ~/Library/LaunchAgents/cx.pow.powd.plist diff --git a/plugins/rake-fast/README.md b/plugins/rake-fast/README.md index 1417befa1..23cbd80fc 100644 --- a/plugins/rake-fast/README.md +++ b/plugins/rake-fast/README.md @@ -8,7 +8,7 @@ checks the file modification time to see if it needs to regenerate the cache file. This is entirely based on [this pull request by Ullrich Schäfer](https://github.com/robb/.dotfiles/pull/10/), -which is inspired by [this Ruby on Rails trick from 2006](http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh/). +which is inspired by [this Ruby on Rails trick from 2006](https://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh/). Think about that. 2006. diff --git a/plugins/repo/README.md b/plugins/repo/README.md index 0b77e6d48..4d9366adf 100644 --- a/plugins/repo/README.md +++ b/plugins/repo/README.md @@ -2,6 +2,6 @@ **Maintainer:** [Stibbons](https://github.com/Stibbons) This plugin mainly add support automatic completion for the repo command line tool: -http://code.google.com/p/git-repo/ +https://code.google.com/p/git-repo/ * `r` aliases `repo` diff --git a/plugins/safe-paste/safe-paste.plugin.zsh b/plugins/safe-paste/safe-paste.plugin.zsh index 17c212c19..75f1791d7 100644 --- a/plugins/safe-paste/safe-paste.plugin.zsh +++ b/plugins/safe-paste/safe-paste.plugin.zsh @@ -1,7 +1,7 @@ -# Code from Mikael Magnusson: http://www.zsh.org/mla/users/2011/msg00367.html +# Code from Mikael Magnusson: https://www.zsh.org/mla/users/2011/msg00367.html # # Requires xterm, urxvt, iTerm2 or any other terminal that supports bracketed -# paste mode as documented: http://www.xfree86.org/current/ctlseqs.html +# paste mode as documented: https://www.xfree86.org/current/ctlseqs.html # create a new keymap to use while pasting bindkey -N paste diff --git a/plugins/scala/_scala b/plugins/scala/_scala index 80434680c..f7511a647 100644 --- a/plugins/scala/_scala +++ b/plugins/scala/_scala @@ -1,6 +1,6 @@ #compdef scala scalac # ------------------------------------------------------------------------------ -# Copyright (c) 2012 Github zsh-users - http://github.com/zsh-users +# Copyright (c) 2012 Github zsh-users - https://github.com/zsh-users # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -28,7 +28,7 @@ # Description # ----------- # -# Completion script for scala and scalac (http://www.scala-lang.org/). +# Completion script for scala and scalac (https://www.scala-lang.org/). # # ------------------------------------------------------------------------------ # Authors diff --git a/plugins/scd/README.md b/plugins/scd/README.md index 86ab67203..8c156da1f 100644 --- a/plugins/scd/README.md +++ b/plugins/scd/README.md @@ -14,8 +14,8 @@ directory aliases, which appear as named directories in zsh session. ## INSTALLATION NOTES Besides oh-my-zsh, `scd` can be used with *bash*, *dash* or *tcsh* -shells and is also available as [Vim](http://www.vim.org/) plugin and -[IPython](http://ipython.org/) extension. For installation details, see +shells and is also available as [Vim](https://www.vim.org/) plugin and +[IPython](https://ipython.org/) extension. For installation details, see https://github.com/pavoljuhas/smart-change-directory. ## SYNOPSIS diff --git a/plugins/scw/_scw b/plugins/scw/_scw index f9fdf916e..0eb125c65 100644 --- a/plugins/scw/_scw +++ b/plugins/scw/_scw @@ -1,6 +1,6 @@ #compdef scw # -# zsh completion for scw (http://scaleway.com) +# zsh completion for scw (https://www.scaleway.com) # # Inspired by https://github.com/felixr/docker-zsh-completion diff --git a/plugins/shrink-path/README.md b/plugins/shrink-path/README.md index 51fa8a051..b990aea91 100644 --- a/plugins/shrink-path/README.md +++ b/plugins/shrink-path/README.md @@ -57,10 +57,10 @@ supported. Copyright (C) 2008 by Daniel Friesel -License: WTFPL +License: WTFPL -Ref: http://www.zsh.org/mla/workers/2009/msg00415.html - http://www.zsh.org/mla/workers/2009/msg00419.html +Ref: https://www.zsh.org/mla/workers/2009/msg00415.html + https://www.zsh.org/mla/workers/2009/msg00419.html ## Misc diff --git a/plugins/shrink-path/shrink-path.plugin.zsh b/plugins/shrink-path/shrink-path.plugin.zsh index 29e6f0deb..86102e651 100644 --- a/plugins/shrink-path/shrink-path.plugin.zsh +++ b/plugins/shrink-path/shrink-path.plugin.zsh @@ -24,10 +24,10 @@ # Keywords: prompt directory truncate shrink collapse fish # # Copyright (C) 2008 by Daniel Friesel -# License: WTFPL +# License: WTFPL # -# Ref: http://www.zsh.org/mla/workers/2009/msg00415.html -# http://www.zsh.org/mla/workers/2009/msg00419.html +# Ref: https://www.zsh.org/mla/workers/2009/msg00415.html +# https://www.zsh.org/mla/workers/2009/msg00419.html shrink_path () { setopt localoptions diff --git a/plugins/spring/README.md b/plugins/spring/README.md index 62bfd8013..816181326 100644 --- a/plugins/spring/README.md +++ b/plugins/spring/README.md @@ -10,16 +10,16 @@ oh-my-zsh Spring Boot plugin $ cd ~/.oh-my-zsh/plugins $ git clone git@github.com:linux-china/oh-my-zsh-spring-boot-plugin.git spring -Adjust your .zshrc file and add spring to plugins=(...) - -## Tips +Adjust your .zshrc file and add spring to plugins=(...) + +## Tips * Install Spring Cloud plugin: spring install org.springframework.cloud:spring-cloud-cli:1.0.2.RELEASE ## Reference -* Spring Boot: http://projects.spring.io/spring-boot/ -* Spring Boot CLI: http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#cli +* Spring Boot: https://spring.io/projects/spring-boot +* Spring Boot CLI: https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#cli Maintainer : linux_china ([@linux_china](https://twitter.com/linux_china)) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index fcc9004f8..e1c89b729 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -1,40 +1,40 @@ # Contributed and SLIGHTLY modded by Matt Parnell/ilikenwf # Created by the blogger at the URL below...I don't know where to find his/her name -# Original found at http://www.shellperson.net/sprunge-pastebin-script/ - +# Original found at https://www.shellperson.net/sprunge-pastebin-script/ + usage() { description | fmt -s >&2 } - + description() { cat << HERE - + DESCRIPTION Upload data and fetch URL from the pastebin http://sprunge.us - + USAGE $0 filename.txt $0 text string $0 < filename.txt piped_data | $0 - + NOTES -------------------------------------------------------------------------- * INPUT METHODS * $0 can accept piped data, STDIN redirection [ + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -671,7 +671,7 @@ the "copyright" line and a pointer to where the full notice is found. GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. @@ -690,11 +690,11 @@ might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see -. +. The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read -. +. diff --git a/themes/adben.zsh-theme b/themes/adben.zsh-theme index e4774cf0e..b9ac77d00 100644 --- a/themes/adben.zsh-theme +++ b/themes/adben.zsh-theme @@ -6,7 +6,7 @@ # # a) displaying a pseudo-random message from a database of quotations # # (https://en.wikipedia.org/wiki/Fortune_%28Unix%29) # # b) displaying randomly command line tips from The command line fu -# # (http://www.commandlinefu.com) community: in order to make use of this functionality +# # (https://www.commandlinefu.com) community: in order to make use of this functionality # # you will need Internet connection. # # This theme provides as well information for the current user's context, like; # # branch and status for the current version control system (git and svn currently @@ -23,11 +23,11 @@ # # optionally: # # -Oh-myzsh vcs plug-ins git and svn. # # -Solarized theme (https://github.com/altercation/solarized/) -# # -OS X: iTerm 2 (http://www.iterm2.com/) +# # -OS X: iTerm 2 (https://iterm2.com/) # # -font Source code pro (https://github.com/adobe/source-code-pro) # # # # This theme's look and feel is based on the Aaron Toponce's zsh theme, more info: -# # http://pthree.org/2008/11/23/727/ +# # https://pthree.org/2008/11/23/727/ # # enjoy! ########## COLOR ########### for COLOR in CYAN WHITE YELLOW MAGENTA BLACK BLUE RED DEFAULT GREEN GREY; do diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index b0a794f4d..d91f98735 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -13,7 +13,7 @@ # # In addition, I recommend the # [Solarized theme](https://github.com/altercation/solarized/) and, if you're -# using it on Mac OS X, [iTerm 2](http://www.iterm2.com/) over Terminal.app - +# using it on Mac OS X, [iTerm 2](https://iterm2.com/) over Terminal.app - # it has significantly better color fidelity. # # # Goals diff --git a/themes/arrow.zsh-theme b/themes/arrow.zsh-theme index d62dcdcb9..a3e77d65d 100644 --- a/themes/arrow.zsh-theme +++ b/themes/arrow.zsh-theme @@ -8,7 +8,7 @@ ZSH_THEME_GIT_PROMPT_SUFFIX="" ZSH_THEME_GIT_PROMPT_DIRTY="*" ZSH_THEME_GIT_PROMPT_CLEAN="" -# See http://geoff.greer.fm/lscolors/ +# See https://geoff.greer.fm/lscolors/ export LSCOLORS="exfxcxdxbxbxbxbxbxbxbx" export LS_COLORS="di=34;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=31;40:cd=31;40:su=31;40:sg=31;40:tw=31;40:ow=31;40:" diff --git a/themes/avit.zsh-theme b/themes/avit.zsh-theme index c43fcc9fe..cf439f757 100644 --- a/themes/avit.zsh-theme +++ b/themes/avit.zsh-theme @@ -102,7 +102,7 @@ ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}" ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}" ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[white]%}" -# LS colors, made with http://geoff.greer.fm/lscolors/ +# LS colors, made with https://geoff.greer.fm/lscolors/ export LSCOLORS="exfxcxdxbxegedabagacad" export LS_COLORS='di=34;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=34;46:cd=34;43:su=0;41:sg=0;46:tw=0;42:ow=0;43:' export GREP_COLOR='1;33' diff --git a/themes/bira.zsh-theme b/themes/bira.zsh-theme index 29bda0be8..675483996 100644 --- a/themes/bira.zsh-theme +++ b/themes/bira.zsh-theme @@ -1,4 +1,4 @@ -# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png +# ZSH Theme - Preview: https://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" diff --git a/themes/clean.zsh-theme b/themes/clean.zsh-theme index 7ee29cb8c..5c96e4726 100644 --- a/themes/clean.zsh-theme +++ b/themes/clean.zsh-theme @@ -9,6 +9,6 @@ ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[blue]%})%{$reset_color%} " ZSH_THEME_GIT_PROMPT_CLEAN="" ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}✗" -# LS colors, made with http://geoff.greer.fm/lscolors/ +# LS colors, made with https://geoff.greer.fm/lscolors/ export LSCOLORS="Gxfxcxdxbxegedabagacad" export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' diff --git a/themes/duellj.zsh-theme b/themes/duellj.zsh-theme index 3849c35be..f70b39bc3 100644 --- a/themes/duellj.zsh-theme +++ b/themes/duellj.zsh-theme @@ -1,6 +1,6 @@ # user, host, full path, and time/date # on two lines for easier vgrepping -# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 +# entry in a nice long thread on the Arch Linux forums: https://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;34m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}%!%{\e[0;34m%}%B]%b%{\e[0m%} %{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B]%{\e[0m%}%b ' RPROMPT='[%*]' diff --git a/themes/funky.zsh-theme b/themes/funky.zsh-theme index 2451296d9..574538f88 100644 --- a/themes/funky.zsh-theme +++ b/themes/funky.zsh-theme @@ -1,5 +1,5 @@ # Taken from Tassilo's Blog -# http://tsdh.wordpress.com/2007/12/06/my-funky-zsh-prompt/ +# https://tsdh.wordpress.com/2007/12/06/my-funky-zsh-prompt/ local blue_op="%{$fg[blue]%}[%{$reset_color%}" local blue_cp="%{$fg[blue]%}]%{$reset_color%}" @@ -11,4 +11,4 @@ local smiley="%(?,%{$fg[green]%}:%)%{$reset_color%},%{$fg[red]%}:(%{$reset_color PROMPT="╭─${path_p}─${user_host}─${ret_status}─${hist_no} ╰─${blue_op}${smiley}${blue_cp} %# " local cur_cmd="${blue_op}%_${blue_cp}" -PROMPT2="${cur_cmd}> " \ No newline at end of file +PROMPT2="${cur_cmd}> " diff --git a/themes/gnzh.zsh-theme b/themes/gnzh.zsh-theme index 04b0450a8..c763ef3c6 100644 --- a/themes/gnzh.zsh-theme +++ b/themes/gnzh.zsh-theme @@ -1,4 +1,3 @@ -# ZSH Theme - Preview: http://dl.dropbox.com/u/4109351/pics/gnzh-zsh-theme.png # Based on bira theme setopt prompt_subst diff --git a/themes/half-life.zsh-theme b/themes/half-life.zsh-theme index 8b458cde9..c79027ed6 100644 --- a/themes/half-life.zsh-theme +++ b/themes/half-life.zsh-theme @@ -1,11 +1,11 @@ # prompt style and colors based on Steve Losh's Prose theme: -# http://github.com/sjl/oh-my-zsh/blob/master/themes/prose.zsh-theme +# https://github.com/sjl/oh-my-zsh/blob/master/themes/prose.zsh-theme # # vcs_info modifications from Bart Trojanowski's zsh prompt: # http://www.jukie.net/bart/blog/pimping-out-zsh-prompt # # git untracked files modification from Brian Carper: -# http://briancarper.net/blog/570/git-info-in-your-zsh-prompt +# https://briancarper.net/blog/570/git-info-in-your-zsh-prompt function virtualenv_info { [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' diff --git a/themes/itchy.zsh-theme b/themes/itchy.zsh-theme index c23889edf..e1f2d56e2 100644 --- a/themes/itchy.zsh-theme +++ b/themes/itchy.zsh-theme @@ -1,5 +1,3 @@ -# Inspired by http://peepcode.com/blog/2012/my-command-line-prompt - local smiley="%(?,%{$fg[green]%}☺%{$reset_color%},%{$fg[red]%}☹%{$reset_color%})" local user="%{$fg[cyan]%}%n%{$reset_color%}" diff --git a/themes/jreese.zsh-theme b/themes/jreese.zsh-theme index 0fa6b4ecd..de42a1010 100644 --- a/themes/jreese.zsh-theme +++ b/themes/jreese.zsh-theme @@ -1,5 +1,3 @@ -# ZSH Theme - Preview: http://dl.dropbox.com/u/1552408/Screenshots/2010-04-08-oh-my-zsh.png - if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" diff --git a/themes/lambda.zsh-theme b/themes/lambda.zsh-theme index 63292d331..6e67773ea 100644 --- a/themes/lambda.zsh-theme +++ b/themes/lambda.zsh-theme @@ -1,5 +1,3 @@ -# ZSH Theme - Preview: http://cl.ly/350F0F0k1M2y3A2i3p1S - PROMPT='λ %~/ $(git_prompt_info)%{$reset_color%}' ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}" diff --git a/themes/lukerandall.zsh-theme b/themes/lukerandall.zsh-theme index f4045bd8e..cdecd284f 100644 --- a/themes/lukerandall.zsh-theme +++ b/themes/lukerandall.zsh-theme @@ -1,4 +1,4 @@ -# ZSH Theme - Preview: http://cl.ly/f701d00760f8059e06dc +# ZSH Theme - Preview: https://cl.ly/f701d00760f8059e06dc # Thanks to gallifrey, upon whose theme this is based local return_code="%(?..%{$fg_bold[red]%}%? ↵%{$reset_color%})" diff --git a/themes/macovsky-ruby.zsh-theme b/themes/macovsky-ruby.zsh-theme index 69d80d588..abda6232c 100644 --- a/themes/macovsky-ruby.zsh-theme +++ b/themes/macovsky-ruby.zsh-theme @@ -1,4 +1,4 @@ -# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png +# ZSH Theme - Preview: https://i.gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" if [ -e ~/.rvm/bin/rvm-prompt ]; then diff --git a/themes/macovsky.zsh-theme b/themes/macovsky.zsh-theme index 2e6dce42d..d3f7d16b4 100644 --- a/themes/macovsky.zsh-theme +++ b/themes/macovsky.zsh-theme @@ -1,4 +1,4 @@ -# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png +# ZSH Theme - Preview: https://i.gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" if [ -e ~/.rvm/bin/rvm-prompt ]; then diff --git a/themes/mh.zsh-theme b/themes/mh.zsh-theme index 34a3765b1..2b2cc9b68 100644 --- a/themes/mh.zsh-theme +++ b/themes/mh.zsh-theme @@ -1,5 +1,5 @@ # mh theme -# preview: http://cl.ly/1y2x0W0E3t2C0F29043z +# preview: https://cl.ly/1y2x0W0E3t2C0F29043z # features: # path is autoshortened to ~30 characters @@ -19,6 +19,6 @@ ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[gray]%})%{$reset_color%} " ZSH_THEME_GIT_PROMPT_CLEAN="" ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}✱" -# LS colors, made with http://geoff.greer.fm/lscolors/ +# LS colors, made with https://geoff.greer.fm/lscolors/ export LSCOLORS="Gxfxcxdxbxegedabagacad" export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' diff --git a/themes/michelebologna.zsh-theme b/themes/michelebologna.zsh-theme index 110e3f203..7ff6a7ffe 100644 --- a/themes/michelebologna.zsh-theme +++ b/themes/michelebologna.zsh-theme @@ -1,16 +1,16 @@ # Michele Bologna's theme -# http://michelebologna.net +# https://www.michelebologna.net # # This a theme for oh-my-zsh. Features a colored prompt with: -# * username@host: [jobs] [git] workdir % -# * hostname color is based on hostname characters. When using as root, the +# * username@host: [jobs] [git] workdir % +# * hostname color is based on hostname characters. When using as root, the # prompt shows only the hostname in red color. # * [jobs], if applicable, counts the number of suspended jobs tty # * [git], if applicable, represents the status of your git repo (more on that # later) # * '%' prompt will be green if last command return value is 0, yellow otherwise. -# -# git prompt is inspired by official git contrib prompt: +# +# git prompt is inspired by official git contrib prompt: # https://github.com/git/git/tree/master/contrib/completion/git-prompt.sh # and it adds: # * the current branch diff --git a/themes/mikeh.zsh-theme b/themes/mikeh.zsh-theme index a95383ba5..f231b91bb 100644 --- a/themes/mikeh.zsh-theme +++ b/themes/mikeh.zsh-theme @@ -15,7 +15,7 @@ mikeh_precmd() { # user, host, full path, and time/date # on two lines for easier vgrepping -# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 +# entry in a nice long thread on the Arch Linux forums: https://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 PROMPT=$'%{\e[0;34m%}%B..[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%a %b %d, %I:%M"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} %{\e[0;34m%}%B..%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <($vcs_info_msg_0_)>%{\e[0m%}%b ' -PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' \ No newline at end of file +PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' diff --git a/themes/philips.zsh-theme b/themes/philips.zsh-theme index f6e5b324e..fec734bad 100644 --- a/themes/philips.zsh-theme +++ b/themes/philips.zsh-theme @@ -9,6 +9,6 @@ ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[blue]%})%{$reset_color%} " ZSH_THEME_GIT_PROMPT_CLEAN="" ZSH_THEME_GIT_PROMPT_DIRTY="*" -# LS colors, made with http://geoff.greer.fm/lscolors/ +# LS colors, made with https://geoff.greer.fm/lscolors/ export LSCOLORS="Gxfxcxdxbxegedabagacad" export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:*.patch=00;34:*.o=00;32:*.so=01;35:*.ko=01;31:*.la=00;33' diff --git a/themes/pmcgee.zsh-theme b/themes/pmcgee.zsh-theme index e4e45c71a..58a9b8bef 100644 --- a/themes/pmcgee.zsh-theme +++ b/themes/pmcgee.zsh-theme @@ -11,6 +11,6 @@ ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " ZSH_THEME_GIT_PROMPT_CLEAN="" ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}*" -# LS colors, made with http://geoff.greer.fm/lscolors/ +# LS colors, made with https://geoff.greer.fm/lscolors/ export LSCOLORS="Gxfxcxdxbxegedabagacad" export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' diff --git a/themes/rkj.zsh-theme b/themes/rkj.zsh-theme index fe06161c8..d7c9314e3 100644 --- a/themes/rkj.zsh-theme +++ b/themes/rkj.zsh-theme @@ -1,6 +1,6 @@ # user, host, full path, and time/date # on two lines for easier vgrepping -# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 +# entry in a nice long thread on the Arch Linux forums: https://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 function retcode() {} diff --git a/themes/sorin.zsh-theme b/themes/sorin.zsh-theme index ac6a49840..e478d2672 100644 --- a/themes/sorin.zsh-theme +++ b/themes/sorin.zsh-theme @@ -1,10 +1,10 @@ # sorin.zsh-theme -# screenshot: http://i.imgur.com/aipDQ.png +# screenshot: https://i.imgur.com/aipDQ.png if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}" local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}" - + PROMPT='%{$fg[cyan]%}%c$(git_prompt_info) %(!.%{$fg_bold[red]%}#.%{$fg_bold[green]%}❯)%{$reset_color%} ' ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[blue]%}git%{$reset_color%}:%{$fg[red]%}" @@ -20,10 +20,10 @@ if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜" ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═" ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" -else +else MODE_INDICATOR="❮❮❮" local return_status="%(?::⏎)" - + PROMPT='%c$(git_prompt_info) %(!.#.❯) ' ZSH_THEME_GIT_PROMPT_PREFIX=" git:" diff --git a/themes/sporty_256.zsh-theme b/themes/sporty_256.zsh-theme index db0fc4277..e008a8664 100644 --- a/themes/sporty_256.zsh-theme +++ b/themes/sporty_256.zsh-theme @@ -1,6 +1,6 @@ # zsh theme requires 256 color enabled terminal # i.e TERM=xterm-256color -# Preview - http://www.flickr.com/photos/adelcampo/4556482563/sizes/o/ +# Preview - https://www.flickr.com/photos/adelcampo/4556482563/sizes/o/ # based on robbyrussell's shell but louder! PROMPT='%{$fg_bold[blue]%}$(git_prompt_info) %F{208}%c%f diff --git a/themes/steeef.zsh-theme b/themes/steeef.zsh-theme index 622c90465..3532d3bc7 100644 --- a/themes/steeef.zsh-theme +++ b/themes/steeef.zsh-theme @@ -1,11 +1,11 @@ # prompt style and colors based on Steve Losh's Prose theme: -# http://github.com/sjl/oh-my-zsh/blob/master/themes/prose.zsh-theme +# https://github.com/sjl/oh-my-zsh/blob/master/themes/prose.zsh-theme # # vcs_info modifications from Bart Trojanowski's zsh prompt: # http://www.jukie.net/bart/blog/pimping-out-zsh-prompt # # git untracked files modification from Brian Carper: -# http://briancarper.net/blog/570/git-info-in-your-zsh-prompt +# https://briancarper.net/blog/570/git-info-in-your-zsh-prompt export VIRTUAL_ENV_DISABLE_PROMPT=1 diff --git a/themes/sunaku.zsh-theme b/themes/sunaku.zsh-theme index 440fa90b4..77f3acc7b 100644 --- a/themes/sunaku.zsh-theme +++ b/themes/sunaku.zsh-theme @@ -1,5 +1,4 @@ # Git-centric variation of the "fishy" theme. -# See screenshot at http://ompldr.org/vOHcwZg ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%}+" ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[magenta]%}!" diff --git a/themes/tonotdo.zsh-theme b/themes/tonotdo.zsh-theme index a6407034c..426e2bf35 100644 --- a/themes/tonotdo.zsh-theme +++ b/themes/tonotdo.zsh-theme @@ -7,6 +7,6 @@ ZSH_THEME_GIT_PROMPT_SUFFIX="" ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[blue]%})" ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[yellow]%}✗%{$fg_bold[blue]%})" -# LS colors, made with http://geoff.greer.fm/lscolors/ +# LS colors, made with https://geoff.greer.fm/lscolors/ export LSCOLORS="Gxfxcxdxbxegedabagacad" -export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' \ No newline at end of file +export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' diff --git a/themes/xiong-chiamiov-plus.zsh-theme b/themes/xiong-chiamiov-plus.zsh-theme index 5fb4fe6f4..aa6ef7421 100644 --- a/themes/xiong-chiamiov-plus.zsh-theme +++ b/themes/xiong-chiamiov-plus.zsh-theme @@ -1,6 +1,6 @@ # user, host, full path, and time/date # on two lines for easier vgrepping -# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 +# entry in a nice long thread on the Arch Linux forums: https://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%a %b %d, %H:%M"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} %{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <$(git_prompt_info)>%{\e[0m%}%b ' PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' diff --git a/themes/xiong-chiamiov.zsh-theme b/themes/xiong-chiamiov.zsh-theme index 0ed335fb5..b67d9947c 100644 --- a/themes/xiong-chiamiov.zsh-theme +++ b/themes/xiong-chiamiov.zsh-theme @@ -1,6 +1,6 @@ # user, host, full path, and time/date # on two lines for easier vgrepping -# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 +# entry in a nice long thread on the Arch Linux forums: https://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%a %b %d, %H:%M"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} %{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B]>%{\e[0m%}%b ' PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' diff --git a/tools/theme_chooser.sh b/tools/theme_chooser.sh index 2c2a379ba..82ae5857c 100755 --- a/tools/theme_chooser.sh +++ b/tools/theme_chooser.sh @@ -5,7 +5,7 @@ # the extent permitted by applicable law. You can redistribute it # and/or modify it under the terms of the Do What The Fuck You Want # To Public License, Version 2, as published by Sam Hocevar. See -# http://sam.zoy.org/wtfpl/COPYING for more details. +# http://www.wtfpl.net/txt/copying/ for more details. THEMES_DIR="$ZSH/themes" FAVLIST="${HOME}/.zsh_favlist" -- cgit v1.2.3-70-g09d2 From 2991f237aeacb0a1918cdd6d4b98fe4b21980038 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Tue, 7 Aug 2018 21:04:09 +0200 Subject: bundler: allow aliases in `bundle exec` This means that if you have, for example, `alias rs='rails server'`, you can run `be rs` and have it expanded to `bundle exec rails server`. Fixes #5818 --- plugins/bundler/bundler.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index b0b286af5..589f2cfce 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -1,4 +1,4 @@ -alias be="bundle exec" +alias be="bundle exec " alias bl="bundle list" alias bp="bundle package" alias bo="bundle open" -- cgit v1.2.3-70-g09d2 From 850975eb78908e8272e42685da8b5ced3a428c97 Mon Sep 17 00:00:00 2001 From: Johan Kaving Date: Tue, 7 Aug 2018 21:39:38 +0200 Subject: Add support for ForkLift 3 (#6490) This adds support for ForkLift 3, which uses a different application id and also uses a popover instead of a sheet for entering the directory to go to. This also improves the handling of different versions of ForkLift, by first choosing any currently running instance, and if none is running starting the newest available version. Fixes #6565. --- plugins/forklift/forklift.plugin.zsh | 100 ++++++++++++++++++++++++----------- 1 file changed, 69 insertions(+), 31 deletions(-) diff --git a/plugins/forklift/forklift.plugin.zsh b/plugins/forklift/forklift.plugin.zsh index 692ca5790..274c4a822 100644 --- a/plugins/forklift/forklift.plugin.zsh +++ b/plugins/forklift/forklift.plugin.zsh @@ -1,6 +1,6 @@ # Open folder in ForkLift.app or ForkLift2.app from console # Author: Adam Strzelecki nanoant.com, modified by Bodo Tasche bitboxer.de -# Updated to support ForkLift2 by Johan Kaving +# Updated to support ForkLift 2 and ForkLift 3 by Johan Kaving # # Usage: # fl [] @@ -24,46 +24,84 @@ function fl { fi osascript 2>&1 1>/dev/null < Date: Tue, 7 Aug 2018 12:41:53 -0700 Subject: use official heroku autocomplete (#6919) --- plugins/heroku/_heroku | 199 --------------------------------------- plugins/heroku/heroku.plugin.zsh | 9 ++ 2 files changed, 9 insertions(+), 199 deletions(-) delete mode 100644 plugins/heroku/_heroku create mode 100644 plugins/heroku/heroku.plugin.zsh diff --git a/plugins/heroku/_heroku b/plugins/heroku/_heroku deleted file mode 100644 index 4122de237..000000000 --- a/plugins/heroku/_heroku +++ /dev/null @@ -1,199 +0,0 @@ -#compdef heroku - -# Heroku Autocomplete plugin for Oh-My-Zsh -# Requires: The Heroku client gem (https://github.com/heroku/heroku) -# Author: Ali B. (http://awhitebox.com) - -local -a _1st_arguments -_1st_arguments=( - "account\:confirm_billing":"Confirm that your account can be billed at the end of the month" - "addons":"list installed addons" - "addons\:list":"list all available addons" - "addons\:add":"install an addon" - "addons\:upgrade":"upgrade an existing addon" - "addons\:downgrade":"downgrade an existing addon" - "addons\:remove":"uninstall an addon" - "addons\:open":"open an addon's dashboard in your browser" - "apps":"list your apps" - "apps\:info":"show detailed app information" - "apps\:create":"create a new app" - "apps\:rename":"rename the app" - "apps\:open":"open the app in a web browser" - "apps\:destroy":"permanently destroy an app" - "auth\:login":"log in with your heroku credentials" - "auth\:logout":"clear local authentication credentials" - "config":"display the config vars for an app" - "config\:pull":"pull heroku config vars down to the local environment" - "config\:push":"push local config vars to heroku" - "config\:set":"set one or more config vars" - "config\:unset":"unset one or more config vars" - "domains":"list custom domains for an app" - "domains\:add":"add a custom domain to an app" - "domains\:remove":"remove a custom domain from an app" - "domains\:clear":"remove all custom domains from an app" - "features":"list available app features" - "features\:disable":"disables a feature" - "features\:enable":"enables an feature" - "features\:info":"displays additional information about feature" - "help":"list available commands or display help for a specific command" - "keys":"display keys for the current user" - "keys\:add":"add a key for the current user" - "keys\:remove":"remove a key from the current user" - "keys\:clear":"remove all authentication keys from the current user" - "logs":"display recent log output" - "logs\:cron":"DEPRECATED: display cron logs from legacy logging" - "logs\:drains":"manage syslog drains" - "maintenance\:on":"put the app into maintenance mode" - "maintenance\:off":"take the app out of maintenance mode" - "pipelines":"list pipelines you have access to" - "pipelines\:add":"add this app to a pipeline" - "pipelines\:create":"create a new pipeline" - "pipelines\:destroy":"destroy a pipeline" - "pipelines\:diff":"compares the latest release of this app to its downstream app(s)" - "pipelines\:info":"show list of apps in a pipeline" - "pipelines\:list":"list pipelines you have access to" - "pipelines\:open":"open a pipeline in dashboard" - "pipelines\:promote":"promote the latest release of this app to its downstream app(s)" - "pipelines\:remove":"remove this app from its pipeline" - "pipelines\:rename":"rename a pipeline" - "pipelines\:update":"update this app's stage in a pipeline" - "pg\:credentials":"display the DATABASE credentials" - "pg\:diagnose":"run diagnostics report on DATABASE" - "pg\:info":"display database information" - "pg\:kill":"kill a query" - "pg\:killall":"terminates ALL connections" - "pg\:maintenance":"manage maintenance for DATABASE" - "pg\:promote":"sets DATABASE as your DATABASE_URL" - "pg\:ps":"view active queries with execution time" - "pg\:psql":"open a psql shell to the database" - "pg\:pull":"pull from REMOTE_SOURCE_DATABASE to LOCAL_TARGET_DATABASE" - "pg\:push":"push from LOCAL_SOURCE_DATABASE to REMOTE_TARGET_DATABASE" - "pg\:reset":"delete all data in DATABASE" - "pg\:unfollow":"stop a replica from following and make it a read/write database" - "pg\:upgrade":"unfollow a database and upgrade it to the latest PostgreSQL version" - "pg\:wait":"monitor database creation, exit when complete" - "pg\:backups":"Interact with built-in backups" - "pgbackups":"list captured backups" - "pgbackups\:url":"get a temporary URL for a backup" - "pgbackups\:capture":"capture a backup from a database id" - "pgbackups\:restore":"restore a backup to a database" - "pgbackups\:destroy":"destroys a backup" - "plugins":"list installed plugins" - "plugins\:install":"install a plugin" - "plugins\:uninstall":"uninstall a plugin" - "ps\:dynos":"scale to QTY web processes" - "ps\:workers":"scale to QTY background processes" - "ps":"list processes for an app" - "ps\:restart":"restart an app process" - "ps\:scale":"scale processes by the given amount" - "releases":"list releases" - "releases\:info":"view detailed information for a release" - "rollback":"roll back to an older release" - "run":"run an attached process" - "run\:rake":"remotely execute a rake command" - "run\:console":"open a remote console session" - "sharing":"list collaborators on an app" - "sharing\:add":"add a collaborator to an app" - "sharing\:remove":"remove a collaborator from an app" - "sharing\:transfer":"transfer an app to a new owner" - "ssl":"list certificates for an app" - "ssl\:add":"add an ssl certificate to an app" - "ssl\:remove":"remove an ssl certificate from an app" - "ssl\:clear":"remove all ssl certificates from an app" - "stack":"show the list of available stacks" - "stack\:migrate":"prepare migration of this app to a new stack" - "version":"show heroku client version" -) - -_arguments '*:: :->command' - -if (( CURRENT == 1 )); then - _describe -t commands "heroku command" _1st_arguments - return -fi - -local -a _command_args -case "$words[1]" in - apps:info) - _command_args=( - '(-r|--raw)'{-r,--raw}'[output info as raw key/value pairs]' \ - ) - ;; - apps:create) - _command_args=( - '(-a|--addons)'{-a,--addons}'[a list of addons to install]' \ - '(-r|--remote)'{-r,--remote}'[the git remote to create, default "heroku"]' \ - '(-s|--stack)'{-s,--stack}'[the stack on which to create the app]' \ - ) - ;; - config) - _command_args=( - '(-s|--shell)'{-s,--shell}'[output config vars in shell format]' \ - ) - ;; - keys) - _command_args=( - '(-l|--long)'{-l,--long}'[display extended information for each key]' \ - ) - ;; - logs) - _command_args=( - '(-n|--num)'{-n,--num}'[the number of lines to display]' \ - '(-p|--ps)'{-p,--ps}'[only display logs from the given process]' \ - '(-s|--source)'{-s,--source}'[only display logs from the given source]' \ - '(-t|--tail)'{-t,--tail}'[continually stream logs]' \ - ) - ;; - pipelines) - _command_args=( - '(--json)'--json'[output in json format]' \ - ) - ;; - pipelines:add) - _command_args=( - '(-s|--stage)'{-s,--stage}'[stage of first app in pipeline]' \ - ) - ;; - pipelines:create) - _command_args=( - '(-s|--stage)'{-s,--stage}'[stage of first app in pipeline]' \ - ) - ;; - pipelines:info) - _command_args=( - '(--json)'--json'[output in json format]' \ - ) - ;; - pipelines:list) - _command_args=( - '(--json)'--json'[output in json format]' \ - ) - ;; - pipelines:promote) - _command_args=( - '(-t|--to)'{-t,--to}'[comma separated list of apps to promote to]' \ - ) - ;; - pipelines:update) - _command_args=( - '(-s|--stage)'{-s,--stage}'[stage of first app in pipeline]' \ - ) - ;; - pgbackups:capture) - _command_args=( - '(-e|--expire)'{-e,--expire}'[if no slots are available to capture, delete the oldest backup to make room]' \ - ) - ;; - stack) - _command_args=( - '(-a|--all)'{-a,--all}'[include deprecated stacks]' \ - ) - ;; - esac - -_arguments \ - $_command_args \ - '(--app)--app[the app name]' \ - '(--remote)--remote[the remote name]' \ - '(--help)--help[help about the current command]' \ - && return 0 diff --git a/plugins/heroku/heroku.plugin.zsh b/plugins/heroku/heroku.plugin.zsh new file mode 100644 index 000000000..9a99b4211 --- /dev/null +++ b/plugins/heroku/heroku.plugin.zsh @@ -0,0 +1,9 @@ +HEROKU_AC_CACHE_DIR="$HOME/.cache" +if [ "$(uname -s)" = "Darwin" ]; then + HEROKU_AC_CACHE_DIR="$HOME/Library/Caches" +fi +if [ ! -z "$XDG_CACHE_HOME" ]; then + HEROKU_AC_CACHE_DIR="$XDG_CACHE_DIR" +fi +HEROKU_AC_ZSH_SETUP_PATH=$HEROKU_AC_CACHE_DIR/heroku/autocomplete/zsh_setup +[ -f $HEROKU_AC_ZSH_SETUP_PATH ] && source $HEROKU_AC_ZSH_SETUP_PATH -- cgit v1.2.3-70-g09d2 From 8961a3794cc2f5bc31b592367e82aa1766f24bbd Mon Sep 17 00:00:00 2001 From: Joseph Richey Date: Tue, 7 Aug 2018 13:54:45 -0700 Subject: plugins/go: Simplify/fix recursive golang format (#7027) Per the [`go` command specification](https://golang.org/cmd/go/#hdr-Package_lists), the `...` wildcard matches the empty string. This makes commands like `go . ./...` unnecessary: they should use `go ./...`. This also fixes a bug with the `gofa` shortcut, where it would emit an error if called from a directory containing no go source files (but having subdirectories that _did_ contain go files). --- plugins/golang/golang.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/golang/golang.plugin.zsh b/plugins/golang/golang.plugin.zsh index d5c78ce6c..64c80e864 100644 --- a/plugins/golang/golang.plugin.zsh +++ b/plugins/golang/golang.plugin.zsh @@ -184,7 +184,7 @@ alias gob='go build' alias goc='go clean' alias god='go doc' alias gof='go fmt' -alias gofa='go fmt . ./...' +alias gofa='go fmt ./...' alias gog='go get' alias goi='go install' alias gol='go list' -- cgit v1.2.3-70-g09d2 From 9ecde7f73211607353954b6fd76fef56d7e663b3 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Tue, 7 Aug 2018 23:54:07 +0200 Subject: dotenv: call function on startup Fixes #7017 --- plugins/dotenv/dotenv.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/dotenv/dotenv.plugin.zsh b/plugins/dotenv/dotenv.plugin.zsh index fa47c4c68..a0c2d0051 100644 --- a/plugins/dotenv/dotenv.plugin.zsh +++ b/plugins/dotenv/dotenv.plugin.zsh @@ -1,5 +1,3 @@ -#!/bin/zsh - source_env() { if [[ -f .env ]]; then if [[ -o a ]]; then @@ -14,3 +12,5 @@ source_env() { autoload -U add-zsh-hook add-zsh-hook chpwd source_env + +source_env -- cgit v1.2.3-70-g09d2 From c781d708da064b42af19e20113d042b65e886d94 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Wed, 8 Aug 2018 00:05:34 +0200 Subject: dotenv: test and warn of incorrect.env syntax Fixes #6337 --- plugins/dotenv/dotenv.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/dotenv/dotenv.plugin.zsh b/plugins/dotenv/dotenv.plugin.zsh index a0c2d0051..b701b5596 100644 --- a/plugins/dotenv/dotenv.plugin.zsh +++ b/plugins/dotenv/dotenv.plugin.zsh @@ -1,5 +1,8 @@ source_env() { if [[ -f .env ]]; then + # test .env syntax + zsh -fn .env || echo 'dotenv: error when sourcing `.env` file' >&2 + if [[ -o a ]]; then source .env else -- cgit v1.2.3-70-g09d2 From 91d55dce11cc975309cd7dc8955c51f82de8548c Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Wed, 8 Aug 2018 13:36:27 +0200 Subject: bundler: update README with latest changes --- plugins/bundler/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/bundler/README.md b/plugins/bundler/README.md index 04d551447..dc2f17008 100644 --- a/plugins/bundler/README.md +++ b/plugins/bundler/README.md @@ -2,7 +2,8 @@ - adds completion for basic bundler commands - adds short aliases for common bundler commands - - `be` aliased to `bundle exec` + - `be` aliased to `bundle exec`. + It also supports aliases (if `rs` is `rails server`, `be rs` will bundle-exec `rails server`). - `bl` aliased to `bundle list` - `bp` aliased to `bundle package` - `bo` aliased to `bundle open` @@ -13,7 +14,8 @@ - looks for a binstub under `./bin/` and executes it (if present) - calls `bundle exec ` otherwise -For a full list of *common gems* being wrapped by default please look at the `bundler.plugin.zsh` file. +Common gems wrapped by default (by name of the executable): +`annotate`, `cap`, `capify`, `cucumber`, `foodcritic`, `guard`, `hanami`, `irb`, `jekyll`, `kitchen`, `knife`, `middleman`, `nanoc`, `pry`, `puma`, `rackup`, `rainbows`, `rake`, `rspec`, `shotgun`, `sidekiq`, `spec`, `spork`, `spring`, `strainer`, `tailor`, `taps`, `thin`, `thor`, `unicorn` and `unicorn_rails`. ## Configuration -- cgit v1.2.3-70-g09d2 From 44473d785e435373350bc6b3253eec104c05b404 Mon Sep 17 00:00:00 2001 From: Michal Halenka Date: Wed, 8 Aug 2018 14:12:55 +0200 Subject: Add doctl autocompletion (#6501) --- plugins/doctl/doctl.plugin.zsh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 plugins/doctl/doctl.plugin.zsh diff --git a/plugins/doctl/doctl.plugin.zsh b/plugins/doctl/doctl.plugin.zsh new file mode 100644 index 000000000..d23ed085c --- /dev/null +++ b/plugins/doctl/doctl.plugin.zsh @@ -0,0 +1,9 @@ +# Autocompletion for doctl, the command line tool for DigitalOcean service +# +# doctl project: https://github.com/digitalocean/doctl +# +# Author: https://github.com/HalisCz + +if [ $commands[doctl] ]; then + source <(doctl completion zsh) +fi -- cgit v1.2.3-70-g09d2 From 60db5cdb582134db2778d25d7cb7a40c0249e8d9 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Thu, 9 Aug 2018 17:19:40 +0200 Subject: tmux: fix invalid syntax on old zsh versions First reported on https://github.com/robbyrussell/oh-my-zsh/commit/f584de5930467fd53e8b7d2e51f5227bc405e4b2#r29984052 --- plugins/tmux/tmux.plugin.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index ff7de746b..4a7986389 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -56,7 +56,8 @@ function _zsh_tmux_plugin_run() { return $? fi - local -a tmux_cmd=(command tmux) + local -a tmux_cmd + tmux_cmd=(command tmux) [[ "$ZSH_TMUX_ITERM2" == "true" ]] && tmux_cmd+=(-CC) # Try to connect to an existing session. -- cgit v1.2.3-70-g09d2 From 3a31074d34c825028a7fbbd1a2ea55a5793a3d01 Mon Sep 17 00:00:00 2001 From: Tom Milligan Date: Thu, 9 Aug 2018 16:37:47 +0100 Subject: Update docker plugin from upstream docker/cli (#7018) Update `docker` plugin from [docker/cli master](https://github.com/tommilligan/cli/blob/master/contrib/completion/zsh/_docker) - bugfix for `docker update` autocompletion: https://github.com/docker/cli/pull/1232 - added `scope` subcommand: https://github.com/docker/cli/pull/1227/files --- plugins/docker/_docker | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/docker/_docker b/plugins/docker/_docker index df4b44961..31b83c777 100644 --- a/plugins/docker/_docker +++ b/plugins/docker/_docker @@ -431,7 +431,7 @@ __docker_complete_events_filter() { integer ret=1 declare -a opts - opts=('container' 'daemon' 'event' 'image' 'label' 'network' 'type' 'volume') + opts=('container' 'daemon' 'event' 'image' 'label' 'network' 'scope' 'type' 'volume') if compset -P '*='; then case "${${words[-1]%=*}#*=}" in @@ -461,6 +461,11 @@ __docker_complete_events_filter() { (network) __docker_complete_networks && ret=0 ;; + (scope) + local -a scope_opts + scope_opts=('local' 'swarm') + _describe -t scope-filter-opts "scope filter options" scope_opts && ret=0 + ;; (type) local -a type_opts type_opts=('container' 'daemon' 'image' 'network' 'volume') @@ -923,7 +928,7 @@ __docker_container_subcommand() { local state _arguments $(__docker_arguments) \ $opts_help \ - opts_create_run_update \ + $opts_create_run_update \ "($help -)*: :->values" && ret=0 case $state in (values) -- cgit v1.2.3-70-g09d2 From 5fbf9120935af9b5e81b72f942be09891c6e508f Mon Sep 17 00:00:00 2001 From: Alexander Kapshuna Date: Thu, 9 Aug 2018 19:16:15 +0300 Subject: extract: whl files support (#7045) --- plugins/extract/_extract | 2 +- plugins/extract/extract.plugin.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/extract/_extract b/plugins/extract/_extract index 172425d2c..3baefa339 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|xpi|xz|zip)(-.)'" \ + "*::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)(-.)'" \ && return 0 diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index d56044805..4c72ce870 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) unzip "$1" -d $extract_dir ;; + (*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.whl) unzip "$1" -d $extract_dir ;; (*.rar) unrar x -ad "$1" ;; (*.7z) 7za x "$1" ;; (*.deb) -- cgit v1.2.3-70-g09d2 From 9624ce992ec3482041c3086bc88f0485eb8d9bd3 Mon Sep 17 00:00:00 2001 From: Thi Date: Fri, 10 Aug 2018 02:10:32 +0900 Subject: Add shell completion for Swift Package Manager (#7046) This was generated by the Swift compiler 4.1.2 using the following command: swift package completion-tool generate-zsh-script --- plugins/swiftpm/_swift | 362 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 362 insertions(+) create mode 100644 plugins/swiftpm/_swift diff --git a/plugins/swiftpm/_swift b/plugins/swiftpm/_swift new file mode 100644 index 000000000..901b5d9e2 --- /dev/null +++ b/plugins/swiftpm/_swift @@ -0,0 +1,362 @@ +#compdef swift +local context state state_descr line +typeset -A opt_args + +_swift() { + _arguments -C \ + '(- :)--help[prints the synopsis and a list of the most commonly used commands]: :->arg' \ + '(-): :->command' \ + '(-)*:: :->arg' && return + + case $state in + (command) + local tools + tools=( + 'build:build sources into binary products' + 'run:build and run an executable product' + 'package:perform operations on Swift packages' + 'test:build and run tests' + ) + _alternative \ + 'tools:common:{_describe "tool" tools }' \ + 'compiler: :_swift_compiler' && _ret=0 + ;; + (arg) + case ${words[1]} in + (build) + _swift_build + ;; + (run) + _swift_run + ;; + (package) + _swift_package + ;; + (test) + _swift_test + ;; + (*) + _swift_compiler + ;; + esac + ;; + esac +} + +_swift_dependency() { + local dependencies + dependencies=( $(swift package completion-tool list-dependencies) ) + _describe '' dependencies +} + +_swift_executable() { + local executables + executables=( $(swift package completion-tool list-executables) ) + _describe '' executables +} + +# Generates completions for swift build +# +# In the final compdef file, set the following file header: +# +# #compdef _swift_build +# local context state state_descr line +# typeset -A opt_args +_swift_build() { + arguments=( + "-Xcc[Pass flag through to all C compiler invocations]:Pass flag through to all C compiler invocations: " + "-Xswiftc[Pass flag through to all Swift compiler invocations]:Pass flag through to all Swift compiler invocations: " + "-Xlinker[Pass flag through to all linker invocations]:Pass flag through to all linker invocations: " + "-Xcxx[Pass flag through to all C++ compiler invocations]:Pass flag through to all C++ compiler invocations: " + "(--configuration -c)"{--configuration,-c}"[Build with configuration (debug|release) ]: :{_values '' 'debug[build with DEBUG configuration]' 'release[build with RELEASE configuration]'}" + "--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" + "--disable-prefetching[]" + "--disable-sandbox[Disable using the sandbox when executing subprocesses]" + "--version[]" + "--destination[]: :_files" + "(--verbose -v)"{--verbose,-v}"[Increase verbosity of informational output]" + "--no-static-swift-stdlib[Do not link Swift stdlib statically]" + "--static-swift-stdlib[Link Swift stdlib statically]" + "--enable-build-manifest-caching[Enable llbuild manifest caching [Experimental]]" + "--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: " + "--show-bin-path[Print the binary output path]" + ) + _arguments $arguments && return +} + +# Generates completions for swift run +# +# In the final compdef file, set the following file header: +# +# #compdef _swift_run +# local context state state_descr line +# typeset -A opt_args +_swift_run() { + arguments=( + ":The executable to run:_swift_executable" + "-Xcc[Pass flag through to all C compiler invocations]:Pass flag through to all C compiler invocations: " + "-Xswiftc[Pass flag through to all Swift compiler invocations]:Pass flag through to all Swift compiler invocations: " + "-Xlinker[Pass flag through to all linker invocations]:Pass flag through to all linker invocations: " + "-Xcxx[Pass flag through to all C++ compiler invocations]:Pass flag through to all C++ compiler invocations: " + "(--configuration -c)"{--configuration,-c}"[Build with configuration (debug|release) ]: :{_values '' 'debug[build with DEBUG configuration]' 'release[build with RELEASE configuration]'}" + "--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" + "--disable-prefetching[]" + "--disable-sandbox[Disable using the sandbox when executing subprocesses]" + "--version[]" + "--destination[]: :_files" + "(--verbose -v)"{--verbose,-v}"[Increase verbosity of informational output]" + "--no-static-swift-stdlib[Do not link Swift stdlib statically]" + "--static-swift-stdlib[Link Swift stdlib statically]" + "--enable-build-manifest-caching[Enable llbuild manifest caching [Experimental]]" + "--skip-build[Skip building the executable product]" + ) + _arguments $arguments && return +} + +# Generates completions for swift package +# +# In the final compdef file, set the following file header: +# +# #compdef _swift_package +# local context state state_descr line +# typeset -A opt_args +_swift_package() { + arguments=( + "-Xcc[Pass flag through to all C compiler invocations]:Pass flag through to all C compiler invocations: " + "-Xswiftc[Pass flag through to all Swift compiler invocations]:Pass flag through to all Swift compiler invocations: " + "-Xlinker[Pass flag through to all linker invocations]:Pass flag through to all linker invocations: " + "-Xcxx[Pass flag through to all C++ compiler invocations]:Pass flag through to all C++ compiler invocations: " + "(--configuration -c)"{--configuration,-c}"[Build with configuration (debug|release) ]: :{_values '' 'debug[build with DEBUG configuration]' 'release[build with RELEASE configuration]'}" + "--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" + "--disable-prefetching[]" + "--disable-sandbox[Disable using the sandbox when executing subprocesses]" + "--version[]" + "--destination[]: :_files" + "(--verbose -v)"{--verbose,-v}"[Increase verbosity of informational output]" + "--no-static-swift-stdlib[Do not link Swift stdlib statically]" + "--static-swift-stdlib[Link Swift stdlib statically]" + "--enable-build-manifest-caching[Enable llbuild manifest caching [Experimental]]" + '(-): :->command' + '(-)*:: :->arg' + ) + _arguments $arguments && return + case $state in + (command) + local modes + modes=( + 'update:Update package dependencies' + 'show-dependencies:Print the resolved dependency graph' + 'resolve:Resolve package dependencies' + 'fetch:' + 'completion-tool:Completion tool (for shell completions)' + 'edit:Put a package in editable mode' + 'tools-version:Manipulate tools version of the current package' + 'describe:Describe the current package' + 'clean:Delete build artifacts' + 'reset:Reset the complete cache/build directory' + 'unedit:Remove a package from editable mode' + 'generate-xcodeproj:Generates an Xcode project' + 'init:Initialize a new package' + 'dump-package:Print parsed Package.swift as JSON' + ) + _describe "mode" modes + ;; + (arg) + case ${words[1]} in + (update) + _swift_package_update + ;; + (show-dependencies) + _swift_package_show-dependencies + ;; + (resolve) + _swift_package_resolve + ;; + (fetch) + _swift_package_fetch + ;; + (completion-tool) + _swift_package_completion-tool + ;; + (edit) + _swift_package_edit + ;; + (tools-version) + _swift_package_tools-version + ;; + (describe) + _swift_package_describe + ;; + (clean) + _swift_package_clean + ;; + (reset) + _swift_package_reset + ;; + (unedit) + _swift_package_unedit + ;; + (generate-xcodeproj) + _swift_package_generate-xcodeproj + ;; + (init) + _swift_package_init + ;; + (dump-package) + _swift_package_dump-package + ;; + esac + ;; + esac +} + +_swift_package_update() { + arguments=( + ) + _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 +} + +_swift_package_resolve() { + arguments=( + ":The name of the package to resolve:_swift_dependency" + "--version[The version to resolve at]:The version to resolve at: " + "--branch[The branch to resolve at]:The branch to resolve at: " + "--revision[The revision to resolve at]:The revision to resolve at: " + ) + _arguments $arguments && return +} + +_swift_package_fetch() { + 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_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_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_describe() { + arguments=( + "--type[json|text]: :{_values '' 'text[describe using text format]' 'json[describe using JSON format]'}" + ) + _arguments $arguments && return +} + +_swift_package_clean() { + arguments=( + ) + _arguments $arguments && return +} + +_swift_package_reset() { + arguments=( + ) + _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_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" + ) + _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 +} + +# Generates completions for swift test +# +# In the final compdef file, set the following file header: +# +# #compdef _swift_test +# local context state state_descr line +# typeset -A opt_args +_swift_test() { + arguments=( + "-Xcc[Pass flag through to all C compiler invocations]:Pass flag through to all C compiler invocations: " + "-Xswiftc[Pass flag through to all Swift compiler invocations]:Pass flag through to all Swift compiler invocations: " + "-Xlinker[Pass flag through to all linker invocations]:Pass flag through to all linker invocations: " + "-Xcxx[Pass flag through to all C++ compiler invocations]:Pass flag through to all C++ compiler invocations: " + "(--configuration -c)"{--configuration,-c}"[Build with configuration (debug|release) ]: :{_values '' 'debug[build with DEBUG configuration]' 'release[build with RELEASE configuration]'}" + "--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" + "--disable-prefetching[]" + "--disable-sandbox[Disable using the sandbox when executing subprocesses]" + "--version[]" + "--destination[]: :_files" + "(--verbose -v)"{--verbose,-v}"[Increase verbosity of informational output]" + "--no-static-swift-stdlib[Do not link Swift stdlib statically]" + "--static-swift-stdlib[Link Swift stdlib statically]" + "--enable-build-manifest-caching[Enable llbuild manifest caching [Experimental]]" + "--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.]" + "(--specifier -s)"{--specifier,-s}"[]: : " + "--filter[Run test cases matching regular expression, Format: . or ./]:Run test cases matching regular expression, Format: . or ./: " + ) + _arguments $arguments && return +} + +_swift_compiler() { +} + +_swift -- cgit v1.2.3-70-g09d2 From 052a6dbd16045d37b07c4bad550077d5ccc82228 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Thu, 9 Aug 2018 19:24:03 +0200 Subject: docker-machine: add official completion Fixes #6962 --- plugins/docker-machine/_docker-machine | 359 +++++++++++++++++++++++++++++++++ 1 file changed, 359 insertions(+) create mode 100644 plugins/docker-machine/_docker-machine diff --git a/plugins/docker-machine/_docker-machine b/plugins/docker-machine/_docker-machine new file mode 100644 index 000000000..7c19ba8e7 --- /dev/null +++ b/plugins/docker-machine/_docker-machine @@ -0,0 +1,359 @@ +#compdef docker-machine +# Description +# ----------- +# zsh completion for docker-machine +# https://github.com/leonhartX/docker-machine-zsh-completion +# ------------------------------------------------------------------------- +# Version +# ------- +# 0.1.1 +# ------------------------------------------------------------------------- +# Authors +# ------- +# * Ke Xu +# ------------------------------------------------------------------------- +# Inspiration +# ----------- +# * @sdurrheimer docker-compose-zsh-completion https://github.com/sdurrheimer/docker-compose-zsh-completion +# * @ilkka _docker-machine + + +__docker-machine_get_hosts() { + [[ $PREFIX = -* ]] && return 1 + local state + declare -a hosts + state=$1; shift + if [[ $state != all ]]; then + hosts=(${(f)"$(_call_program commands docker-machine ls -q --filter state=$state)"}) + else + hosts=(${(f)"$(_call_program commands docker-machine ls -q)"}) + fi + _describe 'host' hosts "$@" && ret=0 + return ret +} + +__docker-machine_hosts_with_state() { + declare -a hosts + hosts=(${(f)"$(_call_program commands docker-machine ls -f '{{.Name}}\:{{.DriverName}}\({{.State}}\)\ {{.URL}}')"}) + _describe 'host' hosts +} + +__docker-machine_hosts_all() { + __docker-machine_get_hosts all "$@" +} + +__docker-machine_hosts_running() { + __docker-machine_get_hosts Running "$@" +} + +__docker-machine_get_swarm() { + declare -a swarms + swarms=(${(f)"$(_call_program commands docker-machine ls -f {{.Swarm}} | awk '{print $1}')"}) + _describe 'swarm' swarms +} + +__docker-machine_hosts_and_files() { + _alternative "hosts:host:__docker-machine_hosts_all -qS ':'" 'files:files:_path_files' +} + +__docker-machine_filters() { + [[ $PREFIX = -* ]] && return 1 + integer ret=1 + + if compset -P '*='; then + case "${${words[-1]%=*}#*=}" in + (driver) + _describe -t driver-filter-opts "driver filter" opts_driver && ret=0 + ;; + (swarm) + __docker-machine_get_swarm && ret=0 + ;; + (state) + opts_state=('Running' 'Paused' 'Saved' 'Stopped' 'Stopping' 'Starting' 'Error') + _describe -t state-filter-opts "state filter" opts_state && ret=0 + ;; + (name) + __docker-machine_hosts_all && ret=0 + ;; + (label) + _message 'label' && ret=0 + ;; + *) + _message 'value' && ret=0 + ;; + esac + else + opts=('driver' 'swarm' 'state' 'name' 'label') + _describe -t filter-opts "filter" opts -qS "=" && ret=0 + fi + return ret +} + +__get_swarm_discovery() { + declare -a masters serivces + local service + services=() + masters=($(docker-machine ls -f {{.Swarm}} |grep '(master)' |awk '{print $1}')) + for master in $masters; do + service=${${${(f)"$(_call_program commands docker-machine inspect -f '{{.HostOptions.SwarmOptions.Discovery}}:{{.Name}}' $master)"}/:/\\:}} + services=($services $service) + done + _describe -t services "swarm service" services && ret=0 + return ret +} + +__get_create_argument() { + typeset -g docker_machine_driver + if [[ CURRENT -le 2 ]]; then + docker_machine_driver="none" + elif [[ CURRENT > 2 && $words[CURRENT-2] = '-d' || $words[CURRENT-2] = '--driver' ]]; then + docker_machine_driver=$words[CURRENT-1] + elif [[ $words[CURRENT-1] =~ '^(-d|--driver)=' ]]; then + docker_machine_driver=${${words[CURRENT-1]}/*=/} + fi + local driver_opt_cmd + local -a opts_provider opts_common opts_read_argument + opts_read_argument=( + ": :->argument" + ) + opts_common=( + $opts_help \ + '(--driver -d)'{--driver=,-d=}'[Driver to create machine with]:dirver:->driver-option' \ + '--engine-install-url=[Custom URL to use for engine installation]:url' \ + '*--engine-opt=[Specify arbitrary flags to include with the created engine in the form flag=value]:flag' \ + '*--engine-insecure-registry=[Specify insecure registries to allow with the created engine]:registry' \ + '*--engine-registry-mirror=[Specify registry mirrors to use]:mirror' \ + '*--engine-label=[Specify labels for the created engine]:label' \ + '--engine-storage-driver=[Specify a storage driver to use with the engine]:storage-driver:->storage-driver-option' \ + '*--engine-env=[Specify environment variables to set in the engine]:environment' \ + '--swarm[Configure Machine with Swarm]' \ + '--swarm-image=[Specify Docker image to use for Swarm]:image' \ + '--swarm-master[Configure Machine to be a Swarm master]' \ + '--swarm-discovery=[Discovery service to use with Swarm]:service:->swarm-service' \ + '--swarm-strategy=[Define a default scheduling strategy for Swarm]:strategy:(spread binpack random)' \ + '*--swarm-opt=[Define arbitrary flags for swarm]:flag' \ + '*--swarm-join-opt=[Define arbitrary flags for Swarm join]:flag' \ + '--swarm-host=[ip/socket to listen on for Swarm master]:host' \ + '--swarm-addr=[addr to advertise for Swarm (default: detect and use the machine IP)]:address' \ + '--swarm-experimental[Enable Swarm experimental features]' \ + '*--tls-san=[Support extra SANs for TLS certs]:option' + ) + driver_opt_cmd="docker-machine create -d $docker_machine_driver | grep $docker_machine_driver | sed -e 's/\(--.*\)\ *\[\1[^]]*\]/*\1/g' -e 's/\(\[[^]]*\)/\\\\\\1\\\\/g' -e 's/\".*\"\(.*\)/\1/g' | awk '{printf \"%s[\", \$1; for(i=2;i<=NF;i++) {printf \"%s \", \$i}; print \"]\"}'" + if [[ $docker_machine_driver != "none" ]]; then + opts_provider=(${(f)"$(_call_program commands $driver_opt_cmd)"}) + _arguments \ + $opts_provider \ + $opts_read_argument \ + $opts_common && ret=0 + else + _arguments $opts_common && ret=0 + fi + case $state in + (driver-option) + _describe -t driver-option "driver" opts_driver && ret=0 + ;; + (storage-driver-option) + _describe -t storage-driver-option "storage driver" opts_storage_driver && ret=0 + ;; + (swarm-service) + __get_swarm_discovery && ret=0 + ;; + (argument) + ret=0 + ;; + esac + return ret +} + + +__docker-machine_subcommand() { + local -a opts_help + opts_help=("(- :)--help[Print usage]") + local -a opts_only_host opts_driver opts_storage_driver opts_stragery + opts_only_host=( + "$opts_help" + "*:host:__docker-machine_hosts_all" + ) + opts_driver=('amazonec2' 'azure' 'digitalocean' 'exoscale' 'generic' 'google' 'hyperv' 'none' 'openstack' 'rackspace' 'softlayer' 'virtualbox' 'vmwarefusion' 'vmwarevcloudair' 'vmwarevsphere') + opts_storage_driver=('overlay' 'aufs' 'btrfs' 'devicemapper' 'vfs' 'zfs') + integer ret=1 + + case "$words[1]" in + (active) + _arguments \ + $opts_help \ + '(--timeout -t)'{--timeout=,-t=}'[Timeout in seconds, default to 10s]:seconds' && ret=0 + ;; + (config) + _arguments \ + $opts_help \ + '--swarm[Display the Swarm config instead of the Docker daemon]' \ + "*:host:__docker-machine_hosts_all" && ret=0 + ;; + (create) + __get_create_argument + ;; + (env) + _arguments \ + $opts_help \ + '--swarm[Display the Swarm config instead of the Docker daemon]' \ + '--shell=[Force environment to be configured for a specified shell: \[fish, cmd, powershell\], default is auto-detect]:shell' \ + '(--unset -u)'{--unset,-u}'[Unset variables instead of setting them]' \ + '--no-proxy[Add machine IP to NO_PROXY environment variable]' \ + '*:host:__docker-machine_hosts_running' && ret=0 + ;; + (help) + _arguments ':subcommand:__docker-machine_commands' && ret=0 + ;; + (inspect) + _arguments \ + $opts_help \ + '(--format -f)'{--format=,-f=}'[Format the output using the given go template]:template' \ + '*:host:__docker-machine_hosts_all' && ret=0 + ;; + (ip) + _arguments \ + $opts_help \ + '*:host:__docker-machine_hosts_running' && ret=0 + ;; + (kill) + _arguments \ + $opts_help \ + '*:host:__docker-machine_hosts_with_state' && ret=0 + ;; + (ls) + _arguments \ + $opts_help \ + '(--quiet -q)'{--quiet,-q}'[Enable quiet mode]' \ + '*--filter=[Filter output based on conditions provided]:filter:->filter-options' \ + '(--timeout -t)'{--timeout=,-t=}'[Timeout in seconds, default to 10s]:seconds' \ + '(--format -f)'{--format=,-f=}'[Pretty-print machines using a Go template]:template' && ret=0 + case $state in + (filter-options) + __docker-machine_filters && ret=0 + ;; + esac + ;; + (provision) + _arguments $opts_only_host && ret=0 + ;; + (regenerate-certs) + _arguments \ + $opts_help \ + '(--force -f)'{--force,-f}'[Force rebuild and do not prompt]' \ + '*:host:__docker-machine_hosts_all' && ret=0 + ;; + (restart) + _arguments \ + $opts_help \ + '*:host:__docker-machine_hosts_with_state' && ret=0 + ;; + (rm) + _arguments \ + $opts_help \ + '(--force -f)'{--force,-f}'[Remove local configuration even if machine cannot be removed, also implies an automatic yes (`-y`)]' \ + '-y[Assumes automatic yes to proceed with remove, without prompting further user confirmation]' \ + '*:host:__docker-machine_hosts_with_state' && ret=0 + ;; + (scp) + _arguments \ + $opts_help \ + '(--recursive -r)'{--recursive,-r}'[Copy files recursively (required to copy directories))]' \ + '*:files:__docker-machine_hosts_and_files' && ret=0 + ;; + (ssh) + _arguments \ + $opts_help \ + '*:host:__docker-machine_hosts_running' && ret=0 + ;; + (start) + _arguments \ + $opts_help \ + '*:host:__docker-machine_hosts_with_state' && ret=0 + ;; + (status) + _arguments $opts_only_host && ret=0 + ;; + (stop) + _arguments \ + $opts_help \ + '*:host:__docker-machine_hosts_with_state' && ret=0 + ;; + (upgrade) + _arguments $opts_only_host && ret=0 + ;; + (url) + _arguments \ + $opts_help \ + '*:host:__docker-machine_hosts_running' && ret=0 + ;; + esac + + return ret +} + + +__docker-machine_commands() { + local cache_policy + + zstyle -s ":completion:${curcontext}:" cache-policy cache_policy + if [[ -z "$cache_policy" ]]; then + zstyle ":completion:${curcontext}:" cache-policy __docker-machine_caching_policy + fi + + if ( [[ ${+_docker_machine_subcommands} -eq 0 ]] || _cache_invalid docker_machine_subcommands) \ + && ! _retrieve_cache docker_machine_subcommands; + then + local -a lines + lines=(${(f)"$(_call_program commands docker-machine 2>&1)"}) + _docker_machine_subcommands=(${${${lines[$((${lines[(i)Commands:]} + 1)),${lines[(I) *]}]}## #}/$'\t'##/:}) + (( $#_docker_machine_subcommands > 0 )) && _store_cache docker_machine_subcommands _docker_machine_subcommands + fi + _describe -t docker-machine-commands "docker-machine command" _docker_machine_subcommands +} + +__docker-machine_caching_policy() { + oldp=( "$1"(Nmh+1) ) + (( $#oldp )) +} + +_docker-machine() { + if [[ $service != docker-machine ]]; then + _call_function - _$service + return + fi + + local curcontext="$curcontext" state line + integer ret=1 + typeset -A opt_args + + _arguments -C \ + "(- :)"{-h,--help}"[Show help]" \ + "(-D --debug)"{-D,--debug}"[Enable debug mode]" \ + '(-s --stroage-path)'{-s,--storage-path}'[Configures storage path]:file:_files' \ + '--tls-ca-cert[CA to verify remotes against]:file:_files' \ + '--tls-ca-key[Private key to generate certificates]:file:_files' \ + '--tls-client-cert[Client cert to use for TLS]:file:_files' \ + '--tls-client-key[Private key used in client TLS auth]:file:_files' \ + '--github-api-token[Token to use for requests to the Github API]' \ + '--native-ssh[Use the native (Go-based) SSH implementation.]' \ + '--bugsnag-api-token[BugSnag API token for crash reporting]' \ + '(- :)'{-v,--version}'[Print the version]' \ + "(-): :->command" \ + "(-)*:: :->option-or-argument" && ret=0 + + case $state in + (command) + __docker-machine_commands && ret=0 + ;; + (option-or-argument) + curcontext=${curcontext%:*:*}:docker-machine-$words[1]: + __docker-machine_subcommand && ret=0 + ret=0 + ;; + esac + + return ret +} + +_docker-machine "$@" -- cgit v1.2.3-70-g09d2 From 2c1ff85bb2389a2ebdbf0150fd9287855cf348a8 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Thu, 9 Aug 2018 19:49:02 +0200 Subject: core: fix alias_value function Fixes #5835 --- lib/functions.zsh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/functions.zsh b/lib/functions.zsh index 1066fed57..4ef8920f6 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -51,8 +51,7 @@ function open_command() { # 1 if it does not exist # function alias_value() { - alias "$1" | sed "s/^$1='\(.*\)'$/\1/" - test $(alias "$1") + (( $+aliases[$1] )) && echo $aliases[$1] } # -- cgit v1.2.3-70-g09d2 From f2f078a1bbbce1631a99150029541544e621b6be Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Thu, 9 Aug 2018 20:17:43 +0200 Subject: pass: update completion (2018-08-03) --- plugins/pass/_pass | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/plugins/pass/_pass b/plugins/pass/_pass index 715229e76..5f3b8f541 100644 --- a/plugins/pass/_pass +++ b/plugins/pass/_pass @@ -6,11 +6,17 @@ # Brian Mattern # Jason A. Donenfeld . # All Rights Reserved. -# # This file is licensed under the GPLv2+. # Please visit https://git.zx2c4.com/password-store/tree/COPYING for more information. + + +# If you use multiple repositories, you can configure completion like this: # -# Oh my zsh plugin maintainer: Santiago Borrazás +# compdef _pass workpass +# zstyle ':completion::complete:workpass::' prefix "$HOME/work/pass" +# workpass() { +# PASSWORD_STORE_DIR=$HOME/work/pass pass $@ +# } _pass () { @@ -117,8 +123,9 @@ _pass_cmd_show () { } _pass_complete_entries_helper () { local IFS=$'\n' - local prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}" - _values -C 'passwords' ${$(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print 2>/dev/null | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' | sort):-""} + local prefix + zstyle -s ":completion:${curcontext}:" prefix prefix || prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}" + _values -C 'passwords' ${$(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print 2>/dev/null | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' -e 's#\\#\\\\#' | sort):-""} } _pass_complete_entries_with_subdirs () { -- cgit v1.2.3-70-g09d2 From 1691cf8a99e437a6f7860334105207640cd46978 Mon Sep 17 00:00:00 2001 From: Tushar Tiwari Date: Mon, 13 Aug 2018 15:11:25 -0400 Subject: Add alias for git add --verbose (#3167) Add alias `gav='git add -v'` fixes #6793 --- 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 04ff22164..d093dcc83 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -44,6 +44,7 @@ alias ga='git add' alias gaa='git add --all' alias gapa='git add --patch' alias gau='git add --update' +alias gav='git add --verbose' alias gap='git apply' alias gb='git branch' -- cgit v1.2.3-70-g09d2 From af1709cfdc57bce75f641f5ea8171ae97d6f246c Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Mon, 13 Aug 2018 22:07:07 +0200 Subject: kubectl: use kubectl to define aliases This prevents conflicts with other utilities named k (see #6408). --- plugins/kubectl/kubectl.plugin.zsh | 64 +++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index f91475b6c..a4a6b1b88 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -14,53 +14,53 @@ fi alias k=kubectl # Apply a YML file -alias kaf='k apply -f' +alias kaf='kubectl apply -f' # Drop into an interactive terminal on a container -alias keti='k exec -ti' +alias keti='kubectl exec -ti' # Manage configuration quickly to switch contexts between local, dev ad staging. -alias kcuc='k config use-context' -alias kcsc='k config set-context' -alias kcdc='k config delete-context' -alias kccc='k config current-context' +alias kcuc='kubectl config use-context' +alias kcsc='kubectl config set-context' +alias kcdc='kubectl config delete-context' +alias kccc='kubectl config current-context' # Pod management. -alias kgp='k get pods' -alias kep='k edit pods' -alias kdp='k describe pods' -alias kdelp='k delete pods' +alias kgp='kubectl get pods' +alias kep='kubectl edit pods' +alias kdp='kubectl describe pods' +alias kdelp='kubectl delete pods' # Service management. -alias kgs='k get svc' -alias kes='k edit svc' -alias kds='k describe svc' -alias kdels='k delete svc' +alias kgs='kubectl get svc' +alias kes='kubectl edit svc' +alias kds='kubectl describe svc' +alias kdels='kubectl delete svc' # Ingress management -alias kgi='k get ingress' -alias kei='k edit ingress' -alias kdi='k describe ingress' -alias kdeli='k delete ingress' +alias kgi='kubectl get ingress' +alias kei='kubectl edit ingress' +alias kdi='kubectl describe ingress' +alias kdeli='kubectl delete ingress' # Secret management -alias kgsec='k get secret' -alias kdsec='k describe secret' -alias kdelsec='k delete secret' +alias kgsec='kubectl get secret' +alias kdsec='kubectl describe secret' +alias kdelsec='kubectl delete secret' # Deployment management. -alias kgd='k get deployment' -alias ked='k edit deployment' -alias kdd='k describe deployment' -alias kdeld='k delete deployment' -alias ksd='k scale deployment' -alias krsd='k rollout status deployment' +alias kgd='kubectl get deployment' +alias ked='kubectl edit deployment' +alias kdd='kubectl describe deployment' +alias kdeld='kubectl delete deployment' +alias ksd='kubectl scale deployment' +alias krsd='kubectl rollout status deployment' # Rollout management. -alias kgrs='k get rs' -alias krh='k rollout history' -alias kru='k rollout undo' +alias kgrs='kubectl get rs' +alias krh='kubectl rollout history' +alias kru='kubectl rollout undo' # Logs -alias kl='k logs' -alias klf='k logs -f' +alias kl='kubectl logs' +alias klf='kubectl logs -f' -- cgit v1.2.3-70-g09d2 From 035d78120cb41297068967d3205a23bee22b9543 Mon Sep 17 00:00:00 2001 From: Peter Bittner Date: Wed, 15 Aug 2018 19:44:06 +0200 Subject: Add Git alias for `git diff --staged` (#7064) --- 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 d093dcc83..93b835b77 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -89,6 +89,7 @@ alias gd='git diff' alias gdca='git diff --cached' alias gdcw='git diff --cached --word-diff' alias gdct='git describe --tags `git rev-list --tags --max-count=1`' +alias gds='git diff --staged' alias gdt='git diff-tree --no-commit-id --name-only -r' alias gdw='git diff --word-diff' -- cgit v1.2.3-70-g09d2 From a52a5fb1f4a5ca4bacc67e117872cfc4eb1d6417 Mon Sep 17 00:00:00 2001 From: Dennis Hägler Date: Thu, 16 Aug 2018 17:52:45 +0200 Subject: Remove the white space The white space is causing an error and bundler cannot find any commands! --- plugins/bundler/bundler.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 589f2cfce..b0b286af5 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -1,4 +1,4 @@ -alias be="bundle exec " +alias be="bundle exec" alias bl="bundle list" alias bp="bundle package" alias bo="bundle open" -- cgit v1.2.3-70-g09d2 From ff6b4c835be54a9529a88849b83284aee61a7126 Mon Sep 17 00:00:00 2001 From: 15cm Date: Wed, 26 Apr 2017 15:56:50 +0800 Subject: tmux: do not auto-load tmux inside of Emacs/Vim When Emacs and Vim are launched from outside of an interactive shell, $TMUX and $STY are not set; check for Emacs and Vim environment variables instead. --- 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 4a7986389..7ddf42099 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -80,7 +80,7 @@ compdef _tmux _zsh_tmux_plugin_run alias tmux=_zsh_tmux_plugin_run # Autostart if not already in tmux and enabled. -if [[ -z "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" ]]; then +if [[ -z "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" && -z "$INSIDE_EMACS" && -z "$EMACS" && -z "$VIM" ]]; then # Actually don't autostart if we already did and multiple autostarts are disabled. if [[ "$ZSH_TMUX_AUTOSTART_ONCE" == "false" || "$ZSH_TMUX_AUTOSTARTED" != "true" ]]; then export ZSH_TMUX_AUTOSTARTED=true -- cgit v1.2.3-70-g09d2 From e8b9958926c6e41fc681983bf4ec7d96e21e27db Mon Sep 17 00:00:00 2001 From: John Burwell Date: Sun, 3 Apr 2016 01:08:06 -0400 Subject: Add jenv plugin Initializes jenv and provides the jenv_prompt_info funtion to add Java version information to prompts. This function is stubbed in prompt_info_functions script to allow it to be safely called regardless of whether or not the jenv plugin is loaded. It also splits detection of the plugin/versions directory and bin directory to suppport the way Homebrew splits the jenv bin and data directories --- lib/prompt_info_functions.zsh | 2 +- plugins/jenv/README.md | 3 +++ plugins/jenv/jenv.plugin.zsh | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 plugins/jenv/README.md create mode 100644 plugins/jenv/jenv.plugin.zsh diff --git a/lib/prompt_info_functions.zsh b/lib/prompt_info_functions.zsh index 335c02a3d..1d5c23e41 100644 --- a/lib/prompt_info_functions.zsh +++ b/lib/prompt_info_functions.zsh @@ -12,7 +12,7 @@ # Real implementations will be used when the respective plugins are loaded function chruby_prompt_info hg_prompt_info pyenv_prompt_info \ rbenv_prompt_info svn_prompt_info vi_mode_prompt_info \ - virtualenv_prompt_info { + virtualenv_prompt_info jenv_prompt_info { return 1 } diff --git a/plugins/jenv/README.md b/plugins/jenv/README.md new file mode 100644 index 000000000..2f27d6786 --- /dev/null +++ b/plugins/jenv/README.md @@ -0,0 +1,3 @@ +# jenv oh-my-zsh plugin + +[jenv](http://www.jenv.be/) is a Java version manager similiar to [rbenv](http://rbenv.org/) and [pyenv]|(https://github.com/yyuu/pyenv). This plugin initializes jenv and adds provides the jenv_prompt_info function to add Java version information to prompts. diff --git a/plugins/jenv/jenv.plugin.zsh b/plugins/jenv/jenv.plugin.zsh new file mode 100644 index 000000000..f131aa2f9 --- /dev/null +++ b/plugins/jenv/jenv.plugin.zsh @@ -0,0 +1,33 @@ +_homebrew-installed() { + type brew &> /dev/null +} + +_jenv-from-homebrew-installed() { + brew --prefix jenv &> /dev/null +} + +jenvdirs=("$HOME/.jenv" "/usr/local/jenv" "/opt/jenv") +if _homebrew-installed && _jenv-from-homebrew-installed ; then + jenvdirs+=($(brew --prefix jenv) "${jenvdirs[@]}") +fi + +FOUND_JENV=0 +for jenvdir in "${jenvdirs[@]}" ; do + if [ -d $jenvdir/bin -a $FOUND_JENV -eq 0 ] ; then + FOUND_JENV=1 + export PATH="${jenvdir}/bin:$PATH" + eval "$(jenv init - zsh)" + + function jenv_prompt_info() { + echo "$(jenv version-name)" + } + fi + if [ -d $jenvdir/versions -a $FOUND_JENV -eq 0 ] ; then + export JENV_ROOT=$jenvdir + fi +done +unset jenvdir + +if [ $FOUND_JENV -eq 0 ] ; then + function jenv_prompt_info() { echo "system: $(java -version 2>&1 | cut -f 2 -d ' ')" } +fi -- cgit v1.2.3-70-g09d2 From 3a822bb5fdc30e5b623f409af5c894fe9ad90d15 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sun, 19 Aug 2018 19:32:48 +0200 Subject: jenv: refactor and optimize logic --- plugins/jenv/jenv.plugin.zsh | 43 ++++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/plugins/jenv/jenv.plugin.zsh b/plugins/jenv/jenv.plugin.zsh index f131aa2f9..6c52635bb 100644 --- a/plugins/jenv/jenv.plugin.zsh +++ b/plugins/jenv/jenv.plugin.zsh @@ -1,33 +1,30 @@ -_homebrew-installed() { - type brew &> /dev/null -} - -_jenv-from-homebrew-installed() { - brew --prefix jenv &> /dev/null -} - jenvdirs=("$HOME/.jenv" "/usr/local/jenv" "/opt/jenv") -if _homebrew-installed && _jenv-from-homebrew-installed ; then - jenvdirs+=($(brew --prefix jenv) "${jenvdirs[@]}") -fi FOUND_JENV=0 -for jenvdir in "${jenvdirs[@]}" ; do - if [ -d $jenvdir/bin -a $FOUND_JENV -eq 0 ] ; then +for jenvdir in $jenvdirs; do + if [[ -d "${jenvdir}/bin" ]]; then FOUND_JENV=1 - export PATH="${jenvdir}/bin:$PATH" - eval "$(jenv init - zsh)" + break + fi +done - function jenv_prompt_info() { - echo "$(jenv version-name)" - } +if [[ $FOUND_JENV -eq 0 ]]; then + if (( $+commands[brew] )) && jenvdir="$(brew --prefix jenv)"; then + FOUND_JENV=1 fi - if [ -d $jenvdir/versions -a $FOUND_JENV -eq 0 ] ; then +fi + +if [[ $FOUND_JENV -eq 1 ]]; then + export PATH="${jenvdir}/bin:$PATH" + eval "$(jenv init - zsh)" + + function jenv_prompt_info() { jenv version-name 2>/dev/null } + + if [[ -d "${jenvdir}/versions" ]]; then export JENV_ROOT=$jenvdir fi -done -unset jenvdir - -if [ $FOUND_JENV -eq 0 ] ; then +else function jenv_prompt_info() { echo "system: $(java -version 2>&1 | cut -f 2 -d ' ')" } fi + +unset jenvdir FOUND_JENV -- cgit v1.2.3-70-g09d2 From 873dc9cfb8ddc3c9bb398e9dbb27ebea7f6cab81 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sun, 19 Aug 2018 19:41:49 +0200 Subject: jenv: update README --- plugins/jenv/README.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/plugins/jenv/README.md b/plugins/jenv/README.md index 2f27d6786..8899d21ae 100644 --- a/plugins/jenv/README.md +++ b/plugins/jenv/README.md @@ -1,3 +1,13 @@ -# jenv oh-my-zsh plugin +# jenv plugin -[jenv](http://www.jenv.be/) is a Java version manager similiar to [rbenv](http://rbenv.org/) and [pyenv]|(https://github.com/yyuu/pyenv). This plugin initializes jenv and adds provides the jenv_prompt_info function to add Java version information to prompts. +[jenv](https://www.jenv.be/) is a Java version manager similiar to [rbenv](https://github.com/rbenv/rbenv) +and [pyenv]|(https://github.com/yyuu/pyenv). + +This plugin initializes jenv and adds provides the jenv_prompt_info function to add Java +version information to prompts. + +To use, add `jenv` to your plugins array in your zshrc file: + +```zsh +plugins=(... jenv) +``` -- cgit v1.2.3-70-g09d2 From 3edd424af2316628c7ab8d86b9b2e0207f48fd6f Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sun, 19 Aug 2018 19:43:35 +0200 Subject: jenv: small fix --- 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 6c52635bb..cead0077b 100644 --- a/plugins/jenv/jenv.plugin.zsh +++ b/plugins/jenv/jenv.plugin.zsh @@ -27,4 +27,4 @@ else function jenv_prompt_info() { echo "system: $(java -version 2>&1 | cut -f 2 -d ' ')" } fi -unset jenvdir FOUND_JENV +unset jenvdir jenvdirs FOUND_JENV -- cgit v1.2.3-70-g09d2 From be65adc6c364e842307c7b4e8da30f0162b629f0 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sun, 19 Aug 2018 21:36:21 +0200 Subject: git-extras: update completion (2018-05-24 0f76863) --- plugins/git-extras/git-extras.plugin.zsh | 225 ++++++++++++++++++++++++++----- 1 file changed, 194 insertions(+), 31 deletions(-) diff --git a/plugins/git-extras/git-extras.plugin.zsh b/plugins/git-extras/git-extras.plugin.zsh index afc1679cc..ef6c35988 100644 --- a/plugins/git-extras/git-extras.plugin.zsh +++ b/plugins/git-extras/git-extras.plugin.zsh @@ -47,6 +47,14 @@ __gitex_commits() { _describe -t commits commit commits && ret=0 } +__gitex_remote_names() { + local expl + declare -a remote_names + remote_names=(${(f)"$(_call_program remotes git remote 2>/dev/null)"}) + __git_command_successful || return + _wanted remote-names expl remote-name compadd $* - $remote_names +} + __gitex_tag_names() { local expl declare -a tag_names @@ -69,7 +77,11 @@ __gitex_specific_branch_names() { declare -a branch_names branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/"$1" 2>/dev/null)"}#refs/heads/$1/}) __git_command_successful || return - _wanted branch-names expl branch-name compadd $* - $branch_names + _wanted branch-names expl branch-name compadd - $branch_names +} + +__gitex_chore_branch_names() { + __gitex_specific_branch_names 'chore' } __gitex_feature_branch_names() { @@ -102,6 +114,11 @@ __gitex_author_names() { } # subcommands +_git-authors() { + _arguments -C \ + '(--list -l)'{--list,-l}'[show authors]' \ + '--no-email[without email]' \ +} _git-bug() { local curcontext=$curcontext state line ret=1 @@ -126,8 +143,16 @@ _git-bug() { _arguments -C \ ':branch-name:__gitex_bug_branch_names' ;; + -r|--remote ) + _arguments -C \ + ':remote-name:__gitex_remote_names' + ;; esac + return 0 esac + + _arguments \ + '(--remote -r)'{--remote,-r}'[setup remote tracking branch]' } @@ -136,6 +161,40 @@ _git-changelog() { '(-l --list)'{-l,--list}'[list commits]' \ } +_git-chore() { + local curcontext=$curcontext state line ret=1 + declare -A opt_args + + _arguments -C \ + ': :->command' \ + '*:: :->option-or-argument' && ret=0 + + case $state in + (command) + declare -a commands + commands=( + 'finish:merge and delete the chore branch' + ) + _describe -t commands command commands && ret=0 + ;; + (option-or-argument) + curcontext=${curcontext%:*}-$line[1]: + case $line[1] in + (finish) + _arguments -C \ + ':branch-name:__gitex_chore_branch_names' + ;; + -r|--remote ) + _arguments -C \ + ':remote-name:__gitex_remote_names' + ;; + esac + return 0 + esac + + _arguments \ + '(--remote -r)'{--remote,-r}'[setup remote tracking branch]' +} _git-contrib() { @@ -149,6 +208,27 @@ _git-count() { '--all[detailed commit count]' } +_git-create-branch() { + local curcontext=$curcontext state line + _arguments -C \ + ': :->command' \ + '*:: :->option-or-argument' + + case "$state" in + (command) + _arguments \ + '(--remote -r)'{--remote,-r}'[setup remote tracking branch]' + ;; + (option-or-argument) + curcontext=${curcontext%:*}-$line[1]: + case $line[1] in + -r|--remote ) + _arguments -C \ + ':remote-name:__gitex_remote_names' + ;; + esac + esac +} _git-delete-branch() { _arguments \ @@ -220,10 +300,17 @@ _git-feature() { _arguments -C \ ':branch-name:__gitex_feature_branch_names' ;; + -r|--remote ) + _arguments -C \ + ':remote-name:__gitex_remote_names' + ;; esac + return 0 esac -} + _arguments \ + '(--remote -r)'{--remote,-r}'[setup remote tracking branch]' +} _git-graft() { _arguments \ @@ -231,14 +318,39 @@ _git-graft() { ':dest-branch-name:__gitex_branch_names' } +_git-guilt() { + _arguments -C \ + '(--email -e)'{--email,-e}'[display author emails instead of names]' \ + '(--ignore-whitespace -w)'{--ignore-whitespace,-w}'[ignore whitespace only changes]' \ + '(--debug -d)'{--debug,-d}'[output debug information]' \ + '-h[output usage information]' +} _git-ignore() { _arguments -C \ '(--local -l)'{--local,-l}'[show local gitignore]' \ - '(--global -g)'{--global,-g}'[show global gitignore]' + '(--global -g)'{--global,-g}'[show global gitignore]' \ + '(--private -p)'{--private,-p}'[show repo gitignore]' } +_git-ignore() { + _arguments -C \ + '(--append -a)'{--append,-a}'[append .gitignore]' \ + '(--replace -r)'{--replace,-r}'[replace .gitignore]' \ + '(--list-in-table -l)'{--list-in-table,-l}'[print available types in table format]' \ + '(--list-alphabetically -L)'{--list-alphabetically,-L}'[print available types in alphabetical order]' \ + '(--search -s)'{--search,-s}'[search word in available types]' +} + + +_git-merge-into() { + _arguments '--ff-only[merge only fast-forward]' + _arguments \ + ':src:__gitex_branch_names' \ + ':dest:__gitex_branch_names' +} + _git-missing() { _arguments \ ':first-branch-name:__gitex_branch_names' \ @@ -269,8 +381,16 @@ _git-refactor() { _arguments -C \ ':branch-name:__gitex_refactor_branch_names' ;; + -r|--remote ) + _arguments -C \ + ':remote-name:__gitex_remote_names' + ;; esac + return 0 esac + + _arguments \ + '(--remote -r)'{--remote,-r}'[setup remote tracking branch]' } @@ -279,6 +399,23 @@ _git-squash() { ':branch-name:__gitex_branch_names' } +_git-stamp() { + _arguments -C \ + '(--replace -r)'{--replace,-r}'[replace stamps with same id]' +} + +_git-standup() { + _arguments -C \ + '-a[Specify the author of commits. Use "all" to specify all authors.]' \ + '-d[Show history since N days ago]' \ + '-D[Specify the date format displayed in commit history]' \ + '-f[Fetch commits before showing history]' \ + '-g[Display GPG signed info]' \ + '-h[Display help message]' \ + '-L[Enable the inclusion of symbolic links]' \ + '-m[The depth of recursive directory search]' +} + _git-summary() { _arguments '--line[summarize with lines rather than commits]' __gitex_commits @@ -291,45 +428,71 @@ _git-undo(){ '(--hard -h)'{--hard,-h}'[wipes your commit(s)]' } -zstyle ':completion:*:*:git:*' user-commands \ +zstyle -g existing_user_commands ':completion:*:*:git:*' user-commands + +zstyle ':completion:*:*:git:*' user-commands $existing_user_commands \ alias:'define, search and show aliases' \ - archive-file:'export the current HEAD of the git repository to a archive' \ + archive-file:'export the current head of the git repository to an archive' \ + authors:'generate authors report' \ back:'undo and stage latest commits' \ - bug:'create a bug branch' \ - changelog:'populate changelog file with commits since the previous tag' \ - commits-since:'list commits since a given date' \ - contrib:'display author contributions' \ - count:'count commits' \ - create-branch:'create local and remote branch' \ - delete-branch:'delete local and remote branch' \ - delete-merged-branches:'delete merged branches'\ - delete-submodule:'delete submodule' \ - delete-tag:'delete local and remote tag' \ - effort:'display effort statistics' \ - extras:'git-extras' \ - feature:'create a feature branch' \ + bug:'create bug branch' \ + bulk:'run bulk commands' \ + changelog:'generate a changelog report' \ + chore:'create chore branch' \ + clear-soft:'soft clean up a repository' \ + clear:'rigorously clean up a repository' \ + commits-since:'show commit logs since some date' \ + contrib:'show user contributions' \ + count:'show commit count' \ + create-branch:'create branches' \ + delete-branch:'delete branches' \ + delete-merged-branches:'delete merged branches' \ + delete-submodule:'delete submodules' \ + delete-tag:'delete tags' \ + delta:'lists changed files' \ + effort:'show effort statistics on file(s)' \ + extras:'awesome git utilities' \ + feature:'create/merge feature branch' \ + force-clone:'overwrite local repositories with clone' \ fork:'fork a repo on github' \ - fresh-branch:'create empty local branch' \ - gh-pages:'create the GitHub Pages branch' \ - graft:'merge commits from source branch to destination branch' \ - ignore:'add patterns to .gitignore' \ - info:'show info about the repository' \ - local-commits:'list unpushed commits on the local branch' \ + fresh-branch:'create fresh branches' \ + gh-pages:'create the github pages branch' \ + graft:'merge and destroy a given branch' \ + guilt:'calculate change between two revisions' \ + ignore-io:'get sample gitignore file' \ + ignore:'add .gitignore patterns' \ + info:'returns information on current repository' \ + local-commits:'list local commits' \ lock:'lock a file excluded from version control' \ locked:'ls files that have been locked' \ + merge-into:'merge one branch into another' \ + merge-repo:'merge two repo histories' \ missing:'show commits missing from another branch' \ + mr:'checks out a merge request locally' \ + obliterate:'rewrite past commits to remove some files' \ pr:'checks out a pull request locally' \ + psykorebase:'rebase a branch with a merge commit' \ + pull-request:'create pull request to GitHub project' \ + reauthor:'replace the author and/or committer identities in commits and tags' \ rebase-patch:'rebases a patch' \ - refactor:'create a refactor branch' \ + refactor:'create refactor branch' \ release:'commit, tag and push changes to the repository' \ + rename-branch:'rename a branch' \ rename-tag:'rename a tag' \ - repl:'read-eval-print-loop' \ + repl:'git read-eval-print-loop' \ reset-file:'reset one file' \ root:'show path of root' \ - setup:'setup a git repository' \ + scp:'copy files to ssh compatible `git-remote`' \ + sed:'replace patterns in git-controlled files' \ + setup:'set up a git repository' \ + show-merged-branches:'show merged branches' \ show-tree:'show branch tree of commit history' \ - squash:'merge commits from source branch into the current one as a single commit' \ - summary:'repository summary' \ - touch:'one step creation of new files' \ - undo:'remove the latest commit' \ + show-unmerged-branches:'show unmerged branches' \ + squash:'import changes from a branch' \ + stamp:'stamp the last commit message' \ + standup:'recall the commit history' \ + summary:'show repository summary' \ + sync:'sync local branch with remote branch' \ + touch:'touch and add file to the index' \ + undo:'remove latest commits' \ unlock:'unlock a file excluded from version control' -- cgit v1.2.3-70-g09d2 From b743ce92249726fe444911213bf2ed55099158d3 Mon Sep 17 00:00:00 2001 From: Sumit Sahrawat Date: Mon, 20 Aug 2018 01:09:58 +0530 Subject: Add scu-* aliases for 'systemctl --user' commands (#6661) --- plugins/systemd/systemd.plugin.zsh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/systemd/systemd.plugin.zsh b/plugins/systemd/systemd.plugin.zsh index 5a35ecbc7..7cd27d450 100644 --- a/plugins/systemd/systemd.plugin.zsh +++ b/plugins/systemd/systemd.plugin.zsh @@ -10,7 +10,13 @@ sudo_commands=( for c in $user_commands; do; alias sc-$c="systemctl $c"; done for c in $sudo_commands; do; alias sc-$c="sudo systemctl $c"; done +for c in $user_commands; do; alias scu-$c="systemctl --user $c"; done +for c in $sudo_commands; do; alias scu-$c="systemctl --user $c"; done alias sc-enable-now="sc-enable --now" alias sc-disable-now="sc-disable --now" alias sc-mask-now="sc-mask --now" + +alias scu-enable-now="scu-enable --now" +alias scu-disable-now="scu-disable --now" +alias scu-mask-now="scu-mask --now" -- cgit v1.2.3-70-g09d2 From 0de3b29fd3fde0d5d95271cb076a12931ccee7d8 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Sun, 19 Aug 2018 15:46:22 -0400 Subject: composer: Fix bin directory when Composer is not available (#6240) * Fix for Composer's bin when Composer isn't global When Composer isn't globally installed, the `composer global` call results in an error. This checks to see if Composer is available before making the call. When Composer isn't available, it will just manually set the directories. * Fix Composer brackets in global bin directory * composer: Apply feedback from ricpelo This applies ricpelo's feedback at https://github.com/robbyrussell/oh-my-zsh/pull/6240#pullrequestreview-64253321 * composer: Fix path check syntax * composer: test with $commands[] syntax --- plugins/composer/composer.plugin.zsh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh index d00813e39..634961023 100644 --- a/plugins/composer/composer.plugin.zsh +++ b/plugins/composer/composer.plugin.zsh @@ -51,5 +51,10 @@ alias cgrm='composer global remove' # install composer in the current directory alias cget='curl -s https://getcomposer.org/installer | php' -# Add Composer's global binaries to PATH -export PATH=$PATH:$(composer global config bin-dir --absolute 2>/dev/null) +# Add Composer's global binaries to PATH, using Composer if available. +if (( $+commands[composer] )); then + export PATH=$PATH:$(composer global config bin-dir --absolute 2>/dev/null) +else + [ -d $HOME/.composer/vendor/bin ] && export PATH=$PATH:$HOME/.composer/vendor/bin + [ -d $HOME/.config/composer/vendor/bin ] && export PATH=$PATH:$HOME/.config/composer/vendor/bin +fi -- cgit v1.2.3-70-g09d2 From dc948826b21470081c7d6b8dd22ceee45ce96c7c Mon Sep 17 00:00:00 2001 From: Scott Kidder Date: Sun, 19 Aug 2018 16:14:55 -0400 Subject: ember-cli : Add alias for ember test --serve (#6492) --- plugins/ember-cli/README.md | 3 ++- plugins/ember-cli/ember-cli.plugin.zsh | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/ember-cli/README.md b/plugins/ember-cli/README.md index 2e4ed7068..b46373619 100644 --- a/plugins/ember-cli/README.md +++ b/plugins/ember-cli/README.md @@ -1,6 +1,6 @@ # Ember CLI -**Maintainers:** [BilalBudhani](https://github.com/BilalBudhani), [eubenesa](https://github.com/eubenesa) +**Maintainers:** [BilalBudhani](https://github.com/BilalBudhani), [eubenesa](https://github.com/eubenesa), [scottkidder](https://github.com/scottkidder] Ember CLI (https://www.ember-cli.com/) @@ -17,5 +17,6 @@ Alias | Ember-CLI command **ein** | *ember init* **ei** | *ember install* **et** | *ember test* +**ets** | *ember test --serve* **eu** | *ember update* **ev** | *ember version* diff --git a/plugins/ember-cli/ember-cli.plugin.zsh b/plugins/ember-cli/ember-cli.plugin.zsh index 3d06fd2f5..67842c120 100644 --- a/plugins/ember-cli/ember-cli.plugin.zsh +++ b/plugins/ember-cli/ember-cli.plugin.zsh @@ -10,6 +10,7 @@ alias eh='ember help' alias ein='ember init' alias ei='ember install' alias et='ember test' +alias ets='ember test --serve' alias eu='ember update' # version -- cgit v1.2.3-70-g09d2 From e4d2d27af4ba10ae456b5676f3b70573b01d9538 Mon Sep 17 00:00:00 2001 From: Frederic Crozat Date: Sun, 19 Aug 2018 22:28:37 +0200 Subject: Agnoster: solarized light variant (#4680) * agnoster: do not hardcode black foreground. This would allow easy customization when using light color schemes, like solarized-light * agnoster: implement light theme variant Use same variable as in blinks theme, to detect if solarized theme used is a light or dark one. --- themes/agnoster.zsh-theme | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index d91f98735..d1a69c560 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -16,6 +16,10 @@ # using it on Mac OS X, [iTerm 2](https://iterm2.com/) over Terminal.app - # it has significantly better color fidelity. # +# If using with "light" variant of the Solarized color schema, set +# SOLARIZED_THEME variable to "light". If you don't specify, we'll assume +# you're using the "dark" variant. +# # # Goals # # The aim of this theme is to only show you *relevant* information. Like most @@ -30,6 +34,11 @@ CURRENT_BG='NONE' +case ${SOLARIZED_THEME:-dark} in + light) CURRENT_FG='white';; + *) CURRENT_FG='black';; +esac + # Special Powerline characters () { @@ -101,7 +110,7 @@ prompt_git() { if [[ -n $dirty ]]; then prompt_segment yellow black else - prompt_segment green black + prompt_segment green $CURRENT_FG fi if [[ -e "${repo_path}/BISECT_LOG" ]]; then @@ -164,7 +173,7 @@ prompt_hg() { st='±' else # if working copy is clean - prompt_segment green black + prompt_segment green $CURRENT_FG fi echo -n $(hg prompt "☿ {rev}@{branch}") $st else @@ -178,7 +187,7 @@ prompt_hg() { prompt_segment yellow black st='±' else - prompt_segment green black + prompt_segment green $CURRENT_FG fi echo -n "☿ $rev@$branch" $st fi @@ -187,7 +196,7 @@ prompt_hg() { # Dir: current working directory prompt_dir() { - prompt_segment blue black '%~' + prompt_segment blue $CURRENT_FG '%~' } # Virtualenv: current working virtualenv -- cgit v1.2.3-70-g09d2 From fceae90219c1c8b422a6d0e220e45ce59b9b737a Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sun, 19 Aug 2018 22:33:44 +0200 Subject: jenv: fix brew directory search `brew --prefix jenv` doesn't ensure jenv is installed so we have to recheck if the bin folder is still there. --- 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 cead0077b..14c586be9 100644 --- a/plugins/jenv/jenv.plugin.zsh +++ b/plugins/jenv/jenv.plugin.zsh @@ -10,7 +10,7 @@ done if [[ $FOUND_JENV -eq 0 ]]; then if (( $+commands[brew] )) && jenvdir="$(brew --prefix jenv)"; then - FOUND_JENV=1 + [[ -d "${jenvdir}/bin" ]] && FOUND_JENV=1 fi fi -- cgit v1.2.3-70-g09d2 From abca62add1a6d0ac34e697beac8682076d5c1dd7 Mon Sep 17 00:00:00 2001 From: Michele Iacobone Date: Sun, 19 Aug 2018 22:43:47 +0200 Subject: Fix for external dependency in trapd00r theme (#5579) --- themes/trapd00r.zsh-theme | 64 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 57 insertions(+), 7 deletions(-) diff --git a/themes/trapd00r.zsh-theme b/themes/trapd00r.zsh-theme index 3fa5d57ab..fa8d21898 100644 --- a/themes/trapd00r.zsh-theme +++ b/themes/trapd00r.zsh-theme @@ -1,8 +1,9 @@ # trapd00r.zsh-theme # -# This theme needs a terminal supporting 256 colors as well as unicode. It also -# needs the script that splits up the current path and makes it fancy as located -# here: https://github.com/trapd00r/utils/blob/master/zsh_path +# This theme needs a terminal supporting 256 colors as well as unicode. +# In order to avoid external dependencies, it also embeds a (possibly old) +# copy of the perl script located at https://github.com/trapd00r/utils/blob/master/zsh_path, +# which splits up the current path and makes it fancy. # # By default it spans over two lines like so: # @@ -35,6 +36,54 @@ local c11=$(printf "\e[38;5;208m\e[1m") local c12=$(printf "\e[38;5;142m\e[1m") local c13=$(printf "\e[38;5;196m\e[1m") +local zsh_path_pl=' + +use strict; +use Term::ExtendedColor "fg"; + +chomp(my $pwd = `pwd`); + +my @chars = split//, $pwd; + +my $i = 1; + +for(@chars) { + if($_ eq "/") { + if(defined($ENV{DISPLAY})) { + if($i == 1) { + print fg("green28", fg("bold", " /")); + $i++; + next; + } + } + else { + if($i == 1) { + print "\e[31;1m /\e[0m"; + $i++; + next; + } + } + + if(defined($ENV{DISPLAY})) { + print fg("yellow$i", " » "); + $i += 6 + } + else { + print "\e[33m > \e[0m"; + $i += 6; + } + } + else { + if(defined($ENV{DISPLAY})) { + print fg("green28", $_); + } + else { + print "\e[34m$_\e[0m"; + } + } +} + +' # We don't want to use the extended colorset in the TTY / VC. if [ "$TERM" = "linux" ]; then @@ -67,28 +116,29 @@ add-zsh-hook precmd prompt_jnrowe_precmd prompt_jnrowe_precmd () { vcs_info if [ "${vcs_info_msg_0_}" = "" ]; then - dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" + dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(echo $zsh_path_pl | perl)%} %{$c0%}(%{$c5%}%?%{$c0%})" PROMPT='%{$fg_bold[green]%}%p%{$reset_color%}${vcs_info_msg_0_}${dir_status} ${ret_status}%{$reset_color%} > ' # modified, to be committed elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then - dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" + dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(echo $zsh_path_pl | perl)%} %{$c0%}(%{$c5%}%?%{$c0%})" PROMPT='${vcs_info_msg_0_}%{$30%} %{$bg_bold[red]%}%{$fg_bold[cyan]%}C%{$fg_bold[black]%}OMMIT%{$reset_color%} %{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%} > ' elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then - dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" + dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(echo $zsh_path_pl | perl)%} %{$c0%}(%{$c5%}%?%{$c0%})" PROMPT='${vcs_info_msg_0_}%{$bg_bold[red]%}%{$fg_bold[blue]%}D%{$fg_bold[black]%}IRTY%{$reset_color%} %{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%} %{$c13%}>%{$c0%} ' else - dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" + dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(echo $zsh_path_pl | perl)%} %{$c0%}(%{$c5%}%?%{$c0%})" PROMPT='${vcs_info_msg_0_} %{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%} > ' fi } + # vim: set ft=zsh sw=2 et tw=0: -- cgit v1.2.3-70-g09d2 From 1d26e2ab6f0b57ae8599d59e120df2aea1f125f3 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Mon, 20 Aug 2018 17:35:02 +0200 Subject: trapd00r: convert perl script to zsh Used color encodings from https://metacpan.org/source/WOLDRICH/Term-ExtendedColor-0.224/lib/Term/ExtendedColor.pm --- themes/trapd00r.zsh-theme | 92 ++++++++++++++++++++++------------------------- 1 file changed, 42 insertions(+), 50 deletions(-) mode change 100644 => 100755 themes/trapd00r.zsh-theme diff --git a/themes/trapd00r.zsh-theme b/themes/trapd00r.zsh-theme old mode 100644 new mode 100755 index fa8d21898..2feca08b9 --- a/themes/trapd00r.zsh-theme +++ b/themes/trapd00r.zsh-theme @@ -36,54 +36,46 @@ local c11=$(printf "\e[38;5;208m\e[1m") local c12=$(printf "\e[38;5;142m\e[1m") local c13=$(printf "\e[38;5;196m\e[1m") -local zsh_path_pl=' - -use strict; -use Term::ExtendedColor "fg"; - -chomp(my $pwd = `pwd`); - -my @chars = split//, $pwd; - -my $i = 1; - -for(@chars) { - if($_ eq "/") { - if(defined($ENV{DISPLAY})) { - if($i == 1) { - print fg("green28", fg("bold", " /")); - $i++; - next; - } - } - else { - if($i == 1) { - print "\e[31;1m /\e[0m"; - $i++; - next; - } - } - - if(defined($ENV{DISPLAY})) { - print fg("yellow$i", " » "); - $i += 6 - } - else { - print "\e[33m > \e[0m"; - $i += 6; - } - } - else { - if(defined($ENV{DISPLAY})) { - print fg("green28", $_); - } - else { - print "\e[34m$_\e[0m"; - } - } + +zsh_path() { + local -A yellow + yellow=( + 1 '%F{228}' 2 '%F{222}' 3 '%F{192}' 4 '%F{186}' + 5 '%F{227}' 6 '%F{221}' 7 '%F{191}' 8 '%F{185}' + 9 '%F{226}' 10 '%F{220}' 11 '%F{190}' 12 '%F{184}' + 13 '%F{214}' 14 '%F{178}' 15 '%F{208}' 16 '%F{172}' + 17 '%F{202}' 18 '%F{166}' + ) + + local c i=1 + for c (${(s::)PWD}); do + if [[ $c = "/" ]]; then + if [[ $i -eq 1 ]]; then + if [[ -n "$DISPLAY" ]]; then + print -Pn '%F{065}%B /%b%f' + else + print -Pn '\e[31;1m /%f' + fi + (( i++ )) + continue + fi + + if [[ -n "$DISPLAY" ]]; then + print -Pn "${yellow[$i]:-%f} » %f" + else + print -Pn "%F{yellow} > %f" + fi + (( i += 6 )) + else + if [[ -n "$DISPLAY" ]]; then + print -Pn "%F{065}$c%f" + else + print -Pn "%F{blue}$c%f" + fi + fi + done } -' # We don't want to use the extended colorset in the TTY / VC. if [ "$TERM" = "linux" ]; then @@ -116,24 +108,24 @@ add-zsh-hook precmd prompt_jnrowe_precmd prompt_jnrowe_precmd () { vcs_info if [ "${vcs_info_msg_0_}" = "" ]; then - dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(echo $zsh_path_pl | perl)%} %{$c0%}(%{$c5%}%?%{$c0%})" + dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" PROMPT='%{$fg_bold[green]%}%p%{$reset_color%}${vcs_info_msg_0_}${dir_status} ${ret_status}%{$reset_color%} > ' # modified, to be committed elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then - dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(echo $zsh_path_pl | perl)%} %{$c0%}(%{$c5%}%?%{$c0%})" + dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" PROMPT='${vcs_info_msg_0_}%{$30%} %{$bg_bold[red]%}%{$fg_bold[cyan]%}C%{$fg_bold[black]%}OMMIT%{$reset_color%} %{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%} > ' elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then - dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(echo $zsh_path_pl | perl)%} %{$c0%}(%{$c5%}%?%{$c0%})" + dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" PROMPT='${vcs_info_msg_0_}%{$bg_bold[red]%}%{$fg_bold[blue]%}D%{$fg_bold[black]%}IRTY%{$reset_color%} %{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%} %{$c13%}>%{$c0%} ' else - dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(echo $zsh_path_pl | perl)%} %{$c0%}(%{$c5%}%?%{$c0%})" + dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" PROMPT='${vcs_info_msg_0_} %{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%} > ' -- cgit v1.2.3-70-g09d2 From 4774bc62d5e1799ff531f2713f4a8cb493a406a1 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Mon, 20 Aug 2018 17:45:36 +0200 Subject: trapd00r: look for 256-color support, not $DISPLAY Checking if the terminal supports 256 colors is better suited for our purpose. Checking if `$DISPLAY` is set doesn't tell us if our colors will be displayed correctly. --- themes/trapd00r.zsh-theme | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/themes/trapd00r.zsh-theme b/themes/trapd00r.zsh-theme index 2feca08b9..51d5387e0 100755 --- a/themes/trapd00r.zsh-theme +++ b/themes/trapd00r.zsh-theme @@ -38,6 +38,9 @@ local c13=$(printf "\e[38;5;196m\e[1m") zsh_path() { + local colors + colors=$(echoti colors) + local -A yellow yellow=( 1 '%F{228}' 2 '%F{222}' 3 '%F{192}' 4 '%F{186}' @@ -51,7 +54,7 @@ zsh_path() { for c (${(s::)PWD}); do if [[ $c = "/" ]]; then if [[ $i -eq 1 ]]; then - if [[ -n "$DISPLAY" ]]; then + if [[ $colors -ge 256 ]]; then print -Pn '%F{065}%B /%b%f' else print -Pn '\e[31;1m /%f' @@ -60,14 +63,14 @@ zsh_path() { continue fi - if [[ -n "$DISPLAY" ]]; then + if [[ $colors -ge 256 ]]; then print -Pn "${yellow[$i]:-%f} » %f" else print -Pn "%F{yellow} > %f" fi (( i += 6 )) else - if [[ -n "$DISPLAY" ]]; then + if [[ $colors -ge 256 ]]; then print -Pn "%F{065}$c%f" else print -Pn "%F{blue}$c%f" -- cgit v1.2.3-70-g09d2 From 3d1719c618e83b03ec7fae023444cdacf729f63a Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Mon, 20 Aug 2018 17:50:11 +0200 Subject: trapd00r: optimize reset of foreground colors --- themes/trapd00r.zsh-theme | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/themes/trapd00r.zsh-theme b/themes/trapd00r.zsh-theme index 51d5387e0..a1db9945c 100755 --- a/themes/trapd00r.zsh-theme +++ b/themes/trapd00r.zsh-theme @@ -55,28 +55,29 @@ zsh_path() { if [[ $c = "/" ]]; then if [[ $i -eq 1 ]]; then if [[ $colors -ge 256 ]]; then - print -Pn '%F{065}%B /%b%f' + print -Pn "%F{065}%B /%b" else - print -Pn '\e[31;1m /%f' + print -Pn "\e[31;1m /" fi (( i++ )) continue fi if [[ $colors -ge 256 ]]; then - print -Pn "${yellow[$i]:-%f} » %f" + print -Pn "${yellow[$i]:-%f} » " else - print -Pn "%F{yellow} > %f" + print -Pn "%F{yellow} > " fi (( i += 6 )) else if [[ $colors -ge 256 ]]; then - print -Pn "%F{065}$c%f" + print -Pn "%F{065}$c" else - print -Pn "%F{blue}$c%f" + print -Pn "%F{blue}$c" fi fi done + print -Pn "%f" } -- cgit v1.2.3-70-g09d2 From b4c8b60bb45f00f3cd68000ceda3c96b2ad852ed Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Mon, 20 Aug 2018 17:55:22 +0200 Subject: trapd00r: change more slowly between yellows Also refactor the logic --- themes/trapd00r.zsh-theme | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/themes/trapd00r.zsh-theme b/themes/trapd00r.zsh-theme index a1db9945c..33579e728 100755 --- a/themes/trapd00r.zsh-theme +++ b/themes/trapd00r.zsh-theme @@ -59,16 +59,15 @@ zsh_path() { else print -Pn "\e[31;1m /" fi - (( i++ )) - continue - fi - - if [[ $colors -ge 256 ]]; then - print -Pn "${yellow[$i]:-%f} » " else - print -Pn "%F{yellow} > " + if [[ $colors -ge 256 ]]; then + print -Pn "${yellow[$i]:-%f} » " + else + print -Pn "%F{yellow} > " + fi fi - (( i += 6 )) + + (( i++ )) else if [[ $colors -ge 256 ]]; then print -Pn "%F{065}$c" -- cgit v1.2.3-70-g09d2 From e97262499780caadf5388c3b612100b87da39548 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Mon, 20 Aug 2018 18:03:41 +0200 Subject: trapd00r: simplify logic and optimize for loop This version splits the `$PWD` by the slashes and prints the path directory by directory, printing the separators as before. --- themes/trapd00r.zsh-theme | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/themes/trapd00r.zsh-theme b/themes/trapd00r.zsh-theme index 33579e728..7c36487b3 100755 --- a/themes/trapd00r.zsh-theme +++ b/themes/trapd00r.zsh-theme @@ -50,31 +50,29 @@ zsh_path() { 17 '%F{202}' 18 '%F{166}' ) - local c i=1 - for c (${(s::)PWD}); do - if [[ $c = "/" ]]; then - if [[ $i -eq 1 ]]; then - if [[ $colors -ge 256 ]]; then - print -Pn "%F{065}%B /%b" - else - print -Pn "\e[31;1m /" - fi + local dir i=1 + for dir (${(s:/:)PWD}); do + if [[ $i -eq 1 ]]; then + if [[ $colors -ge 256 ]]; then + print -Pn "%F{065}%B /%b" else - if [[ $colors -ge 256 ]]; then - print -Pn "${yellow[$i]:-%f} » " - else - print -Pn "%F{yellow} > " - fi + print -Pn "\e[31;1m /" fi - - (( i++ )) else if [[ $colors -ge 256 ]]; then - print -Pn "%F{065}$c" + print -Pn "${yellow[$i]:-%f} » " else - print -Pn "%F{blue}$c" + print -Pn "%F{yellow} > " fi fi + + (( i++ )) + + if [[ $colors -ge 256 ]]; then + print -Pn "%F{065}$dir" + else + print -Pn "%F{blue}$dir" + fi done print -Pn "%f" } -- cgit v1.2.3-70-g09d2 From b70a703a09627e6d96fe9184e9a40395b625a0cd Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Mon, 20 Aug 2018 18:15:49 +0200 Subject: trapd00r: clean up the script --- themes/trapd00r.zsh-theme | 68 +++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 37 deletions(-) diff --git a/themes/trapd00r.zsh-theme b/themes/trapd00r.zsh-theme index 7c36487b3..144d2549a 100755 --- a/themes/trapd00r.zsh-theme +++ b/themes/trapd00r.zsh-theme @@ -1,8 +1,8 @@ # trapd00r.zsh-theme # # This theme needs a terminal supporting 256 colors as well as unicode. -# In order to avoid external dependencies, it also embeds a (possibly old) -# copy of the perl script located at https://github.com/trapd00r/utils/blob/master/zsh_path, +# In order to avoid external dependencies, it also has a zsh version of +# the perl script at https://github.com/trapd00r/utils/blob/master/zsh_path, # which splits up the current path and makes it fancy. # # By default it spans over two lines like so: @@ -21,20 +21,20 @@ autoload -U add-zsh-hook autoload -Uz vcs_info -local c0=$( printf "\e[m") -local c1=$( printf "\e[38;5;245m") -local c2=$( printf "\e[38;5;250m") -local c3=$( printf "\e[38;5;242m") -local c4=$( printf "\e[38;5;197m") -local c5=$( printf "\e[38;5;225m") -local c6=$( printf "\e[38;5;240m") -local c7=$( printf "\e[38;5;242m") -local c8=$( printf "\e[38;5;244m") -local c9=$( printf "\e[38;5;162m") -local c10=$(printf "\e[1m") -local c11=$(printf "\e[38;5;208m\e[1m") -local c12=$(printf "\e[38;5;142m\e[1m") -local c13=$(printf "\e[38;5;196m\e[1m") +local c0=$'\e[m' +local c1=$'\e[38;5;245m' +local c2=$'\e[38;5;250m' +local c3=$'\e[38;5;242m' +local c4=$'\e[38;5;197m' +local c5=$'\e[38;5;225m' +local c6=$'\e[38;5;240m' +local c7=$'\e[38;5;242m' +local c8=$'\e[38;5;244m' +local c9=$'\e[38;5;162m' +local c10=$'\e[1m' +local c11=$'\e[38;5;208m\e[1m' +local c12=$'\e[38;5;142m\e[1m' +local c13=$'\e[38;5;196m\e[1m' zsh_path() { @@ -79,20 +79,19 @@ zsh_path() { # We don't want to use the extended colorset in the TTY / VC. -if [ "$TERM" = "linux" ]; then - c1=$( printf "\e[34;1m") - c2=$( printf "\e[35m") - c3=$( printf "\e[31m") - c4=$( printf "\e[31;1m") - c5=$( printf "\e[32m") - c6=$( printf "\e[32;1m") - c7=$( printf "\e[33m") - c8=$( printf "\e[33;1m") - c9=$( printf "\e[34m") - - c11=$(printf "\e[35;1m") - c12=$(printf "\e[36m") - c13=$(printf "\e[31;1m") +if [ "$TERM" = linux ]; then + c1=$'\e[34;1m' + c2=$'\e[35m' + c3=$'\e[31m' + c4=$'\e[31;1m' + c5=$'\e[32m' + c6=$'\e[32;1m' + c7=$'\e[33m' + c8=$'\e[33;1m' + c9=$'\e[34m' + c11=$'\e[35;1m' + c12=$'\e[36m' + c13=$'\e[31;1m' fi zstyle ':vcs_info:*' actionformats \ @@ -112,14 +111,12 @@ prompt_jnrowe_precmd () { dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" PROMPT='%{$fg_bold[green]%}%p%{$reset_color%}${vcs_info_msg_0_}${dir_status} ${ret_status}%{$reset_color%} > ' - -# modified, to be committed + # modified, to be committed elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" PROMPT='${vcs_info_msg_0_}%{$30%} %{$bg_bold[red]%}%{$fg_bold[cyan]%}C%{$fg_bold[black]%}OMMIT%{$reset_color%} %{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%} > ' - elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" PROMPT='${vcs_info_msg_0_}%{$bg_bold[red]%}%{$fg_bold[blue]%}D%{$fg_bold[black]%}IRTY%{$reset_color%} @@ -130,8 +127,5 @@ prompt_jnrowe_precmd () { PROMPT='${vcs_info_msg_0_} %{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%} > ' -fi + fi } - - -# vim: set ft=zsh sw=2 et tw=0: -- cgit v1.2.3-70-g09d2 From 314f9dfcb393af65a326ee4cbbf77363aaf415c3 Mon Sep 17 00:00:00 2001 From: jack Date: Fri, 24 Aug 2018 02:01:01 +0800 Subject: github: fix new_gh to force-add .gitignore (#7086) --- plugins/github/github.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh index fd19fb524..8e4b97352 100644 --- a/plugins/github/github.plugin.zsh +++ b/plugins/github/github.plugin.zsh @@ -36,7 +36,7 @@ new_gh() { # [DIRECTORY] print '.*'"\n"'*~' >> .gitignore git add [^.]* \ || return - git add .gitignore \ + git add -f .gitignore \ || return git commit -m 'Initial commit.' \ || return -- cgit v1.2.3-70-g09d2 From 2bb10441da3e9715d580706c9a3aab060350b0e3 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Thu, 23 Aug 2018 20:28:20 +0200 Subject: nyan: deprecate plugin with removal notice Fixes #6826 --- plugins/nyan/nyan.plugin.zsh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/plugins/nyan/nyan.plugin.zsh b/plugins/nyan/nyan.plugin.zsh index ac9d0017e..c21c784d9 100644 --- a/plugins/nyan/nyan.plugin.zsh +++ b/plugins/nyan/nyan.plugin.zsh @@ -1,5 +1,10 @@ -if [[ -x `which nc` ]]; then - alias nyan='nc -v nyancat.dakko.us 23' # nyan cat -fi - - +print -Pn '%F{yellow}' +cat >&2 <<-EOD + nyan plugin: + The nyancat server used by this plugin was shut down due to increased + bandwidth costs, so the nyan plugin no longer works. You can get the + same functionality in some distributions by installing the nyancat package, + or you can compile it yourself. + See https://github.com/klange/nyancat for more information. +EOD +print -Pn '%f' -- cgit v1.2.3-70-g09d2 From 652356b9b99b26317478a8756893f896abbed6cd Mon Sep 17 00:00:00 2001 From: Joel Wallis Jucá Date: Thu, 23 Aug 2018 17:04:42 -0300 Subject: git: add the `git show` alias `gsh` (#5591) --- 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 93b835b77..36f0ff448 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -226,6 +226,7 @@ alias grv='git remote -v' alias gsb='git status -sb' alias gsd='git svn dcommit' +alias gsh='git show' alias gsi='git submodule init' alias gsps='git show --pretty=short --show-signature' alias gsr='git svn rebase' -- cgit v1.2.3-70-g09d2 From 2c1100c0e5af5999621872321aaa11533ae24097 Mon Sep 17 00:00:00 2001 From: Ryan Stull Date: Wed, 29 Aug 2018 09:15:11 -0400 Subject: Updating 'sbcl' to 'sbcln' (#7095) Changing 'sbcl' to 'sbcln' so it doesn't collide with 'Steel Bank Common Lisp', a popular lisp implementation. --- plugins/sbt/sbt.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sbt/sbt.plugin.zsh b/plugins/sbt/sbt.plugin.zsh index 8fabf0add..f883b7fee 100644 --- a/plugins/sbt/sbt.plugin.zsh +++ b/plugins/sbt/sbt.plugin.zsh @@ -10,7 +10,7 @@ alias sbc='sbt compile' alias sbcc='sbt clean compile' alias sbco='sbt console' alias sbcq='sbt console-quick' -alias sbcl='sbt clean' +alias sbcln='sbt clean' alias sbcp='sbt console-project' alias sbd='sbt doc' alias sbdc='sbt dist:clean' -- cgit v1.2.3-70-g09d2 From e93378aacd313a11b83da1d0d7480c1840cd2532 Mon Sep 17 00:00:00 2001 From: Kris Kalavantavanich Date: Wed, 29 Aug 2018 20:18:20 +0700 Subject: [plugins/git] Updated git clone alias (#6893) * Updated git clone alias `git clone --recursive` has been deprecated in favor of `--recurse-submodules`. See: https://stackoverflow.com/questions/3796927 --- 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 36f0ff448..916866ff5 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -71,7 +71,7 @@ alias gcam='git commit -a -m' alias gcsm='git commit -s -m' alias gcb='git checkout -b' alias gcf='git config --list' -alias gcl='git clone --recursive' +alias gcl='git clone --recurse-submodules' alias gclean='git clean -fd' alias gpristine='git reset --hard && git clean -dfx' alias gcm='git checkout master' -- cgit v1.2.3-70-g09d2 From 77d75d7fcdcc7978246b84e6b3f0e95a0595c452 Mon Sep 17 00:00:00 2001 From: Samuel Lelièvre Date: Wed, 29 Aug 2018 20:50:52 +0200 Subject: Clarify random theme setting (#7090) Clarify random theme setting, in particular how to know which theme was loaded if picked at random. --- templates/zshrc.zsh-template | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 5f98fb211..7cd2a873b 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -4,23 +4,23 @@ # Path to your oh-my-zsh installation. export ZSH=$HOME/.oh-my-zsh -# Set name of the theme to load. Optionally, if you set this to "random" -# it'll load a random theme each time that oh-my-zsh is loaded. +# Set name of the theme to load --- if set to "random", it will +# load a random theme each time oh-my-zsh is loaded, in which case, +# to know which specific one was loaded, run: echo $RANDOM_THEME # See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes ZSH_THEME="robbyrussell" -# Set list of themes to load -# Setting this variable when ZSH_THEME=random -# cause zsh load theme from this variable instead of -# looking in ~/.oh-my-zsh/themes/ -# An empty array have no effect +# Set list of themes to pick from when loading at random +# Setting this variable when ZSH_THEME=random will cause zsh to load +# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/ +# If set to an empty array, this variable will have no effect. # ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) # Uncomment the following line to use case-sensitive completion. # CASE_SENSITIVE="true" -# Uncomment the following line to use hyphen-insensitive completion. Case -# sensitive completion must be off. _ and - will be interchangeable. +# Uncomment the following line to use hyphen-insensitive completion. +# Case-sensitive completion must be off. _ and - will be interchangeable. # HYPHEN_INSENSITIVE="true" # Uncomment the following line to disable bi-weekly auto-update checks. @@ -57,7 +57,8 @@ ZSH_THEME="robbyrussell" # Would you like to use another custom folder than $ZSH/custom? # ZSH_CUSTOM=/path/to/new-custom-folder -# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) +# Which plugins would you like to load? +# Standard plugins can be found in ~/.oh-my-zsh/plugins/* # 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. -- cgit v1.2.3-70-g09d2 From 39221643b06e5c5ee884978787b08c74de850ec2 Mon Sep 17 00:00:00 2001 From: Dan O'Brien Date: Wed, 29 Aug 2018 14:51:50 -0400 Subject: Add aliases for kubectl nodes (#7093) * Add aliases for kubectl nodes * change to have 'o' at the end. My teammate noticed there's no namespacing shortcuts either and will be doing a PR on them with kgna. --- plugins/kubectl/kubectl.plugin.zsh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index a4a6b1b88..492e6ff00 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -64,3 +64,9 @@ alias kru='kubectl rollout undo' # Logs alias kl='kubectl logs' alias klf='kubectl logs -f' + +# Node Management +alias kgno='kubectl get nodes' +alias keno='kubectl edit node' +alias kdno='kubectl describe node' +alias kdelno='kubectl delete node' -- cgit v1.2.3-70-g09d2 From 5cc6de67bd65d78cdf021345a5fa5d697049b347 Mon Sep 17 00:00:00 2001 From: Aiden <38707987+aidenhx@users.noreply.github.com> Date: Thu, 30 Aug 2018 02:53:24 +0800 Subject: Update brew.plugin.zsh (#6947) add aliases for `brew pin` and `brew list --pinned` --- plugins/brew/brew.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh index 6fb7f3453..60b81f8ec 100644 --- a/plugins/brew/brew.plugin.zsh +++ b/plugins/brew/brew.plugin.zsh @@ -1,4 +1,6 @@ +alias brewp='brew pin' alias brews='brew list -1' +alias brewsp='brew list --pinned' alias bubo='brew update && brew outdated' alias bubc='brew upgrade && brew cleanup' alias bubu='bubo && bubc' -- cgit v1.2.3-70-g09d2 From 8ec0937653f30277361621191e8cee01b7fc089d Mon Sep 17 00:00:00 2001 From: Matthew Murphy Date: Wed, 29 Aug 2018 14:55:23 -0400 Subject: Update golang.plugin.zsh (#6750) add alias to cd to $GOPATH, $GOPATH/src, $GOPATH/bin --- plugins/golang/golang.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/golang/golang.plugin.zsh b/plugins/golang/golang.plugin.zsh index 64c80e864..919c98629 100644 --- a/plugins/golang/golang.plugin.zsh +++ b/plugins/golang/golang.plugin.zsh @@ -188,6 +188,9 @@ alias gofa='go fmt ./...' alias gog='go get' alias goi='go install' alias gol='go list' +alias gop='cd $GOPATH' +alias gopb='cd $GOPATH/bin' +alias gops='cd $GOPATH/src' alias gor='go run' alias got='go test' alias gov='go vet' -- cgit v1.2.3-70-g09d2 From e7c9bf8d669bd4ec0c63041e37adb17f3fc1b567 Mon Sep 17 00:00:00 2001 From: Vinod Damle Date: Wed, 29 Aug 2018 14:56:30 -0400 Subject: kubectl: add alias for `kubectl cp` (#7068) --- plugins/kubectl/kubectl.plugin.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index 492e6ff00..197ada37b 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -65,8 +65,11 @@ alias kru='kubectl rollout undo' alias kl='kubectl logs' alias klf='kubectl logs -f' +# File copy +alias kcp='kubectl cp' + # Node Management alias kgno='kubectl get nodes' alias keno='kubectl edit node' alias kdno='kubectl describe node' -alias kdelno='kubectl delete node' +alias kdelno='kubectl delete node' \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 2b6434e8793a876e5465edd9c75819166878aba6 Mon Sep 17 00:00:00 2001 From: Konstantin Gribov Date: Wed, 29 Aug 2018 21:57:02 +0300 Subject: Fixed `fwl` function in `firewalld` plugin when `sources` used (#7011) `firewall-cmd --get-active-zones` returns something like this: ``` dmz sources: ipset:dmz-hosts public interfaces: eth0 ``` if zone binding is based on source ips, so strings with `sources: ...` should be excluded along with `interfaces: ...` to get zones list. --- plugins/firewalld/firewalld.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/firewalld/firewalld.plugin.zsh b/plugins/firewalld/firewalld.plugin.zsh index bfbf6f48f..5b1090636 100644 --- a/plugins/firewalld/firewalld.plugin.zsh +++ b/plugins/firewalld/firewalld.plugin.zsh @@ -6,7 +6,7 @@ alias fwrp="sudo firewall-cmd --runtime-to-permanent" function fwl () { # converts output to zsh array () # @f flag split on new line - zones=("${(@f)$(sudo firewall-cmd --get-active-zones | grep -v interfaces)}") + zones=("${(@f)$(sudo firewall-cmd --get-active-zones | grep -v 'interfaces\|sources')}") for i in $zones; do sudo firewall-cmd --zone $i --list-all -- cgit v1.2.3-70-g09d2 From 84aa274604f33bf440df81fbe73543b072018d47 Mon Sep 17 00:00:00 2001 From: Janosch Schwalm Date: Wed, 29 Aug 2018 20:59:27 +0200 Subject: executing gradlew, when gradlew-file exists (#6485) --- plugins/gradle/gradle.plugin.zsh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/gradle/gradle.plugin.zsh b/plugins/gradle/gradle.plugin.zsh index c7047552d..8df62c2e2 100644 --- a/plugins/gradle/gradle.plugin.zsh +++ b/plugins/gradle/gradle.plugin.zsh @@ -1,6 +1,18 @@ ############################################################################## # A descriptive listing of core Gradle commands ############################################################################ + +gradle-or-gradlew() { + if [ -f ./gradlew ] ; then + echo "executing gradlew instead of gradle"; + ./gradlew "$@"; + else + gradle "$@"; + fi +} + +alias gradle=gradle-or-gradlew; + function _gradle_core_commands() { local ret=1 state _arguments ':subcommand:->subcommand' && ret=0 -- cgit v1.2.3-70-g09d2 From 3cd8eaf9bb1382ff4f35e614904a4f16553e0dcb Mon Sep 17 00:00:00 2001 From: Janosch Schwalm Date: Wed, 29 Aug 2018 21:00:06 +0200 Subject: execute mvnw with "mvn" when mvnw-file is present (#6484) * executing mvnw, when mvnw-file exists indriectly enable autocompletion for mvnw * inform the user :) --- plugins/mvn/mvn.plugin.zsh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index d422ba5c7..74583c6dc 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -20,6 +20,15 @@ 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 +mvn-or-mvnw() { + if [ -f ./mvnw ] ; then + echo "executing mvnw instead of mvn" + ./mvnw "$@"; + else + mvn "$@"; + fi +} # Wrapper function for Maven's mvn command. mvn-color() { @@ -40,6 +49,9 @@ mvn-color() { # Override the mvn command with the colorized one. #alias mvn="mvn-color" +# either use orignal mvn oder the mvn wrapper +alias mvn="mvn-or-mvnw" + # aliases alias mvncie='mvn clean install eclipse:eclipse' alias mvnci='mvn clean install' @@ -276,3 +288,5 @@ function listMavenCompletions { } compctl -K listMavenCompletions mvn +compctl -K listMavenCompletions mvn-or-mvnw + -- cgit v1.2.3-70-g09d2 From 285b540167a665bbe45da780f3fb35da2d4aea60 Mon Sep 17 00:00:00 2001 From: Balint Gyapjas Date: Wed, 29 Aug 2018 21:00:35 +0200 Subject: vi-mode show indicator on zle-line-init and SIGWINCH (#6449) --- plugins/vi-mode/vi-mode.plugin.zsh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh index 82a2f3040..a1889d451 100644 --- a/plugins/vi-mode/vi-mode.plugin.zsh +++ b/plugins/vi-mode/vi-mode.plugin.zsh @@ -4,9 +4,15 @@ function zle-keymap-select() { zle -R } +# Ensures that MODE_INDITCATOR is displayed on terminal start up. +function zle-line-init() { + zle reset-prompt +} + # Ensure that the prompt is redrawn when the terminal size changes. TRAPWINCH() { zle && zle -R + zle reset-prompt } zle -N zle-keymap-select -- cgit v1.2.3-70-g09d2 From 143cc8f90158f39d8630f26e9b0865502a467c61 Mon Sep 17 00:00:00 2001 From: Nick Diego Yamane Date: Wed, 29 Aug 2018 15:01:10 -0400 Subject: Fix rvm-prompt usage in fino* themes (#6477) * theme/fino: Check rvm-prompt is installed before to try to use it Signed-off-by: Nick Diego Yamane * theme/fino-time: Check rvm-prompt is installed before to try to use it Signed-off-by: Nick Diego Yamane --- themes/fino-time.zsh-theme | 8 ++++++-- themes/fino.zsh-theme | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/themes/fino-time.zsh-theme b/themes/fino-time.zsh-theme index 9b1db3a08..c1a48d02a 100644 --- a/themes/fino-time.zsh-theme +++ b/themes/fino-time.zsh-theme @@ -25,12 +25,16 @@ function box_name { } -local rvm_ruby='‹$(rvm-prompt i v g)›%{$reset_color%}' +rvm_ruby='' +if type rvm-prompt &>/dev/null; then + rvm_ruby='using%{$FG[243]%}‹$(rvm-prompt i v g)›%{$reset_color%}' +fi + local current_dir='${PWD/#$HOME/~}' local git_info='$(git_prompt_info)' -PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}${current_dir}%{$reset_color%}${git_info} %{$FG[239]%}using%{$FG[243]%} ${rvm_ruby} %D - %* +PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}${current_dir}%{$reset_color%}${git_info} %{$FG[239]%}${rvm_ruby} %D - %* ╰─$(virtualenv_info)$(prompt_char) " ZSH_THEME_GIT_PROMPT_PREFIX=" %{$FG[239]%}on%{$reset_color%} %{$fg[255]%}" diff --git a/themes/fino.zsh-theme b/themes/fino.zsh-theme index 6eec097f5..71ed6bbbc 100644 --- a/themes/fino.zsh-theme +++ b/themes/fino.zsh-theme @@ -22,10 +22,10 @@ function box_name { local ruby_env='' if which rvm-prompt &> /dev/null; then - ruby_env=' ‹$(rvm-prompt i v g)›%{$reset_color%}' + ruby_env='using%{$FG[243]%} ‹$(rvm-prompt i v g)›%{$reset_color%}' else if which rbenv &> /dev/null; then - ruby_env=' ‹$(rbenv version-name)›%{$reset_color%}' + ruby_env='using%{$FG[243]%} ‹$(rbenv version-name)›%{$reset_color%}' fi fi @@ -34,7 +34,7 @@ local git_info='$(git_prompt_info)' local prompt_char='$(prompt_char)' -PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}${current_dir}%{$reset_color%}${git_info} %{$FG[239]%}using%{$FG[243]%}${ruby_env} +PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}${current_dir}%{$reset_color%}${git_info} %{$FG[239]%}${ruby_env} ╰─${prompt_char}%{$reset_color%} " ZSH_THEME_GIT_PROMPT_PREFIX=" %{$FG[239]%}on%{$reset_color%} %{$fg[255]%}" -- cgit v1.2.3-70-g09d2 From 94df5038632df5453ffd0ff4b6367399bc5fe7e8 Mon Sep 17 00:00:00 2001 From: Serhii Kuts Date: Wed, 29 Aug 2018 22:01:40 +0300 Subject: Update kubectl.plugin.zsh (#6636) --- plugins/kubectl/kubectl.plugin.zsh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index 197ada37b..680ec1a8c 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -31,6 +31,9 @@ alias kep='kubectl edit pods' alias kdp='kubectl describe pods' alias kdelp='kubectl delete pods' +# get pod by label: kgpl "app=myapp" -n myns +alias kgpl='function _kgpl(){ label=$1; shift; kgp -l $label $*; };_kgpl' + # Service management. alias kgs='kubectl get svc' alias kes='kubectl edit svc' @@ -61,6 +64,9 @@ alias kgrs='kubectl get rs' alias krh='kubectl rollout history' alias kru='kubectl rollout undo' +# Port forwarding +alias kpf="k port-forward" + # Logs alias kl='kubectl logs' alias klf='kubectl logs -f' -- cgit v1.2.3-70-g09d2 From dc8811f81779d0e06ac2cd1372a586576e2c8aef Mon Sep 17 00:00:00 2001 From: Fadi Hadzh Date: Thu, 30 Aug 2018 00:06:11 +0300 Subject: fix nmap vuln category name (#7044) --- plugins/nmap/nmap.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/nmap/nmap.plugin.zsh b/plugins/nmap/nmap.plugin.zsh index 82c275f23..8c691bdaa 100644 --- a/plugins/nmap/nmap.plugin.zsh +++ b/plugins/nmap/nmap.plugin.zsh @@ -13,7 +13,7 @@ # -O - enable OS detection # -sA - TCP ACK scan # -F - fast scan -# --script=vulscan - also access vulnerabilities in target +# --script=vuln - also access vulnerabilities in target alias nmap_open_ports="nmap --open" alias nmap_list_interfaces="nmap --iflist" @@ -24,7 +24,7 @@ alias nmap_check_for_firewall="sudo nmap -sA -p1-65535 -v -T4" alias nmap_ping_through_firewall="nmap -PS -PA" alias nmap_fast="nmap -F -T5 --version-light --top-ports 300" alias nmap_detect_versions="sudo nmap -sV -p1-65535 -O --osscan-guess -T4 -Pn" -alias nmap_check_for_vulns="nmap --script=vulscan" +alias nmap_check_for_vulns="nmap --script=vuln" alias nmap_full_udp="sudo nmap -sS -sU -T4 -A -v -PE -PS22,25,80 -PA21,23,80,443,3389 " alias nmap_traceroute="sudo nmap -sP -PE -PS22,25,80 -PA21,23,80,3389 -PU -PO --traceroute " alias nmap_full_with_scripts="sudo nmap -sS -sU -T4 -A -v -PE -PP -PS21,22,23,25,80,113,31339 -PA80,113,443,10042 -PO --script all " -- cgit v1.2.3-70-g09d2 From 9f1ffc64f1cc9b82ee38b5a947033aa77e16e178 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Fri, 31 Aug 2018 21:18:18 +0200 Subject: vi-mode: reset-prompt if zle is active (TRAPWINCH) Fixes zle errors when resizing: TRAPWINCH:zle: widgets can only be called when ZLE is active --- plugins/vi-mode/vi-mode.plugin.zsh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh index a1889d451..6cadd166a 100644 --- a/plugins/vi-mode/vi-mode.plugin.zsh +++ b/plugins/vi-mode/vi-mode.plugin.zsh @@ -11,8 +11,7 @@ function zle-line-init() { # Ensure that the prompt is redrawn when the terminal size changes. TRAPWINCH() { - zle && zle -R - zle reset-prompt + zle && { zle -R; zle reset-prompt } } zle -N zle-keymap-select -- cgit v1.2.3-70-g09d2 From 0853b74fef0fa3a05af7487ff9b15a7f714bb037 Mon Sep 17 00:00:00 2001 From: Ross Lafferty Date: Sat, 1 Sep 2018 07:37:05 -0400 Subject: jump: fix printf path output (#7105) Using the `jump` plugin, using the `marks` command will yield this output: ``` $ marks desktop marks:printf:5: bad option: -> dotfiles marks:printf:5: bad option: -> home marks:printf:5: bad option: -> ``` the `marks` function uses `printf` with `->` and I believe `-` is used by `printf` for left-justification. changing this to `-- "->"` seems to render the appropriate output. ``` desktop -> /Users/uname/Desktop dotfiles -> /Users/uname/.dotfiles home -> /Users/uname ``` --- plugins/jump/jump.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/jump/jump.plugin.zsh b/plugins/jump/jump.plugin.zsh index 86d9553a2..168dfaba2 100644 --- a/plugins/jump/jump.plugin.zsh +++ b/plugins/jump/jump.plugin.zsh @@ -32,7 +32,7 @@ marks() { 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 -- "-> %s \t\n" $markpath done } -- cgit v1.2.3-70-g09d2 From e41699044277c914a280bc9800b45662b01771f1 Mon Sep 17 00:00:00 2001 From: "Cristian Măgherușan-Stanciu @magheru_san" Date: Mon, 3 Sep 2018 17:09:31 +0200 Subject: fasd: drop-in replace the autojump j alias (#3860) --- plugins/fasd/fasd.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/fasd/fasd.plugin.zsh b/plugins/fasd/fasd.plugin.zsh index 45d10858f..eaaa96f42 100644 --- a/plugins/fasd/fasd.plugin.zsh +++ b/plugins/fasd/fasd.plugin.zsh @@ -8,4 +8,5 @@ if [ $commands[fasd] ]; then # check if fasd is installed alias v="f -e \"$EDITOR\"" alias o='a -e open_command' + alias j='zz' fi -- cgit v1.2.3-70-g09d2 From 69e637c35578305e19dbfc520e65c514180db6ef Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Mon, 3 Sep 2018 17:13:18 +0200 Subject: fasd: use xdg-open in o alias back again Fixes #6314 --- plugins/fasd/fasd.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/fasd/fasd.plugin.zsh b/plugins/fasd/fasd.plugin.zsh index eaaa96f42..36a0428a7 100644 --- a/plugins/fasd/fasd.plugin.zsh +++ b/plugins/fasd/fasd.plugin.zsh @@ -7,6 +7,6 @@ if [ $commands[fasd] ]; then # check if fasd is installed unset fasd_cache alias v="f -e \"$EDITOR\"" - alias o='a -e open_command' + alias o='a -e xdg-open' alias j='zz' fi -- cgit v1.2.3-70-g09d2 From 86542dcd8627d0e9a4b1acd8c01a9cdae4697698 Mon Sep 17 00:00:00 2001 From: Maxime Brunet <32458727+maxbrunet@users.noreply.github.com> Date: Tue, 4 Sep 2018 16:25:45 -0400 Subject: Add fzf plugin (#6910) --- plugins/fzf/README.md | 19 ++++++++++++++++++ plugins/fzf/fzf.plugin.zsh | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 plugins/fzf/README.md create mode 100644 plugins/fzf/fzf.plugin.zsh diff --git a/plugins/fzf/README.md b/plugins/fzf/README.md new file mode 100644 index 000000000..b3a434347 --- /dev/null +++ b/plugins/fzf/README.md @@ -0,0 +1,19 @@ +# fzf + +This plugin enables [junegunn's fzf](https://github.com/junegunn/fzf) fuzzy auto-completion and key bindings + +```zsh +# Set fzf installation directory path +export FZF_BASE=/path/to/fzf/install/dir + +# Uncomment the following line to disable fuzzy completion +# export DISABLE_FZF_AUTO_COMPLETION="true" + +# Uncomment the following line to disable key bindings (CTRL-T, CTRL-R, ALT-C) +# export DISABLE_FZF_KEY_BINDINGS="true" + +plugins=( + ... + fzf +) +``` diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh new file mode 100644 index 000000000..b28b97994 --- /dev/null +++ b/plugins/fzf/fzf.plugin.zsh @@ -0,0 +1,50 @@ +test -d "${FZF_BASE}" && fzf_base="${FZF_BASE}" + +if [[ -z "${fzf_base}" ]]; then + fzfdirs=( + "${HOME}/.fzf" + "/usr/local/opt/fzf" + "/usr/share/fzf" + ) + for dir in ${fzfdirs}; do + if [[ -d "${dir}" ]]; then + fzf_base="${dir}" + break + fi + done + + if [[ -z "${fzf_base}" ]]; then + if (( ${+commands[brew]} )) && dir="$(brew --prefix fzf 2>/dev/null)"; then + if [[ -d "${dir}" ]]; then + fzf_base="${dir}" + fi + fi + fi +fi + +if [[ -n "${fzf_base}" ]]; then + + # Setup fzf + # --------- + if [[ ! "$PATH" == *$fzf_base/bin* ]]; then + export PATH="$PATH:$fzf_base/bin" + fi + + # Auto-completion + # --------------- + if [[ ! "$DISABLE_FZF_AUTO_COMPLETION" == "true" ]]; then + [[ $- == *i* ]] && source "$fzf_base/shell/completion.zsh" 2> /dev/null + fi + + # Key bindings + # ------------ + if [[ ! "$DISABLE_FZF_KEY_BINDINGS" == "true" ]]; then + source "$fzf_base/shell/key-bindings.zsh" + fi + +else + print "[oh-my-zsh] fzf plugin: Cannot find fzf installation directory.\n"\ + "Please add \`export FZF_BASE=/path/to/fzf/install/dir\` to your .zshrc" >&2 +fi + +unset fzf_base -- cgit v1.2.3-70-g09d2 From f73c29a8203f8df539a72d28763bc5f521b775c0 Mon Sep 17 00:00:00 2001 From: Michele Bologna Date: Thu, 6 Sep 2018 20:34:37 +0200 Subject: Feat: add Salt completion plugin (#7031) * Feat: add Salt completion * Docs: add README --- plugins/salt/README.md | 5 + plugins/salt/_salt | 279 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 284 insertions(+) create mode 100644 plugins/salt/README.md create mode 100644 plugins/salt/_salt diff --git a/plugins/salt/README.md b/plugins/salt/README.md new file mode 100644 index 000000000..3d224cce7 --- /dev/null +++ b/plugins/salt/README.md @@ -0,0 +1,5 @@ +## Salt autocomplete plugin + +A copy of the completion script from the +[salt](https://github.com/saltstack/salt/blob/develop/pkg/zsh_completion.zsh) +git repo. diff --git a/plugins/salt/_salt b/plugins/salt/_salt new file mode 100644 index 000000000..10b782af4 --- /dev/null +++ b/plugins/salt/_salt @@ -0,0 +1,279 @@ +#compdef salt salt-call salt-cp salt-run salt-key +# The use-cache style is checked in a few places to allow caching minions, modules, +# or the directory salt is installed in. +# you can cache those three with: +# zstyle ':completion:*:salt(|-cp|-call|-run|-key):*' use-cache true +# and/or selectively: +# zstyle ':completion::complete:salt-key:set-option-a-1:' use-cache false +# zstyle ':completion::complete:salt(|-cp|-call):minions:' use-cache true +# zstyle ':completion::complete:salt(|-call):modules:' use-cache true +# zstyle ':completion::complete:salt(|-cp|-call|-run|-key):salt_dir:' use-cache true +# +# cache validation can be controled with the style cache-ttl. +# it expects two arguments: number (days|hours|weeks|months) +# to invalidate the minion cache after four days: +# zstyle ':completion::complete:salt(|-cp|-call):minions:' cache-ttl 4 days + + +local state line curcontext="$curcontext" salt_dir + +_modules(){ + local _funcs expl curcontext=${curcontext%:*}:modules + + if ! zstyle -m ":completion:$curcontext:" cache-policy '*'; then + zstyle ":completion:$curcontext:" cache-policy _salt_caching_policy + fi + + if _cache_invalid salt/modules || ! _retrieve_cache salt/modules; then + _funcs=( ${${(Q)${${(s. .)"$(_call_program salt-call-cmd salt-call --local --log-level error --out txt sys.list_functions)"}%%[],]##}#\[}:#local:} ) + _store_cache salt/modules _funcs + fi + + _wanted modules expl modules _multi_parts "$@" . _funcs +} + +_runners(){ + local _runs expl curcontext=${curcontext%:*}:runners + + if ! zstyle -m ":completion:$curcontext:" cache-policy '*'; then + zstyle ":completion:$curcontext:" cache-policy _salt_caching_policy + fi + + if _cache_invalid salt/runners || ! _retrieve_cache salt/runners; then + _runs=( ${${(Q)${${(s. .)"$(_call_program salt-call-cmd salt-call --local --log-level error --out txt sys.list_runner_functions)"}%%[],]##}#\[}:#local:} ) + _store_cache salt/runners _runs + fi + + _wanted modules expl runners _multi_parts "$@" . _runs +} + +_minions(){ + local type requested_type include_all key expl; typeset -A _peons + + # when completing the minion argument for salt and salt-cp, set the argument section + # of the context to `minion' not `argument-1' + if [[ $service = salt(|-cp) ]]; then + curcontext=${curcontext%:*}:minions + fi + + # only pass the argument accepted, unaccepted, rejected, denied or all to -t/-T + # the argument is used as part of an tag, accepted-minions, rejected-minions, etc. + # while un, acc, den, etc will work, you will possibly ignore user customized tags. + zparseopts -D -E 't+:=requested_type' 'T+:=include_all' + + if ! zstyle -m ":completion:$curcontext:" cache-policy '*'; then + zstyle ":completion:$curcontext:" cache-policy _salt_caching_policy + fi + + if _cache_invalid salt/minions || ! _retrieve_cache salt/minions; then + # it would be awesome if salt-key could prefix or suffix a word to denote + # the key's state. It would remove the need for this loop, calling salt-key N times. + for type in accepted unaccepted rejected denied; do + salt-key -l $type 2>/dev/null | while read -r key; do + [[ $key == *' Keys:' ]] && continue + _peons+=( "$key" $type ) + done + done + _store_cache salt/minions _peons + fi + + # if salt-key's --include-all option isn't on the line, ignore the -T options + (( words[(I)--include-all] )) || unset include_all + + if (( requested_type[(I)all] )); then + requested_type=( -t accepted -t unaccepted -t rejected -t denied ) + unset include_all + fi + + for type in ${${requested_type:#-t}:-accepted} ${include_all:#-T}; do + _wanted $type-minions expl minion compadd "$@" -M 'r:|.=* r:|=*' ${(k)_peons[(R)$~type]} + done +} + +(( $+functions[_salt_caching_policy] )) || +_salt_caching_policy() { + local oldp ttl d t + zstyle -a ":completion:$curcontext:" cache-ttl ttl + + if (( $#ttl >= 2 )); then + [[ $ttl[1] == <-> ]] && integer t=$ttl[1] + + case $ttl[2] in + seconds#)d=s;; + months#) d=M;; + weeks#) d=w;; + hours#) d=h;; + *) d=d;; + esac + fi + + oldp=( "$1"(Nm${d:-d}+${t:-1}) ) + (( $#oldp )) +} + +local -a _{target,master,logging,minion}_options _{common,out}_opts _target_opt_pat +_target_opt_pat=( + '(-[ELGNRCIS]|--(pcre|list|grain(|-pcre)|nodegroup|range|compound|pillar|ipcidr))' + '(-E --pcre -L --list -G --grain --grain-pcre -N --nodegroup -R --range -C --compound -I --pillar -S --ipcidr)' +) + +_target_options=( + "$_target_opt_pat[2]"{-E,--pcre}'[use pcre regular expressions]:pcre:' + "$_target_opt_pat[2]"{-L,--list}'[take a comma or whitespace delimited list of servers.]:list:' + "$_target_opt_pat[2]"{-G,--grain}'[use a grain value to identify targets]:Grains:' + "$_target_opt_pat[2]--grain-pcre[use a grain value to identify targets.]:pcre:" + "$_target_opt_pat[2]"{-N,--nodegroup}'[use one of the predefined nodegroups to identify a list of targets.]:Nodegroup:' + "$_target_opt_pat[2]"{-R,--range}'[use a range expression to identify targets.]:Range:' + "$_target_opt_pat[2]"{-C,--compound}'[Use multiple targeting options.]:Compound:' + "$_target_opt_pat[2]"{-I,--pillar}'[use a pillar value to identify targets.]:Pillar:' + "$_target_opt_pat[2]"{-S,--ipcidr}'[Match based on Subnet (CIDR notation) or IPv4 address.]:Cidr:' +) + +_common_opts=( + "--version[show program's version number and exit]" + "--versions-report[show program's dependencies version number and exit]" + '(-h --help)'{-h,--help}'[show this help message and exit]' + '(-c --config-dir)'{-c,--config-dir}'[Pass in an alternative configuration directory.(default: /etc/salt/)]:Config Directory:_files -/' + '(-t --timeout)'{-t,--timeout}'[Change the timeout for the running command; default=5]:Timeout (seconds):' +) + +_master_options=( + '(-s --static)'{-s,--static}'[Return the data from minions as a group after they all return.]' + "--async[Run the salt command but don't wait for a reply]" + '(--state-output --state_output)'{--state-output,--state_output}'[Override the configured state_output value for minion output. Default: full]:Outputs:(full terse mixed changes)' + '--subset[Execute the routine on a random subset of the targeted minions]:Subset:' + '(-v --verbose)'{-v,--verbose}'[Turn on command verbosity, display jid and active job queries]' + '--hide-timeout[Hide minions that timeout]' + '(-b --batch --batch-size)'{-b,--batch,--batch-size}'[Execute the salt job in batch mode, pass number or percentage to batch.]:Batch Size:' + '(-a --auth --eauth --extrenal-auth)'{-a,--auth,--eauth,--external-auth}'[Specify an external authentication system to use.]:eauth:' + '(-T --make-token)'{-T,--make-token}'[Generate and save an authentication token for re-use.]' + '--return[Set an alternative return method.]:Returners:_path_files -W "$salt_dir/returners" -g "[^_]*.py(\:r)"' + '(-d --doc --documentation)'{-d,--doc,--documentation}'[Return the documentation for the specified module]' + '--args-separator[Set the special argument used as a delimiter between command arguments of compound commands.]:Arg separator:' +) + +_minion_options=( + '--return[Set an alternative return method.]:Returners:_path_files -W "$salt_dir"/returners" -g "[^_]*.py(\:r)"' + '(-d --doc --documentation)'{-d,--doc,--documentation}'[Return the documentation for the specified module]' + '(-g --grains)'{-g,--grains}'[Return the information generated by the salt grains]' + {*-m,*--module-dirs}'[Specify an additional directory to pull modules from.]:Module Dirs:_files -/' + '--master[Specify the master to use.]:Master:' + '--local[Run salt-call locally, as if there was no master running.]' + '--file-root[Set this directory as the base file root.]:File Root:_files -/' + '--pillar-root[Set this directory as the base pillar root.]:Pillar Root:_files -/' + '--retcode-passthrough[Exit with the salt call retcode and not the salt binary retcode]' + '--id[Specify the minion id to use.]:Minion ID:' + '--skip-grains[Do not load grains.]' + '--refresh-grains-cache[Force a refresh of the grains cache]' +) + +_runner_options=( + '--hard-crash[raise any original exception rather than exiting gracefully]' + '(-d --doc --documentation)'{-d,--doc,--documentation}'[Return the documentation for the specified module]' +) + +_key_options=( + '(-u --user)'{-u+,--user=}'[specify user to run salt-key]:user:_users' + '--hard-crash[raise any original exception rather than exiting gracefully]' + '(-q --quiet)'{-q,--quiet}'[quiet mode]' + '(-y --yes)'{-y,--yes}'[assume yes]' + '--rotate-aes-key[prevents the master from refreshing the key session when keys are deleted or rejected]:boolean:(true false)' + '--gen-keys=[set a name to generate a keypair for use with salt]:key name' + '--gen-keys-dir=[set the directory to save the generated keypair]: : _directories' + '--keysize=[set the size for keypair]:key size' + '--gen-signature[create a signature file of the masters public-key]' + '--priv=[the private-key file to create a signature with]:private key:_files' + '--signature-path=[the path where the signature file should be written]: : _directories' + '--pub=[the public-key file to create a signature for]:public key:_files' + '--auto-create[auto-create a signing key-pair if it does not yet exist]' + '--include-all[include non-pending keys when accepting/rejecting]' + - '(set)' + {-l+,--list=}'[list public keys]:key type:(( + preaccepted\:"unaccepted/unsigned keys" unaccepted\:"unaccepted/unsigned keys" un\:"unaccepted/unsigned keys" + accepted\:"accepted/signed keys" acc\:"accepted/signed keys" + rejected\:"rejected keys" rej\:"rejected keys" + den\:"denied keys" denied\:"denied keys" all + ))' + {-a+,--accept=}'[accept key]:key:_minions -t unaccepted -T rejected' + {-A,--accept-all}'[accept all keys]' + {-r+,--reject=}'[reject key]:key:_minions -t rejected -T accepted' + {-p+,--print=}'[print the specified public key]:key:_minions -t all' + {-P,--print-all}'[print all public keys]' + {-d+,--delete=}'[delete the specified public key]:key:_minions -t all' + {-D,--delete-all}'[delete all public keys]' + {-f+,--finger=}'[print the specified key'\''s fingerprint]:key:_minions -t all' + {-F,--finger-all}'[print the fingerprint of all keys]' +) + +_logging_options=( + '(-l --log-level)'{-l,--log-level}'[Console logging log level.(default: warning)]:Log Level:(all garbage trace debug info warning error critical quiet)' + '--log-file[Log file path. Default: /var/log/salt/master.]:Log File:_files' + '--log-file-level=[Logfile logging log level.Default: warning]:Log Level:(all garbage trace debug info warning error critical quiet)' +) + +_out_opts=( + '(--out --output)'{--out,--output}'[Print the output using the specified outputter.]:Outputters:_path_files -W "$salt_dir/output" -g "[^_]*.py(\:r)"' + '(--out-indent --output-indent)'{--out-indent,--output-indent}'[Print the output indented by the provided value in spaces.]:Number:' + '(--out-file --output-file)'{--out-file,--output-file}'[Write the output to the specified file]:Output File:_files' + '(--no-color --no-colour)'{--no-color,--no-colour}'[Disable all colored output]' + '(--force-color --force-colour)'{--force-color,--force-colour}'[Force colored output]' +) + +_salt_comp(){ + case "$service" in + salt) + _arguments -C \ + "${words[(r)$_target_opt_pat[1]]+!}:minions:_minions" \ + ':modules:_modules' \ + "$_target_options[@]" \ + "$_common_opts[@]" \ + "$_master_options[@]" \ + "$_logging_options[@]" \ + "$_out_opts[@]" + ;; + salt-call) + _arguments -C \ + ':modules:_modules' \ + "$_minion_options[@]" \ + "$_common_opts[@]" \ + "$_logging_options[@]" \ + "$_out_opts[@]" + ;; + salt-cp) + _arguments -C \ + "${words[(r)$_target_opt_pat[1]]+!}:minions:_minions" \ + "$_target_options[@]" \ + "$_common_opts[@]" \ + "$_logging_options[@]" \ + ':Source File:_files' \ + ':Destination File:_files' + ;; + salt-run) + _arguments -C \ + ":runners:_runners" \ + "$_runner_options[@]" \ + "$_common_opts[@]" \ + "$_logging_options[@]" + ;; + salt-key) + _arguments -C \ + "$_key_options[@]" \ + "${_common_opts[@]:#'-t --timeout\)'*}" \ + "${_logging_options[@]:#'(-l --log-level)'*}" + ;; + esac +} + +() { + local curcontext=${curcontext%:*}:salt_dir + if ! zstyle -m ":completion:$curcontext:" cache-policy '*'; then + zstyle ":completion:$curcontext:" cache-policy _salt_caching_policy + fi + + if _cache_invalid salt/salt_dir || ! _retrieve_cache salt/salt_dir; then + salt_dir="${$(python2 -c 'import salt; print(salt.__file__);')%__init__*}" + _store_cache salt/salt_dir salt_dir + fi +} + +_salt_comp "$@" -- cgit v1.2.3-70-g09d2 From bb908495deae22314c3355235133063087698796 Mon Sep 17 00:00:00 2001 From: Maxime Brunet <32458727+maxbrunet@users.noreply.github.com> Date: Sat, 8 Sep 2018 09:31:13 -0400 Subject: fzf: Fix shell directory for archlinux package (#7119) * fzf: Fix shell directory for archlinux package * fzf: Don't clutter PATH if fzf already available * brew has it available via symlink in /usr/local/bin * Fedora and Arch packages have it place in /usr/bin * fzf: Fix archlinux guess by using release file * fzf: unset leftover variables --- plugins/fzf/fzf.plugin.zsh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh index b28b97994..27e2d9246 100644 --- a/plugins/fzf/fzf.plugin.zsh +++ b/plugins/fzf/fzf.plugin.zsh @@ -24,22 +24,29 @@ fi if [[ -n "${fzf_base}" ]]; then + # Fix fzf shell directory for Archlinux package + if [[ ! -d "${fzf_base}/shell" ]] && [[ -f /etc/arch-release ]]; then + fzf_shell="${fzf_base}" + else + fzf_shell="${fzf_base}/shell" + fi + # Setup fzf # --------- - if [[ ! "$PATH" == *$fzf_base/bin* ]]; then + if ! (( ${+commands[fzf]} )) && [[ ! "$PATH" == *$fzf_base/bin* ]]; then export PATH="$PATH:$fzf_base/bin" fi # Auto-completion # --------------- if [[ ! "$DISABLE_FZF_AUTO_COMPLETION" == "true" ]]; then - [[ $- == *i* ]] && source "$fzf_base/shell/completion.zsh" 2> /dev/null + [[ $- == *i* ]] && source "${fzf_shell}/completion.zsh" 2> /dev/null fi # Key bindings # ------------ if [[ ! "$DISABLE_FZF_KEY_BINDINGS" == "true" ]]; then - source "$fzf_base/shell/key-bindings.zsh" + source "${fzf_shell}/key-bindings.zsh" fi else @@ -47,4 +54,4 @@ else "Please add \`export FZF_BASE=/path/to/fzf/install/dir\` to your .zshrc" >&2 fi -unset fzf_base +unset fzf_base fzf_shell dir fzfdirs -- cgit v1.2.3-70-g09d2 From f75d096c1a3863b84cb9788d0934babe4cd3c577 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sat, 8 Sep 2018 21:35:03 +0200 Subject: lib: small change to git_compare_version Fixes #7118 --- lib/git.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git.zsh b/lib/git.zsh index b55b762d7..b92373153 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -185,7 +185,7 @@ function git_prompt_status() { # Outputs -1, 0, or 1 if the installed version is less than, equal to, or # greater than the input version, respectively. function git_compare_version() { - local INPUT_GIT_VERSION INSTALLED_GIT_VERSION + local INPUT_GIT_VERSION INSTALLED_GIT_VERSION i INPUT_GIT_VERSION=(${(s/./)1}) INSTALLED_GIT_VERSION=($(command git --version 2>/dev/null)) INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]}) -- cgit v1.2.3-70-g09d2 From 08a280863661dd44aad20d494187d9c4ba12fac9 Mon Sep 17 00:00:00 2001 From: Iulian Onofrei <6d0847b9@opayq.com> Date: Sun, 9 Sep 2018 01:39:23 +0300 Subject: Fix incorrect error message when running bi without having bundler installed (#7112) --- plugins/bundler/bundler.plugin.zsh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index b0b286af5..668e15d2f 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -54,8 +54,12 @@ done ## Functions bundle_install() { - if _bundler-installed && _within-bundled-project; then - local bundler_version=`bundle --version | cut -d' ' -f3` + if ! _bundler-installed; then + echo "Bundler is not installed" + elif ! _within-bundled-project; then + echo "Can't 'bundle install' outside a bundled project" + else + local bundler_version=`bundle version | cut -d' ' -f3` if [[ $bundler_version > '1.4.0' || $bundler_version = '1.4.0' ]]; then if [[ "$OSTYPE" = (darwin|freebsd)* ]] then @@ -67,8 +71,6 @@ bundle_install() { else bundle install $@ fi - else - echo "Can't 'bundle install' outside a bundled project" fi } -- cgit v1.2.3-70-g09d2 From fe5fe81c8cfa66981c51d149a35fe545f2ef5016 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sun, 9 Sep 2018 19:50:23 +0200 Subject: lib: quote arguments to env_default Fixes #7117 --- lib/misc.zsh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/misc.zsh b/lib/misc.zsh index 3052b7710..f45c10757 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -18,9 +18,8 @@ fi ## jobs setopt long_list_jobs -## pager -env_default PAGER 'less' -env_default LESS '-R' +env_default 'PAGER' 'less' +env_default 'LESS' '-R' ## super user alias alias _='sudo' -- cgit v1.2.3-70-g09d2