Compare View

switch
from
...
to
 
Commits (3)
  • mj
     
  • fd22306 Merge branch 'add-dnf-plugin'
    6245180 Add README to dnf plugin
    c0b1252 Fix deprecated dnf commands
    ee86f1a Create dnf plugin
    26064c6 Merge pull request #4841 from FiloSottile/patch-1
    52737b1 git.plugin: remove the conflicting gvt alias
    a38d7cf Merge pull request #4836 from alias1/patch-1
    2a0be1a Add hash imported from
    db39afe Update _brew to match latest
    15d52fd Merge pull request #4832 from eddie-dunn/master
    78bf3dd pylint.plugin.zsh: Remove include-ids=y
    5464fe3 Center Oh My Zsh logo
    e5f5d79 Merge branch 'low-ghost-patch-1'
    494b07b Update gitignore.plugin: comma separated arguments
    d60cf5c Merge branch 'slariviere-master'
    7daa207 Adding support for stdin input in the encode64 plugin
    40016af Merge pull request #4755 from psprint/master
    77f93f6 znt: optimizations for zsh<=5.2, use $BUFFER if cmd is not from history
    87e782f Merge pull request #4738 from valentinbud/feature-vault
    b9ace28 Vault basic autocompletion.
    071db94 Merge pull request #4713 from apjanke/forklift-new-homepage
    4b9bc91 Merge pull request #4537 from agireud/command-not-found-OSX
    078cd4a Merge pull request #4759 from swrobel/patch-1
    9df79bc Merge pull request #4773 from mbologna/patch-1
    87f8251 Re-added $ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE
    9dd8def forklift: update homepage URL and tweak formatting
    3dfd216 chruby plugin locals moved inside function
    f655793 Add OSX support for command-not-found

    git-subtree-dir: repos/robbyrussell/oh-my-zsh
    git-subtree-split: fd223067c8aea38f09a68746f765ad5aade35e3e

    mj
     
  • mj
     

Changes

Showing 22 changed files Side-by-side Diff

... ... @@ -2,6 +2,14 @@ zsh-config:
2 2 ===========
3 3  
4 4  
  5 +**Update oh-my-zsh**
  6 +--------------------
  7 +
  8 + git fetch --no-tags remote--robbyrussell--oh-my-zsh && \
  9 + git subtree pull --prefix=repos/robbyrussell/oh-my-zsh remote--robbyrussell--oh-my-zsh master --squash
  10 +
  11 +
  12 +
5 13 ToDo:
6 14 -----
7 15  
repos/robbyrussell/oh-my-zsh/README.markdown
1   -![Oh My Zsh](https://s3.amazonaws.com/ohmyzsh/oh-my-zsh-logo.png)
2   -
  1 +<p align="center">
  2 + <img src="https://s3.amazonaws.com/ohmyzsh/oh-my-zsh-logo.png" alt="Oh My Zsh">
  3 +</p>
3 4  
4 5 Oh My Zsh is an open source, community-driven framework for managing your [zsh](http://www.zsh.org/) configuration. That sounds boring. Let's try this again.
5 6  
6 7 __Oh My Zsh is a way of life!__ Once installed, your terminal prompt will become the talk of the town _or your money back!_ Each time you interact with your command prompt, you'll be able to take advantage of the hundreds of bundled plugins and pretty themes. Strangers will come up to you in cafés and ask you, _"that is amazing. are you some sort of genius?"_ Finally, you'll begin to get the sort of attention that you always felt that you deserved. ...or maybe you'll just use the time that you saved to start flossing more often.
7 8  
8   -To learn more, visit [ohmyz.sh](http://ohmyz.sh) and/or follow [ohmyzsh](https://twitter.com/ohmyzsh) on Twitter.
  9 +To learn more, visit [ohmyz.sh](http://ohmyz.sh) and follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter.
9 10  
10 11 ## Getting Started
11 12  
12   -
13 13 ### Prerequisites
14 14  
15 15 __Disclaimer:__ _Oh My Zsh works best on Mac OS X and Linux._
16 16  
17 17 * Unix-based operating system (Mac OS X or Linux)
18   -* [Zsh](http://www.zsh.org) should be installed (v4.3.9 or more recent). If not pre-installed (`zsh --version` to confirm), check the following instruction here: [Installing-ZSH](https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH)
  18 +* [Zsh](http://www.zsh.org) should be installed (v4.3.9 or more recent). If not pre-installed (`zsh --version` to confirm), check the following instruction here: [Installing ZSH](https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH)
19 19 * `curl` or `wget` should be installed
20 20 * `git` should be installed
21 21  
repos/robbyrussell/oh-my-zsh/lib/git.zsh
... ... @@ -37,7 +37,9 @@ function git_remote_status() {
37 37 ahead=$(command git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
38 38 behind=$(command git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
39 39  
40   - if [[ $ahead -gt 0 ]] && [[ $behind -eq 0 ]]; then
  40 + if [[ $ahead -eq 0 ]] && [[ $behind -eq 0 ]]; then
  41 + git_remote_status="$ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE"
  42 + elif [[ $ahead -gt 0 ]] && [[ $behind -eq 0 ]]; then
41 43 git_remote_status="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE"
42 44 git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}"
43 45 elif [[ $behind -gt 0 ]] && [[ $ahead -eq 0 ]]; then
repos/robbyrussell/oh-my-zsh/plugins/brew/_brew
1 1 #compdef brew
2 2 #autoload
3 3  
4   -# imported from the latest homebrew contributions
  4 +# imported from https://github.com/Homebrew/homebrew/blob/29f73d2212c2b202fe25f69dcbf440d8391fa4c9/Library/Contributions/brew_zsh_completion.zsh
  5 +
  6 +# Brew ZSH completion function
  7 +# Drop this somewhere in your $fpath (like /usr/share/zsh/site-functions)
  8 +# and rename it _brew
  9 +#
  10 +# altered from _fink
5 11  
6 12 _brew_all_formulae() {
7 13 formulae=(`brew search`)
... ... @@ -15,6 +21,14 @@ _brew_installed_taps() {
15 21 installed_taps=(`brew tap`)
16 22 }
17 23  
  24 +_brew_official_taps() {
  25 + official_taps=(`brew tap --list-official`)
  26 +}
  27 +
  28 +_brew_pinned_taps() {
  29 + pinned_taps=(`brew tap --list-pinned`)
  30 +}
  31 +
18 32 _brew_outdated_formulae() {
19 33 outdated_formulae=(`brew outdated`)
20 34 }
... ... @@ -25,8 +39,10 @@ _1st_arguments=(
25 39 'cat:display formula file for a formula'
26 40 'cleanup:uninstall unused and old versions of packages'
27 41 'commands:show a list of commands'
  42 + 'config:show homebrew and system configuration'
28 43 'create:create a new formula'
29   - 'deps:list dependencies of a formula'
  44 + 'deps:list dependencies and dependants of a formula'
  45 + 'desc:display a description of a formula'
30 46 'doctor:audits your installation for common issues'
31 47 'edit:edit a formula'
32 48 'fetch:download formula resources to the cache'
... ... @@ -37,40 +53,45 @@ _1st_arguments=(
37 53 'reinstall:install a formula anew; re-using its current options'
38 54 'leaves:show installed formulae that are not dependencies of another installed formula'
39 55 'link:link a formula'
  56 + 'linkapps:symlink .app bundles provided by formulae into /Applications'
40 57 'list:list files in a formula or not-installed formulae'
41 58 'log:git commit log for a formula'
42 59 'missing:check all installed formuale for missing dependencies.'
  60 + 'migrate:migrate renamed formula to new name'
43 61 'outdated:list formulae for which a newer version is available'
44 62 'pin:pin specified formulae'
45 63 'postinstall:perform post_install for a given formula'
46 64 'prune:remove dead links'
47 65 'remove:remove a formula'
48 66 'search:search for a formula (/regex/ or string)'
49   - 'switch:switch linkage between installed versions of a formula'
  67 + 'switch:switch between different versions of a formula'
50 68 'tap:tap a new formula repository from GitHub, or list existing taps'
  69 + 'tap-info:information about a tap'
  70 + 'tap-pin:pin a tap'
  71 + 'tap-unpin:unpin a tap'
51 72 'test-bot:test a formula and build a bottle'
52 73 'uninstall:uninstall a formula'
53 74 'unlink:unlink a formula'
  75 + 'unlinkapps:remove symlinked .app bundles provided by formulae from /Applications'
54 76 'unpin:unpin specified formulae'
55 77 'untap:remove a tapped repository'
56   - 'update:pull latest repository'
  78 + 'update:fetch latest version of Homebrew and all formulae'
57 79 'upgrade:upgrade outdated formulae'
58 80 'uses:show formulae which depend on a formula'
  81 + `brew commands --quiet --include-aliases`
59 82 )
60 83  
61 84 local expl
62   -local -a formulae installed_formulae installed_taps outdated_formulae
  85 +local -a formulae installed_formulae installed_taps official_taps outdated_formulae
63 86  
64 87 _arguments \
65 88 '(-v)-v[verbose]' \
66 89 '(--cellar)--cellar[brew cellar]' \
67   - '(--config)--config[brew configuration]' \
68 90 '(--env)--env[brew environment]' \
69 91 '(--repository)--repository[brew repository]' \
70 92 '(--version)--version[version information]' \
71 93 '(--prefix)--prefix[where brew lives on this system]' \
72 94 '(--cache)--cache[brew cache]' \
73   - '(--force)--force[brew force]' \
74 95 '*:: :->subcmds' && return 0
75 96  
76 97 if (( CURRENT == 1 )); then
... ... @@ -79,9 +100,18 @@ if (( CURRENT == 1 )); then
79 100 fi
80 101  
81 102 case "$words[1]" in
82   - install|reinstall|audit|home|homepage|log|info|abv|uses|cat|deps|edit|options)
  103 + install|reinstall|audit|home|homepage|log|info|abv|uses|cat|deps|desc|edit|options|switch)
83 104 _brew_all_formulae
84 105 _wanted formulae expl 'all formulae' compadd -a formulae ;;
  106 + linkapps|unlinkapps)
  107 + _arguments \
  108 + '(--local)--local[operate on ~/Applications instead of /Applications]' \
  109 + '1: :->forms' && return 0
  110 +
  111 + if [[ "$state" == forms ]]; then
  112 + _brew_installed_formulae
  113 + _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae
  114 + fi ;;
85 115 list|ls)
86 116 _arguments \
87 117 '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
... ... @@ -100,9 +130,15 @@ case &quot;$words[1]&quot; in
100 130 _arguments \
101 131 '(--macports)--macports[search the macports repository]' \
102 132 '(--fink)--fink[search the fink repository]' ;;
103   - untap)
  133 + untap|tap-info|tap-pin)
104 134 _brew_installed_taps
105   - _wanted installed_taps expl 'installed taps' compadd -a installed_taps ;;
  135 + _wanted installed_taps expl 'installed taps' compadd -a installed_taps ;;
  136 + tap)
  137 + _brew_official_taps
  138 + _wanted official_taps expl 'official taps' compadd -a official_taps ;;
  139 + tap-unpin)
  140 + _brew_pinned_taps
  141 + _wanted pinned_taps expl 'pinned taps' compadd -a pinned_taps ;;
106 142 upgrade)
107 143 _brew_outdated_formulae
108 144 _wanted outdated_formulae expl 'outdated formulae' compadd -a outdated_formulae ;;
repos/robbyrussell/oh-my-zsh/plugins/chruby/chruby.plugin.zsh
... ... @@ -16,9 +16,6 @@
16 16 # rvm and rbenv plugins also provide this alias
17 17 alias rubies='chruby'
18 18  
19   -local _chruby_path
20   -local _chruby_auto
21   -
22 19 _homebrew-installed() {
23 20 whence brew &> /dev/null
24 21 }
... ... @@ -42,6 +39,9 @@ if _ruby-build_installed; then
42 39 fi
43 40  
44 41 _source_from_omz_settings() {
  42 + local _chruby_path
  43 + local _chruby_auto
  44 +
45 45 zstyle -s :omz:plugins:chruby path _chruby_path
46 46 zstyle -s :omz:plugins:chruby auto _chruby_auto
47 47  
repos/robbyrussell/oh-my-zsh/plugins/command-not-found/command-not-found.plugin.zsh
... ... @@ -23,3 +23,11 @@ if [ -f /usr/libexec/pk-command-not-found ]; then
23 23 return $retval
24 24 }
25 25 fi
  26 +
  27 +# OSX command-not-found support
  28 +# https://github.com/Homebrew/homebrew-command-not-found
  29 +if type brew &> /dev/null; then
  30 + if brew command command-not-found-init > /dev/null 2>&1; then
  31 + eval "$(brew command-not-found-init)";
  32 + fi
  33 +fi
repos/robbyrussell/oh-my-zsh/plugins/dnf/README.md
... ... @@ -0,0 +1,25 @@
  1 +## Description
  2 +
  3 +This plugin makes `dnf` usage easier by adding aliases for the most
  4 +common commands.
  5 +
  6 +`dnf` is the new package manager for RPM-based distributions, which
  7 +replaces `yum`.
  8 +
  9 +## Aliases
  10 +
  11 +| Alias | Command | Description |
  12 +|-------|-------------------------|--------------------------|
  13 +| dnfl | `dnf list` | List packages |
  14 +| dnfli | `dnf list installed` | List installed packages |
  15 +| dnfgl | `dnf grouplist` | List package groups |
  16 +| dnfmc | `dnf makecache` | Generate metadata cache |
  17 +| dnfp | `dnf info` | Show package information |
  18 +| dnfs | `dnf search` | Search package |
  19 +| **Use `sudo`** |
  20 +| dnfu | `sudo dnf upgrade` | Upgrade package |
  21 +| dnfi | `sudo dnf install` | Install package |
  22 +| dnfgi | `sudo dnf groupinstall` | Install package group |
  23 +| dnfr | `sudo dnf remove` | Remove package |
  24 +| dnfgr | `sudo dnf groupremove` | Remove package group |
  25 +| dnfc | `sudo dnf clean all` | Clean cache |
repos/robbyrussell/oh-my-zsh/plugins/dnf/dnf.plugin.zsh
... ... @@ -0,0 +1,15 @@
  1 +## Aliases
  2 +
  3 +alias dnfl="dnf list" # List packages
  4 +alias dnfli="dnf list installed" # List installed packages
  5 +alias dnfgl="dnf grouplist" # List package groups
  6 +alias dnfmc="dnf makecache" # Generate metadata cache
  7 +alias dnfp="dnf info" # Show package information
  8 +alias dnfs="dnf search" # Search package
  9 +
  10 +alias dnfu="sudo dnf upgrade" # Upgrade package
  11 +alias dnfi="sudo dnf install" # Install package
  12 +alias dnfgi="sudo dnf groupinstall" # Install package group
  13 +alias dnfr="sudo dnf remove" # Remove package
  14 +alias dnfgr="sudo dnf groupremove" # Remove package group
  15 +alias dnfc="sudo dnf clean all" # Clean cache
repos/robbyrussell/oh-my-zsh/plugins/encode64/encode64.plugin.zsh
1   -encode64(){ printf '%s' $1 | base64 }
2   -decode64(){ printf '%s' $1 | base64 --decode }
  1 +encode64() {
  2 + if [[ $# -eq 0 ]]; then
  3 + cat | base64
  4 + else
  5 + printf '%s' $1 | base64
  6 + fi
  7 +}
  8 +
  9 +decode64() {
  10 + if [[ $# -eq 0 ]]; then
  11 + cat | base64 --decode
  12 + else
  13 + printf '%s' $1 | base64 --decode
  14 + fi
  15 +}
3 16 alias e64=encode64
4 17 alias d64=decode64
repos/robbyrussell/oh-my-zsh/plugins/forklift/README.md
... ... @@ -4,10 +4,12 @@ Plugin for ForkLift, an FTP application for OS X.
4 4  
5 5 ### Requirements
6 6  
7   -* [ForkLift](http://forkliftapp.com/forklift/)
  7 +* [ForkLift](http://www.binarynights.com/forklift/)
8 8  
9 9 ### Usage
10 10  
11   -* If `fl` is called without arguments then the current folder is opened in ForkLift. Is equivalent to `fl .`
  11 +<code>fl [*file_or_folder*]</code>
12 12  
13   -* If `fl` is called with a directory as the argument, then that directory is opened in ForkLift
14 13 \ No newline at end of file
  14 +* If `fl` is called without arguments then the current folder is opened in ForkLift. This is equivalent to `fl .`.
  15 +
  16 +* If `fl` is called with a directory as the argument, then that directory is opened in ForkLift. If called with a non-directory file as the argument, then the file's parent directory is opened.
repos/robbyrussell/oh-my-zsh/plugins/git/git.plugin.zsh
... ... @@ -213,7 +213,5 @@ alias gup=&#39;git pull --rebase&#39;
213 213 alias gupv='git pull --rebase -v'
214 214 alias glum='git pull upstream master'
215 215  
216   -alias gvt='git verify-tag'
217   -
218 216 alias gwch='git whatchanged -p --abbrev-commit --pretty=medium'
219 217 alias gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit -m "--wip--"'
repos/robbyrussell/oh-my-zsh/plugins/gitignore/gitignore.plugin.zsh
1   -function gi() { curl -sL https://www.gitignore.io/api/$@ ;}
  1 +function gi() { curl -sL https://www.gitignore.io/api/${(j:,:)@} }
2 2  
3 3 _gitignoreio_get_command_list() {
4 4 curl -sL https://www.gitignore.io/api/list | tr "," "\n"
repos/robbyrussell/oh-my-zsh/plugins/pylint/pylint.plugin.zsh
1 1 # Aliases
2   -alias pylint-quick='pylint --reports=n --include-ids=y'
3   -compdef _pylint-quick pylint-quick='pylint --reports=n --include-ids=y'
4 2 \ No newline at end of file
  3 +alias pylint-quick='pylint --reports=n'
  4 +compdef _pylint-quick pylint-quick='pylint --reports=n'
repos/robbyrussell/oh-my-zsh/plugins/vault/README.md
... ... @@ -0,0 +1,18 @@
  1 +## Vault (https://www.vaultproject.io) autocomplete plugin
  2 +
  3 +- Adds autocomplete options for all vault commands.
  4 +
  5 +####Show help for all commands
  6 +![General Help](http://i.imgur.com/yv5Db1r.png "Help for all commands")
  7 +
  8 +
  9 +####Create new Vault token
  10 +![Create token](http://i.imgur.com/xMegNgh.png "Create token")
  11 +
  12 +
  13 +####Enable audit backends
  14 +![Audit backends](http://i.imgur.com/fKLeiSF.png "Audit backends")
  15 +
  16 +
  17 +
  18 +Crafted with <3 by Valentin Bud ([@valentinbud](https://twitter.com/valentinbud))
0 19 \ No newline at end of file
repos/robbyrussell/oh-my-zsh/plugins/vault/_vault
... ... @@ -0,0 +1,400 @@
  1 +#compdef vault
  2 +
  3 +typeset -a main_args
  4 +main_args=(
  5 + '(-version)-version[Prints the Vault version]'
  6 + '(-help)-help[Prints Vault Help]'
  7 +)
  8 +
  9 +typeset -a general_args
  10 +general_args=(
  11 + '(-help)-help[Prints Help]'
  12 + '(-address)-address=-[The address of the Vault server. Overrides the VAULT_ADDR environment variable if set.]:address:'
  13 + '(-ca-cert)-ca-cert=-[Path to a PEM encoded CA cert file to use to verify the Vault server SSL certificate. Overrides the VAULT_CACERT environment variable if set.]:file:_files -g "*.pem"'
  14 + '(-ca-path)-ca-path=-[Path to a directory of PEM encoded CA cert files to verify the Vault server SSL certificate. If both -ca-cert and -ca-path are specified, -ca-path is used.Overrides the VAULT_CAPATH environment variable if set.]:directory:_directories'
  15 + '(-client-cert)-client-cert=-[Path to a PEM encoded client certificate for TLS authentication to the Vault server. Must also specify -client-key. Overrides the VAULT_CLIENT_CERT environment variable if set.]:file:_files -g "*.pem"'
  16 + '(-client-key)-client-key=-[Path to an unencrypted PEM encoded private key matching the client certificate from -client-cert. Overrides the VAULT_CLIENT_KEY environment variable if set.]:file:_files -g "*.pem"'
  17 + '(-tls-skip-verify)-tls-skip-verify[Do not verify TLS certificate. This is highly not recommended. Verification will also be skipped if VAULT_SKIP_VERIFY is set.]'
  18 +)
  19 +
  20 +typeset -a audit_enable_args
  21 +audit_enable_args=(
  22 + '(-description)-description=-[A human-friendly description for the backend. This shows up only when querying the enabled backends.]:description:'
  23 + '(-id)-id=-[Specify a unique ID for this audit backend. This is purely for referencing this audit backend. By default this will be the backend type.]:id:'
  24 +)
  25 +
  26 +typeset -a auth_args
  27 +auth_args=(
  28 + '(-method)-method=-[Outputs help for the authentication method with the given name for the remote server. If this authentication method is not available, exit with code 1.]:method:(cert ldap github userpass app-id)'
  29 + '(-method-help)-method-help[If set, the help for the selected method will be shown.]'
  30 + '(-methods)-methods[List the available auth methods.]'
  31 + '(-no-verify)-no-verify[Do not verify the token after creation; avoids a use count]'
  32 +)
  33 +
  34 +typeset -a auth_enable_args
  35 +auth_enable_args=(
  36 + '(-description)-description=-[Human-friendly description of the purpose for the auth provider. This shows up in the auth-list command.]:description:'
  37 + '(-path)-path=-[Mount point for the auth provider. This defaults to the type of the mount. This will make the auth provider available at "/auth/<path>"]:path:'
  38 +)
  39 +
  40 +typeset -a init_args
  41 +init_args=(
  42 + '(-key-shares)-key-shares=-[(default: 5) The number of key shares to split the master key into.]:keyshares:'
  43 + '(-key-threshold)-key-threshold=-[(default: 3) The number of key shares required to reconstruct the master key.]:keythreshold:'
  44 + '(-pgp-keys)-pgp-keys[If provided, must be a comma-separated list of files on disk containing binary- or base64-format public PGP keys. The number of files must match "key-shares". The output unseal keys will encrypted and hex-encoded, in order, with the given public keys. If you want to use them with the "vault unseal" command, you will need to hex decode and decrypt; this will be the plaintext unseal key.]:pgpkeys:_files'
  45 +)
  46 +
  47 +typeset -a mount_tune_args
  48 +mount_tune_args=(
  49 + '(-default-lease-ttl)-default-lease-ttl=-[Default lease time-to-live for this backend. If not specified, uses the system default, or the previously set value. Set to "system" to explicitly set it to use the system default.]:defaultleasettl:'
  50 + '(-max-lease-ttl)-max-lease-ttl=-[Max lease time-to-live for this backend. If not specified, uses the system default, or the previously set value. Set to "system" to explicitly set it to use the system default.]:maxleasettl:'
  51 +)
  52 +
  53 +typeset -a mount_args
  54 +mount_args=(
  55 + $mount_tune_args
  56 + '(-path)-path=-[Mount point for the logical backend. This defauls to the type of the mount.]:path:'
  57 + '(-description)-description=-[Human-friendly description of the purpose for the mount. This shows up in the mounts command.]:description:'
  58 +)
  59 +
  60 +typeset -a rekey_args
  61 +rekey_args=(
  62 + $init_args
  63 + '(-init)-init[Initialize the rekey operation by setting the desired number of shares and the key threshold. This can only be done if no rekey is already initiated.]:init:'
  64 + '(-cancel)-cancel[Reset the rekey process by throwing away prior keys and the rekey configuration.]:cancel:'
  65 + '(-status)-status[Prints the status of the current rekey operation. This can be used to see the status without attempting to provide an unseal key.]:status:'
  66 +)
  67 +
  68 +typeset -a ssh_args
  69 +ssh_args=(
  70 + '(-role)-role[Role to be used to create the key. ]:role:'
  71 + '(-no-exec)-no-exec[Shows the credentials but does not establish connection.]:noexec:'
  72 + '(-mount-point)-mount-point[Mount point of SSH backend. If the backend is mounted at "ssh", which is the default as well, this parameter can be skipped.]:mountpoint:'
  73 + '(-format)-format[If no-exec option is enabled, then the credentials will be printed out and SSH connection will not be established. The format of the output can be "json" or "table". JSON output is useful when writing scripts. Default is "table".]:format:(json table)'
  74 +)
  75 +
  76 +typeset -a token_create_args
  77 +token_create_args=(
  78 + '(-id)-id=-[The token value that clients will use to authenticate with vault. If not provided this defaults to a 36 character UUID. A root token is required to specify the ID of a token.]:id:'
  79 + '(-display-name)-display-name=-[A display name to associate with this token. This is a non-security sensitive value used to help identify created secrets, i.e. prefixes.]:displayname:'
  80 + '(-ttl)-ttl=-[TTL to associate with the token. This option enables the tokens to be renewable.]:ttl:'
  81 + '*-metadata=-[Metadata to associate with the token. This shows up in the audit log. This can be specified multiple times.]:metadata:'
  82 + '(-orphan)-orphan[If specified, the token will have no parent. Only root tokens can create orphan tokens. This prevents the new token from being revoked with your token.]:orphan:'
  83 + '(-no-default-policy)-no-default-policy[If specified, the token will not have the "default" policy included in its policy set.]:nodefaultpolicy:'
  84 + '*-policy=-[Policy to associate with this token. This can be specified multiple times.]:policy:__vault_policies'
  85 + '(-use-limit)-use-limit=-[The number of times this token can be used until it is automatically revoked.]:uselimit:'
  86 + '(-format)-format=-[The format for output. By default it is a whitespace-delimited table. This can also be json.]:format:(json table)'
  87 +)
  88 +
  89 +typeset -a server_args
  90 +server_args=(
  91 + '*-config=-[Path to the configuration file or directory. This can be specified multiple times. If it is a directory, all files with a ".hcl" or ".json" suffix will be loaded.]:config:_files'
  92 + '-dev[Enables Dev mode. In this mode, Vault is completely in-memory and unsealed. Do not run the Dev server in production!]:dev:'
  93 + '-log-level=-[Log verbosity. Defaults to "info", will be outputtedto stderr. Supported values: "trace", "debug", "info", "warn", "err"]:loglevel:(trace debug info warn err)'
  94 +)
  95 +
  96 +_vault_audit-list() {
  97 + _arguments : \
  98 + ${general_args[@]} && ret=0
  99 +}
  100 +
  101 +_vault_audit-disable() {
  102 + # vault audit-list doesn't print the backend id so for now
  103 + # no *smart* autocompletion for this subcommand.
  104 + _arguments : \
  105 + ${general_args[@]} \
  106 + ':::(file syslog)' && ret=0
  107 +}
  108 +
  109 +_vault_audit-enable() {
  110 + _arguments : \
  111 + ${general_args[@]} \
  112 + ${audit_enable_args[@]} \
  113 + ': :->backends' \
  114 + '*:: :->backendconfig' && ret=0
  115 +
  116 + case $state in
  117 + backends)
  118 + local -a backends
  119 + backends=(
  120 + 'file:The "file" audit backend writes audit logs to a file.'
  121 + 'syslog:The "syslog" audit backend writes audit logs to syslog.'
  122 + )
  123 + _describe -t backends 'vault audit backends' backends && ret=0
  124 + ;;
  125 + backendconfig)
  126 + case ${line[1]} in
  127 + file)
  128 + _values -w "Audit Backend File" \
  129 + 'path[(required) - The path to where the file will be written. If this path exists, the audit backend will append to it.]:file:_files' \
  130 + 'log_raw[(optional) Should security sensitive information be logged raw. Defaults to "false".]:log_raw:(true false)' && ret=0
  131 + ;;
  132 + syslog)
  133 + _values -w "Audit Backend Syslog" \
  134 + 'facility[(optional) - The syslog facility to use. Defaults to "AUTH".]:facility:(kern user mail daemon auth syslog lpr news uucp authpriv ftp cron local0 local1 local2 local3 local4 local5 local6 local7)' \
  135 + 'tag[(optional) - The syslog tag to use. Defaults to "vault".]:tag:' \
  136 + 'log_raw[(optional) Should security sensitive information be logged raw.]:log_raw:(true false)' && ret=0
  137 + ;;
  138 + esac
  139 + ;;
  140 + esac
  141 +}
  142 +
  143 +_vault_auth() {
  144 + _arguments : \
  145 + ${general_args[@]} \
  146 + ${auth_args[@]} && ret=0
  147 +}
  148 +
  149 +_vault_auth-enable() {
  150 + _arguments : \
  151 + ${general_args[@]} \
  152 + ${auth_enable_args[@]} \
  153 + ':::(cert ldap github userpass app-id)' && ret=0
  154 +}
  155 +
  156 +__vault_auth_methods() {
  157 + local -a authmethods
  158 + authmethods=($(vault auth -methods | awk 'NR>1{split ($1,a,"/"); print a[1]":["$2"]"}'))
  159 + _describe -t authmethods 'authmethods' authmethods && ret=0
  160 +}
  161 +
  162 +_vault_auth-disable() {
  163 + _arguments : \
  164 + ${general_args[@]} \
  165 + ':::__vault_auth_methods' && ret=0
  166 +
  167 +}
  168 +
  169 +_vault_init() {
  170 + _arguments : \
  171 + ${general_args[@]} \
  172 + ${init_args[@]} && ret=0
  173 +}
  174 +
  175 +_vault_key-status() {
  176 + _arguments : \
  177 + ${general_args[@]} && ret=0
  178 +}
  179 +
  180 +__vault_mounts() {
  181 + local -a mounts
  182 + mounts=($(vault mounts | awk 'NR>1{split ($1,a,"/"); print a[1]":["$2"]"}'))
  183 + _describe -t mounts 'mounts' mounts && ret=0
  184 +}
  185 +
  186 +_vault_mounts() {
  187 + _arguments : \
  188 + ${general_args[@]} && ret=0
  189 +}
  190 +
  191 +_vault_mount() {
  192 + # to find out how many types of backens are there
  193 + _arguments : \
  194 + ${general_args[@]} \
  195 + ${mount_args[@]} \
  196 + ':::(generic ssh)' && ret=0
  197 +}
  198 +
  199 +_vault_mount-tune() {
  200 + _arguments : \
  201 + ${general_args[@]} \
  202 + ${mount_tune_args[@]} \
  203 + ':::__vault_mounts' && ret=0
  204 +}
  205 +
  206 +_vault_unmount() {
  207 + _arguments : \
  208 + ${general_args[@]} \
  209 + ':::__vault_mounts' && ret=0
  210 +}
  211 +
  212 +_vault_remount() {
  213 + _arguments : \
  214 + ${general_args[@]} \
  215 + ':::__vault_mounts' \
  216 + ':::' && ret=0
  217 +}
  218 +
  219 +__vault_policies() {
  220 + local -a policies
  221 + policies=($(vault policies | awk '{print $1":["$1"]"}'))
  222 + _describe -t policies 'policies' policies && ret=0
  223 +}
  224 +
  225 +_vault_policies() {
  226 + _arguments : \
  227 + ${general_args[@]} \
  228 + ':::__vault_policies' && ret=0
  229 +}
  230 +
  231 +_vault_policy-delete() {
  232 + _arguments : \
  233 + ${general_args[@]} \
  234 + ':::__vault_policies' && ret=0
  235 +}
  236 +
  237 +_vault_policy-write() {
  238 + _arguments : \
  239 + ${general_args[@]} \
  240 + ': ::' \
  241 + '::policy:_files' && ret=0
  242 +}
  243 +
  244 +_vault_status() {
  245 + _arguments : \
  246 + ${general_args[@]} && ret=0
  247 +}
  248 +
  249 +_vault_rekey() {
  250 + _arguments : \
  251 + ${general_args[@]} \
  252 + ${rekey_args[@]} \
  253 + ': ::' && ret=0
  254 +}
  255 +
  256 +_vault_rotate() {
  257 + _arguments : \
  258 + ${general_args[@]} && ret=0
  259 +}
  260 +
  261 +_vault_seal() {
  262 + _arguments : \
  263 + ${general_args[@]} && ret=0
  264 +}
  265 +
  266 +_vault_ssh() {
  267 + _arguments : \
  268 + ${general_args[@]} \
  269 + ${ssh_args[@]} \
  270 + ': ::' && ret=0
  271 +}
  272 +
  273 +_vault_token-create() {
  274 + _arguments : \
  275 + ${general_args[@]} \
  276 + ${token_create_args[@]} && ret=0
  277 +}
  278 +
  279 +_vault_token-renew() {
  280 + _arguments : \
  281 + ${general_args[@]} \
  282 + '(-format)-format=-[The format for output. By default it is a whitespace-delimited table. This can also be json.]:format:(json table)' \
  283 + ': ::' \
  284 + ': ::' && ret=0
  285 +}
  286 +
  287 +_vault_token-revoke() {
  288 + _arguments : \
  289 + ${general_args[@]} \
  290 + '(-mode)-mode=-[The type of revocation to do. See the documentation above for more information.]:mode:( orphan path)' \
  291 + ': ::' && ret=0
  292 +}
  293 +
  294 +_vault_unseal() {
  295 + _arguments : \
  296 + ${general_args[@]} \
  297 + '(-reset)-reset[Reset the unsealing process by throwing away prior keys in process to unseal the vault.]:reset:' \
  298 + ': ::' && ret=0
  299 +}
  300 +
  301 +_vault_version() {
  302 + # no args
  303 +}
  304 +
  305 +_vault_delete() {
  306 + _arguments : \
  307 + ${general_args[@]} \
  308 + ': ::' && ret=0
  309 +}
  310 +
  311 +_vault_path-help() {
  312 + _arguments : \
  313 + ${general_args[@]} \
  314 + ': ::' && ret=0
  315 +}
  316 +
  317 +_vault_revoke() {
  318 + _arguments : \
  319 + ${general_args[@]} \
  320 + '(-format)-format=-[The format for output. By default it is a whitespace-delimited table. This can also be json.]:format:(json table)' \
  321 + ': ::' \
  322 + ': ::' && ret=0
  323 +}
  324 +
  325 +_vault_server() {
  326 + _arguments : \
  327 + ${server_args[@]} && ret=0
  328 +
  329 +}
  330 +
  331 +_vault_write() {
  332 + _arguments : \
  333 + ${general_args[@]} \
  334 + '(-f -force)'{-f,-force}'[Force the write to continue without any data values specified. This allows writing to keys that do not need or expect any fields to be specified.]:force:' \
  335 + ': ::' \
  336 + ': ::' && ret=0
  337 +}
  338 +
  339 +_vault_read() {
  340 + _arguments : \
  341 + ${general_args[@]} \
  342 + '(-format)-format=-[The format for output. By default it is a whitespace-delimited table. This can also be json.]:format:(json table)' \
  343 + '(-field)-field=-[If included, the raw value of the specified field will be output raw to stdout.]:field:' \
  344 + ': ::' && ret=0
  345 +}
  346 +
  347 +_vault_commands() {
  348 + local -a commands
  349 +
  350 + commands=(
  351 + "delete":"Delete operation on secrets in Vault"
  352 + "path-help":"Look up the help for a path"
  353 + "read":"Read data or secrets from Vault"
  354 + "renew":"Renew the lease of a secret"
  355 + "revoke":"Revoke a secret"
  356 + "server":"Start a Vault server"
  357 + "status":"Outputs status of whether Vault is sealed and if HA mode is enabled"
  358 + "write":"Write secrets or configuration into Vault"
  359 + "audit-disable":"Disable an audit backend"
  360 + "audit-enable":"Enable an audit backend"
  361 + "audit-list":"Lists enabled audit backends in Vault"
  362 + "auth":"Prints information about how to authenticate with Vault"
  363 + "auth-disable":"Disable an auth provider"
  364 + "auth-enable":"Enable a new auth provider"
  365 + "init":"Initialize a new Vault server"
  366 + "key-status":"Provides information about the active encryption key"
  367 + "mount":"Mount a logical backend"
  368 + "mount-tune":"Tune mount configuration parameters"
  369 + "mounts":"Lists mounted backends in Vault"
  370 + "policies":"List the policies on the server"
  371 + "policy-delete":"Delete a policy from the server"
  372 + "policy-write":"Write a policy to the server"
  373 + "rekey":"Rekeys Vault to generate new unseal keys"
  374 + "remount":"Remount a secret backend to a new path"
  375 + "rotate":"Rotates the backend encryption key used to persist data"
  376 + "seal":"Seals the vault server"
  377 + "ssh":"Initiate a SSH session"
  378 + "token-create":"Create a new auth token"
  379 + "token-renew":"Renew an auth token if there is an associated lease"
  380 + "token-revoke":"Revoke one or more auth tokens"
  381 + "unmount":"Unmount a secret backend"
  382 + "unseal":"Unseals the vault server"
  383 + "version":"Prints the Vault version"
  384 + )
  385 +
  386 + _describe -t commands 'vault command' commands && ret=0
  387 +}
  388 +
  389 +local curcontext=$curcontext ret=1
  390 +_arguments : \
  391 + ${main_args[@]} \
  392 + '*:: :->subcommands' && ret=0
  393 +if ((CURRENT == 1 )); then
  394 + _vault_commands && ret=0
  395 +fi
  396 +if [[ $state == subcommands ]]; then
  397 + # (( CURRENT -- ))
  398 + curcontext="${curcontext%:*:*}:vault-$words[1]:"
  399 + _call_function ret _vault_$words[1]
  400 +fi
repos/robbyrussell/oh-my-zsh/plugins/zsh-navigation-tools/.config/znt/n-cd.conf
1 1 # Hotlist
  2 +# Try to use $ZSH_VERSION, e.g. /usr/share/zsh/$ZSH_VERSION/functions
2 3 local hotlist
3 4 hotlist=(
4 5 ~/.config/znt
... ... @@ -7,7 +8,6 @@ hotlist=(
7 8 /usr/local/share/zsh/site-functions
8 9 /usr/local/share/zsh
9 10 /usr/local/bin
10   - /usr/lib
11 11 )
12 12  
13 13 # Suppress adding (to directory stack) directories visited by n-cd
repos/robbyrussell/oh-my-zsh/plugins/zsh-navigation-tools/README.md
... ... @@ -25,7 +25,7 @@ widgets exist, znt-cd-widget and znt-kill-widget, they can be too assigned
25 25 to key combinations (no need for autoload when using Oh My Zsh):
26 26  
27 27 zle -N znt-cd-widget
28   - bindkey "^T" znt-cd-widget
  28 + bindkey "^A" znt-cd-widget
29 29 zle -N znt-kill-widget
30 30 bindkey "^Y" znt-kill-widget
31 31  
repos/robbyrussell/oh-my-zsh/plugins/zsh-navigation-tools/n-history
... ... @@ -42,7 +42,7 @@ if [ &quot;$REPLY&quot; -gt 0 ]; then
42 42 # ZLE?
43 43 if [ "${(t)CURSOR}" = "integer-local-special" ]; then
44 44 zle redisplay
45   - zle kill-whole-line
  45 + zle kill-buffer
46 46 zle -U "$selected"
47 47 else
48 48 print -zr "$selected"
repos/robbyrussell/oh-my-zsh/plugins/zsh-navigation-tools/n-list
1 1 # $1, $2, ... - elements of the list
2 2 # $NLIST_NONSELECTABLE_ELEMENTS - array of indexes (1-based) that cannot be selected
3 3 # $REPLY is the output variable - contains index (1-based) or -1 when no selection
  4 +# $reply (array) is the second part of the output - use the index (REPLY) to get selected element
4 5 #
5 6 # Copy this file into /usr/share/zsh/site-functions/
6 7 # and add 'autoload n-list` to .zshrc
... ... @@ -164,6 +165,7 @@ integer current_difference=0
164 165 local prev_search_buffer=""
165 166 integer prev_uniq_mode=0
166 167 integer prev_start_idx=-1
  168 +local MBEGIN MEND MATCH mbegin mend match
167 169  
168 170 # Ability to remember the list between calls
169 171 if [[ -z "$NLIST_REMEMBER_STATE" || "$NLIST_REMEMBER_STATE" -eq 0 || "$NLIST_REMEMBER_STATE" -eq 2 ]]; then
... ... @@ -264,11 +266,15 @@ while (( 1 )); do
264 266 local search_pattern=""
265 267 local colsearch_pattern=""
266 268 if [ -n "$search_buffer" ]; then
267   - # Patterns will be *foo*~^*bar* and foo|bar)
  269 + # Patterns will be *foo*~^*bar* and (foo|bar)
268 270 search_pattern="${search_buffer// ##/*~^*}"
269 271 colsearch_pattern="${search_buffer// ##/|}"
270 272  
271   - list=( "${(@M)list:#(#i)*$~search_pattern*}" )
  273 + # The repeat will make the matching work on a fresh heap
  274 + repeat 1; do
  275 + list=( "${(@M)list:#(#i)*$~search_pattern*}" )
  276 + done
  277 +
272 278 last_element="$#list"
273 279 fi
274 280  
... ... @@ -287,7 +293,10 @@ while (( 1 )); do
287 293  
288 294 if [ -n "$colsearch_pattern" ]; then
289 295 local red=$'\x1b[00;31m' reset=$'\x1b[00;00m'
290   - disp_list=( "${(@)disp_list//(#mi)($~colsearch_pattern)/$red${MATCH}$reset}" )
  296 + # The repeat will make the matching work on a fresh heap
  297 + repeat 1; do
  298 + disp_list=( "${(@)disp_list//(#mi)($~colsearch_pattern)/$red${MATCH}$reset}" )
  299 + done
291 300 fi
292 301  
293 302 # We have display list, lets replace newlines with "\n" when needed (1/2)
... ... @@ -380,7 +389,7 @@ while (( 1 )); do
380 389  
381 390 # Get the special (i.e. "keypad") key or regular key
382 391 if [ -n "$key" ]; then
383   - final_key="$key"
  392 + final_key="$key"
384 393 elif [ -n "$keypad" ]; then
385 394 final_key="$keypad"
386 395 else
repos/robbyrussell/oh-my-zsh/plugins/zsh-navigation-tools/n-list-draw
... ... @@ -98,7 +98,7 @@ shift 7
98 98 integer max_text_len=page_width-x_offset
99 99  
100 100 [ "$bold" = "0" ] && bold="" || bold="+bold"
101   -[[ "$active_text" = "underline" || "$active_text" = "reverse" ]] || active_text="reverse"
  101 +[[ "$active_text" = "underline" || "$active_text" = "reverse" ]] || local active_text="reverse"
102 102 # With Linux terminal underline won't work properly
103 103 [ "$TERM" = "linux" ] && active_text="reverse"
104 104  
repos/robbyrussell/oh-my-zsh/plugins/zsh-navigation-tools/n-list-input
... ... @@ -44,7 +44,7 @@ case &quot;$key&quot; in
44 44 [ "$current_idx" -lt "$last_element" ] && current_idx=current_idx+1;
45 45 _nlist_compute_first_to_show_idx
46 46 ;;
47   - (PPAGE)
  47 + (PPAGE|$'\b'|$'\C-?'|BACKSPACE)
48 48 current_idx=current_idx-page_height
49 49 [ "$current_idx" -lt 1 ] && current_idx=1;
50 50 _nlist_compute_first_to_show_idx
... ... @@ -72,7 +72,7 @@ case &quot;$key&quot; in
72 72 current_idx=last_element
73 73 _nlist_compute_first_to_show_idx
74 74 ;;
75   - ($'\n')
  75 + ($'\n'|ENTER)
76 76 # Is that element selectable?
77 77 # Check for this only when there is no search
78 78 if [[ "$NLIST_SEARCH_BUFFER" != "" || "$NLIST_IS_UNIQ_MODE" -eq 1 ||
... ... @@ -137,7 +137,7 @@ esac
137 137 else
138 138  
139 139 case "$key" in
140   - ($'\n')
  140 + ($'\n'|ENTER)
141 141 search=0
142 142 _nlist_cursor_visibility 0
143 143 ;;
repos/robbyrussell/oh-my-zsh/plugins/zsh-navigation-tools/znt-history-widget
1 1 autoload znt-usetty-wrapper n-history
2 2 local NLIST_START_IN_SEARCH_MODE=1
3 3 local NLIST_START_IN_UNIQ_MODE=1
4   -local NLIST_SET_SEARCH_TO="$BUFFER"
  4 +
  5 +# Only if current $BUFFER doesn't come from history
  6 +if [ "$HISTCMD" = "$HISTNO" ]; then
  7 + local NLIST_SET_SEARCH_TO="$BUFFER"
  8 +fi
5 9  
6 10 znt-usetty-wrapper n-history "$@"
7 11