diff --git a/zsh/.oh-my-zsh/.editorconfig b/zsh/.oh-my-zsh/.editorconfig new file mode 100644 index 0000000..aa18e0e --- /dev/null +++ b/zsh/.oh-my-zsh/.editorconfig @@ -0,0 +1,10 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 + +[*.sh] +indent_size = 4 +indent_style = tab diff --git a/zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/bug_report.md b/zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..076c355 --- /dev/null +++ b/zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + + + +**Describe the bug** + + +**To Reproduce** + + +**Expected behavior** + + +**Screenshots or recordings** + + +**System:** + - OS: [e.g. macOS] + - Zsh version [e.g. 5.6] + - Terminal emulator [e.g. iTerm2] + +**Additional context** + diff --git a/zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/feature_request.md b/zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..d9c324a --- /dev/null +++ b/zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,26 @@ +--- +name: Feature request +about: Suggest a feature for Oh My Zsh +labels: 'Type: feature' + +--- + + + +**Is your feature request related to a particular plugin or theme? If so, specify it.** + + +**Is your feature request related to a problem? Please describe.** + + +**Describe the solution you'd like** + + +**Describe alternatives you've considered** + + +**Additional context** + diff --git a/zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/support.md b/zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/support.md new file mode 100644 index 0000000..3c69a7d --- /dev/null +++ b/zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/support.md @@ -0,0 +1,12 @@ +--- +name: Support +about: Request support for any problem you're having with Oh My Zsh +labels: 'Type: support' + +--- + + diff --git a/zsh/.oh-my-zsh/CODE_OF_CONDUCT.md b/zsh/.oh-my-zsh/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..20ad1cc --- /dev/null +++ b/zsh/.oh-my-zsh/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies within all project spaces, and it also applies when +an individual is representing the project or its community in public spaces. +Examples of representing a project or community include using an official +project e-mail address, posting via an official social media account, or acting +as an appointed representative at an online or offline event. Representation of +a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at ohmyzsh@planetargon.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/zsh/.oh-my-zsh/plugins/alias-finder/README.md b/zsh/.oh-my-zsh/plugins/alias-finder/README.md new file mode 100644 index 0000000..409f4b6 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/alias-finder/README.md @@ -0,0 +1,46 @@ +# alias-finder plugin + +This plugin searches the defined aliases and outputs any that match the command inputted. This makes learning new aliases easier. + +To use it, add `alias-finder` to the `plugins` array of your zshrc file: +``` +plugins=(... alias-finder) +``` + +## Usage +To see if there is an alias defined for the command, pass it as an argument to `alias-finder`. This can also run automatically before each command you input - add `ZSH_ALIAS_FINDER_AUTOMATIC=true` to your zshrc if you want this. + +## Options + +- Use `--longer` or `-l` to allow the aliases to be longer than the input (match aliases if they contain the input). +- Use `--exact` or `-e` to avoid matching aliases that are shorter than the input. + +## Examples +``` +$ alias-finder "git pull" +gl='git pull' +g=git +``` +``` +$ alias-finder "web_search google oh my zsh" +google='web_search google' +``` +``` +$ alias-finder "git commit -v" +gc="git commit -v" +g=git +``` +``` +$ alias-finder -e "git commit -v" +gc='git commit -v' +``` +``` +$ alias-finder -l "git commit -v" +gc='git commit -v' +'gc!'='git commit -v --amend' +gca='git commit -v -a' +'gca!'='git commit -v -a --amend' +'gcan!'='git commit -v -a --no-edit --amend' +'gcans!'='git commit -v -a -s --no-edit --amend' +'gcn!'='git commit -v --no-edit --amend' +``` diff --git a/zsh/.oh-my-zsh/plugins/alias-finder/alias-finder.plugin.zsh b/zsh/.oh-my-zsh/plugins/alias-finder/alias-finder.plugin.zsh new file mode 100644 index 0000000..6b8fa66 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/alias-finder/alias-finder.plugin.zsh @@ -0,0 +1,46 @@ +alias-finder() { + local cmd="" exact="" longer="" wordStart="" wordEnd="" multiWordEnd="" + for i in $@; do + case $i in + -e|--exact) exact=true;; + -l|--longer) longer=true;; + *) + if [[ -z $cmd ]]; then + cmd=$i + else + cmd="$cmd $i" + fi + ;; + esac + done + cmd=$(sed 's/[].\|$(){}?+*^[]/\\&/g' <<< $cmd) # adds escaping for grep + if (( $(wc -l <<< $cmd) == 1 )); then + while [[ $cmd != "" ]]; do + if [[ $longer = true ]]; then + wordStart="'{0,1}" + else + wordEnd="$" + multiWordEnd="'$" + fi + if [[ $cmd == *" "* ]]; then + local finder="'$cmd$multiWordEnd" + else + local finder=$wordStart$cmd$wordEnd + fi + alias | grep -E "=$finder" + if [[ $exact = true || $longer = true ]]; then + break + else + cmd=$(sed -E 's/ {0,1}[^ ]*$//' <<< $cmd) # removes last word + fi + done + fi +} + +preexec_alias-finder() { + if [[ $ZSH_ALIAS_FINDER_AUTOMATIC = true ]]; then + alias-finder $1 + fi +} + +preexec_functions+=(preexec_alias-finder) diff --git a/zsh/.oh-my-zsh/plugins/autoenv/README.md b/zsh/.oh-my-zsh/plugins/autoenv/README.md new file mode 100644 index 0000000..de38817 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/autoenv/README.md @@ -0,0 +1,14 @@ +# Autoenv plugin + +This plugin loads the [Autoenv](https://github.com/inishchith/autoenv). + +To use it, add `autoenv` to the plugins array in your zshrc file: + +```zsh +plugins=(... autoenv) +``` +## Requirements + +In order to make this work, you will need to have the autoenv installed. + +More info on the usage and install: https://github.com/inishchith/autoenv diff --git a/zsh/.oh-my-zsh/plugins/cake/README.md b/zsh/.oh-my-zsh/plugins/cake/README.md new file mode 100644 index 0000000..aad92a3 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/cake/README.md @@ -0,0 +1,15 @@ +# Cake + +This plugin provides completion for [CakePHP](https://cakephp.org/). + +To use it add cake to the plugins array in your zshrc file. + +```bash +plugins=(... cake) +``` + +## Note + +This plugin generates a cache file of the cake tasks found, named `.cake_task_cache`, in the current working directory. +It is regenerated when the Cakefile is newer than the cache file. It is advised that you add the cake file to your +`.gitignore` files. diff --git a/zsh/.oh-my-zsh/plugins/cakephp3/README.md b/zsh/.oh-my-zsh/plugins/cakephp3/README.md new file mode 100644 index 0000000..7e8f664 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/cakephp3/README.md @@ -0,0 +1,16 @@ +# cakephp3 plugin + +The plugin adds aliases and autocompletion for [cakephp3](https://book.cakephp.org/3.0/en/index.html). + +To use it, add `cakephp3` to the plugins array of your zshrc file: +``` +plugins=(... cakephp3) +``` + +## Aliases + +| Alias | Command | +|-----------|-------------------------------| +| c3 | `bin/cake` | +| c3cache | `bin/cake orm_cache clear` | +| c3migrate | `bin/cake migrations migrate` | diff --git a/zsh/.oh-my-zsh/plugins/chruby/README.md b/zsh/.oh-my-zsh/plugins/chruby/README.md new file mode 100644 index 0000000..d373006 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/chruby/README.md @@ -0,0 +1,20 @@ +# chruby plugin + +This plugin loads [chruby](https://github.com/postmodern/chruby), a tool that changes the +current Ruby version, and completion and a prompt function to display the Ruby version. +Supports brew and manual installation of chruby. + +To use it, add `chruby` to the plugins array in your zshrc file: +```zsh +plugins=(... chruby) +``` + +## Usage + +If you'd prefer to specify an explicit path to load chruby from +you can set variables like so: + +``` +zstyle :omz:plugins:chruby path /local/path/to/chruby.sh +zstyle :omz:plugins:chruby auto /local/path/to/auto.sh +``` diff --git a/zsh/.oh-my-zsh/plugins/cloudapp/README.md b/zsh/.oh-my-zsh/plugins/cloudapp/README.md new file mode 100644 index 0000000..62975a6 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/cloudapp/README.md @@ -0,0 +1,24 @@ +# CloudApp plugin + +[CloudApp](https://www.getcloudapp.com) brings screen recording, screenshots, and GIF creation to the cloud, in an easy-to-use enterprise-level app. The CloudApp plugin allows you to upload a file to your CloadApp account from the command line. + +To use it, add `cloudapp` to the plugins array of your `~/.zshrc` file: + +``` +plugins=(... dash) +``` + +## Requirements + +1. [Aaron Russell's `cloudapp_api` gem](https://github.com/aaronrussell/cloudapp_api#installation) + +2. That you set your CloudApp credentials in `~/.cloudapp` as a simple text file like below: + ``` + email + password + ``` + +## Usage + +- `cloudapp `: uploads `` to your CloudApp account, and if you're using + macOS, copies the URL to your clipboard. diff --git a/zsh/.oh-my-zsh/plugins/colemak/README.md b/zsh/.oh-my-zsh/plugins/colemak/README.md new file mode 100644 index 0000000..4da4bc1 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/colemak/README.md @@ -0,0 +1,48 @@ +# Colemak plugin + +This plugin remaps keys in `zsh`'s [`vi`-style navigation mode](http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Keymaps) +for a [Colemak](https://colemak.com/) keyboard layout, to match the QWERTY position: + +![Colemak layout on a US keyboard](https://colemak.com/wiki/images/6/6c/Colemak2.png) + +To use it, add it to the plugins array in your `~/.zshrc` file: + +``` +plugins=(... colemak) +``` + +You will also need to enable `vi` mode, so add another line to `~/.zshrc`: +``` +bindkey -v +``` + +Restart your shell and hit the `` key to activate `vicmd` (navigation) mode, +and start navigating `zsh` with your new keybindings! + +## Key bindings for vicmd + +| Old | New | Binding | Description | +|------------|------------|---------------------------|----------------------------------------------------| +| `CTRL`+`j` | `CTRL`+`n` | accept-line | Insert new line | +| `j` | `n` | down-line-or-history | Move one line down or command history forwards | +| `k` | `e` | up-line-or-history | Move one line up or command history backwards | +| `l` | `i` | vi-forward-char | Move one character to the right | +| `n` | `k` | vi-repeat-search | Repeat command search forwards | +| `N` | `K` | vi-rev-repeat-search | Repeat command search backwards | +| `i` | `u` | vi-insert | Enter insert mode | +| `I` | `U` | vi-insert-bol | Move to first non-blank char and enter insert mode | +| `` | `l` | vi-undo-change | Undo change | +| `J` | `N` | vi-join | Join the current line with the next one | +| `e` | `j` | vi-forward-word-end | Move to the end of the next word | +| `E` | `J` | vi-forward-blank-word-end | Move to end of the current or next word | + +## Key bindings for less + +| Keyboard shortcut | `less` key binding | +|-------------------|--------------------| +| `n` | forw-line | +| `e` | back-line | +| `k` | repeat-search | +| `ESC`+`k` | repeat-search-all | +| `K` | reverse-search | +| `ESC`+`K` | reverse-search-all | diff --git a/zsh/.oh-my-zsh/plugins/colored-man-pages/README.md b/zsh/.oh-my-zsh/plugins/colored-man-pages/README.md new file mode 100644 index 0000000..d9f6acb --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/colored-man-pages/README.md @@ -0,0 +1,15 @@ +# Colored man pages plugin + +This plugin adds colors to man pages. + +To use it, add `colored-man-pages` to the plugins array in your zshrc file: + +```zsh +plugins=(... colored-man-pages) +``` + +You can also try to color other pages by prefixing the respective command with `colored`: + +```zsh +colored git help clone +``` diff --git a/zsh/.oh-my-zsh/plugins/common-aliases/README.md b/zsh/.oh-my-zsh/plugins/common-aliases/README.md new file mode 100644 index 0000000..d198a29 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/common-aliases/README.md @@ -0,0 +1,121 @@ +# Common Aliases Plugin + +This plugin creates helpful shortcut aliases for many commonly used commands. + +To use it add `common-aliases` to the plugins array in your zshrc file: + +```zsh +plugins=(... common-aliases) +``` + +## Aliases + +### ls command + +| Alias | Command | Description | +|-------|---------------|--------------------------------------------------------------------------------| +| l | `ls -lFh` | List files as a long list, show size, type, human-readable | +| la | `ls -lAFh` | List almost all files as a long list show size, type, human-readable | +| lr | `ls -tRFh` | List files recursively sorted by date, show type, human-readable | +| lt | `ls -ltFh` | List files as a long list sorted by date, show type, human-readable | +| ll | `ls -l` | List files as a long list | +| ldot | `ls -ld .*` | List dot files as a long list | +| lS | `ls -1FSsh` | List files showing only size and name sorted by size | +| lart | `ls -1Fcart` | List all files sorted in reverse of create/modification time (oldest first) | +| lrt | `ls -1Fcrt` | List files sorted in reverse of create/modification time(oldest first) | + +### File handling + +| Alias | Command | Description | +|-------|-----------------------|------------------------------------------------------------------------------------| +| rm | `rm -i` | Remove a file | +| cp | `cp -i` | Copy a file | +| mv | `mv -i` | Move a file | +| zshrc | `${=EDITOR} ~/.zshrc` | Quickly access the ~/.zshrc file | +| dud | `du -d 1 -h` | Display the size of files at depth 1 in current location in human-readable form | +| duf | `du -sh` | Display the size of files in current location in human-readable form | +| t | `tail -f` | Shorthand for tail which outputs the last part of a file | + +### find and grep + +| Alias | Command | Description | +|-------|-----------------------------------------------------|-----------------------------------------| +| fd | `find . -type d -name` | Find a directory with the given name | +| ff | `find . -type f -name` | Find a file with the given name | +| grep | `grep --color` | Searches for a query string | +| sgrep | `grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS}` | Useful for searching within files | + +### Other Aliases + +| Alias | Command | Description | +|-----------|---------------------|-------------------------------------------------------------| +| h | `history` | Lists all recently used commands | +| hgrep | `fc -El 0 \| grep` | Searches for a word in the list of previously used commands | +| help | `man` | Opens up the man page for a command | +| p | `ps -f` | Displays currently executing processes | +| sortnr | `sort -n -r` | Used to sort the lines of a text file | +| unexport | `unset` | Used to unset an environment variable | + +## Global aliases + +These aliases are expanded in any position in the command line, meaning you can use them even at the +end of the command you've typed. Examples: + +Quickly pipe to less: +```zsh +$ ls -l /var/log L +# will run +$ ls -l /var/log | less +``` +Silences stderr output: +```zsh +$ find . -type f NE +# will run +$ find . -type f 2>/dev/null +``` + +| Alias | Command | Description | +|-------|-----------------------------|-------------------------------------------------------------| +| H | `\| head` | Pipes output to head which outputs the first part of a file | +| T | `\| tail` | Pipes output to tail which outputs the last part of a file | +| G | `\| grep` | Pipes output to grep to search for some word | +| L | `\| less` | Pipes output to less, useful for paging | +| M | `\| most` | Pipes output to more, useful for paging | +| LL | `2>&1 \| less` | Writes stderr to stdout and passes it to less | +| CA | `2>&1 \| cat -A` | Writes stderr to stdout and passes it to cat | +| NE | `2 > /dev/null` | Silences stderr | +| NUL | `> /dev/null 2>&1` | Silences both stdout and stderr | +| P | `2>&1\| pygmentize -l pytb` | Writes stderr to stdout and passes it to pygmentize | + +## File extension aliases + +These are special aliases that are triggered when a file name is passed as the command. For example, +if the pdf file extension is aliased to `acroread` (a popular Linux pdf reader), when running `file.pdf` +that file will be open with `acroread`. + +### Reading Docs + +| Alias | Command | Description | +|-------|-------------|-------------------------------------| +| pdf | `acroread` | Opens up a document using acroread | +| ps | `gv` | Opens up a .ps file using gv | +| dvi | `xdvi` | Opens up a .dvi file using xdvi | +| chm | `xchm` | Opens up a .chm file using xchm | +| djvu | `djview` | Opens up a .djvu file using djview | + +### Listing files inside a packed file + +| Alias | Command | Description | +|---------|-------------|-------------------------------------| +| zip | `unzip -l` | Lists files inside a .zip file | +| rar | `unrar l` | Lists files inside a .rar file | +| tar | `tar tf` | Lists files inside a .tar file | +| tar.gz | `echo` | Lists files inside a .tar.gz file | +| ace | `unace l` | Lists files inside a .ace file | + +### Some other features + +- Opens urls in terminal using browser specified by the variable `$BROWSER` +- Opens C, C++, Tex and text files using editor specified by the variable `$EDITOR` +- Opens images using image viewer specified by the variable `$XIVIEWER` +- Opens videos and other media using mplayer diff --git a/zsh/.oh-my-zsh/plugins/compleat/README.md b/zsh/.oh-my-zsh/plugins/compleat/README.md new file mode 100644 index 0000000..630c915 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/compleat/README.md @@ -0,0 +1,8 @@ +# compleat plugin + +This plugin looks for [compleat](https://github.com/mbrubeck/compleat) and loads its completion. + +To use it, add compleat to the plugins array in your zshrc file: +``` +plugins=(... compleat) +``` diff --git a/zsh/.oh-my-zsh/plugins/dash/README.md b/zsh/.oh-my-zsh/plugins/dash/README.md new file mode 100644 index 0000000..0ca3e4e --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/dash/README.md @@ -0,0 +1,28 @@ +# Dash plugin + +This plugin adds command line functionality for [Dash](https://kapeli.com/dash), +an API Documentation Browser for macOS. This plugin requires Dash to be installed +to work. + +To use it, add `dash` to the plugins array in your zshrc file: + +```zsh +plugins=(... dash) +``` + +## Usage + +- Open and switch to the dash application. +``` +dash +``` + +- Query for something in dash app: `dash query` +``` +dash golang +``` + +- You can optionally provide a keyword: `dash [keyword:]query` +``` +dash python:tuple +``` diff --git a/zsh/.oh-my-zsh/plugins/dnote/README.md b/zsh/.oh-my-zsh/plugins/dnote/README.md new file mode 100644 index 0000000..e1b9b70 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/dnote/README.md @@ -0,0 +1,51 @@ +# Dnote Plugin + +This plugin adds auto-completion for [Dnote](https://dnote.io) project. + +To use it, add `dnote` to the plugins array in your zshrc file: + +```zsh +plugins=(dnote) +``` + +## Usage + +At the basic level, this plugin completes all Dnote commands. + +```zsh +$ dnote a(press here) +``` + +would result in: + +```zsh +$ dnote add +``` + +For some commands, this plugin dynamically suggests matching book names. + +For instance, if you have three books that begin with 'j': 'javascript', 'job', 'js', + +```zsh +$ dnote view j(press here) +``` + +would result in: + +```zsh +$ dnote v j +javascript job js +``` + +As another example, + +```zsh +$ dnote edit ja(press here) +``` + +would result in: + + +```zsh +$ dnote v javascript +`````` diff --git a/zsh/.oh-my-zsh/plugins/dnote/_dnote b/zsh/.oh-my-zsh/plugins/dnote/_dnote new file mode 100644 index 0000000..c8b3348 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/dnote/_dnote @@ -0,0 +1,39 @@ +#compdef dnote + +local -a _1st_arguments + +_1st_arguments=( + 'add:add a new note' + 'view:list books, notes, or view a content' + 'edit:edit a note or a book' + 'remove:remove a note or a book' + 'find:find notes by keywords' + 'sync:sync data with the server' + 'login:login to the dnote server' + 'logout:logout from the dnote server' + 'version:print the current version' + 'help:get help about any command' +) + +get_booknames() { + local names=$(dnote view --name-only) + local -a ret + + while read -r line; do + ret+=("${line}") + done <<< "$names" + + echo "$ret" +} + +if (( CURRENT == 2 )); then + _describe -t commands "dnote subcommand" _1st_arguments + return +elif (( CURRENT == 3 )); then + case "$words[2]" in + v|view|a|add) + _alternative \ + "names:book names:($(get_booknames))" + esac +fi + diff --git a/zsh/.oh-my-zsh/plugins/drush/README.md b/zsh/.oh-my-zsh/plugins/drush/README.md new file mode 100644 index 0000000..df7b82b --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/drush/README.md @@ -0,0 +1,83 @@ +# Drush + +## Description +This plugin offers aliases and functions to make the work with drush easier and more productive. + +To enable it, add the `drush` to your `plugins` array in `~/.zshrc`: + +``` +plugins=(... drush) +``` + +## Aliases +| Alias | Description | Command | +|-------|-----------------------------------------------------------------------|-----------------------------| +| dr | Display drush help | drush | +| drca | Clear all drupal caches. | drush cc all | +| drcb | Clear block cache. | drush cc block | +| drcg | Clear registry cache. | drush cc registry | +| drcj | Clear css-js cache. | drush cc css-js | +| drcm | Clear menu cache. | drush cc menu | +| drcml | Clear module-list cache. | drush cc module-list | +| drcr | Run all cron hooks in all active modules for specified site. | drush core-cron | +| drct | Clear theme-registry cache. | drush cc theme-registry | +| drcv | Clear views cache. (Make sure that the views module is enabled) | drush cc views | +| drdmp | Backup database in a new dump.sql file | drush drush sql-dump --ordered-dump --result-file=dump.sql| +| drf | Display features status | drush features | +| drfr | Revert a feature module on your site. | drush features-revert -y | +| drfu | Update a feature module on your site. | drush features-update -y | +| drfra | Revert all enabled feature module on your site. | drush features-revert-all | +| drif | Flush all derived images. | drush image-flush --all | +| drpm | Show a list of available modules. | drush pm-list --type=module | +| drst | Provides a birds-eye view of the current Drupal installation, if any. | drush core-status | +| drup | Apply any database updates required (as with running update.php). | drush updatedb | +| drups | List any pending database updates. | drush updatedb-status | +| drv | Show drush version. | drush version | +| drvd | Delete a variable. | drush variable-del | +| drvg | Get a list of some or all site variables and values. | drush variable-get | +| drvs | Set a variable. | drush variable-set | + +## Functions + +### dren +Download and enable one or more extensions (modules or themes). +Must be invoked with one or more parameters. e.g.: +`dren devel` or `dren devel module_filter views` + +### drf +Edit drushrc, site alias, and Drupal settings.php files. +Can be invoked with one or without parameters. e.g.: +`drf 1` + +### dris +Disable one or more extensions (modules or themes) +Must be invoked with one or more parameters. e.g.: +`dris devel` or `dris devel module_filter views` + +### drpu +Uninstall one or more modules. +Must be invoked with one or more parameters. e.g.: +`drpu devel` or `drpu devel module_filter views` + +### drnew +Creates a brand new drupal website. +Note: As soon as the installation is complete, drush will print a username and a random password into the terminal: +``` +Installation complete. User name: admin User password: cf7t8yqNEm +``` + +## Additional features + +### Autocomplete +The [completion script for drush](https://github.com/drush-ops/drush/blob/8.0.1/drush.complete.sh) comes enabled with this plugin. +So, it is possible to type a command: +``` +drush sql +``` + +And as soon as the tab key is pressed, the script will display the available commands: +``` +drush sql +sqlc sql-conf sql-create sql-dump sql-query sql-sanitize +sql-cli sql-connect sql-drop sqlq sqlsan sql-sync +``` diff --git a/zsh/.oh-my-zsh/plugins/drush/drush.complete.sh b/zsh/.oh-my-zsh/plugins/drush/drush.complete.sh new file mode 100644 index 0000000..38b882e --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/drush/drush.complete.sh @@ -0,0 +1,50 @@ +# BASH completion script for Drush. +# +# Place this in your /etc/bash_completion.d/ directory or source it from your +# ~/.bash_completion or ~/.bash_profile files. Alternatively, source +# examples/example.bashrc instead, as it will automatically find and source +# this file. +# +# If you're using ZSH instead of BASH, add the following to your ~/.zshrc file +# and source it. +# +# autoload bashcompinit +# bashcompinit +# source /path/to/your/drush.complete.sh + +# Ensure drush is available. +which drush > /dev/null || alias drush &> /dev/null || return + +__drush_ps1() { + f="${TMPDIR:-/tmp/}/drush-env-${USER}/drush-drupal-site-$$" + if [ -f $f ] + then + __DRUPAL_SITE=$(cat "$f") + else + __DRUPAL_SITE="$DRUPAL_SITE" + fi + + # Set DRUSH_PS1_SHOWCOLORHINTS to a non-empty value and define a + # __drush_ps1_colorize_alias() function for color hints in your Drush PS1 + # prompt. See example.prompt.sh for an example implementation. + if [ -n "${__DRUPAL_SITE-}" ] && [ -n "${DRUSH_PS1_SHOWCOLORHINTS-}" ]; then + __drush_ps1_colorize_alias + fi + + [[ -n "$__DRUPAL_SITE" ]] && printf "${1:- (%s)}" "$__DRUPAL_SITE" +} + +# Completion function, uses the "drush complete" command to retrieve +# completions for a specific command line COMP_WORDS. +_drush_completion() { + # Set IFS to newline (locally), since we only use newline separators, and + # need to retain spaces (or not) after completions. + local IFS=$'\n' + # The '< /dev/null' is a work around for a bug in php libedit stdin handling. + # Note that libedit in place of libreadline in some distributions. See: + # https://bugs.launchpad.net/ubuntu/+source/php5/+bug/322214 + COMPREPLY=( $(drush --early=includes/complete.inc "${COMP_WORDS[@]}" < /dev/null 2> /dev/null) ) +} + +# Register our completion function. We include common short aliases for Drush. +complete -o bashdefault -o default -o nospace -F _drush_completion d dr drush drush5 drush6 drush7 drush8 drush.php diff --git a/zsh/.oh-my-zsh/plugins/drush/drush.plugin.zsh b/zsh/.oh-my-zsh/plugins/drush/drush.plugin.zsh new file mode 100644 index 0000000..8a20d79 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/drush/drush.plugin.zsh @@ -0,0 +1,104 @@ +# Drush support. + +function dren() { + drush en $@ -y +} + +function dris() { + drush pm-disable $@ -y +} + +function drpu() { + drush pm-uninstall $@ -y +} + +function drf() { + if [[ $1 == "" ]] then + drush core-config + else + drush core-config --choice=$1 + fi +} + +function drfi() { + if [[ $1 == "fields" ]]; then + drush field-info fields + elif [[ $1 == "types" ]]; then + drush field-info types + else + drush field-info + fi +} + +function drnew() { + + cd ~ + echo "Website's name: " + read WEBSITE_NAME + + HOST=http://$(hostname -i)/ + + if [[ $WEBSITE_NAME == "" ]] then + MINUTES=$(date +%M:%S) + WEBSITE_NAME="Drupal-$MINUTES" + echo "Your website will be named: $WEBSITE_NAME" + fi + + drush dl drupal --drupal-project-rename=$WEBSITE_NAME + + echo "Type your localhost directory: (Leave empty for /var/www/html/)" + read DIRECTORY + + if [[ $DIRECTORY == "" ]] then + DIRECTORY="/var/www/html/" + fi + + echo "Moving to $DIRECTORY$WEBSITE_NAME" + sudo mv $WEBSITE_NAME $DIRECTORY + cd $DIRECTORY$WEBSITE_NAME + + echo "Database's user: " + read DATABASE_USR + echo "Database's password: " + read -s DATABASE_PWD + echo "Database's name for your project: " + read DATABASE + + DB_URL="mysql://$DATABASE_USR:$DATABASE_PWD@localhost/$DATABASE" + drush site-install standard --db-url=$DB_URL --site-name=$WEBSITE_NAME + + open_command $HOST$WEBSITE_NAME + echo "Done" + +} + +# Aliases, sorted alphabetically. +alias dr="drush" +alias drca="drush cc all" # Deprecated for Drush 8 +alias drcb="drush cc block" # Deprecated for Drush 8 +alias drcg="drush cc registry" # Deprecated for Drush 8 +alias drcj="drush cc css-js" +alias drcm="drush cc menu" +alias drcml="drush cc module-list" +alias drcr="drush core-cron" +alias drct="drush cc theme-registry" +alias drcv="drush cc views" +alias drdmp="drush sql-dump --ordered-dump --result-file=dump.sql" +alias drf="drush features" +alias drfr="drush features-revert -y" +alias drfu="drush features-update -y" +alias drfra="drush features-revert-all" +alias drif="drush image-flush --all" +alias drpm="drush pm-list --type=module" +alias drst="drush core-status" +alias drup="drush updatedb" +alias drups="drush updatedb-status" +alias drv="drush version" +alias drvd="drush variable-del" +alias drvg="drush variable-get" +alias drvs="drush variable-set" + +# Enable drush autocomplete support +autoload bashcompinit +bashcompinit +source $(dirname $0)/drush.complete.sh diff --git a/zsh/.oh-my-zsh/plugins/eecms/README.md b/zsh/.oh-my-zsh/plugins/eecms/README.md new file mode 100644 index 0000000..c538355 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/eecms/README.md @@ -0,0 +1,11 @@ +# eecms plugin + +This plugin adds auto-completion of console commands for [`eecms`](https://github.com/ExpressionEngine/ExpressionEngine). + +To use it, add `eecms` to the plugins array of your `.zshrc` file: +``` +plugins=(... eecms) +``` + +It also adds the alias `eecms` which finds the eecms file in the current project +and runs it with php. diff --git a/zsh/.oh-my-zsh/plugins/emotty/README.md b/zsh/.oh-my-zsh/plugins/emotty/README.md new file mode 100644 index 0000000..2cfbe12 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/emotty/README.md @@ -0,0 +1,39 @@ +# emotty plugin + +This plugin returns an emoji for the current $TTY number so it can be used +in a prompt. + +To use it, add emotty to the plugins array in your zshrc file: +``` +plugins=(... emotty) +``` + +**NOTE:** it requires the [emoji plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/emoji). + +## Usage + +The function `emotty` displays an emoji from the current character set (default: `emoji`), based +on the number associated to the `$TTY`. + +There are different sets of emoji characters available, to choose a different +set, set `$emotty_set` to the name of the set you would like to use, e.g.: +``` +emotty_set=nature +``` + +### Character Sets + +- emoji +- loral +- love +- nature +- stellar +- zodiac + +Use the `display_emotty` function to list the emojis in the current character set, or +the character set passed as the first argument. For example: + +``` +$ display_emotty zodiac + +``` diff --git a/zsh/.oh-my-zsh/plugins/fasd/README.md b/zsh/.oh-my-zsh/plugins/fasd/README.md new file mode 100644 index 0000000..1641a92 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/fasd/README.md @@ -0,0 +1,21 @@ +# fasd + +[`Fasd`](https://github.com/clvv/fasd) (pronounced similar to "fast") is a command-line productivity booster. Fasd offers quick access to files and directories for POSIX shells. + +To use it, add `fasd` to the plugins array in your zshrc file: + +```zsh +plugins=(... fd) +``` + +## Installation + +Please find detailed installation guide [`here`](https://github.com/clvv/fasd#install) + +## Aliases + +| Alias | Command | Description | +|-------|-------------------------------------------|-------------------------------------------------------------| +| v | `fasd -f -e "$EDITOR"` | List frequent/recent files matching the given filename. | +| o | `fasd -a -e xdg-open` | List frequent/recent files and directories matching. | +| j | `fasd_cd -d -i` | cd with interactive selection | \ No newline at end of file diff --git a/zsh/.oh-my-zsh/plugins/fbterm/README.md b/zsh/.oh-my-zsh/plugins/fbterm/README.md new file mode 100644 index 0000000..eec33d7 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/fbterm/README.md @@ -0,0 +1,9 @@ +# fbterm + +This plugin automatically starts [fbterm](https://github.com/zhangyuanwei/fbterm) +if on a real TTY (`/dev/tty*`). + +To use it, add fbterm to the plugins array of your zshrc file: +``` +plugins=(... fbterm) +``` diff --git a/zsh/.oh-my-zsh/plugins/fd/README.md b/zsh/.oh-my-zsh/plugins/fd/README.md new file mode 100644 index 0000000..aabd624 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/fd/README.md @@ -0,0 +1,13 @@ +# fd + +This plugin adds completion for the file search tool [`fd`](https://github.com/sharkdp/fd), also known as `fd-find`. + +To use it, add `fd` to the plugins array in your zshrc file: + +```zsh +plugins=(... fd) +``` + +Completion is taken from the fd release [`7.3.0`](https://github.com/sharkdp/fd/releases/tag/v7.3.0). + +Updated on Febrary 13th, 2019. diff --git a/zsh/.oh-my-zsh/plugins/fd/_fd b/zsh/.oh-my-zsh/plugins/fd/_fd new file mode 100644 index 0000000..7a4c387 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/fd/_fd @@ -0,0 +1,83 @@ +#compdef fd fdfind + +autoload -U is-at-least + +_fd() { + typeset -A opt_args + typeset -a _arguments_options + local ret=1 + + if is-at-least 5.2; then + _arguments_options=(-s -S -C) + else + _arguments_options=(-s -C) + fi + + local context curcontext="$curcontext" state line + _arguments "${_arguments_options[@]}" \ +'-d+[Set maximum search depth (default: none)]' \ +'--max-depth=[Set maximum search depth (default: none)]' \ +'--maxdepth=[See --max-depth]' \ +'*-t+[Filter by type: file (f), directory (d), symlink (l), +executable (x), empty (e)]: :(f file d directory l symlink x executable e empty)' \ +'*--type=[Filter by type: file (f), directory (d), symlink (l), +executable (x), empty (e)]: :(f file d directory l symlink x executable e empty)' \ +'*-e+[Filter by file extension]' \ +'*--extension=[Filter by file extension]' \ +'-x+[Execute a command for each search result]' \ +'--exec=[Execute a command for each search result]' \ +'(-x --exec)-X+[Execute a command with all search results at once]' \ +'(-x --exec)--exec-batch=[Execute a command with all search results at once]' \ +'*-E+[Exclude entries that match the given glob pattern]' \ +'*--exclude=[Exclude entries that match the given glob pattern]' \ +'*--ignore-file=[Add a custom ignore-file in .gitignore format]' \ +'-c+[When to use colors: never, *auto*, always]: :(never auto always)' \ +'--color=[When to use colors: never, *auto*, always]: :(never auto always)' \ +'-j+[Set number of threads to use for searching & executing]' \ +'--threads=[Set number of threads to use for searching & executing]' \ +'*-S+[Limit results based on the size of files.]' \ +'*--size=[Limit results based on the size of files.]' \ +'--max-buffer-time=[the time (in ms) to buffer, before streaming to the console]' \ +'--changed-within=[Filter by file modification time (newer than)]' \ +'--changed-before=[Filter by file modification time (older than)]' \ +'*--search-path=[(hidden)]' \ +'-H[Search hidden files and directories]' \ +'--hidden[Search hidden files and directories]' \ +'-I[Do not respect .(git|fd)ignore files]' \ +'--no-ignore[Do not respect .(git|fd)ignore files]' \ +'--no-ignore-vcs[Do not respect .gitignore files]' \ +'*-u[Alias for no-ignore and/or hidden]' \ +'-s[Case-sensitive search (default: smart case)]' \ +'--case-sensitive[Case-sensitive search (default: smart case)]' \ +'-i[Case-insensitive search (default: smart case)]' \ +'--ignore-case[Case-insensitive search (default: smart case)]' \ +'-F[Treat the pattern as a literal string]' \ +'--fixed-strings[Treat the pattern as a literal string]' \ +'-a[Show absolute instead of relative paths]' \ +'--absolute-path[Show absolute instead of relative paths]' \ +'-L[Follow symbolic links]' \ +'--follow[Follow symbolic links]' \ +'-p[Search full path (default: file-/dirname only)]' \ +'--full-path[Search full path (default: file-/dirname only)]' \ +'-0[Separate results by the null character]' \ +'--print0[Separate results by the null character]' \ +'--show-errors[Enable display of filesystem errors]' \ +'-h[Prints help information]' \ +'--help[Prints help information]' \ +'-V[Prints version information]' \ +'--version[Prints version information]' \ +'::pattern -- the search pattern, a regular expression (optional):_files' \ +'::path -- the root directory for the filesystem search (optional):_files' \ +&& ret=0 + +} + +(( $+functions[_fd_commands] )) || +_fd_commands() { + local commands; commands=( + + ) + _describe -t commands 'fd commands' commands "$@" +} + +_fd "$@" diff --git a/zsh/.oh-my-zsh/plugins/flutter/README.md b/zsh/.oh-my-zsh/plugins/flutter/README.md new file mode 100644 index 0000000..be41914 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/flutter/README.md @@ -0,0 +1,21 @@ +## Flutter plugin + +The Flutter plugin provides completion and useful aliases + +To use it, add flutter to the plugins array of your zshrc file: + +``` +plugins=(... flutter) +``` + +## Aliases + +| Alias | Command | Description | +| :--------- | :--------------------- | :------------------------------------------------------------------------- | +| `fl` | `flutter` | Shorthand for flutter command | +| `flr` | `flutter run` | Runs flutter app | +| `fldoc` | `flutter doctor` | Runs flutter doctor | +| `flb` | `flutter build` | Build flutter application | +| `flattach` | `flutter attach` | Attaches flutter to a running flutter application with enabled observatory | +| `flget` | `flutter packages get` | Installs dependencies | +| `flc` | `flutter clean` | Cleans flutter porject | diff --git a/zsh/.oh-my-zsh/plugins/flutter/_flutter b/zsh/.oh-my-zsh/plugins/flutter/_flutter new file mode 100644 index 0000000..ab6ce42 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/flutter/_flutter @@ -0,0 +1,37 @@ +#compdef flutter +#autoload + +local -a _1st_arguments +_1st_arguments=( + "analyze":"Analyze the project's Dart code." + "assemble":"Assemble and build flutter resources." + "attach":"Attach to a running application." + "build":"Flutter build commands." + "channel":"List or switch flutter channels." + "clean":"Delete the build/ and .dart_tool/ directories." + "config":"Configure Flutter settings." + "create":"Create a new Flutter project." + "devices":"List all connected devices." + "doctor":"Show information about the installed tooling." + "drive":"Runs Flutter Driver tests for the current project." + "emulators":"List, launch and create emulators." + "format":" Format one or more dart files." + "help":"Display help information for flutter." + "install":"Install a Flutter app on an attached device." + "logs":"Show log output for running Flutter apps." + "make-host-app-editable":"Moves host apps from generated directories to non-generated directories so that they can be edited by developers." + "precache":"Populates the Flutter tool's cache of binary artifacts." + "pub":"Commands for managing Flutter packages." + "run":"Run your Flutter app on an attached device." + "screenshot":"Take a screenshot from a connected device." + "test":"Run Flutter unit tests for the current project." + "upgrade":"Upgrade your copy of Flutter." + "version":"List or switch flutter versions." +) + +_arguments -C '*:: :->subcmds' + +if (( CURRENT == 1 )); then + _describe -t commands "flutter command" _1st_arguments + return +fi diff --git a/zsh/.oh-my-zsh/plugins/flutter/flutter.plugin.zsh b/zsh/.oh-my-zsh/plugins/flutter/flutter.plugin.zsh new file mode 100644 index 0000000..01c4c9f --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/flutter/flutter.plugin.zsh @@ -0,0 +1,7 @@ +alias fl="flutter" +alias flr="flutter run" +alias fldoc="flutter doctor" +alias flb="flutter build" +alias flattach="flutter attach" +alias flget="flutter packages get" +alias flc="flutter clean" diff --git a/zsh/.oh-my-zsh/plugins/gatsby/README.md b/zsh/.oh-my-zsh/plugins/gatsby/README.md new file mode 100644 index 0000000..36846a2 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/gatsby/README.md @@ -0,0 +1,7 @@ +# gatsby autocomplete plugin + +* Adds autocomplete options for all gatsby commands. + +## Requirements + +In order to make this work, you will need to have gatsby set up in your path. diff --git a/zsh/.oh-my-zsh/plugins/gatsby/_gatsby b/zsh/.oh-my-zsh/plugins/gatsby/_gatsby new file mode 100644 index 0000000..66eb02f --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/gatsby/_gatsby @@ -0,0 +1,24 @@ +#compdef gatsby +#autoload + +# in order to make this work, you will need to have gatsby +# https://www.gatsbyjs.org/ + +local -a _1st_arguments +_1st_arguments=( +'develop:Start development server. Watches files, rebuilds, and hot reloads if something changes' +'build:Build a Gatsby project.' +'serve:Serve previously built Gatsby site.' +'info:Get environment information for debugging and issue reporting' +'clean:Wipe the local gatsby environment including built assets and cache' +'repl:Get a node repl with context of Gatsby environment, see (add docs link here)' +'new: [rootPath] [starter] Create new Gatsby project.' +'telemetry:Enable or disable Gatsby anonymous analytics collection.' +) + +_arguments -C '*:: :->subcmds' && return 0 + +if (( CURRENT == 1 )); then + _describe -t commands "gatsby subcommand" _1st_arguments + return +fi diff --git a/zsh/.oh-my-zsh/plugins/gcloud/README.md b/zsh/.oh-my-zsh/plugins/gcloud/README.md new file mode 100644 index 0000000..e7ce0e0 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/gcloud/README.md @@ -0,0 +1,24 @@ +# gcloud + +This plugin provides completion support for the +[Google Cloud SDK CLI](https://cloud.google.com/sdk/gcloud/). + +To use it, add `gcloud` to the plugins array in your zshrc file. + +```zsh +plugins=(... gcloud) +``` + +It relies on you having installed the SDK using one of the supported options +listed [here](https://cloud.google.com/sdk/install). + +## Plugin Options + +* Set `CLOUDSDK_HOME` in your `zshrc` file before you load oh-my-zsh if you have +your GCloud SDK installed in a non-standard location. The plugin will use this +as the base for your SDK if it finds it set already. + +* If you do not have a `python2` in your `PATH` you'll also need to set the +`CLOUDSDK_PYTHON` environment variable at the end of your `.zshrc`. This is +used by the SDK to call a compatible interpreter when you run one of the +SDK commands. diff --git a/zsh/.oh-my-zsh/plugins/gcloud/gcloud.plugin.zsh b/zsh/.oh-my-zsh/plugins/gcloud/gcloud.plugin.zsh new file mode 100644 index 0000000..c7aebe6 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/gcloud/gcloud.plugin.zsh @@ -0,0 +1,33 @@ +##################################################### +# gcloud plugin for oh-my-zsh # +# Author: Ian Chesal (github.com/ianchesal) # +##################################################### + +if [[ -z "${CLOUDSDK_HOME}" ]]; then + search_locations=( + "$HOME/google-cloud-sdk" + "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk" + "/usr/share/google-cloud-sdk" + "/snap/google-cloud-sdk/current" + "/usr/lib64/google-cloud-sdk/" + "/opt/google-cloud-sdk" + ) + + for gcloud_sdk_location in $search_locations; do + if [[ -d "${gcloud_sdk_location}" ]]; then + CLOUDSDK_HOME="${gcloud_sdk_location}" + break + fi + done +fi + +if (( ${+CLOUDSDK_HOME} )); then + if (( ! $+commands[gcloud] )); then + # Only source this if GCloud isn't already on the path + if [[ -f "${CLOUDSDK_HOME}/path.zsh.inc" ]]; then + source "${CLOUDSDK_HOME}/path.zsh.inc" + fi + fi + source "${CLOUDSDK_HOME}/completion.zsh.inc" + export CLOUDSDK_HOME +fi diff --git a/zsh/.oh-my-zsh/plugins/git-escape-magic/README.md b/zsh/.oh-my-zsh/plugins/git-escape-magic/README.md new file mode 100644 index 0000000..7fefed3 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/git-escape-magic/README.md @@ -0,0 +1,16 @@ +# Git Escape Magic + +This plugin is copied from the original at +https://github.com/knu/zsh-git-escape-magic. All credit for the +functionality enabled by this plugin should go to @knu. + +An excerpt from that project's readme explains its purpose. + +> It eliminates the need for manually escaping those meta-characters. The zle function it provides is context aware and recognizes the characteristics of each subcommand of git. Every time you type one of these meta-characters on a git command line, it automatically escapes the meta-character with a backslash as necessary and as appropriate. + +## Usage + +To use this plugin, add it to your list of plugins in your `.zshrc` file. + +**NOTE**: If you use url-quote-magic, it must be included before this +plugin runs to prevent any conflicts. diff --git a/zsh/.oh-my-zsh/plugins/git-escape-magic/git-escape-magic b/zsh/.oh-my-zsh/plugins/git-escape-magic/git-escape-magic new file mode 100644 index 0000000..94a8d7b --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/git-escape-magic/git-escape-magic @@ -0,0 +1,135 @@ +# -*- mode: sh -*- +# +# git-escape-magic - zle tweak for git command line arguments +# +# Copyright (c) 2011, 2012, 2014 Akinori MUSHA +# Licensed under the 2-clause BSD license. +# +# This tweak eliminates the need for manually escaping shell +# meta-characters such as [~^{}] that are used for specifying a git +# object (commit or tree). Every time you type one of these +# characters on a git command line, it is automatically escaped with a +# backslash as necessary and as appropriate. +# +# If you want to use this with url-quote-magic, make sure to enable it +# first. +# +# Usage: +# autoload -Uz git-escape-magic +# git-escape-magic +# + +git-escape-magic.self-insert() { + emulate -L zsh + setopt extendedglob + local self_insert_function + zstyle -s ':git-escape-magic' self-insert-function self_insert_function + + if [[ "$KEYS" == [{}~^]* ]] && { + local qkey="${(q)KEYS}" + [[ "$KEYS" != "$qkey" ]] + } && { + local lbuf="$LBUFFER$qkey" + [[ "${(Q)LBUFFER}$KEYS" == "${(Q)lbuf}" ]] + } && { + local -a words + words=("${(@Q)${(z)lbuf}}") + [[ "$words[(i)(*/|)git(|-[^/]##)]" -le $#words ]] + } + then + local i + i="$words[(I)([;(){\&]|\&[\&\!]|\|\||[=<>]\(*)]" + if [[ $i -gt 0 ]]; then + shift $((i-1)) words + if [[ "$words[1]" == [\=\<\>]\(* ]]; then + words[1]="${words[1]#[=<>]\(}" + else + [[ "$words[1]" == \; && $words[2] == (then|else|elif|do) ]] && shift words + shift words + fi + fi + while [[ "$words[1]" == (if|while|until|\!) ]]; do + shift words + done + while [[ "$words[1]" == [A-Za-z_][A-Za-z0-9_]#=* ]]; do + shift words + done + [[ "$words[1]" == (*/|)git(|-[^/]##) ]] && { + local subcommand + subcommand="${words[1]##*/git-}" + if [[ -z "$subcommand" ]]; then + shift words + subcommand="$words[1]" + fi + [[ $#words -ge 2 ]] + } && + case "$subcommand" in + # commands that may take pathspec but never take refspec with [{}~^] + (add|rm|am|apply|check-attr|checkout-index|clean|clone|config|diff-files|hash-object|help|index-pack|mailinfo|mailsplit|merge-file|merge-index|mergetool|mktag|mv|pack-objects|pack-redundant|relink|send-email|show-index|show-ref|stage|status|verify-pack) + false ;; + # commands that may take pathspec but rarely take refspec with [{}~^] + (for-each-ref|grep|ls-files|update-index) + false ;; + (archive|ls-tree) + ! [[ $#words -ge 3 && + "$words[-2]" == [^-]* ]] ;; + (diff-tree) + ! [[ $#words -ge 4 && + "$words[-2]" == [^-]* && + "$words[-3]" == [^-]* ]] ;; + (*) + [[ $words[(i)--] -gt $#words ]] ;; + esac && + case "${words[-1]%%"$KEYS"}" in + (*[@^]) + [[ "$KEYS" == [{~^]* ]] ;; + (*[@^]\{[^}]##) + [[ "$KEYS" == \}* ]] ;; + (?*) + [[ "$KEYS" == [~^]* ]] ;; + (*) + false ;; + esac && + LBUFFER="$LBUFFER\\" + fi + + zle "$self_insert_function" +} + +git-escape-magic.on() { + emulate -L zsh + local self_insert_function="${$(zle -lL | awk \ + '$1=="zle"&&$2=="-N"&&$3=="self-insert"{print $4;exit}'):-.self-insert}" + + [[ "$self_insert_function" == git-escape-magic.self-insert ]] && + return 0 + + # For url-quote-magic which does not zle -N itself + zle -la "$self_insert_function" || zle -N "$self_insert_function" + + zstyle ':git-escape-magic' self-insert-function "$self_insert_function" + + zle -A git-escape-magic.self-insert self-insert + return 0 +} + +git-escape-magic.off() { + emulate -L zsh + local self_insert_function + zstyle -s ':git-escape-magic' self-insert-function self_insert_function + + [[ -n "$self_insert_function" ]] && + zle -A "$self_insert_function" self-insert + return 0 +} + +zle -N git-escape-magic.self-insert +zle -N git-escape-magic.on +zle -N git-escape-magic.off + +git-escape-magic() { + git-escape-magic.on +} + +[[ -o kshautoload ]] || git-escape-magic "$@" + diff --git a/zsh/.oh-my-zsh/plugins/git-escape-magic/git-escape-magic.plugin.zsh b/zsh/.oh-my-zsh/plugins/git-escape-magic/git-escape-magic.plugin.zsh new file mode 100644 index 0000000..c021ea7 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/git-escape-magic/git-escape-magic.plugin.zsh @@ -0,0 +1,9 @@ +# Automatically detect and escape zsh globbing meta-characters when used with +# git refspec characters like `[^~{}]`. NOTE: This must be loaded _after_ +# url-quote-magic. +# +# This trick is detailed at https://github.com/knu/zsh-git-escape-magic and is +# what allowed this plugin to exist. + +autoload -Uz git-escape-magic +git-escape-magic diff --git a/zsh/.oh-my-zsh/plugins/git-prompt/README.md b/zsh/.oh-my-zsh/plugins/git-prompt/README.md new file mode 100644 index 0000000..e3b2d62 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/git-prompt/README.md @@ -0,0 +1,61 @@ +# git-prompt plugin + +A `zsh` prompt that displays information about the current git repository. In particular: +the branch name, difference with remote branch, number of files staged or changed, etc. + +To use it, add `git-prompt` to the plugins array in your zshrc file: + +```zsh +plugins=(... git-prompt) +``` + +See the [original repository](https://github.com/olivierverdier/zsh-git-prompt). + +## Examples + +The prompt may look like the following: + +- `(master↑3|✚1)`: on branch `master`, ahead of remote by 3 commits, 1 file changed but not staged +- `(status|●2)`: on branch `status`, 2 files staged +- `(master|✚7…)`: on branch `master`, 7 files changed, some files untracked +- `(master|✖2✚3)`: on branch `master`, 2 conflicts, 3 files changed +- `(experimental↓2↑3|✔)`: on branch `experimental`; your branch has diverged by 3 commits, remote by 2 commits; the repository is otherwise clean +- `(:70c2952|✔)`: not on any branch; parent commit has hash `70c2952`; the repository is otherwise clean + +## Prompt Structure + +By default, the general appearance of the prompt is: + +``` +(|) +``` + +The symbols are as follows: + +### Local Status Symbols + +| Symbol | Meaning | +|--------|--------------------------------| +| ✔ | repository clean | +| ●n | there are `n` staged files | +| ✖n | there are `n` unmerged files | +| ✚n | there are `n` unstaged files | +| … | there are some untracked files | + +### Branch Tracking Symbols + +| Symbol | Meaning | +|--------|---------------------------------------------------------------| +| ↑n | ahead of remote by `n` commits | +| ↓n | behind remote by `n` commits | +| ↓m↑n | branches diverged: other by `m` commits, yours by `n` commits | + +## Customisation + +- Set the variable `ZSH_THEME_GIT_PROMPT_CACHE` to any value in order to enable caching. +- You may also change a number of variables (whose name start with `ZSH_THEME_GIT_PROMPT_`) + to change the appearance of the prompt. Take a look at the bottom of the [plugin file](git-prompt.plugin.zsh)` + to see what variables are available. + + +**Enjoy!** diff --git a/zsh/.oh-my-zsh/plugins/git-remote-branch/README.md b/zsh/.oh-my-zsh/plugins/git-remote-branch/README.md new file mode 100644 index 0000000..bd73e5d --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/git-remote-branch/README.md @@ -0,0 +1,14 @@ +# git-remote-branch plugin + +This plugin adds completion for [`grb`](https://github.com/webmat/git_remote_branch), +or `git_remote_branch`. + +To use it, add `git-remote-branch` to the plugins array of your `.zshrc` file: +``` +plugins=(... git-remote-branch) +``` + +## Deprecation + +[git_remote_branch was archived in 2018](https://github.com/webmat/git_remote_branch#archived), +meaning it's not actively maintained anymore. Use at your own risk. diff --git a/zsh/.oh-my-zsh/plugins/gitfast/update b/zsh/.oh-my-zsh/plugins/gitfast/update new file mode 100755 index 0000000..0505424 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/gitfast/update @@ -0,0 +1,9 @@ +#!/bin/sh + +url="https://git.kernel.org/pub/scm/git/git.git/plain/contrib/completion" +version="2.16.0" + +curl -s -o _git "${url}/git-completion.zsh?h=v${version}" && +curl -s -o git-completion.bash "${url}/git-completion.bash?h=v${version}" && +curl -s -o git-prompt.sh "${url}/git-prompt.sh?h=v${version}" && +git apply updates.patch diff --git a/zsh/.oh-my-zsh/plugins/gitfast/updates.patch b/zsh/.oh-my-zsh/plugins/gitfast/updates.patch new file mode 100644 index 0000000..28a31f8 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/gitfast/updates.patch @@ -0,0 +1,56 @@ +diff --git b/plugins/gitfast/_git a/plugins/gitfast/_git +index e2554130..a2e3bef5 100644 +--- b/plugins/gitfast/_git ++++ a/plugins/gitfast/_git +@@ -30,7 +30,7 @@ if [ -z "$script" ]; then + local -a locations + local e + locations=( +- $(dirname ${funcsourcetrace[1]%:*})/git-completion.bash ++ "$(dirname ${funcsourcetrace[1]%:*})/git-completion.bash" + '/etc/bash_completion.d/git' # fedora, old debian + '/usr/share/bash-completion/completions/git' # arch, ubuntu, new debian + '/usr/share/bash-completion/git' # gentoo +@@ -214,8 +214,10 @@ _git () + + if (( $+functions[__${service}_zsh_main] )); then + __${service}_zsh_main +- else ++ elif (( $+functions[__${service}_main] )); then + emulate ksh -c __${service}_main ++ elif (( $+functions[_${service}] )); then ++ emulate ksh -c _${service} + fi + + let _ret && _default && _ret=0 +diff --git b/plugins/gitfast/git-completion.bash a/plugins/gitfast/git-completion.bash +index 9c8f7380..14012cab 100644 +--- b/plugins/gitfast/git-completion.bash ++++ a/plugins/gitfast/git-completion.bash +@@ -2915,6 +2915,6 @@ __git_complete gitk __gitk_main + # when the user has tab-completed the executable name and consequently + # included the '.exe' suffix. + # +-if [ Cygwin = "$(uname -o 2>/dev/null)" ]; then ++if [[ "$OSTYPE" = cygwin* ]]; then + __git_complete git.exe __git_main + fi +diff --git b/plugins/gitfast/git-prompt.sh a/plugins/gitfast/git-prompt.sh +index 97eacd78..c1de34eb 100644 +--- b/plugins/gitfast/git-prompt.sh ++++ a/plugins/gitfast/git-prompt.sh +@@ -502,9 +502,11 @@ __git_ps1 () + + local z="${GIT_PS1_STATESEPARATOR-" "}" + +- # NO color option unless in PROMPT_COMMAND mode +- if [ $pcmode = yes ] && [ -n "${GIT_PS1_SHOWCOLORHINTS-}" ]; then +- __git_ps1_colorize_gitstring ++ # NO color option unless in PROMPT_COMMAND mode or it's Zsh ++ if [ -n "${GIT_PS1_SHOWCOLORHINTS-}" ]; then ++ if [ $pcmode = yes ] || [ -n "${ZSH_VERSION-}" ]; then ++ __git_ps1_colorize_gitstring ++ fi + fi + + b=${b##refs/heads/} diff --git a/zsh/.oh-my-zsh/plugins/httpie/_httpie b/zsh/.oh-my-zsh/plugins/httpie/_httpie new file mode 100644 index 0000000..4d702ef --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/httpie/_httpie @@ -0,0 +1,181 @@ +#compdef http +# ------------------------------------------------------------------------------ +# Copyright (c) 2015 Github zsh-users - http://github.com/zsh-users +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the zsh-users nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ------------------------------------------------------------------------------ +# Description +# ----------- +# +# Completion script for httpie 0.7.2 (http://httpie.org) +# +# ------------------------------------------------------------------------------ +# Authors +# ------- +# +# * Akira Maeda +# * Valodim +# * Claus Klingberg +# +# ------------------------------------------------------------------------------ +# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- +# vim: ft=zsh sw=2 ts=2 et +# ------------------------------------------------------------------------------ + +_httpie_params () { + + local ret=1 expl + + # or a url + if (( CURRENT <= NORMARG+1 )) && [[ $words[NORMARG] != *:* ]] ; then + _httpie_urls && ret=0 + + # regular param, if we already have a url + elif (( CURRENT > NORMARG )); then + + # if the suffix is precisely : this is shorthand for a header + if [[ -prefix ':' ]]; then + PREFIX= + SUFFIX=: + fi + + # if we are in front of a : (possibly due to the PREFIX move before) + if [[ -suffix ':' ]]; then + + # this is rather buggy with normal tab behavior :\ + compstate[insert]=menu + _wanted http_header expl 'HTTP Header' \ + compadd -s ':' -S '' -- Content-Type Cookie && return 0 + fi + + # ignore all prefix stuff + compset -P '(#b)([^:@=]#)' + local name=$match[1] + + if compset -P '='; then + _message "$name data field value" + elif compset -P '@'; then + _files + elif compset -P ':=@'; then + _files + elif compset -P ':='; then + _message "$name raw json data" + elif compset -P '=='; then + _message "$name url parameter value" + elif compset -P ':'; then + _message "$name header content" + else + typeset -a ops + ops=( + '=:data field' + '\::header' + '==:request parameter' + '@:data file field' + '\:=:raw json field' + '\:=@:raw json field file path' + ) + _describe -t httpparams "parameter types" ops -Q -S '' + fi + + ret=0 + + fi + + # first arg may be a request method + (( CURRENT == NORMARG )) && + _wanted http_method expl 'Request Method' \ + compadd GET POST PUT DELETE HEAD OPTIONS TRACE CONNECT PATCH LINK UNLINK && ret=0 + + return $ret + +} + +_httpie_urls() { + + local ret=1 + + if ! [[ -prefix [-+.a-z0-9]#:// ]]; then + local expl + compset -S '[^:/]*' && compstate[to_end]='' + _wanted url-schemas expl 'URL schema' compadd -S '' http:// https:// && ret=0 + else + _urls && ret=0 + fi + + return $ret + +} + +_httpie_printflags () { + + local ret=1 + + # not sure why this is necessary, but it will complete "-pH" style without it + [[ $IPREFIX == "-p" ]] && IPREFIX+=" " + + compset -P '(#b)([a-zA-Z]#)' + + local -a flags + [[ $match[1] != *H* ]] && flags+=( "H:request headers" ) + [[ $match[1] != *B* ]] && flags+=( "B:request body" ) + [[ $match[1] != *h* ]] && flags+=( "h:response headers" ) + [[ $match[1] != *b* ]] && flags+=( "b:response body" ) + + _describe -t printflags "print flags" flags -S '' && ret=0 + + return $ret + +} + +integer NORMARG + +_arguments -n -C -s \ + '(-j --json -f)'{-j,--json}'[Data items from the command line are serialized as a JSON object.]' \ + '(-f --form -j)'{-f,--form}'[Data items from the command line are serialized as form fields.]' \ + '--pretty=[Controls output processing.]:output format:(all colors format none)' \ + '(-s --style)'{-s,--style}'=[Output coloring style]:STYLE:(autumn borland bw colorful default emacs friendly fruity manni monokai murphy native pastie perldoc ttr solarized tango trac vim vs)' \ + '(-p --print)'{-p,--print}'=[String specifying what the output should contain]:print flags:_httpie_printflags' \ + '(-v --verbose)'{-v,--verbose}'[Print the whole request as well as the response.]' \ + '(-p -h --headers)'{-h,--headers}'[Print only the response headers.]' \ + '(-p -b --body)'{-b,--body}'[Print only the response body.]' \ + '(-S --stream)'{-S,--stream}'[Always stream the output by line, i.e., behave like `tail -f`.]' \ + '(-o --output)'{-o,--output}'=[Save output to FILE.]:output file:_files' \ + '(-d --download)'{-d,--download}'=[Do not print the response body to stdout.]' \ + '(-c --continue)'{-c,--continue}'[Resume an interrupted download.]' \ + '(--session-read-only)--session=[Create, or reuse and update a session.]:session name (or path)' \ + '(--session)--session-read-only=[Create or read a session without updating it form the request/response exchange.]:session name (or path)' \ + '(-a --auth)'{-a,--auth}'=[If only the username is provided (-a username)]:USER\:PASS' \ + '--auth-type=[The authentication mechanism to be used. Defaults to "basic".]:AUTH-TYPE:(basic digest)' \ + '--proxy=[String mapping protocol to the URL of the proxy.]:PROXY' \ + '--follow[Allow full redirects.]' \ + "--verify=[Enable or disable verification of ssl certificates.]:verify certificate:(yes no)" \ + '--allow-redirects[Set this flag if full redirects are allowed (e.g. re-POST-ing of data at new ``Location``)]' \ + '--timeout=[Float describes the timeout of the request (Use socket.setdefaulttimeout() as fallback).]:timeout (seconds)' \ + '--check-status[This flag instructs HTTPie to also check the HTTP status code and exit with an error if the status indicates one.]' \ + '--ignore-stdin[Do not attempt to read stdin.]' \ + '(- *)--help[show help message.]' \ + "(- *)--version[show program's version number and exit.]" \ + '--traceback[Prints exception traceback should one occur.]' \ + '--debug[Prints exception traceback should one occur and other information useful for debugging HTTPie itself.]' \ + '*:args:_httpie_params' && return 0 diff --git a/zsh/.oh-my-zsh/plugins/jruby/README.md b/zsh/.oh-my-zsh/plugins/jruby/README.md new file mode 100644 index 0000000..821a46d --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/jruby/README.md @@ -0,0 +1,21 @@ +# JRuby plugin + +This plugin adds aliases for [JRuby](https://www.jruby.org/). + +To use it, add `jruby` to the plugins array in your zshrc file: + +```zsh +plugins=(... jruby) +``` + +## Requirements + +This plugin assumes you already have jruby installed and available in your [path](https://www.jruby.org/getting-started). + +## Aliases + +| Alias | Command | +| ------------ | ---------------------------------------------------------------- | +| `jrspec` | `jruby --debug -S rspec --debug` | +| `jprofile` | `jruby --profile.api -S rspec` | +| `jexec` | `jruby -S` | diff --git a/zsh/.oh-my-zsh/plugins/lein/README.md b/zsh/.oh-my-zsh/plugins/lein/README.md new file mode 100644 index 0000000..0c41196 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/lein/README.md @@ -0,0 +1,9 @@ +# Leiningen plugin + +This plugin adds completions for the [Leiningen](https://leiningen.org/) Clojure build tool. + +To use it, add `lein` to the plugins array in your zshrc file: + +```zsh +plugins=(... lein) +``` diff --git a/zsh/.oh-my-zsh/plugins/lighthouse/README.md b/zsh/.oh-my-zsh/plugins/lighthouse/README.md new file mode 100644 index 0000000..0db29b4 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/lighthouse/README.md @@ -0,0 +1,26 @@ +# Lighthouse plugin + +This plugin adds commands to manage [Lighthouse](https://lighthouseapp.com/). + +To use it, add `lighthouse` to the plugins array in your zshrc file: + +```zsh +plugins=(... lighthouse) +``` + +## Commands + +* `open_lighthouse_ticket ` (alias: `lho`): + + Opens the URL to the issue passed as an argument. To use it, add a `.lighthouse-url` + file in your directory with the URL to the individual project. + + Example: + ```zsh + $ cat .lighthouse-url + https://rails.lighthouseapp.com/projects/8994 + + $ lho 23 + Opening ticket #23 + # The browser goes to https://rails.lighthouseapp.com/projects/8994/tickets/23 + ``` diff --git a/zsh/.oh-my-zsh/plugins/mysql-macports/README.md b/zsh/.oh-my-zsh/plugins/mysql-macports/README.md new file mode 100644 index 0000000..a4224d9 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/mysql-macports/README.md @@ -0,0 +1,20 @@ +# MySQL-Macports plugin + +This plugin adds aliases for some of the commonly used [MySQL](https://www.mysql.com/) commands when installed using [MacPorts](https://www.macports.org/) on macOS. + +To use it, add `mysql-macports` to the plugins array in your zshrc file: + +```zsh +plugins=(... mysql-macports) +``` + +For instructions on how to install MySQL using MacPorts, read the [MacPorts wiki](https://trac.macports.org/wiki/howto/MySQL/). + +## Aliases + +| Alias | Command | Description | +| ------------ | --------------------------------------------------------- | ------------------------------------------ | +| mysqlstart | `sudo /opt/local/share/mysql5/mysql/mysql.server start` | Start the MySQL server. | +| mysqlstop | `sudo /opt/local/share/mysql5/mysql/mysql.server stop` | Stop the MySQL server. | +| mysqlrestart | `sudo /opt/local/share/mysql5/mysql/mysql.server restart` | Restart the MySQL server. | +| mysqlstatus | `mysqladmin5 -u root -p ping` | Check whether the MySQL server is running. | diff --git a/zsh/.oh-my-zsh/plugins/n98-magerun/README.md b/zsh/.oh-my-zsh/plugins/n98-magerun/README.md new file mode 100644 index 0000000..b0abe47 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/n98-magerun/README.md @@ -0,0 +1,21 @@ +# n98-magerun plugin + +The swiss army knife for Magento developers, sysadmins and devops. The tool provides a huge set of well tested command line commands which save hours of work time. + +The [n98-magerun plugin](https://github.com/netz98/n98-magerun) provides many +[useful aliases](#aliases) as well as completion for the `n98-magerun` command. + +Enable it by adding `n98-magerun` to the plugins array in your zshrc file: + +```zsh +plugins=(... n98-magerun) +``` + +## Aliases + +| Alias | Command | Description | +| --------- | -------------------------------------------------- | --------------------------------------------------------------------------------- | +| n98 | `n98-magerun.phar` | The N98-Magerun phar-file (Version 1) | +| n98-2 | `n98-magerun2.phar` | The N98-Magerun phar-file (Version 2) | +| mage-get | `wget https://files.magerun.net/n98-magerun.phar` | Download the latest stable N98-Magerun phar-file from the file-server (Version 1) | +| mage2-get | `wget https://files.magerun.net/n98-magerun2.phar` | Download the latest stable N98-Magerun phar-file from the file-server (Version 2) | diff --git a/zsh/.oh-my-zsh/plugins/oc/README.md b/zsh/.oh-my-zsh/plugins/oc/README.md new file mode 100644 index 0000000..deae9b2 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/oc/README.md @@ -0,0 +1,13 @@ +# OC - OpenShift CLI + +This plugin provides autocompletion for [OC](https://docs.openshift.com/container-platform/3.7/cli_reference/index.html) commands, building, managing and updating operations. + +To use it, add `oc` to the plugins array of your zshrc file: + +```bash +plugins=(... oc) +``` + +## Contributors + ++ [kevinkirkup](https://github.com/kevinkirkup) - Plugin Author diff --git a/zsh/.oh-my-zsh/plugins/otp/otp.plugin.zsh b/zsh/.oh-my-zsh/plugins/otp/otp.plugin.zsh new file mode 100644 index 0000000..4bce34f --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/otp/otp.plugin.zsh @@ -0,0 +1,54 @@ +export OTP_HOME=~/.otp +mkdir -p $OTP_HOME + +function ot () { + if ! command -v oathtool > /dev/null 2>&1; then + echo "Note: you need to install oathtool or oath-toolkit, depending on your OS or distribution." + return 1 + fi + + if ! command -v gpg > /dev/null 2>&1; then + echo "Note: you need to install gpg and create an ID using 'gpg --gen-key', unless you have one already." + return 1 + fi + + if [[ `uname` == 'Darwin' ]] then # MacOS X + export COPY_CMD='pbcopy' + elif command -v xsel > /dev/null 2>&1; then # Any Unix with xsel installed + export COPY_CMD='xsel --clipboard --input' + else + COPY_CMD='true' + fi + + if [[ "x$1" == "x" ]]; then + echo "usage: otpw " + return 1 + elif [ ! -f $OTP_HOME/$1.otp.asc ]; then + echo "missing profile $1, you might need to create it first using otp_add_device" + return 1 + else + totpkey=$(gpg --decrypt $OTP_HOME/$1.otp.asc) + oathtool --totp --b $totpkey | tee /dev/stderr | `echo $COPY_CMD` + if [[ $COPY_CMD == 'true' ]] then + echo "Note: you might consider installing xsel for clipboard integration" + fi + fi +} + +function otp_add_device () { + if [[ "x$1" == "x" ]] then + echo "usage: otp_add " + return 1 + else + echo "Enter an email address attached to your GPG private key, then paste the secret configuration key followed by ^D" + + rm -f $OTP_HOME/$1.otp.asc + gpg --armor --encrypt --output $OTP_HOME/$1.otp.asc /dev/stdin + fi +} + +function otp_devices () { + reply=($(find $OTP_HOME -name \*.otp.asc | xargs basename -s .otp.asc)) +} + +compctl -K otp_devices ot diff --git a/zsh/.oh-my-zsh/plugins/pass/README.md b/zsh/.oh-my-zsh/plugins/pass/README.md new file mode 100644 index 0000000..2b07049 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/pass/README.md @@ -0,0 +1,22 @@ +# pass + +This plugin provides completion for the [pass](https://www.passwordstore.org/) password manager. + +To use it, add `pass` to the plugins array in your zshrc file. + +``` +plugins=(... pass) +``` + +## Configuration + +### Multiple repositories + +If you use multiple repositories, you can configure completion like this: +```zsh +compdef _pass workpass +zstyle ':completion::complete:workpass::' prefix "$HOME/work/pass" +workpass() { + PASSWORD_STORE_DIR=$HOME/work/pass pass $@ +} +``` diff --git a/zsh/.oh-my-zsh/plugins/perl/README.md b/zsh/.oh-my-zsh/plugins/perl/README.md new file mode 100644 index 0000000..dd9b7dc --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/perl/README.md @@ -0,0 +1,37 @@ +# Perl + +This plugin adds [perl](https://www.perl.org/) useful aliases/functions. + +To use it, add `perl` to the plugins array in your zshrc file: + +```zsh +plugins=(... perl) +``` + +## Aliases + +| Aliases | Command | Description | +| :------------ | :----------------- | :------------------------------------- | +| pbi | `perlbrew install` | Install specific perl version | +| pbl | `perlbrew list` | List all perl version installed | +| pbo | `perlbrew off` | Go back to the system perl | +| pbs | `perlbrew switch` | Turn it back on | +| pbu | `perlbrew use` | Use specific version of perl | +| pd | `perldoc` | Show the perl documentation | +| ple | `perl -wlne` | Use perl like awk/sed | +| latest-perl | `curl ...` | Show the latest stable release of Perl | + +## Functions + +* `newpl`: creates a basic Perl script file and opens it with $EDITOR. + +* `pgs`: Perl Global Substitution: `pgs ` + Looks for `` and replaces it with `` in ``. + +* `prep`: Perl grep, because 'grep -P' is terrible: `prep []` + Lets you work with pipes or files (if no `` provided, use stdin). + +## Requirements + +In order to make this work, you will need to have perl installed. +More info on the usage and install: https://www.perl.org/get.html diff --git a/zsh/.oh-my-zsh/plugins/phing/README.md b/zsh/.oh-my-zsh/plugins/phing/README.md new file mode 100644 index 0000000..e2ac0bd --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/phing/README.md @@ -0,0 +1,8 @@ +# Phing plugin + +This plugin adds autocompletion for [`phing`](https://github.com/phingofficial/phing) targets. + +To use it, add `phing` to the plugins array of your `.zshrc` file: +``` +plugins=(... eecms) +``` diff --git a/zsh/.oh-my-zsh/plugins/pip/README.md b/zsh/.oh-my-zsh/plugins/pip/README.md new file mode 100644 index 0000000..f07b5c0 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/pip/README.md @@ -0,0 +1,19 @@ +# pip plugin + +This plugin adds completion for [pip](https://pip.pypa.io/en/latest/), +the Python package manager. + +To use it, add `pip` to the plugins array in your zshrc file: + +```zsh +plugins=(... pip) +``` + +## pip cache + +The pip plugin caches the names of available pip packages from the PyPI index. +To trigger the caching process, try to complete `pip install`, +or you can run `zsh-pip-cache-packages` directly. + +To reset the cache, run `zsh-pip-clear-cache` and it will be rebuilt next +the next time you autocomplete `pip install`. diff --git a/zsh/.oh-my-zsh/plugins/pipenv/README.md b/zsh/.oh-my-zsh/plugins/pipenv/README.md new file mode 100644 index 0000000..ab1c1e4 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/pipenv/README.md @@ -0,0 +1,28 @@ +# Pipenv + +## Installation +In your `.zshrc` file, add `pipenv` to the plugins section + +``` +plugins=(... pipenv ...) +``` + +## Features +This plugin provides some features to simplify the use of Pipenv while working on ZSH. +- Adds completion for pipenv +- Auto activates and deactivates pipenv shell +- Adds short aliases for common pipenv commands + - `pch` is aliased to `pipenv check` + - `pcl` is aliased to `pipenv clean` + - `pgr` is aliased to `pipenv graph` + - `pi` is aliased to `pipenv install` + - `pidev` is aliased to `pipenv install --dev` + - `pl` is aliased to `pipenv lock` + - `po` is aliased to `pipenv open` + - `prun` is aliased to `pipenv run` + - `psh` is aliased to `pipenv shell` + - `psy` is aliased to `pipenv sync` + - `pu` is aliased to `pipenv uninstall` + - `pwh` is aliased to `pipenv --where` + - `pvenv` is aliased to `pipenv --venv` + - `ppy` is aliased to `pipenv --py` diff --git a/zsh/.oh-my-zsh/plugins/pipenv/pipenv.plugin.zsh b/zsh/.oh-my-zsh/plugins/pipenv/pipenv.plugin.zsh new file mode 100644 index 0000000..0a5dc56 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/pipenv/pipenv.plugin.zsh @@ -0,0 +1,42 @@ +# Pipenv completion +_pipenv() { + eval $(env COMMANDLINE="${words[1,$CURRENT]}" _PIPENV_COMPLETE=complete-zsh pipenv) +} +compdef _pipenv pipenv + +# Automatic pipenv shell activation/deactivation +_togglePipenvShell() { + # deactivate shell if Pipfile doesn't exist and not in a subdir + if [[ ! -a "$PWD/Pipfile" ]]; then + if [[ "$PIPENV_ACTIVE" == 1 ]]; then + if [[ "$PWD" != "$pipfile_dir"* ]]; then + exit + fi + fi + fi + + # activate the shell if Pipfile exists + if [[ "$PIPENV_ACTIVE" != 1 ]]; then + if [[ -a "$PWD/Pipfile" ]]; then + export pipfile_dir="$PWD" + pipenv shell + fi + fi +} +chpwd_functions+=(_togglePipenvShell) + +# Aliases +alias pch="pipenv check" +alias pcl="pipenv clean" +alias pgr="pipenv graph" +alias pi="pipenv install" +alias pidev="pipenv install --dev" +alias pl="pipenv lock" +alias po="pipenv open" +alias prun="pipenv run" +alias psh="pipenv shell" +alias psy="pipenv sync" +alias pu="pipenv uninstall" +alias pwh="pipenv --where" +alias pvenv="pipenv --venv" +alias ppy="pipenv --py" diff --git a/zsh/.oh-my-zsh/plugins/please/README.md b/zsh/.oh-my-zsh/plugins/please/README.md new file mode 100644 index 0000000..89bfbf1 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/please/README.md @@ -0,0 +1,26 @@ +# please plugin + +[Please](https://please.build) is a cross-language build system with an emphasis on +high performance, extensibility and reproduceability. It supports a number of popular +languages and can automate nearly any aspect of your build process. + +This plugin adds autocomplete and major aliases for `plz`, the command line tool for +Please. + +To use it, add `please` to the plugins array in your zshrc file: + +```zsh +plugins=(... please) +``` + +## Aliases + +| Alias | Command | +|-------|-------------| +| `pb` | `plz build` | +| `pt` | `plz test` | +| `pw` | `plz watch` | + +## Maintainer + +[@thought-machine](https://github.com/thought-machine) diff --git a/zsh/.oh-my-zsh/plugins/please/please.plugin.zsh b/zsh/.oh-my-zsh/plugins/please/please.plugin.zsh new file mode 100644 index 0000000..0f58307 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/please/please.plugin.zsh @@ -0,0 +1,7 @@ +if (( $+commands[plz] )); then + source <(plz --completion_script) +fi + +alias pb='plz build' +alias pt='plz test' +alias pw='plz watch' diff --git a/zsh/.oh-my-zsh/plugins/pod/README.md b/zsh/.oh-my-zsh/plugins/pod/README.md new file mode 100644 index 0000000..0a3cc7a --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/pod/README.md @@ -0,0 +1,10 @@ +# pod + +This plugin adds completion for [`CocoaPods`](https://cocoapods.org/). +CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects. + +To use it, add `pod` to the plugins array in your zshrc file: + +```zsh +plugins=(... pod) +``` diff --git a/zsh/.oh-my-zsh/plugins/pow/README.md b/zsh/.oh-my-zsh/plugins/pow/README.md new file mode 100644 index 0000000..1f8a9d1 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/pow/README.md @@ -0,0 +1,21 @@ +# pow plugin + +This plugin adds completion and commands for [pow](http://pow.cx/), a +zero-configuration Rack server for macOS. + +To use it, add pow to the plugins array of your zshrc file: + +```sh +plugins=(... pow) +``` + +## Commands + +- `kapow` will restart an app. + + ```bash + kapow myapp + ``` + +- `kaput` will show the standard output from any pow app. +- `repow` will restart the pow process. diff --git a/zsh/.oh-my-zsh/plugins/powder/README.md b/zsh/.oh-my-zsh/plugins/powder/README.md new file mode 100644 index 0000000..a83b1f2 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/powder/README.md @@ -0,0 +1,8 @@ +# Powder + +This plugin provides completion for [powder](https://github.com/powder-rb/powder/). + +To use it, add powder to the plugins array of your zshrc file: +``` +plugins=(... powder) +``` diff --git a/zsh/.oh-my-zsh/plugins/powify/README.md b/zsh/.oh-my-zsh/plugins/powify/README.md new file mode 100644 index 0000000..fd58b86 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/powify/README.md @@ -0,0 +1,10 @@ +# powify plugin + +This plugin adds autocompletion for [powify](https://github.com/sethvargo/powify), +an easy-to-use wrapper for Basecamp's [pow](https://github.com/basecamp/pow). + +To use it, add powify to the plugins array of your zshrc file: + +```sh +plugins=(... powify) +``` diff --git a/zsh/.oh-my-zsh/plugins/profiles/README.md b/zsh/.oh-my-zsh/plugins/profiles/README.md new file mode 100644 index 0000000..5aa1918 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/profiles/README.md @@ -0,0 +1,25 @@ +# profiles plugin + +This plugin allows you to create separate configuration files for zsh based +on your long hostname (including the domain). + +To use it, add profiles to the plugins array of your zshrc file: + +```sh +plugins=(... profiles) +``` + +It takes your `$HOST` variable and looks for files named according to the +domain parts in `$ZSH_CUSTOM/profiles/` directory. + +For example, for `HOST=host.domain.com`, it will try to load the following files, +in this order: + +```text +$ZSH_CUSTOM/profiles/com +$ZSH_CUSTOM/profiles/domain.com +$ZSH_CUSTOM/profiles/host.domain.com +``` + +This means that if there are conflicting settings on those files, the one to take +precedence will be the last applied, i.e. the one in host.domain.com. diff --git a/zsh/.oh-my-zsh/plugins/pyenv/README.md b/zsh/.oh-my-zsh/plugins/pyenv/README.md new file mode 100644 index 0000000..d063b55 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/pyenv/README.md @@ -0,0 +1,16 @@ +# pyenv + +This plugin looks for [pyenv](https://github.com/pyenv/pyenv), a Simple Python version +management system, and loads it if it's found. It also loads pyenv-virtualenv, a pyenv +plugin to manage virtualenv, if it's found. + +To use it, add `pyenv` to the plugins array in your zshrc file: + +```zsh +plugins=(... pyenv) +``` + +## Functions + +- `pyenv_prompt_info`: displays the Python version in use by pyenv; or the global Python + version, if pyenv wasn't found. diff --git a/zsh/.oh-my-zsh/plugins/rails/README.md b/zsh/.oh-my-zsh/plugins/rails/README.md new file mode 100644 index 0000000..5549ba1 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/rails/README.md @@ -0,0 +1,83 @@ +# Rails + +This plugin adds completion for [Ruby On Rails Framework](https://rubyonrails.org/) and [Rake](https://ruby.github.io/rake/) commands, as well as some aliases for logs and environment variables. + +To use it, add `rails` to the plugins array in your zshrc file: + +```zsh +plugins=(... rails) +``` + +## List of Aliases + +### Rails aliases + +| Alias | Command | Description | +|-------|----------------------------|----------------------------------------------------| +| `rc` | `rails console` | Interact with your Rails app from the CLI | +| `rcs` | `rails console --sandbox` | Test code in a sandbox, without changing any data | +| `rd` | `rails destroy` | Undo a generate operation | +| `rdb` | `rails dbconsole` | Interact with your db from the console | +| `rgen` | `rails generate` | Generate boilerplate code | +| `rgm` | `rails generate migration` | Generate a db migration | +| `rp` | `rails plugin` | Run a Rails plugin command | +| `ru` | `rails runner` | Run Ruby code in the context of Rails | +| `rs` | `rails server` | Launch a web server | +| `rsd` | `rails server --debugger` | Launch a web server with debugger | +| `rsp` | `rails server --port` | Launch a web server and specify the listening port | + +### Rake aliases + +| Alias | Command | Description | +|---------|---------------------------------|--------------------------------------------------------| +| `rdm` | `rake db:migrate` | Run pending db migrations | +| `rdms` | `rake db:migrate:status` | Show current db migration status | +| `rdmtc` | `rake db:migrate db:test:clone` | Run pending migrations and clone db into test database | +| `rdr` | `rake db:rollback` | Roll back the last migration | +| `rdc` | `rake db:create` | Create the database | +| `rds` | `rake db:seed` | Seed the database | +| `rdd` | `rake db:drop` | Delete the database | +| `rdrs` | `rake db:reset` | Delete the database and set it up again | +| `rdtc` | `rake db:test:clone` | Clone the database into the test database | +| `rdtp` | `rake db:test:prepare` | Duplicate the db schema into your test database | +| `rdsl` | `rake db:schema:load` | Load the database schema | +| `rlc` | `rake log:clear` | Clear Rails logs | +| `rn` | `rake notes` | Search for notes (`FIXME`, `TODO`) in code comments | +| `rr` | `rake routes` | List all defined routes | +| `rrg` | `rake routes | grep` | List and filter the defined routes | +| `rt` | `rake test` | Run Rails tests | +| `rmd` | `rake middleware` | Interact with Rails middlewares | +| `rsts` | `rake stats` | Print code statistics | + +### Utility aliases + +| Alias | Command | Description | +|-----------|-------------------------------|------------------------------------------------| +| `devlog` | `tail -f log/development.log` | Show and follow changes to the development log | +| `prodlog` | `tail -f log/production.log` | Show and follow changes to the production log | +| `testlog` | `tail -f log/test.log` | Show and follow changes to the test log | + +### Environment settings + +| Alias | Command | Description | +|-------|-------------------------|---------------------------------| +| `RED` | `RAILS_ENV=development` | Sets `RAILS_ENV` to development | +| `REP` | `RAILS_ENV=production` | Sets `RAILS_ENV` to production | +| `RET` | `RAILS_ENV=test` | Sets `RAILS_ENV` to test | + +These are global aliases. Use in combination with a command or just run them +separately. For example: `REP rake db:migrate` will migrate the production db. + +### Legacy stuff + +| Alias | Command | +|---------|------------------------------------| +| `sstat` | `thin --stats "/thin/stats" start` | +| `sg` | `ruby script/generate` | +| `sd` | `ruby script/destroy` | +| `sp` | `ruby script/plugin` | +| `sr` | `ruby script/runner` | +| `ssp` | `ruby script/spec` | +| `sc` | `ruby script/console` | +| `sd` | `ruby script/server --debugger` | + diff --git a/zsh/.oh-my-zsh/plugins/rake/README.md b/zsh/.oh-my-zsh/plugins/rake/README.md new file mode 100644 index 0000000..e235bd9 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/rake/README.md @@ -0,0 +1,37 @@ +# Rake plugin + +This plugin adds support for [rake](https://ruby.github.io/rake/), the Ruby +build tool or Ruby Make. + +To use it, add `rake` to the plugins array in your zshrc file: + +```zsh +plugins=(... rake) +``` + +## Aliases + +The plugin aliases the rake command so you can pass arguments when invoking rake tasks +without having to escape the brackets, i.e., you can run +``` +rake namespace:task['argument'] +``` +instead of having to do +``` +rake namespace:task\['argument'\] +``` + +| Alias | Command | Description | +|--------|--------------------------------|-----------------------------------------------| +| rake | `noglob rake` | Allows unescaped square brackets | +| brake | `noglob bundle exec rake` | Same as above but call rake using bundler | +| srake | `noglob sudo rake` | Same as rake but using sudo | +| sbrake | `noglob sudo bundle exec rake` | Same as above but using both sudo and bundler | + +## Jim Weirich + +The plugin also aliases `rake` to [`jimweirich`](https://github.com/jimweirich), author of Rake +and big time contributor to the Ruby open source community. He passed away in 2014: + +> Thank you Jim for everything you contributed to the Ruby and open source community +> over the years. We will miss you dearly. — [**@robbyrussell**](https://github.com/robbyrussell/oh-my-zsh/commit/598a9c6f990756386517d66b6bcf77e53791e905) diff --git a/zsh/.oh-my-zsh/plugins/rbenv/README.md b/zsh/.oh-my-zsh/plugins/rbenv/README.md new file mode 100644 index 0000000..43a2e93 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/rbenv/README.md @@ -0,0 +1,26 @@ +# rbenv plugin + +The primary job of this plugin is to provide `rbenv_prompt_info` which can be added to your theme to include Ruby +version and gemset information into your prompt. + +Some functionality of this plugin will not work unless you also have the rbenv plugin *gemset* installed. +https://github.com/jf/rbenv-gemset + +To use it, add `rbenv` to the plugins array in your zshrc file: +```zsh +plugins=(... rbenv) +``` + +## Alias + +| Alias | Command | Description | +|----------------|---------------------|----------------------------------| +| rubies | `rbenv versions` | List the installed Ruby versions | +| gemsets | `rbenv gemset list` | List the existing gemsets | + +## Functions + +* `current_ruby`: The version of Ruby currently being used. +* `current_gemset`: The name of the current gemset. +* `gems`: Lists installed gems with enhanced formatting and color. +* `rbenv_prompt_info`: For adding information to your prompt. Format: `@`. diff --git a/zsh/.oh-my-zsh/plugins/rebar/README.md b/zsh/.oh-my-zsh/plugins/rebar/README.md new file mode 100644 index 0000000..456ba45 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/rebar/README.md @@ -0,0 +1,9 @@ +# rebar plugin + +This plugin adds completions for the [rebar](https://www.rebar3.org/) Erlang build tool. + +To use it, add `rebar` to the plugins array in your zshrc file: + +```zsh +plugins=(... rebar) +``` diff --git a/zsh/.oh-my-zsh/plugins/redis-cli/README.md b/zsh/.oh-my-zsh/plugins/redis-cli/README.md new file mode 100644 index 0000000..bb6e94a --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/redis-cli/README.md @@ -0,0 +1,15 @@ +# Redis-CLI + +This plugin adds [redis-cli](https://redis.io/topics/rediscli) completion, based off of Homebrew completion. + +To use it, add `redis-cli` to the plugins array in your zshrc file: + +```zsh +plugins=(... redis-cli) +``` + +## Requirements + +In order to make this work, you will need to have redis installed. + +More info on the usage and install: https://redis.io/topics/quickstart diff --git a/zsh/.oh-my-zsh/plugins/ripgrep/README.md b/zsh/.oh-my-zsh/plugins/ripgrep/README.md new file mode 100644 index 0000000..937f73c --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/ripgrep/README.md @@ -0,0 +1,13 @@ +# ripgrep + +This plugin adds completion for the text search tool [`ripgrep`](https://github.com/BurntSushi/ripgrep), also known as `rg`. + +To use it, add `ripgrep` to the plugins array in your zshrc file: + +```zsh +plugins=(... ripgrep) +``` + +Completion is taken from the ripgrep release [`11.0.2`](https://github.com/BurntSushi/ripgrep/releases/tag/11.0.2). + +Updated on August 16th, 2019. diff --git a/zsh/.oh-my-zsh/plugins/ripgrep/_ripgrep b/zsh/.oh-my-zsh/plugins/ripgrep/_ripgrep new file mode 100644 index 0000000..d7dcfd6 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/ripgrep/_ripgrep @@ -0,0 +1,612 @@ +#compdef rg + +## +# zsh completion function for ripgrep +# +# Run ci/test_complete.sh after building to ensure that the options supported by +# this function stay in synch with the `rg` binary. +# +# For convenience, a completion reference guide is included at the bottom of +# this file. +# +# Originally based on code from the zsh-users project — see copyright notice +# below. + +_rg() { + local curcontext=$curcontext no='!' descr ret=1 + local -a context line state state_descr args tmp suf + local -A opt_args + + # ripgrep has many options which negate the effect of a more common one — for + # example, `--no-column` to negate `--column`, and `--messages` to negate + # `--no-messages`. There are so many of these, and they're so infrequently + # used, that some users will probably find it irritating if they're completed + # indiscriminately, so let's not do that unless either the current prefix + # matches one of those negation options or the user has the `complete-all` + # style set. Note that this prefix check has to be updated manually to account + # for all of the potential negation options listed below! + if + # We also want to list all of these options during testing + [[ $_RG_COMPLETE_LIST_ARGS == (1|t*|y*) ]] || + # (--[imnp]* => --ignore*, --messages, --no-*, --pcre2-unicode) + [[ $PREFIX$SUFFIX == --[imnp]* ]] || + zstyle -t ":complete:$curcontext:*" complete-all + then + no= + fi + + # We make heavy use of argument groups here to prevent the option specs from + # growing unwieldy. These aren't supported in zsh <5.4, though, so we'll strip + # them out below if necessary. This makes the exclusions inaccurate on those + # older versions, but oh well — it's not that big a deal + args=( + + '(exclusive)' # Misc. fully exclusive options + '(: * -)'{-h,--help}'[display help information]' + '(: * -)'{-V,--version}'[display version information]' + '(: * -)'--pcre2-version'[print the version of PCRE2 used by ripgrep, if available]' + + + '(buffered)' # buffering options + '--line-buffered[force line buffering]' + $no"--no-line-buffered[don't force line buffering]" + '--block-buffered[force block buffering]' + $no"--no-block-buffered[don't force block buffering]" + + + '(case)' # Case-sensitivity options + {-i,--ignore-case}'[search case-insensitively]' + {-s,--case-sensitive}'[search case-sensitively]' + {-S,--smart-case}'[search case-insensitively if pattern is all lowercase]' + + + '(context-a)' # Context (after) options + '(context-c)'{-A+,--after-context=}'[specify lines to show after each match]:number of lines' + + + '(context-b)' # Context (before) options + '(context-c)'{-B+,--before-context=}'[specify lines to show before each match]:number of lines' + + + '(context-c)' # Context (combined) options + '(context-a context-b)'{-C+,--context=}'[specify lines to show before and after each match]:number of lines' + + + '(column)' # Column options + '--column[show column numbers for matches]' + $no"--no-column[don't show column numbers for matches]" + + + '(count)' # Counting options + {-c,--count}'[only show count of matching lines for each file]' + '--count-matches[only show count of individual matches for each file]' + + + '(encoding)' # Encoding options + {-E+,--encoding=}'[specify text encoding of files to search]: :_rg_encodings' + $no'--no-encoding[use default text encoding]' + + + file # File-input options + '(1)*'{-f+,--file=}'[specify file containing patterns to search for]: :_files' + + + '(file-match)' # Files with/without match options + '(stats)'{-l,--files-with-matches}'[only show names of files with matches]' + '(stats)--files-without-match[only show names of files without matches]' + + + '(file-name)' # File-name options + {-H,--with-filename}'[show file name for matches]' + {-I,--no-filename}"[don't show file name for matches]" + + + '(file-system)' # File system options + "--one-file-system[don't descend into directories on other file systems]" + $no'--no-one-file-system[descend into directories on other file systems]' + + + '(fixed)' # Fixed-string options + {-F,--fixed-strings}'[treat pattern as literal string instead of regular expression]' + $no"--no-fixed-strings[don't treat pattern as literal string]" + + + '(follow)' # Symlink-following options + {-L,--follow}'[follow symlinks]' + $no"--no-follow[don't follow symlinks]" + + + glob # File-glob options + '*'{-g+,--glob=}'[include/exclude files matching specified glob]:glob' + '*--iglob=[include/exclude files matching specified case-insensitive glob]:glob' + + + '(glob-case-insensitive)' # File-glob case sensitivity options + '--glob-case-insensitive[treat -g/--glob patterns case insensitively]' + $no'--no-glob-case-insensitive[treat -g/--glob patterns case sensitively]' + + + '(heading)' # Heading options + '(pretty-vimgrep)--heading[show matches grouped by file name]' + "(pretty-vimgrep)--no-heading[don't show matches grouped by file name]" + + + '(hidden)' # Hidden-file options + '--hidden[search hidden files and directories]' + $no"--no-hidden[don't search hidden files and directories]" + + + '(hybrid)' # hybrid regex options + '--auto-hybrid-regex[dynamically use PCRE2 if necessary]' + $no"--no-auto-hybrid-regex[don't dynamically use PCRE2 if necessary]" + + + '(ignore)' # Ignore-file options + "(--no-ignore-global --no-ignore-parent --no-ignore-vcs --no-ignore-dot)--no-ignore[don't respect ignore files]" + $no'(--ignore-global --ignore-parent --ignore-vcs --ignore-dot)--ignore[respect ignore files]' + + + '(ignore-file-case-insensitive)' # Ignore-file case sensitivity options + '--ignore-file-case-insensitive[process ignore files case insensitively]' + $no'--no-ignore-file-case-insensitive[process ignore files case sensitively]' + + + '(ignore-global)' # Global ignore-file options + "--no-ignore-global[don't respect global ignore files]" + $no'--ignore-global[respect global ignore files]' + + + '(ignore-parent)' # Parent ignore-file options + "--no-ignore-parent[don't respect ignore files in parent directories]" + $no'--ignore-parent[respect ignore files in parent directories]' + + + '(ignore-vcs)' # VCS ignore-file options + "--no-ignore-vcs[don't respect version control ignore files]" + $no'--ignore-vcs[respect version control ignore files]' + + + '(ignore-dot)' # .ignore-file options + "--no-ignore-dot[don't respect .ignore files]" + $no'--ignore-dot[respect .ignore files]' + + + '(json)' # JSON options + '--json[output results in JSON Lines format]' + $no"--no-json[don't output results in JSON Lines format]" + + + '(line-number)' # Line-number options + {-n,--line-number}'[show line numbers for matches]' + {-N,--no-line-number}"[don't show line numbers for matches]" + + + '(line-terminator)' # Line-terminator options + '--crlf[use CRLF as line terminator]' + $no"--no-crlf[don't use CRLF as line terminator]" + '(text)--null-data[use NUL as line terminator]' + + + '(max-columns-preview)' # max column preview options + '--max-columns-preview[show preview for long lines (with -M)]' + $no"--no-max-columns-preview[don't show preview for long lines (with -M)]" + + + '(max-depth)' # Directory-depth options + '--max-depth=[specify max number of directories to descend]:number of directories' + '!--maxdepth=:number of directories' + + + '(messages)' # Error-message options + '(--no-ignore-messages)--no-messages[suppress some error messages]' + $no"--messages[don't suppress error messages affected by --no-messages]" + + + '(messages-ignore)' # Ignore-error message options + "--no-ignore-messages[don't show ignore-file parse error messages]" + $no'--ignore-messages[show ignore-file parse error messages]' + + + '(mmap)' # mmap options + '--mmap[search using memory maps when possible]' + "--no-mmap[don't search using memory maps]" + + + '(multiline)' # Multiline options + {-U,--multiline}'[permit matching across multiple lines]' + $no'(multiline-dotall)--no-multiline[restrict matches to at most one line each]' + + + '(multiline-dotall)' # Multiline DOTALL options + '(--no-multiline)--multiline-dotall[allow "." to match newline (with -U)]' + $no"(--no-multiline)--no-multiline-dotall[don't allow \".\" to match newline (with -U)]" + + + '(only)' # Only-match options + {-o,--only-matching}'[show only matching part of each line]' + + + '(passthru)' # Pass-through options + '(--vimgrep)--passthru[show both matching and non-matching lines]' + '!(--vimgrep)--passthrough' + + + '(pcre2)' # PCRE2 options + {-P,--pcre2}'[enable matching with PCRE2]' + $no'(pcre2-unicode)--no-pcre2[disable matching with PCRE2]' + + + '(pcre2-unicode)' # PCRE2 Unicode options + $no'(--no-pcre2 --no-pcre2-unicode)--pcre2-unicode[enable PCRE2 Unicode mode (with -P)]' + '(--no-pcre2 --pcre2-unicode)--no-pcre2-unicode[disable PCRE2 Unicode mode (with -P)]' + + + '(pre)' # Preprocessing options + '(-z --search-zip)--pre=[specify preprocessor utility]:preprocessor utility:_command_names -e' + $no'--no-pre[disable preprocessor utility]' + + + pre-glob # Preprocessing glob options + '*--pre-glob[include/exclude files for preprocessing with --pre]' + + + '(pretty-vimgrep)' # Pretty/vimgrep display options + '(heading)'{-p,--pretty}'[alias for --color=always --heading -n]' + '(heading passthru)--vimgrep[show results in vim-compatible format]' + + + regexp # Explicit pattern options + '(1 file)*'{-e+,--regexp=}'[specify pattern]:pattern' + + + '(replace)' # Replacement options + {-r+,--replace=}'[specify string used to replace matches]:replace string' + + + '(sort)' # File-sorting options + '(threads)--sort=[sort results in ascending order (disables parallelism)]:sort method:(( + none\:"no sorting" + path\:"sort by file path" + modified\:"sort by last modified time" + accessed\:"sort by last accessed time" + created\:"sort by creation time" + ))' + '(threads)--sortr=[sort results in descending order (disables parallelism)]:sort method:(( + none\:"no sorting" + path\:"sort by file path" + modified\:"sort by last modified time" + accessed\:"sort by last accessed time" + created\:"sort by creation time" + ))' + '!(threads)--sort-files[sort results by file path (disables parallelism)]' + + + '(stats)' # Statistics options + '(--files file-match)--stats[show search statistics]' + $no"--no-stats[don't show search statistics]" + + + '(text)' # Binary-search options + {-a,--text}'[search binary files as if they were text]' + "--binary[search binary files, don't print binary data]" + $no"--no-binary[don't search binary files]" + $no"(--null-data)--no-text[don't search binary files as if they were text]" + + + '(threads)' # Thread-count options + '(sort)'{-j+,--threads=}'[specify approximate number of threads to use]:number of threads' + + + '(trim)' # Trim options + '--trim[trim any ASCII whitespace prefix from each line]' + $no"--no-trim[don't trim ASCII whitespace prefix from each line]" + + + type # Type options + '*'{-t+,--type=}'[only search files matching specified type]: :_rg_types' + '*--type-add=[add new glob for specified file type]: :->typespec' + '*--type-clear=[clear globs previously defined for specified file type]: :_rg_types' + # This should actually be exclusive with everything but other type options + '(: *)--type-list[show all supported file types and their associated globs]' + '*'{-T+,--type-not=}"[don't search files matching specified file type]: :_rg_types" + + + '(word-line)' # Whole-word/line match options + {-w,--word-regexp}'[only show matches surrounded by word boundaries]' + {-x,--line-regexp}'[only show matches surrounded by line boundaries]' + + + '(zip)' # Compression options + '(--pre)'{-z,--search-zip}'[search in compressed files]' + $no"--no-search-zip[don't search in compressed files]" + + + misc # Other options — no need to separate these at the moment + '(-b --byte-offset)'{-b,--byte-offset}'[show 0-based byte offset for each matching line]' + '--color=[specify when to use colors in output]:when:(( + never\:"never use colors" + auto\:"use colors or not based on stdout, TERM, etc." + always\:"always use colors" + ansi\:"always use ANSI colors (even on Windows)" + ))' + '*--colors=[specify color and style settings]: :->colorspec' + '--context-separator=[specify string used to separate non-continuous context lines in output]:separator' + '--debug[show debug messages]' + '--dfa-size-limit=[specify upper size limit of generated DFA]:DFA size (bytes)' + "(1 stats)--files[show each file that would be searched (but don't search)]" + '*--ignore-file=[specify additional ignore file]:ignore file:_files' + '(-v --invert-match)'{-v,--invert-match}'[invert matching]' + '(-M --max-columns)'{-M+,--max-columns=}'[specify max length of lines to print]:number of bytes' + '(-m --max-count)'{-m+,--max-count=}'[specify max number of matches per file]:number of matches' + '--max-filesize=[specify size above which files should be ignored]:file size (bytes)' + "--no-config[don't load configuration files]" + '(-0 --null)'{-0,--null}'[print NUL byte after file names]' + '--path-separator=[specify path separator to use when printing file names]:separator' + '(-q --quiet)'{-q,--quiet}'[suppress normal output]' + '--regex-size-limit=[specify upper size limit of compiled regex]:regex size (bytes)' + '*'{-u,--unrestricted}'[reduce level of "smart" searching]' + + + operand # Operands + '(--files --type-list file regexp)1: :_guard "^-*" pattern' + '(--type-list)*: :_files' + ) + + # This is used with test_complete.sh to verify that there are no options + # listed in the help output that aren't also defined here + [[ $_RG_COMPLETE_LIST_ARGS == (1|t*|y*) ]] && { + print -rl - $args + return 0 + } + + # Strip out argument groups where unsupported (see above) + [[ $ZSH_VERSION == (4|5.<0-3>)(.*)# ]] && + args=( ${(@)args:#(#i)(+|[a-z0-9][a-z0-9_-]#|\([a-z0-9][a-z0-9_-]#\))} ) + + _arguments -C -s -S : $args && ret=0 + + case $state in + colorspec) + if [[ ${IPREFIX#--*=}$PREFIX == [^:]# ]]; then + suf=( -qS: ) + tmp=( + 'column:specify coloring for column numbers' + 'line:specify coloring for line numbers' + 'match:specify coloring for match text' + 'path:specify coloring for file names' + ) + descr='color/style type' + elif [[ ${IPREFIX#--*=}$PREFIX == (column|line|match|path):[^:]# ]]; then + suf=( -qS: ) + tmp=( + 'none:clear color/style for type' + 'bg:specify background color' + 'fg:specify foreground color' + 'style:specify text style' + ) + descr='color/style attribute' + elif [[ ${IPREFIX#--*=}$PREFIX == [^:]##:(bg|fg):[^:]# ]]; then + tmp=( black blue green red cyan magenta yellow white ) + descr='color name or r,g,b' + elif [[ ${IPREFIX#--*=}$PREFIX == [^:]##:style:[^:]# ]]; then + tmp=( {,no}bold {,no}intense {,no}underline ) + descr='style name' + else + _message -e colorspec 'no more arguments' + fi + + (( $#tmp )) && { + compset -P '*:' + _describe -t colorspec $descr tmp $suf && ret=0 + } + ;; + + typespec) + if compset -P '[^:]##:include:'; then + _sequence -s , _rg_types && ret=0 + # @todo This bit in particular could be better, but it's a little + # complex, and attempting to solve it seems to run us up against a crash + # bug — zsh # 40362 + elif compset -P '[^:]##:'; then + _message 'glob or include directive' && ret=1 + elif [[ ! -prefix *:* ]]; then + _rg_types -qS : && ret=0 + fi + ;; + esac + + return ret +} + +# Complete encodings +_rg_encodings() { + local -a expl + local -aU _encodings + + # This is impossible to read, but these encodings rarely if ever change, so it + # probably doesn't matter. They are derived from the list given here: + # https://encoding.spec.whatwg.org/#concept-encoding-get + _encodings=( + {{,us-}ascii,arabic,chinese,cyrillic,greek{,8},hebrew,korean} + logical visual mac {,cs}macintosh x-mac-{cyrillic,roman,ukrainian} + 866 ibm{819,866} csibm866 + big5{,-hkscs} {cn-,cs}big5 x-x-big5 + cp{819,866,125{0..8}} x-cp125{0..8} + csiso2022{jp,kr} csiso8859{6,8}{e,i} + csisolatin{{1..6},9} csisolatin{arabic,cyrillic,greek,hebrew} + ecma-{114,118} asmo-708 elot_928 sun_eu_greek + euc-{jp,kr} x-euc-jp cseuckr cseucpkdfmtjapanese + {,x-}gbk csiso58gb231280 gb18030 {,cs}gb2312 gb_2312{,-80} hz-gb-2312 + iso-2022-{cn,cn-ext,jp,kr} + iso8859{,-}{{1..11},13,14,15} + iso-8859-{{1..11},{6,8}-{e,i},13,14,15,16} iso_8859-{{1..9},15} + iso_8859-{1,2,6,7}:1987 iso_8859-{3,4,5,8}:1988 iso_8859-9:1989 + iso-ir-{58,100,101,109,110,126,127,138,144,148,149,157} + koi{,8,8-r,8-ru,8-u,8_r} cskoi8r + ks_c_5601-{1987,1989} ksc{,_}5691 csksc56011987 + latin{1..6} l{{1..6},9} + shift{-,_}jis csshiftjis {,x-}sjis ms_kanji ms932 + utf{,-}8 utf-16{,be,le} unicode-1-1-utf-8 + windows-{31j,874,949,125{0..8}} dos-874 tis-620 ansi_x3.4-1968 + x-user-defined auto none + ) + + _wanted encodings expl encoding compadd -a "$@" - _encodings +} + +# Complete file types +_rg_types() { + local -a expl + local -aU _types + + _types=( ${(@)${(f)"$( _call_program types rg --type-list )"}%%:*} ) + + _wanted types expl 'file type' compadd -a "$@" - _types +} + +_rg "$@" + +################################################################################ +# ZSH COMPLETION REFERENCE +# +# For the convenience of developers who aren't especially familiar with zsh +# completion functions, a brief reference guide follows. This is in no way +# comprehensive; it covers just enough of the basic structure, syntax, and +# conventions to help someone make simple changes like adding new options. For +# more complete documentation regarding zsh completion functions, please see the +# following: +# +# * http://zsh.sourceforge.net/Doc/Release/Completion-System.html +# * https://github.com/zsh-users/zsh/blob/master/Etc/completion-style-guide +# +# OVERVIEW +# +# Most zsh completion functions are defined in terms of `_arguments`, which is a +# shell function that takes a series of argument specifications. The specs for +# `rg` are stored in an array, which is common for more complex functions; the +# elements of the array are passed to `_arguments` on invocation. +# +# ARGUMENT-SPECIFICATION SYNTAX +# +# The following is a contrived example of the argument specs for a simple tool: +# +# '(: * -)'{-h,--help}'[display help information]' +# '(-q -v --quiet --verbose)'{-q,--quiet}'[decrease output verbosity]' +# '!(-q -v --quiet --verbose)--silent' +# '(-q -v --quiet --verbose)'{-v,--verbose}'[increase output verbosity]' +# '--color=[specify when to use colors]:when:(always never auto)' +# '*:example file:_files' +# +# Although there may appear to be six specs here, there are actually nine; we +# use brace expansion to combine specs for options that go by multiple names, +# like `-q` and `--quiet`. This is customary, and ties in with the fact that zsh +# merges completion possibilities together when they have the same description. +# +# The first line defines the option `-h`/`--help`. With most tools, it isn't +# useful to complete anything after `--help` because it effectively overrides +# all others; the `(: * -)` at the beginning of the spec tells zsh not to +# complete any other operands (`:` and `*`) or options (`-`) after this one has +# been used. The `[...]` at the end associates a description with `-h`/`--help`; +# as mentioned, zsh will see the identical descriptions and merge these options +# together when offering completion possibilities. +# +# The next line defines `-q`/`--quiet`. Here we don't want to suppress further +# completions entirely, but we don't want to offer `-q` if `--quiet` has been +# given (since they do the same thing), nor do we want to offer `-v` (since it +# doesn't make sense to be quiet and verbose at the same time). We don't need to +# tell zsh not to offer `--quiet` a second time, since that's the default +# behaviour, but since this line expands to two specs describing `-q` *and* +# `--quiet` we do need to explicitly list all of them here. +# +# The next line defines a hidden option `--silent` — maybe it's a deprecated +# synonym for `--quiet`. The leading `!` indicates that zsh shouldn't offer this +# option during completion. The benefit of providing a spec for an option that +# shouldn't be completed is that, if someone *does* use it, we can correctly +# suppress completion of other options afterwards. +# +# The next line defines `-v`/`--verbose`; this works just like `-q`/`--quiet`. +# +# The next line defines `--color`. In this example, `--color` doesn't have a +# corresponding short option, so we don't need to use brace expansion. Further, +# there are no other options it's exclusive with (just itself), so we don't need +# to define those at the beginning. However, it does take a mandatory argument. +# The `=` at the end of `--color=` indicates that the argument may appear either +# like `--color always` or like `--color=always`; this is how most GNU-style +# command-line tools work. The corresponding short option would normally use `+` +# — for example, `-c+` would allow either `-c always` or `-calways`. For this +# option, the arguments are known ahead of time, so we can simply list them in +# parentheses at the end (`when` is used as the description for the argument). +# +# The last line defines an operand (a non-option argument). In this example, the +# operand can be used any number of times (the leading `*`), and it should be a +# file path, so we tell zsh to call the `_files` function to complete it. The +# `example file` in the middle is the description to use for this operand; we +# could use a space instead to accept the default provided by `_files`. +# +# GROUPING ARGUMENT SPECIFICATIONS +# +# Newer versions of zsh support grouping argument specs together. All specs +# following a `+` and then a group name are considered to be members of the +# named group. Grouping is useful mostly for organisational purposes; it makes +# the relationship between different options more obvious, and makes it easier +# to specify exclusions. +# +# We could rewrite our example above using grouping as follows: +# +# '(: * -)'{-h,--help}'[display help information]' +# '--color=[specify when to use colors]:when:(always never auto)' +# '*:example file:_files' +# + '(verbosity)' +# {-q,--quiet}'[decrease output verbosity]' +# '!--silent' +# {-v,--verbose}'[increase output verbosity]' +# +# Here we take advantage of a useful feature of spec grouping — when the group +# name is surrounded by parentheses, as in `(verbosity)`, it tells zsh that all +# of the options in that group are exclusive with each other. As a result, we +# don't need to manually list out the exclusions at the beginning of each +# option. +# +# Groups can also be referred to by name in other argument specs; for example: +# +# '(xyz)--aaa' '*: :_files' +# + xyz --xxx --yyy --zzz +# +# Here we use the group name `xyz` to tell zsh that `--xxx`, `--yyy`, and +# `--zzz` are not to be completed after `--aaa`. This makes the exclusion list +# much more compact and reusable. +# +# CONVENTIONS +# +# zsh completion functions generally adhere to the following conventions: +# +# * Use two spaces for indentation +# * Combine specs for options with different names using brace expansion +# * In combined specs, list the short option first (as in `{-a,--text}`) +# * Use `+` or `=` as described above for options that take arguments +# * Provide a description for all options, option-arguments, and operands +# * Capitalise/punctuate argument descriptions as phrases, not complete +# sentences — 'display help information', never 'Display help information.' +# (but still capitalise acronyms and proper names) +# * Write argument descriptions as verb phrases — 'display x', 'enable y', +# 'use z' +# * Word descriptions to make it clear when an option expects an argument; +# usually this is done with the word 'specify', as in 'specify x' or +# 'use specified x') +# * Write argument descriptions as tersely as possible — for example, articles +# like 'a' and 'the' should be omitted unless it would be confusing +# +# Other conventions currently used by this function: +# +# * Order argument specs alphabetically by group name, then option name +# * Group options that are directly related, mutually exclusive, or frequently +# referenced by other argument specs +# * Use only characters in the set [a-z0-9_-] in group names +# * Order exclusion lists as follows: short options, long options, groups +# * Use American English in descriptions +# * Use 'don't' in descriptions instead of 'do not' +# * Word descriptions for related options as similarly as possible. For example, +# `--foo[enable foo]` and `--no-foo[disable foo]`, or `--foo[use foo]` and +# `--no-foo[don't use foo]` +# * Word descriptions to make it clear when an option only makes sense with +# another option, usually by adding '(with -x)' to the end +# * Don't quote strings or variables unnecessarily. When quotes are required, +# prefer single-quotes to double-quotes +# * Prefix option specs with `$no` when the option serves only to negate the +# behaviour of another option that must be provided explicitly by the user. +# This prevents rarely used options from cluttering up the completion menu +################################################################################ + +# ------------------------------------------------------------------------------ +# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the zsh-users nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ------------------------------------------------------------------------------ +# Description +# ----------- +# +# Completion script for ripgrep +# +# ------------------------------------------------------------------------------ +# Authors +# ------- +# +# * arcizan +# * MaskRay +# +# ------------------------------------------------------------------------------ + +# Local Variables: +# mode: shell-script +# coding: utf-8-unix +# indent-tabs-mode: nil +# sh-indentation: 2 +# sh-basic-offset: 2 +# End: +# vim: ft=zsh sw=2 ts=2 et diff --git a/zsh/.oh-my-zsh/plugins/ros/README.mkd b/zsh/.oh-my-zsh/plugins/ros/README.mkd new file mode 100644 index 0000000..83573e4 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/ros/README.mkd @@ -0,0 +1,10 @@ +# Roswell Plugin + +This plugin adds completions and aliases for [Roswell](https://github.com/roswell/roswell/). + +To use it, add `ros` to the plugins array in your zshrc file: + +```zsh +plugins=(... ros) +``` + diff --git a/zsh/.oh-my-zsh/plugins/ros/_ros b/zsh/.oh-my-zsh/plugins/ros/_ros new file mode 100644 index 0000000..6a04d3c --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/ros/_ros @@ -0,0 +1,64 @@ +#compdef ros +#autoload + +# roswell zsh completion, based on gem completion + +local -a _1st_arguments +_1st_arguments=( +'run: Run repl' +'install:Install a given implementation or a system for roswell environment' +'update:Update installed systems.' +'build:Make executable from script.' +'use:Change default implementation.' +'init:a new ros script, optionally based on a template.' +'fmt:Indent lisp source.' +'list:Information' +'template:[WIP] Manage templates' +'delete:Delete installed implementations' +'config:Get and set options' +'version:Show the roswell version information' +"help:Use \"ros help [command]\" for more information about a command."$'\n\t\t'"Use \"ros help [topic]\" for more information about the topic." +) + +#local expl + +_arguments \ + '(--version)'--version'[Print version information and quit]' \ + '(-w --wrap)'{-w,--wrap}'[\[CODE\] Run roswell with a shell wrapper CODE]' \ + '(-m --image)'{-m,--image}'[\[IMAGE\] continue from Lisp image IMAGE]' \ + '(-M --module)'{-M,--module}'[\[NAME\] Execute ros script found in ROSWELLPATH. (pythons -m)]' \ + '(-L --lisp)'{-L,--lisp}'[\[NAME\] Run roswell with a lisp impl NAME\[/VERSION\].]' \ + '(-l --load)'{-l,--load}'[\[FILE\] load lisp FILE while building]' \ + '(-S --source-registry)'{-S,--source-registry}'[\[X\] override source registry of asdf systems]' \ + '(-s --system --load-system)'{-s,--system,--load-system}'[\[SYSTEM\] load asdf SYSTEM while building]' \ + '(-p --package)'{-p,--package}'[\[PACKAGE\] change current package to \[PACKAGE\]]' \ + '(-sp --system-package)'{-sp,--system-package}'[\[SP\] combination of -s \[SP\] and -p \[SP\]]' \ + '(-e --eval)'{-e,--eval}'[\[FORM\] evaluate \[FORM\] while building]' \ + '--require'--require'[\[MODULE\] require \[MODULE\] while building]' \ + '(-q --quit)'{-q,--quit}'[quit lisp here]' \ + '(-r --restart)'{-r,--restart}'[\[FUNC\] restart from build by calling (\[FUNC\])]' \ + '(-E --entry)'{-E,--entry}'[\[FUNC\] restart from build by calling (\[FUNC\] argv)]' \ + '(-i --init)'{-i,--init}'[\[FORM\] evaluate \[FORM\] after restart]' \ + '(-ip --print)'{-ip,--print}'[\[FORM\] evaluate and princ \[FORM\] after restart]' \ + '(-iw --write)'{-iw,--write}'[\[FORM\] evaluate and write \[FORM\] after restart]' \ + '(-F --final)'{-F,--final}'[\[FORM\] evaluate \[FORM\] before dumping IMAGE]' \ + '(\+R --no-rc)'{\+R,--no-rc}'[skip /etc/rosrc, ~/.roswell/init.lisp]' \ + '(-A --asdf)'{-A,--asdf}'[use new asdf]' \ + '(\+Q --no-quicklisp)'{\+Q,--no-quicklisp}'[do not use quicklisp]' \ + '(-v --verbose)'{-v,--verbose}'[be quite noisy while building]' \ + '--quiet'--quiet'[be quite quiet while building default]' \ + '--test'--test'[for test purpose]' \ + '*:: :->subcmds' && return 0 + + +if (( CURRENT == 1 )); then + _describe -t commands "ros subcommand" _1st_arguments + return +fi + +# _files +case "$words[1]" in + -l|--load) + _files + ;; +esac diff --git a/zsh/.oh-my-zsh/plugins/rust/README.md b/zsh/.oh-my-zsh/plugins/rust/README.md new file mode 100644 index 0000000..83d7d91 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/rust/README.md @@ -0,0 +1,9 @@ +# rust + +This plugin adds completion for [`rustc`](https://doc.rust-lang.org/rustc/index.html), the compiler for the Rust programming language. + +To use it, add `rust` to the plugins array in your zshrc file: + +```zsh +plugins=(... rust) +``` diff --git a/zsh/.oh-my-zsh/plugins/rvm/README.md b/zsh/.oh-my-zsh/plugins/rvm/README.md new file mode 100644 index 0000000..9d6fd8f --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/rvm/README.md @@ -0,0 +1,19 @@ +# Ruby Version Manager plugin + +This plugin adds some utility functions and completions for [Ruby Version Manager](https://rvm.io/). + +To use it, add `rvm` to the plugins array in your zshrc file: + +```zsh +plugins=(... rvm) +``` + +## Functions +| Alias | Command | +|----------------|----------------------| +| `rb18` | `rvm use ruby-1.8.7` | +| `rb19` | `rvm use ruby-1.9.3` | +| `rb20` | `rvm use ruby-2.0.0` | +| `rb21` | `rvm use ruby-2.1.2` | +| `rvm-update` | `rvm get head` | +| `gems` | `gem list` | diff --git a/zsh/.oh-my-zsh/plugins/safe-paste/README.md b/zsh/.oh-my-zsh/plugins/safe-paste/README.md new file mode 100644 index 0000000..a2e7ddb --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/safe-paste/README.md @@ -0,0 +1,9 @@ +# safe-paste + +Preventing any code from actually running while pasting, so you have a chance to review what was actually pasted before running it. + +To use it, add `safe-paste` to the plugins array in your zshrc file: + +```zsh +plugins=(... safe-paste) +``` diff --git a/zsh/.oh-my-zsh/plugins/screen/README.md b/zsh/.oh-my-zsh/plugins/screen/README.md new file mode 100644 index 0000000..103e172 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/screen/README.md @@ -0,0 +1,10 @@ +# screen + +This plugin sets title and hardstatus of the tab window for [screen](https://www.gnu.org/software/screen/), +the terminal multiplexer. + +To use it add `screen` to the plugins array in your zshrc file. + +```zsh +plugins=(... screen) +``` diff --git a/zsh/.oh-my-zsh/plugins/sdk/README.md b/zsh/.oh-my-zsh/plugins/sdk/README.md new file mode 100644 index 0000000..b237f3b --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/sdk/README.md @@ -0,0 +1,8 @@ +# sdk + +Plugin for SDKMAN, a tool for managing parallel versions of multiple Software Development Kits on most Unix based systems. +Provides autocompletion for all known commands. + +## Requirements + + * [SDKMAN](http://sdkman.io/) diff --git a/zsh/.oh-my-zsh/plugins/sdk/sdk.plugin.zsh b/zsh/.oh-my-zsh/plugins/sdk/sdk.plugin.zsh new file mode 100644 index 0000000..d00459b --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/sdk/sdk.plugin.zsh @@ -0,0 +1,82 @@ +### SDKMAN Autocomplete for Oh My Zsh + +# This is the output from sdkman. All the these options are supported at the +# moment. + +# Usage: sdk [candidate] [version] +# sdk offline +# +# commands: +# install or i [version] +# uninstall or rm +# list or ls [candidate] +# use or u [version] +# default or d [version] +# current or c [candidate] +# upgrade or ug [candidate] +# version or v +# broadcast or b +# help or h +# offline [enable|disable] +# selfupdate [force] +# update +# flush +# +# candidate : the SDK to install: groovy, scala, grails, gradle, kotlin, etc. +# use list command for comprehensive list of candidates +# eg: $ sdk list +# +# version : where optional, defaults to latest stable if not provided +# eg: $ sdk install groovy + +local _sdk_commands=( + install i + uninstall rm + list ls + use u + default d + current c + upgrade ug + version v + broadcast b + help h + offline + selfupdate + update + flush +) + +_listInstalledVersions() { + __sdkman_build_version_csv $1 | sed -e "s/,/ /g" +} + +_listInstallableVersions() { + __sdkman_list_versions $1 | grep "^ " | sed -e "s/\* /*/g" | \ + sed -e "s/>//g" | xargs -n 1 echo | grep -v "^*" +} + +_listAllVersion() { + __sdkman_list_versions $1 | grep "^ " | sed -e "s/\*/ /g" | sed -e "s/>//g" +} + +_sdk () { + case $CURRENT in + 2) compadd -- $_sdk_commands ;; + 3) case "$words[2]" in + i|install|rm|uninstall|ls|list|u|use|d|default|c|current|ug|upgrade) + compadd -- $SDKMAN_CANDIDATES ;; + offline) compadd -- enable disable ;; + selfupdate) compadd -- force ;; + flush) compadd -- candidates broadcast archives temp ;; + esac + ;; + 4) case "$words[2]" in + rm|uninstall|d|default) compadd -- $(_listInstalledVersions $words[3]) ;; + i|install) compadd -- $(_listInstallableVersions $words[3]) ;; + u|use) compadd -- $(_listAllVersion $words[3]) ;; + esac + ;; + esac +} + +compdef _sdk sdk diff --git a/zsh/.oh-my-zsh/plugins/sfdx/README.md b/zsh/.oh-my-zsh/plugins/sfdx/README.md new file mode 100644 index 0000000..259c17f --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/sfdx/README.md @@ -0,0 +1,11 @@ +# sfdx plugin + +This plugin provides autocompletion for the [Salesforce DX](https://developer.salesforce.com/tools/sfdxcli) CLI. + +To use it, add `sfdx` to the plugins array in your zshrc file: + +```zsh +plugins=(... sfdx) +``` + +Original repository: https://github.com/wadewegner/salesforce-cli-zsh-completion diff --git a/zsh/.oh-my-zsh/plugins/sfdx/_sfdx b/zsh/.oh-my-zsh/plugins/sfdx/_sfdx new file mode 100644 index 0000000..42ee559 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/sfdx/_sfdx @@ -0,0 +1,1110 @@ +#compdef sfdx + +# DESCRIPTION: Zsh completion script for the Salesforce CLI +# AUTHOR: Wade Wegner (@WadeWegner) +# REPO: https://github.com/wadewegner/salesforce-cli-zsh-completion +# LICENSE: https://github.com/wadewegner/salesforce-cli-zsh-completion/blob/master/LICENSE + +local -a _1st_arguments + +_1st_arguments=( + "force\:alias\:list":"list username aliases for the Salesforce CLI" + "force\:alias\:set":"set username aliases for the Salesforce CLI" + "force\:apex\:class\:create":"create an Apex class" + "force\:apex\:execute":"execute anonymous Apex code" + "force\:apex\:log\:get":"fetch a debug log" + "force\:apex\:log\:list":"list debug logs" + "force\:apex\:log\:tail":"start debug logging and display logs" + "force\:apex\:test\:report":"display test results" + "force\:apex\:test\:run":"invoke Apex tests" + "force\:apex\:trigger\:create":"create an Apex trigger" + "force\:auth\:jwt\:grant":"authorize an org using the JWT flow" + "force\:auth\:logout":"log out from authorized orgs" + "force\:auth\:sfdxurl\:store":"authorize an org using an SFDX auth URL" + "force\:auth\:web\:login":"authorize an org using the web login flow" + "force\:config\:get":"get config var values for given names" + "force\:config\:list":"list config vars for the Salesforce CLI" + "force\:config\:set":"set config vars for the Salesforce CLI" + "force\:data\:bulk\:delete":"bulk delete records from a csv file" + "force\:data\:bulk\:status":"view the status of a bulk data load job or batch" + "force\:data\:bulk\:upsert":"bulk upsert records from a CSV file" + "force\:data\:record\:create":"create a record" + "force\:data\:record\:delete":"delete a record" + "force\:data\:record\:get":"view a record" + "force\:data\:record\:update":"update a record" + "force\:data\:soql\:query":"execute a SOQL query" + "force\:data\:tree\:export":"export data from an org into sObject tree format for force:data:tree:import consumption" + "force\:data\:tree\:import":"import data into an org using SObject Tree Save API" + "force\:doc\:commands\:display":"display help for force commands" + "force\:doc\:commands\:list":"list the force commands" + "force\:lightning\:app\:create":"create a Lightning app" + "force\:lightning\:component\:create":"create a bundle for an Aura component or a Lightning web component" + "force\:lightning\:event\:create":"create a Lightning event" + "force\:lightning\:interface\:create":"create a Lightning interface" + "force\:lightning\:lint":"analyse (lint) Lightning component code" + "force\:lightning\:test\:create":"create a Lightning test" + "force\:lightning\:test\:install":"install Lightning Testing Service unmanaged package in your org" + "force\:lightning\:test\:run":"invoke Aura component tests" + "force\:limits\:api\:display":"display current org’s limits" + "force\:mdapi\:convert":"convert metadata from the Metadata API format into the source format" + "force\:mdapi\:deploy":"deploy metadata to an org using Metadata API" + "force\:mdapi\:deploy\:cancel":"cancel a metadata deployment" + "force\:mdapi\:deploy\:report":"check the status of a metadata deployment" + "force\:mdapi\:retrieve":"retrieve metadata from an org using Metadata API" + "force\:mdapi\:retrieve\:report":"check the status of a metadata retrieval" + "force\:org\:create":"create a scratch org" + "force\:org\:delete":"mark a scratch org for deletion" + "force\:org\:display":"get org description" + "force\:org\:list":"list all orgs you’ve created or authenticated to" + "force\:org\:open":"open an org in your browser" + "force\:org\:shape\:create":"create a snapshot of org edition, features, and licenses" + "force\:org\:shape\:delete":"delete all org shapes for a target org" + "force\:org\:shape\:list":"list all org shapes you’ve created" + "force\:org\:snapshot\:create":"snapshot a scratch org" + "force\:org\:snapshot\:delete":"delete a scratch org snapshot" + "force\:org\:snapshot\:get":"get details about a scratch org snapshot" + "force\:org\:snapshot\:list":"list scratch org snapshots" + "force\:package1\:version\:create":"create a first-generation package version in the release org" + "force\:package1\:version\:create\:get":"retrieve the status of a package version creation request" + "force\:package1\:version\:display":"display details about a first-generation package version" + "force\:package1\:version\:list":"list package versions for the specified first-generation package or for the org" + "force\:package\:create":"create a package" + "force\:package\:hammertest\:list":"list the statuses of running and completed hammer tests" + "force\:package\:hammertest\:report":"display the status or results of a hammer test" + "force\:package\:hammertest\:run":"run ISV Hammer" + "force\:package\:install":"install a package in the target org" + "force\:package\:install\:report":"retrieve the status of a package installation request" + "force\:package\:installed\:list":"list the org’s installed packages" + "force\:package\:list":"list all packages in the Dev Hub org" + "force\:package\:uninstall":"uninstall a second-generation package from the target org" + "force\:package\:uninstall\:report":"retrieve status of package uninstall request" + "force\:package\:update":"update package details" + "force\:package\:version\:create":"create a package version" + "force\:package\:version\:create\:list":"list package version creation requests" + "force\:package\:version\:create\:report":"retrieve details about a package version creation request" + "force\:package\:version\:list":"list all package versions in the Dev Hub org" + "force\:package\:version\:promote":"promote a package version to released" + "force\:package\:version\:report":"retrieve details about a package version in the Dev Hub org" + "force\:package\:version\:update":"update a package version" + "force\:project\:create":"create a new SFDX project" + "force\:project\:upgrade":"update project config files to the latest format" + "force\:schema\:sobject\:describe":"describe an object" + "force\:schema\:sobject\:list":"list all objects of a specified category" + "force\:source\:convert":"convert source into Metadata API format" + "force\:source\:delete":"delete source from your project and from a non-source-tracked org" + "force\:source\:deploy":"deploy source to a non-source-tracked org" + "force\:source\:open":"edit a Lightning Page with Lightning App Builder" + "force\:source\:pull":"pull source from the scratch org to the project" + "force\:source\:push":"push source to a scratch org from the project" + "force\:source\:retrieve":"retrieve source from a non-source-tracked org" + "force\:source\:status":"list local changes and/or changes in a scratch org" + "force\:user\:create":"create a user for a scratch org" + "force\:user\:display":"displays information about a user of a scratch org" + "force\:user\:list":"lists all users of a scratch org" + "force\:user\:password\:generate":"generate a password for scratch org users" + "force\:user\:permset\:assign":"assign a permission set to one or more users of an org" + "force\:visualforce\:component\:create":"create a Visualforce component" + "force\:visualforce\:page\:create":"create a Visualforce page" +) + +_arguments '*:: :->command' + +if (( CURRENT == 1 )); then + _describe -t commands "sfdx command" _1st_arguments + return +fi + +local -a _command_args +case "$words[1]" in + force:limits:api:display) + _command_args=( + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:lightning:app:create) + _command_args=( + '(-n|--appname)'{-n,--appname}'[name of the generated Lightning app]' \ + '(-t|--template)'{-t,--template}'[template to use for file creation (DefaultLightningApp*)]' \ + '(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \ + '(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \ + '(-a|--apiversion)'{-a,--apiversion}'[API version number (45.0*,44.0)]' \ + '(--json)--json[JSON output]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:data:bulk:delete) + _command_args=( + '(-s|--sobjecttype)'{-s,--sobjecttype}'[the sObject type of the records you’re deleting]' \ + '(-f|--csvfile)'{-f,--csvfile}'[the path to the CSV file containing the ids of the records to delete]:file:_files' \ + '(-w|--wait)'{-w,--wait}'[the number of minutes to wait for the command to complete before displaying the results]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:data:bulk:status) + _command_args=( + '(-i|--jobid)'{-i,--jobid}'[the ID of the job you want to view or of the job whose batch you want to view]' \ + '(-b|--batchid)'{-b,--batchid}'[the ID of the batch whose status you want to view]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:data:bulk:upsert) + _command_args=( + '(-s|--sobjecttype)'{-s,--sobjecttype}'[the sObject type of the records you want to upsert]' \ + '(-f|--csvfile)'{-f,--csvfile}'[the path to the CSV file that defines the records to upsert]:file:_files' \ + '(-i|--externalid)'{-i,--externalid}'[the column name of the external ID]' \ + '(-w|--wait)'{-w,--wait}'[the number of minutes to wait for the command to complete before displaying the results]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:apex:class:create) + _command_args=( + '(-n|--classname)'{-n,--classname}'[name of the generated Apex class]' \ + '(-t|--template)'{-t,--template}'[template to use for file creation (DefaultApexClass*,ApexException,ApexUnitTest,InboundEmailService)]' \ + '(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \ + '(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \ + '(-a|--apiversion)'{-a,--apiversion}'[API version number (45.0*,44.0)]' \ + '(--json)--json[JSON output]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:doc:commands:display) + _command_args=( + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:doc:commands:list) + _command_args=( + '(-u|--usage)'{-u,--usage}'[list only docopt usage strings]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:visualforce:component:create) + _command_args=( + '(-t|--template)'{-t,--template}'[template to use for file creation (DefaultVFComponent*)]' \ + '(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \ + '(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \ + '(-n|--componentname)'{-n,--componentname}'[name of the generated Visualforce component]' \ + '(-a|--apiversion)'{-a,--apiversion}'[API version number (45.0*,44.0)]' \ + '(-l|--label)'{-l,--label}'[Visualforce component label]' \ + '(--json)--json[JSON output]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:lightning:component:create) + _command_args=( + '(-n|--componentname)'{-n,--componentname}'[name of the generated Lightning component]' \ + '(-t|--template)'{-t,--template}'[template to use for file creation (DefaultLightningCmp*)]' \ + '(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \ + '(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \ + '(-a|--apiversion)'{-a,--apiversion}'[API version number (45.0*,44.0)]' \ + '(--type)--type[type of the Lightning component (aura*,lwc)]' \ + '(--json)--json[JSON output]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:mdapi:convert) + _command_args=( + '(-r|--rootdir)'{-r,--rootdir}'[the root directory containing the Metadata API–formatted metadata]:file:_files' \ + '(-d|--outputdir)'{-d,--outputdir}'[the output directory to store the source–formatted files]:file:_files' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:source:convert) + _command_args=( + '(-r|--rootdir)'{-r,--rootdir}'[a source directory other than the default package to convert]:file:_files' \ + '(-d|--outputdir)'{-d,--outputdir}'[output directory to store the Metadata API–formatted files in]:file:_files' \ + '(-n|--packagename)'{-n,--packagename}'[name of the package to associate with the metadata-formatted files]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:org:create) + _command_args=( + '(-f|--definitionfile)'{-f,--definitionfile}'[path to a scratch org definition file]:file:_files' \ + '(-j|--definitionjson)'{-j,--definitionjson}'[scratch org definition in json format ]' \ + '(-n|--nonamespace)'{-n,--nonamespace}'[creates the scratch org with no namespace]' \ + '(-c|--noancestors)'{-c,--noancestors}'[do not include second-generation package ancestors in the scratch org]' \ + '(-i|--clientid)'{-i,--clientid}'[connected app consumer key]' \ + '(-s|--setdefaultusername)'{-s,--setdefaultusername}'[set the created org as the default username]' \ + '(-a|--setalias)'{-a,--setalias}'[set an alias for for the created scratch org]' \ + '(-e|--env)'{-e,--env}'[environment where the scratch org is created: \[sandbox*,virtual,prototype\] (sandbox*,virtual,prototype)]' \ + '(-w|--wait)'{-w,--wait}'[the streaming client socket timeout (in minutes) (default:6, min:2)]' \ + '(-d|--durationdays)'{-d,--durationdays}'[duration of the scratch org (in days) (default:7, min:1, max:30)]' \ + '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:package:create) + _command_args=( + '(-n|--name)'{-n,--name}'[package name]' \ + '(-t|--packagetype)'{-t,--packagetype}'[package type (Managed,Unlocked)]' \ + '(-d|--description)'{-d,--description}'[package description]' \ + '(-e|--nonamespace)'{-e,--nonamespace}'[creates the package with no namespace; available only for unlocked packages.]' \ + '(-r|--path)'{-r,--path}'[path to directory that contains the contents of the package]:file:_files' \ + '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:user:create) + _command_args=( + '(-f|--definitionfile)'{-f,--definitionfile}'[file path to a user definition]:file:_files' \ + '(-a|--setalias)'{-a,--setalias}'[set an alias for the created username to reference within the CLI]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:project:create) + _command_args=( + '(-n|--projectname)'{-n,--projectname}'[name of the generated project]' \ + '(-t|--template)'{-t,--template}'[template to use for file creation (Defaultsfdx-project.json*)]' \ + '(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \ + '(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \ + '(-l|--loginurl)'{-l,--loginurl}'[Salesforce instance login URL (https://login.salesforce.com*)]' \ + '(--sourceapiversion)--sourceapiversion[source API version number (45.0*)]' \ + '(-s|--namespace)'{-s,--namespace}'[project associated namespace]' \ + '(-p|--defaultpackagedir)'{-p,--defaultpackagedir}'[default package directory name (force-app*)]' \ + '(-x|--manifest)'{-x,--manifest}'[generate a manifest (package.xml) for change-set-based development]' \ + '(--json)--json[JSON output]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:org:delete) + _command_args=( + '(-p|--noprompt)'{-p,--noprompt}'[no prompt to confirm deletion]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org]' \ + '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:source:delete) + _command_args=( + '(-r|--noprompt)'{-r,--noprompt}'[do not prompt for delete confirmation]' \ + '(-w|--wait)'{-w,--wait}'[wait time for command to finish in minutes (default: 33) (default:33, min:1)]' \ + '(-p|--sourcepath)'{-p,--sourcepath}'[comma-separated list of paths to the local metadata to delete]:file:_files' \ + '(-m|--metadata)'{-m,--metadata}'[comma-separated list of names of metadata components to delete]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:mdapi:deploy) + _command_args=( + '(-c|--checkonly)'{-c,--checkonly}'[validate deploy but don’t save to the org (default:false)]' \ + '(-d|--deploydir)'{-d,--deploydir}'[root of directory tree of files to deploy]:file:_files' \ + '(-w|--wait)'{-w,--wait}'[wait time for command to finish in minutes (default: 0)]' \ + '(-i|--jobid)'{-i,--jobid}'[(deprecated) job ID of the deployment you want to check; defaults to your most recent CLI deployment if not specified]' \ + '(-l|--testlevel)'{-l,--testlevel}'[deployment testing level (NoTestRun,RunSpecifiedTests,RunLocalTests,RunAllTestsInOrg)]' \ + '(-r|--runtests)'{-r,--runtests}'[tests to run if --testlevel RunSpecifiedTests]' \ + '(-e|--rollbackonerror)'{-e,--rollbackonerror}'[(deprecated) roll back deployment for any failure (default:true)]' \ + '(-o|--ignoreerrors)'{-o,--ignoreerrors}'[ignore any errors and do not roll back deployment (default:false)]' \ + '(-g|--ignorewarnings)'{-g,--ignorewarnings}'[whether a warning will allow a deployment to complete successfully (default:false)]' \ + '(-q|--validateddeployrequestid)'{-q,--validateddeployrequestid}'[request ID of the validated deployment to run a Quick Deploy]' \ + '(-f|--zipfile)'{-f,--zipfile}'[path to .zip file of metadata to deploy]:file:_files' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + '(--verbose)--verbose[verbose output of deploy results]' \ + ) + ;; + force:source:deploy) + _command_args=( + '(-w|--wait)'{-w,--wait}'[wait time for command to finish in minutes (default: 33) (default:33, min:1)]' \ + '(-m|--metadata)'{-m,--metadata}'[comma-separated list of metadata component names]' \ + '(-p|--sourcepath)'{-p,--sourcepath}'[comma-separated list of paths to the local source files to deploy]:file:_files' \ + '(-x|--manifest)'{-x,--manifest}'[file path for manifest (package.xml) of components to deploy]:file:_files' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:mdapi:deploy:cancel) + _command_args=( + '(-w|--wait)'{-w,--wait}'[wait time for command to finish in minutes (default: 33) (default:33, min:1)]' \ + '(-i|--jobid)'{-i,--jobid}'[job ID of the deployment you want to cancel; defaults to your most recent CLI deployment if not specified]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:mdapi:deploy:report) + _command_args=( + '(-w|--wait)'{-w,--wait}'[wait time for command to finish in minutes (default: 0)]' \ + '(-i|--jobid)'{-i,--jobid}'[job ID of the deployment you want to check; defaults to your most recent CLI deployment if not specified]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + '(--verbose)--verbose[verbose output of deploy results]' \ + ) + ;; + force:org:display) + _command_args=( + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + '(--verbose)--verbose[emit additional command output to stdout]' \ + ) + ;; + force:user:display) + _command_args=( + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:lightning:event:create) + _command_args=( + '(-n|--eventname)'{-n,--eventname}'[name of the generated Lightning event]' \ + '(-t|--template)'{-t,--template}'[template to use for file creation (DefaultLightningEvt*)]' \ + '(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \ + '(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \ + '(-a|--apiversion)'{-a,--apiversion}'[API version number (45.0*,44.0)]' \ + '(--json)--json[JSON output]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:apex:execute) + _command_args=( + '(-f|--apexcodefile)'{-f,--apexcodefile}'[path to a local file containing Apex code]:file:_files' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:config:get) + _command_args=( + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + '(--verbose)--verbose[emit additional command output to stdout]' \ + ) + ;; + force:package:hammertest:list) + _command_args=( + '(-i|--packageversionid)'{-i,--packageversionid}'[ID of the package version to list results for]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:package:hammertest:report) + _command_args=( + '(-i|--requestid)'{-i,--requestid}'[ID of the hammer request to report on]' \ + '(-s|--summary)'{-s,--summary}'[report only a results summary (hide Apex test failures)]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:package:hammertest:run) + _command_args=( + '(-i|--packageversionid)'{-i,--packageversionid}'[ID of the package version to test]' \ + '(-s|--subscriberorg)'{-s,--subscriberorg}'[comma-separated list of subscriber orgs IDs]' \ + '(-f|--subscriberfile)'{-f,--subscriberfile}'[file with list of subscriber orgs IDs, one per line]' \ + '(-d|--scheduledrundatetime)'{-d,--scheduledrundatetime}'[earliest date/time to run the test]' \ + '(-p|--preview)'{-p,--preview}'[run the package hammer test in the Salesforce preview version]' \ + '(-t|--apextests)'{-t,--apextests}'[run the apex tests in the subscriber org]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:package:install) + _command_args=( + '(-w|--wait)'{-w,--wait}'[number of minutes to wait for installation status]' \ + '(-k|--installationkey)'{-k,--installationkey}'[installation key for key-protected package (default: null)]' \ + '(-b|--publishwait)'{-b,--publishwait}'[number of minutes to wait for subscriber package version ID to become available in the target org ]' \ + '(-r|--noprompt)'{-r,--noprompt}'[allow Remote Site Settings and Content Security Policy websites to send or receive data without confirmation]' \ + '(-p|--package)'{-p,--package}'[ID (starts with 04t) or alias of the package version to install]' \ + '(-s|--securitytype)'{-s,--securitytype}'[security access type for the installed package (AllUsers,AdminsOnly)]' \ + '(-t|--upgradetype)'{-t,--upgradetype}'[the upgrade type for the package installation (Mixed*,DeprecateOnly)]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:package:install:report) + _command_args=( + '(-i|--requestid)'{-i,--requestid}'[ID of the package install request you want to check]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:package:installed:list) + _command_args=( + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:lightning:interface:create) + _command_args=( + '(-n|--interfacename)'{-n,--interfacename}'[name of the generated Lightning interface]' \ + '(-t|--template)'{-t,--template}'[template to use for file creation (DefaultLightningIntf*)]' \ + '(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \ + '(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \ + '(-a|--apiversion)'{-a,--apiversion}'[API version number (45.0*,44.0)]' \ + '(--json)--json[JSON output]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:auth:jwt:grant) + _command_args=( + '(-u|--username)'{-u,--username}'[authentication username]' \ + '(-f|--jwtkeyfile)'{-f,--jwtkeyfile}'[path to a file containing the private key]:file:_files' \ + '(-i|--clientid)'{-i,--clientid}'[OAuth client ID (sometimes called the consumer key)]' \ + '(-r|--instanceurl)'{-r,--instanceurl}'[the login URL of the instance the org lives on]' \ + '(-d|--setdefaultdevhubusername)'{-d,--setdefaultdevhubusername}'[set the authenticated org as the default dev hub org for scratch org creation]' \ + '(-s|--setdefaultusername)'{-s,--setdefaultusername}'[set the authenticated org as the default username that all commands run against]' \ + '(-a|--setalias)'{-a,--setalias}'[set an alias for the authenticated org]' \ + '(-p|--noprompt)'{-p,--noprompt}'[do not prompt for auth confirmation in demo mode]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:lightning:lint) + _command_args=( + '(--ignore)--ignore[pattern used to ignore some folders]' \ + '(--files)--files[pattern used to include specific files]' \ + '(--json)--json[format output as JSON]' \ + '(--config)--config[path to a custom ESLint configuration file]' \ + '(--verbose)--verbose[report warnings in addition to errors]' \ + '(--exit)--exit[exit with error code 1 if there are lint issues]' \ + ) + ;; + force:alias:list) + _command_args=( + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:config:list) + _command_args=( + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:org:list) + _command_args=( + '(--all)--all[include expired, deleted, and unknown-status scratch orgs]' \ + '(--clean)--clean[remove all local org authorizations for non-active orgs]' \ + '(-p|--noprompt)'{-p,--noprompt}'[do not prompt for confirmation]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + '(--verbose)--verbose[list more information about each org]' \ + ) + ;; + force:package:list) + _command_args=( + '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + '(--verbose)--verbose[display extended package detail]' \ + ) + ;; + force:user:list) + _command_args=( + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:apex:log:get) + _command_args=( + '(-c|--color)'{-c,--color}'[colorize noteworthy log lines]' \ + '(-i|--logid)'{-i,--logid}'[ID of the log to display]' \ + '(-n|--number)'{-n,--number}'[number of most recent logs to display (min:1, max:25)]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:apex:log:list) + _command_args=( + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:apex:log:tail) + _command_args=( + '(-c|--color)'{-c,--color}'[colorize noteworthy log lines]' \ + '(-d|--debuglevel)'{-d,--debuglevel}'[debug level for trace flag]' \ + '(-s|--skiptraceflag)'{-s,--skiptraceflag}'[skip trace flag setup]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:auth:logout) + _command_args=( + '(-a|--all)'{-a,--all}'[include all authenticated orgs]' \ + '(-p|--noprompt)'{-p,--noprompt}'[do not prompt for confirmation]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:org:open) + _command_args=( + '(-p|--path)'{-p,--path}'[navigation URL path]' \ + '(-r|--urlonly)'{-r,--urlonly}'[display navigation URL, but don’t launch browser]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:source:open) + _command_args=( + '(-f|--sourcefile)'{-f,--sourcefile}'[file to edit]:file:_files' \ + '(-r|--urlonly)'{-r,--urlonly}'[generate a navigation URL; don’t launch the editor]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:visualforce:page:create) + _command_args=( + '(-t|--template)'{-t,--template}'[template to use for file creation (DefaultVFPage*)]' \ + '(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \ + '(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \ + '(-n|--pagename)'{-n,--pagename}'[name of the generated Visualforce page]' \ + '(-a|--apiversion)'{-a,--apiversion}'[API version number (45.0*,44.0)]' \ + '(-l|--label)'{-l,--label}'[Visualforce page label]' \ + '(--json)--json[JSON output]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:user:password:generate) + _command_args=( + '(-o|--onbehalfof)'{-o,--onbehalfof}'[comma-separated list of usernames for which to generate passwords]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:user:permset:assign) + _command_args=( + '(-n|--permsetname)'{-n,--permsetname}'[the name of the permission set to assign]' \ + '(-o|--onbehalfof)'{-o,--onbehalfof}'[comma-separated list of usernames or aliases to assign the permission set to]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:source:pull) + _command_args=( + '(-w|--wait)'{-w,--wait}'[wait time for command to finish in minutes (default: 33) (default:33, min:1)]' \ + '(-f|--forceoverwrite)'{-f,--forceoverwrite}'[ignore conflict warnings and overwrite changes to the project]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:source:push) + _command_args=( + '(-f|--forceoverwrite)'{-f,--forceoverwrite}'[ignore conflict warnings and overwrite changes to scratch org]' \ + '(-g|--ignorewarnings)'{-g,--ignorewarnings}'[deploy changes even if warnings are generated]' \ + '(-r|--replacetokens)'{-r,--replacetokens}'[replace tokens in source files prior to deployment]' \ + '(-w|--wait)'{-w,--wait}'[wait time for command to finish in minutes (default: 33) (default:33, min:1)]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:data:record:create) + _command_args=( + '(-s|--sobjecttype)'{-s,--sobjecttype}'[the type of the record you’re creating]' \ + '(-v|--values)'{-v,--values}'[the = pairs you’re creating]' \ + '(-t|--usetoolingapi)'{-t,--usetoolingapi}'[create the record with tooling api]' \ + '(--perflog)--perflog[get API performance data.]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:data:record:delete) + _command_args=( + '(-s|--sobjecttype)'{-s,--sobjecttype}'[the type of the record you’re deleting]' \ + '(-i|--sobjectid)'{-i,--sobjectid}'[the ID of the record you’re deleting]' \ + '(-w|--where)'{-w,--where}'[a list of = pairs to search for]' \ + '(-t|--usetoolingapi)'{-t,--usetoolingapi}'[delete the record with Tooling API]' \ + '(--perflog)--perflog[get API performance data.]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:data:record:get) + _command_args=( + '(-s|--sobjecttype)'{-s,--sobjecttype}'[the type of the record you’re retrieving]' \ + '(-i|--sobjectid)'{-i,--sobjectid}'[the ID of the record you’re retrieving]' \ + '(-w|--where)'{-w,--where}'[a list of = pairs to search for]' \ + '(-t|--usetoolingapi)'{-t,--usetoolingapi}'[retrieve the record with Tooling API]' \ + '(--perflog)--perflog[get API performance data.]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:data:record:update) + _command_args=( + '(-s|--sobjecttype)'{-s,--sobjecttype}'[the type of the record you’re updating]' \ + '(-i|--sobjectid)'{-i,--sobjectid}'[the ID of the record you’re updating]' \ + '(-w|--where)'{-w,--where}'[a list of = pairs to search for]' \ + '(-v|--values)'{-v,--values}'[the = pairs you’re updating]' \ + '(-t|--usetoolingapi)'{-t,--usetoolingapi}'[update the record with Tooling API]' \ + '(--perflog)--perflog[get API performance data.]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:mdapi:retrieve) + _command_args=( + '(-a|--apiversion)'{-a,--apiversion}'[target API version for the retrieve (default 45.0)]' \ + '(-w|--wait)'{-w,--wait}'[wait time for command to finish in minutes (default: -1 (no limit))]' \ + '(-r|--retrievetargetdir)'{-r,--retrievetargetdir}'[directory root for the retrieved files]:file:_files' \ + '(-k|--unpackaged)'{-k,--unpackaged}'[file path of manifest of components to retrieve]:file:_files' \ + '(-d|--sourcedir)'{-d,--sourcedir}'[source dir to use instead of default manifest sfdx-project.xml]:file:_files' \ + '(-p|--packagenames)'{-p,--packagenames}'[a comma-separated list of packages to retrieve]' \ + '(-s|--singlepackage)'{-s,--singlepackage}'[a single-package retrieve (default: false)]' \ + '(-i|--jobid)'{-i,--jobid}'[(deprecated) job ID of the retrieve you want to check; defaults to your most recent CLI retrieval if not specified]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + '(--verbose)--verbose[verbose output of retrieve result]' \ + ) + ;; + force:source:retrieve) + _command_args=( + '(-w|--wait)'{-w,--wait}'[wait time for command to finish in minutes (default: 33) (default:33, min:1)]' \ + '(-x|--manifest)'{-x,--manifest}'[file path for manifest (package.xml) of components to retrieve]:file:_files' \ + '(-m|--metadata)'{-m,--metadata}'[comma-separated list of metadata component names]' \ + '(-p|--sourcepath)'{-p,--sourcepath}'[comma-separated list of source file paths to retrieve]:file:_files' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:mdapi:retrieve:report) + _command_args=( + '(-w|--wait)'{-w,--wait}'[wait time for command to finish in minutes (default: -1 (no limit))]' \ + '(-r|--retrievetargetdir)'{-r,--retrievetargetdir}'[directory root for the retrieved files]:file:_files' \ + '(-i|--jobid)'{-i,--jobid}'[job ID of the retrieve you want to check; defaults to your most recent CLI retrieval if not specified]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + '(--verbose)--verbose[verbose output of retrieve result]' \ + ) + ;; + force:alias:set) + _command_args=( + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:config:set) + _command_args=( + '(-g|--global)'{-g,--global}'[set config var globally (to be used from any directory)]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:auth:sfdxurl:store) + _command_args=( + '(-f|--sfdxurlfile)'{-f,--sfdxurlfile}'[path to a file containing the sfdx url]:file:_files' \ + '(-d|--setdefaultdevhubusername)'{-d,--setdefaultdevhubusername}'[set the authenticated org as the default dev hub org for scratch org creation]' \ + '(-s|--setdefaultusername)'{-s,--setdefaultusername}'[set the authenticated org as the default username that all commands run against]' \ + '(-a|--setalias)'{-a,--setalias}'[set an alias for the authenticated org]' \ + '(-p|--noprompt)'{-p,--noprompt}'[do not prompt for auth confirmation in demo mode]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:org:shape:create) + _command_args=( + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:org:shape:delete) + _command_args=( + '(-p|--noprompt)'{-p,--noprompt}'[do not prompt for confirmation]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username for the target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:org:shape:list) + _command_args=( + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + '(--verbose)--verbose[list more information about each org shape]' \ + ) + ;; + force:org:snapshot:create) + _command_args=( + '(-o|--sourceorg)'{-o,--sourceorg}'[ID or locally authenticated username or alias of scratch org to snapshot]' \ + '(-n|--snapshotname)'{-n,--snapshotname}'[unique name of snapshot]' \ + '(-d|--description)'{-d,--description}'[description of snapshot]' \ + '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:org:snapshot:delete) + _command_args=( + '(-s|--snapshot)'{-s,--snapshot}'[name or ID of snapshot to delete]' \ + '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:org:snapshot:get) + _command_args=( + '(-s|--snapshot)'{-s,--snapshot}'[name or ID of snapshot to retrieve]' \ + '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:org:snapshot:list) + _command_args=( + '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:schema:sobject:describe) + _command_args=( + '(-s|--sobjecttype)'{-s,--sobjecttype}'[the API name of the object to describe]' \ + '(-t|--usetoolingapi)'{-t,--usetoolingapi}'[execute with Tooling API]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:schema:sobject:list) + _command_args=( + '(-c|--sobjecttypecategory)'{-c,--sobjecttypecategory}'[the type of objects to list (all|custom|standard)]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:data:soql:query) + _command_args=( + '(-q|--query)'{-q,--query}'[SOQL query to execute]' \ + '(-t|--usetoolingapi)'{-t,--usetoolingapi}'[execute query with Tooling API]' \ + '(-r|--resultformat)'{-r,--resultformat}'[query result format emitted to stdout; --json flag overrides this parameter (human*,csv,json)]' \ + '(--perflog)--perflog[get API performance data.]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:source:status) + _command_args=( + '(-a|--all)'{-a,--all}'[list all the changes that have been made]' \ + '(-l|--local)'{-l,--local}'[list the changes that have been made locally]' \ + '(-r|--remote)'{-r,--remote}'[list the changes that have been made in the scratch org]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:lightning:test:create) + _command_args=( + '(-n|--testname)'{-n,--testname}'[name of the generated Lightning test]' \ + '(-t|--template)'{-t,--template}'[template to use for file creation (DefaultLightningTest*)]' \ + '(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \ + '(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \ + '(--json)--json[JSON output]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:lightning:test:install) + _command_args=( + '(-w|--wait)'{-w,--wait}'[number of minutes to wait for installation status (default:2)]' \ + '(-r|--releaseversion)'{-r,--releaseversion}'[release version of Lightning Testing Service (default:latest)]' \ + '(-t|--packagetype)'{-t,--packagetype}'[type of unmanaged package. 'full' option contains both jasmine and mocha, plus examples (full*,jasmine,mocha)]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:apex:test:report) + _command_args=( + '(-i|--testrunid)'{-i,--testrunid}'[ID of test run]' \ + '(-c|--codecoverage)'{-c,--codecoverage}'[retrieve code coverage results]' \ + '(-d|--outputdir)'{-d,--outputdir}'[directory to store test run files]:file:_files' \ + '(-r|--resultformat)'{-r,--resultformat}'[test result format emitted to stdout; --json flag overrides this parameter (human*,tap,junit,json)]' \ + '(-w|--wait)'{-w,--wait}'[the streaming client socket timeout (in minutes) (default:6, min:2)]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + '(--verbose)--verbose[display Apex test processing details]' \ + ) + ;; + force:apex:test:run) + _command_args=( + '(-n|--classnames)'{-n,--classnames}'[comma-separated list of Apex test class names to run]' \ + '(-s|--suitenames)'{-s,--suitenames}'[comma-separated list of Apex test suite names to run]' \ + '(-t|--tests)'{-t,--tests}'[comma-separated list of Apex test class names or IDs and, if applicable, test methods to run]' \ + '(-c|--codecoverage)'{-c,--codecoverage}'[retrieve code coverage results]' \ + '(-d|--outputdir)'{-d,--outputdir}'[directory to store test run files]:file:_files' \ + '(-l|--testlevel)'{-l,--testlevel}'[testlevel enum value (RunLocalTests,RunAllTestsInOrg,RunSpecifiedTests)]' \ + '(-r|--resultformat)'{-r,--resultformat}'[test result format emitted to stdout; --json flag overrides this parameter (human*,tap,junit,json)]' \ + '(-w|--wait)'{-w,--wait}'[the streaming client socket timeout (in minutes) (default:6, min:2)]' \ + '(--precompilewait)--precompilewait[how long to wait (in minutes) for Apex pre-compilation (default:3, min:3)]' \ + '(-y|--synchronous)'{-y,--synchronous}'[run tests from a single class synchronously]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + '(--verbose)--verbose[display Apex test processing details]' \ + ) + ;; + force:lightning:test:run) + _command_args=( + '(-a|--appname)'{-a,--appname}'[name of your Lightning test application]' \ + '(-d|--outputdir)'{-d,--outputdir}'[directory path to store test run artifacts: for example, log files and test results]:file:_files' \ + '(-r|--resultformat)'{-r,--resultformat}'[test result format emitted to stdout; --json flag overrides this parameter (human*,tap,junit,json)]' \ + '(-f|--configfile)'{-f,--configfile}'[path to config file for the test]:file:_files' \ + '(-o|--leavebrowseropen)'{-o,--leavebrowseropen}'[leave browser open]' \ + '(-t|--timeout)'{-t,--timeout}'[time (ms) to wait for results element in dom (default:60000)]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:data:tree:export) + _command_args=( + '(-q|--query)'{-q,--query}'[soql query, or filepath of file containing a soql query, to retrieve records]' \ + '(-p|--plan)'{-p,--plan}'[generate mulitple sobject tree files and a plan definition file for aggregated import]' \ + '(-x|--prefix)'{-x,--prefix}'[prefix of generated files]' \ + '(-d|--outputdir)'{-d,--outputdir}'[directory to store files]:file:_files' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:data:tree:import) + _command_args=( + '(-f|--sobjecttreefiles)'{-f,--sobjecttreefiles}'[comma-delimited, ordered paths of json files containing collection of record trees to insert]:file:_files' \ + '(-p|--plan)'{-p,--plan}'[path to plan to insert multiple data files that have master-detail relationships]:file:_files' \ + '(-c|--contenttype)'{-c,--contenttype}'[if data file extension is not .json, provide content type (applies to all files)]' \ + '(--confighelp)--confighelp[display schema information for the --plan configuration file to stdout; if you use this option, all other options except --json are ignored]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:apex:trigger:create) + _command_args=( + '(-n|--triggername)'{-n,--triggername}'[name of the generated Apex trigger]' \ + '(-t|--template)'{-t,--template}'[template to use for file creation (ApexTrigger*)]' \ + '(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \ + '(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \ + '(-a|--apiversion)'{-a,--apiversion}'[API version number (45.0*,44.0)]' \ + '(-s|--sobject)'{-s,--sobject}'[sObject to create a trigger on (SOBJECT*)]' \ + '(-e|--triggerevents)'{-e,--triggerevents}'[events that fire the trigger (before insert*,before update,before delete,after insert,after update,after delete,after undelete)]' \ + '(--json)--json[JSON output]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:package:uninstall) + _command_args=( + '(-w|--wait)'{-w,--wait}'[number of minutes to wait for uninstall status]' \ + '(-p|--package)'{-p,--package}'[ID (starts with 04t) or alias of the package version to uninstall]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:package:uninstall:report) + _command_args=( + '(-i|--requestid)'{-i,--requestid}'[ID of the package uninstall request you want to check]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:package:update) + _command_args=( + '(-p|--package)'{-p,--package}'[ID (starts with 0Ho) or alias of the package to update]' \ + '(-n|--name)'{-n,--name}'[new package name]' \ + '(-d|--description)'{-d,--description}'[new package description]' \ + '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:project:upgrade) + _command_args=( + '(-f|--forceupgrade)'{-f,--forceupgrade}'[run all upgrades even if project has already been upgraded]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:package:version:create) + _command_args=( + '(-p|--package)'{-p,--package}'[ID (starts with 0Ho) or alias of the package to create a version of]' \ + '(-d|--path)'{-d,--path}'[path to directory that contains the contents of the package]:file:_files' \ + '(-f|--definitionfile)'{-f,--definitionfile}'[path to a definition file similar to scratch org definition file that contains the list of features and org preferences that the metadata of the package version depends on]:file:_files' \ + '(-b|--branch)'{-b,--branch}'[the package version’s branch]' \ + '(-t|--tag)'{-t,--tag}'[the package version’s tag]' \ + '(-k|--installationkey)'{-k,--installationkey}'[installation key for key-protected package (either --installationkey or --installationkeybypass is required)]' \ + '(-x|--installationkeybypass)'{-x,--installationkeybypass}'[bypass the installation key requirement (either --installationkey or --installationkeybypass is required)]' \ + '(-r|--preserve)'{-r,--preserve}'[temp files are preserved that would otherwise be deleted]' \ + '(-j|--validateschema)'{-j,--validateschema}'[sfdx-project.json is validated against JSON schema]' \ + '(-w|--wait)'{-w,--wait}'[minutes to wait for the package version to be created (default:0)]' \ + '(-s|--buildinstance)'{-s,--buildinstance}'[the instance where the package version will be created——for example, NA50]' \ + '(-o|--sourceorg)'{-o,--sourceorg}'[the source org ID used to copy the org shape for the build org]' \ + '(-a|--versionname)'{-a,--versionname}'[the name of the package version to be created]' \ + '(-n|--versionnumber)'{-n,--versionnumber}'[the version number of the package version to be created]' \ + '(-e|--versiondescription)'{-e,--versiondescription}'[the description of the package version to be created]' \ + '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:package1:version:create) + _command_args=( + '(-i|--packageid)'{-i,--packageid}'[ID of the metadata package (starts with 033) of which you’re creating a new version]' \ + '(-n|--name)'{-n,--name}'[package version name]' \ + '(-d|--description)'{-d,--description}'[package version description]' \ + '(-v|--version)'{-v,--version}'[package version in major.minor format, for example, 3.2]' \ + '(-m|--managedreleased)'{-m,--managedreleased}'[create a managed package version]' \ + '(-r|--releasenotesurl)'{-r,--releasenotesurl}'[release notes URL]' \ + '(-p|--postinstallurl)'{-p,--postinstallurl}'[post install URL]' \ + '(-k|--installationkey)'{-k,--installationkey}'[installation key for key-protected package (default: null)]' \ + '(-w|--wait)'{-w,--wait}'[minutes to wait for the package version to be created (default: 2 minutes)]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:package1:version:create:get) + _command_args=( + '(-i|--requestid)'{-i,--requestid}'[PackageUploadRequest ID]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:package:version:create:list) + _command_args=( + '(-c|--createdlastdays)'{-c,--createdlastdays}'[created in the last specified number of days (starting at 00:00:00 of first day to now; 0 for today)]' \ + '(-s|--status)'{-s,--status}'[filter the list by version creation request status (Queued,InProgress,Success,Error)]' \ + '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:package:version:create:report) + _command_args=( + '(-i|--packagecreaterequestid)'{-i,--packagecreaterequestid}'[package version creation request ID (starts with 08c)]' \ + '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:package1:version:display) + _command_args=( + '(-i|--packageversionid)'{-i,--packageversionid}'[metadata package version ID (starts with 04t)]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:package:version:list) + _command_args=( + '(-c|--createdlastdays)'{-c,--createdlastdays}'[created in the last specified number of days (starting at 00:00:00 of first day to now; 0 for today)]' \ + '(-m|--modifiedlastdays)'{-m,--modifiedlastdays}'[list items modified in the specified last number of days (starting at 00:00:00 of first day to now; 0 for today)]' \ + '(-p|--packages)'{-p,--packages}'[filter results on specified comma-delimited packages (aliases or 0Ho IDs)]' \ + '(-r|--released)'{-r,--released}'[display released versions only]' \ + '(-o|--orderby)'{-o,--orderby}'[order by the specified package version fields]' \ + '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ + '(--concise)--concise[display limited package version details]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + '(--verbose)--verbose[display extended package version details]' \ + ) + ;; + force:package1:version:list) + _command_args=( + '(-i|--packageid)'{-i,--packageid}'[metadata package ID (starts with 033)]' \ + '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:package:version:promote) + _command_args=( + '(-p|--package)'{-p,--package}'[ID (starts with 04t) or alias of the package version to promote]' \ + '(-n|--noprompt)'{-n,--noprompt}'[no prompt to confirm setting the package version as released]' \ + '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:package:version:report) + _command_args=( + '(-p|--package)'{-p,--package}'[ID (starts with 04t) or alias of the package to retrieve details for]' \ + '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + '(--verbose)--verbose[displays extended package version details]' \ + ) + ;; + force:package:version:update) + _command_args=( + '(-p|--package)'{-p,--package}'[ID (starts with 04t) or alias of the package to update a version of]' \ + '(-a|--versionname)'{-a,--versionname}'[new package version name]' \ + '(-e|--versiondescription)'{-e,--versiondescription}'[new package version description]' \ + '(-b|--branch)'{-b,--branch}'[new package version branch]' \ + '(-t|--tag)'{-t,--tag}'[new package version tag]' \ + '(-k|--installationkey)'{-k,--installationkey}'[new installation key for key-protected package (default: null)]' \ + '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + force:auth:web:login) + _command_args=( + '(-i|--clientid)'{-i,--clientid}'[OAuth client ID (sometimes called the consumer key)]' \ + '(-r|--instanceurl)'{-r,--instanceurl}'[the login URL of the instance the org lives on]' \ + '(-d|--setdefaultdevhubusername)'{-d,--setdefaultdevhubusername}'[set the authenticated org as the default dev hub org for scratch org creation]' \ + '(-s|--setdefaultusername)'{-s,--setdefaultusername}'[set the authenticated org as the default username that all commands run against]' \ + '(-a|--setalias)'{-a,--setalias}'[set an alias for the authenticated org]' \ + '(--disablemasking)--disablemasking[disable masking of user input (for use with problematic terminals)]' \ + '(-p|--noprompt)'{-p,--noprompt}'[do not prompt for auth confirmation in demo mode]' \ + '(--json)--json[format output as json]' \ + '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ + ) + ;; + esac + +_arguments \ + $_command_args \ + && return 0 diff --git a/zsh/.oh-my-zsh/plugins/singlechar/README.md b/zsh/.oh-my-zsh/plugins/singlechar/README.md new file mode 100644 index 0000000..d890299 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/singlechar/README.md @@ -0,0 +1,118 @@ +# Singlechar plugin + +This plugin adds single char shortcuts (and combinations) for some commands. + +To use it, add `singlechar` to the plugins array of your zshrc file: +``` +plugins=(... singlechar) +``` + +## Aliases + +### CAT, GREP, CURL, WGET + +| Alias | Command | Description | +|-------|------------------|-------------| +| y | `grep -Ri` | Find case-insensitive string in all files and directories, recursively. Follows symlinks. | +| n | `grep -Rvi` | Same as above but only show lines that don't match the string. | +| f | `grep -Rli` | Same as 'y' but only print the filenames where the string is found. | +| fn | `grep -Rlvi` | Same as above but only show files that don't contain the string. | +| f. | `find . \| grep` | Grep list of files in current directory | +| f: | `find` | 'find' command | +| p | `less` | 'less' command | +| m | `man` | 'man' command | +| d | `wget` | 'wget' command | +| u | `curl` | 'curl' command | +| c | `cat` | 'cat' command | +| w | `echo >` | Write arguments to file, overwriting it if it exists. | +| a | `echo >>` | Write arguments to file, appending them if the file exists. | +| w: | `cat >` | Write stdin to file, overwriting if it exists. | +| a: | `cat >>` | Write stdin to file, appending it if the file exists. | + +### XARGS + +These aliases are versions of the aliases above but using xargs. This can be used +by piping the arguments to the xargs aliases. + +| Alias | Command | Description | +|-------|----------------------|---------------------------------| +| x | `xargs` | 'xargs' command | +| xy | `xargs grep -Ri` | Same as 'y' alias using xargs. | +| xn | `xargs grep -Rvi` | Same as 'n' alias using xargs. | +| xf | `xargs grep -Rli` | Same as 'f' alias using xargs. | +| xfn | `xargs grep -Rlvi` | Same as 'fn' alias using xargs. | +| xf. | `xargs find \| grep` | Same as 'f.' alias using xargs. | +| xf: | `xargs find` | Same as 'f:' alias using xargs. | +| xc | `xargs cat` | Same as 'c' alias using xargs. | +| xp | `xargs less` | Same as 'p' alias using xargs. | +| xm | `xargs man` | Same as 'm' alias using xargs. | +| xd | `xargs wget` | Same as 'd' alias using xargs. | +| xu | `xargs curl` | Same as 'u' alias using xargs. | +| xw | `xargs echo >` | Same as 'w' alias using xargs. | +| xa | `xargs echo >>` | Same as 'a' alias using xargs. | +| xw: | `xargs cat >` | Same as 'w:' alias using xargs. | +| xa: | `xargs >>` | Same as 'a:' alias using xargs. | + +### SUDO + +These aliases are versions of the aliases above in [CAT, GREP, CURL, WGET](#cat-grep-curl-wget) +but using sudo to run them with root permission. + +| Alias | Command | Description | +|-------|-----------------------|--------------------------------| +| s | `sudo` | 'sudo' command | +| sy | `sudo grep -Ri` | Same as 'y' alias using sudo. | +| sn | `sudo grep -Riv` | Same as 'n' alias using sudo. | +| sf | `sudo grep -Rli` | Same as 'f' alias using sudo. | +| sfn | `sudo grep -Rlvi` | Same as 'fn' alias using sudo. | +| sf. | `sudo find . \| grep` | Same as 'f.' alias using sudo. | +| sf: | `sudo find` | Same as 'f:' alias using sudo. | +| sp | `sudo less` | Same as 'p' alias using sudo. | +| sm | `sudo man` | Same as 'm' alias using sudo. | +| sd | `sudo wget` | Same as 'd' alias using sudo. | +| sc | `sudo cat` | Same as 'c' alias using sudo. | +| sw | `sudo echo >` | Same as 'w' alias using sudo. | +| sa | `sudo echo >>` | Same as 'a' alias using sudo. | +| sw: | `sudo cat >` | Same as 'w:' alias using sudo. | +| sa: | `sudo cat >>` | Same as 'a:' alias using sudo. | + +### SUDO-XARGS + +Same as above but using both sudo and xargs. + +| Alias | Command | Description | +|-------|---------------------------|---------------------------------| +| sx | `sudo xargs` | 'sudo xargs' command | +| sxy | `sudo xargs grep -Ri` | Same as 'xy' alias using sudo. | +| sxn | `sudo xargs grep -Riv` | Same as 'xn' alias using sudo. | +| sxf | `sudo xargs grep -li` | Same as 'xf' alias using sudo. | +| sxfn | `sudo xargs grep -lvi` | Same as 'xfn' alias using sudo. | +| sxf. | `sudo xargs find \| grep` | Same as 'xf.' alias using sudo. | +| sxf: | `sudo xargs find` | Same as 'xf:' alias using sudo. | +| sxp | `sudo xargs less` | Same as 'xp' alias using sudo. | +| sxm | `sudo xargs man` | Same as 'xm' alias using sudo. | +| sxd | `sudo xargs wget` | Same as 'xd' alias using sudo. | +| sxu | `sudo xargs curl` | Same as 'xu' alias using sudo. | +| sxc | `sudo xargs cat` | Same as 'xc' alias using sudo. | +| sxw | `sudo xargs echo >` | Same as 'xw' alias using sudo. | +| sxa | `sudo xargs echo >>` | Same as 'xa' alias using sudo. | +| sxw: | `sudo xargs cat >` | Same as 'xw:' alias using sudo. | +| sxa: | `sudo xargs cat >>` | Same as 'xa:' alias using sudo. | + +## Options + +The commands `grep`, `sudo`, `wget`, `curl`, and `less` can be configured to use other commands +via the setup variables below, before Oh My Zsh is sourced. If they are not set yet, they will +use their default values: + +| Setup variable | Default value | +|----------------|---------------| +| GREP | `grep` | +| ROOT | `sudo` | +| WGET | `wget` | +| CURL | `curl` | +| PAGER | `less` | + +## Author + +- [Karolin Varner](https://github.com/koraa) diff --git a/zsh/.oh-my-zsh/plugins/sprunge/README.md b/zsh/.oh-my-zsh/plugins/sprunge/README.md new file mode 100644 index 0000000..2a363d3 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/sprunge/README.md @@ -0,0 +1,31 @@ +# Sprunge plugin + +This plugin uploads data and fetch URL from the pastebin http://sprunge.us + +To enable it, add 'sprunge' to your plugins: +``` +plugins=(... sprunge) +``` + +## Usage + +| Command | Description | +|------------------------------|-------------------------------------------| +| `sprunge filename.txt` | Uploads filename.txt | +| `sprunge "this is a string"` | Uploads plain text | +| `sprunge < filename.txt` | Redirects filename.txt content to sprunge | +| `echo data \| sprunge` | Any piped data will be uploaded | + +Once sprunge has processed the input it will give you a unique HTTP address: +``` +$ sprunge "hello" +http://sprunge.us/XxjnKz +``` + +## Notes + +- Sprunge accepts piped data, stdin redirection, text strings as input or filenames. + Only one of these can be used at a time. +- Argument precedence goes as follows: stdin > piped input > text strings. +- If a filename is mispelled or doesn't have the necessary path description, it will NOT + generate an error, but instead treat it as a text string. diff --git a/zsh/.oh-my-zsh/plugins/supervisor/README.md b/zsh/.oh-my-zsh/plugins/supervisor/README.md new file mode 100644 index 0000000..1eacea6 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/supervisor/README.md @@ -0,0 +1,12 @@ +# supervisor plugin + +This plugin adds tab-completion for `supervisord`/`supervisorctl` in [Supervisor](http://supervisord.org/). +Supervisor is a client/server system that allows its users to monitor and control a number +of processes on UNIX-like operating systems. + +To use it, add `supervisor` to the plugins array in your zshrc file: +```zsh +plugins=(... supervisor) +``` + +These scripts are from [zshcompfunc4supervisor](https://bitbucket.org/hhatto/zshcompfunc4supervisor). diff --git a/zsh/.oh-my-zsh/plugins/terminitor/README.md b/zsh/.oh-my-zsh/plugins/terminitor/README.md new file mode 100644 index 0000000..8c0e021 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/terminitor/README.md @@ -0,0 +1,9 @@ +# Terminitor plugin + +This plugin adds completions for the [Terminitor](https://github.com/achiurizo/terminitor) development workflow setup tool. + +To use it, add `terminitor` to the plugins array in your zshrc file: + +```zsh +plugins=(... terminitor) +``` diff --git a/zsh/.oh-my-zsh/plugins/thor/README.md b/zsh/.oh-my-zsh/plugins/thor/README.md new file mode 100644 index 0000000..09c705d --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/thor/README.md @@ -0,0 +1,10 @@ +# Thor plugin + +This plugin adds completion for [Thor](http://whatisthor.com/), +a ruby toolkit for building powerful command-line interfaces. + +To use it, add `thor` to the plugins array in your zshrc file: + +```zsh +plugins=(... thor) +``` diff --git a/zsh/.oh-my-zsh/plugins/timer/README.md b/zsh/.oh-my-zsh/plugins/timer/README.md new file mode 100644 index 0000000..321307e --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/timer/README.md @@ -0,0 +1,17 @@ +This plugin allows to display command's execution time in a very nonintrusive way. + +Timer can be tuned by these two variables: +* `TIMER_PRECISION` allows to control number of decimal places (default `1`) +* `TIMER_FORMAT` allows to adjust display format (default `'/%d'`) + +Sample session: + + me@here:~$ sleep 1 /1.0s + me@here:~$ sleep 73 /1m13.0s + me@here:~$ TIMER_FORMAT='[%d]'; TIMER_PRECISION=2 [0.00s] + me@here:~$ head -c50 < /dev/urandom | hexdump + 0000000 b2 16 20 f0 29 1f 61 2d 8a 29 20 8c 8c 39 5a ab + 0000010 21 47 0e f9 ee a4 76 46 71 9e 4f 6b a4 c4 51 cb + 0000020 f9 1f 7e b9 6f 2c ae dd cf 40 6d 64 a8 fb d3 db + 0000030 09 37 + 0000032 [0.02s] diff --git a/zsh/.oh-my-zsh/plugins/timer/timer.plugin.zsh b/zsh/.oh-my-zsh/plugins/timer/timer.plugin.zsh new file mode 100644 index 0000000..231134e --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/timer/timer.plugin.zsh @@ -0,0 +1,29 @@ +__timer_current_time() { + perl -MTime::HiRes=time -e'print time' +} + +__timer_format_duration() { + local mins=$(printf '%.0f' $(($1 / 60))) + local secs=$(printf "%.${TIMER_PRECISION:-1}f" $(($1 - 60 * mins))) + local duration_str=$(echo "${mins}m${secs}s") + local format="${TIMER_FORMAT:-/%d}" + echo "${format//\%d/${duration_str#0m}}" +} + +__timer_save_time_preexec() { + __timer_cmd_start_time=$(__timer_current_time) +} + +__timer_display_timer_precmd() { + if [ -n "${__timer_cmd_start_time}" ]; then + local cmd_end_time=$(__timer_current_time) + local tdiff=$((cmd_end_time - __timer_cmd_start_time)) + unset __timer_cmd_start_time + local tdiffstr=$(__timer_format_duration ${tdiff}) + local cols=$((COLUMNS - ${#tdiffstr} - 1)) + echo -e "\033[1A\033[${cols}C ${tdiffstr}" + fi +} + +preexec_functions+=(__timer_save_time_preexec) +precmd_functions+=(__timer_display_timer_precmd) diff --git a/zsh/.oh-my-zsh/plugins/torrent/README.md b/zsh/.oh-my-zsh/plugins/torrent/README.md new file mode 100644 index 0000000..079aafc --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/torrent/README.md @@ -0,0 +1,13 @@ +# torrent + +This plugin creates a Torrent file based on a [MagnetURI](https://en.wikipedia.org/wiki/Magnet_URI_scheme). + +To use it, add `torrent` to the plugins array in your zshrc file. + +```zsh +plugins=(... torrent) +``` + +## Plugin commands + +* `magnet_to_torrent `: creates Torrent file. diff --git a/zsh/.oh-my-zsh/plugins/tugboat/README.md b/zsh/.oh-my-zsh/plugins/tugboat/README.md new file mode 100644 index 0000000..14f828f --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/tugboat/README.md @@ -0,0 +1,12 @@ +# Tugboat plugin + +This plugin adds autocompletion for Tugboat, a command line tool for interacting with your +[DigitalOcean droplets](https://www.digitalocean.com/products/droplets/). + +To use it, add it to the plugins array in your `~/.zshrc` file: + +```zsh +plugins=(... tugboat) +``` + +Further documentation for Tugboat can be found in the [Tugboat repository](https://github.com/petems/tugboat). diff --git a/zsh/.oh-my-zsh/plugins/ufw/README.md b/zsh/.oh-my-zsh/plugins/ufw/README.md new file mode 100644 index 0000000..ac377cd --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/ufw/README.md @@ -0,0 +1,18 @@ +# UFW plugin + +This plugin adds completion for managing everybody's favorite Uncomplicated Firewall (UFW), +a simple interface for managing iptables. Learn more about [`UFW`](https://wiki.ubuntu.com/UncomplicatedFirewall). + +To use it, add ufw to the plugins array of your zshrc file: +``` +plugins=(... ufw) +``` + +Some of the commands include: + +* `allow /` add an allow rule +* `default` set default policy +* `delete /` delete RULE +* `deny /` add deny rule +* `disable` disables the firewall +* `enable` enables the firewall diff --git a/zsh/.oh-my-zsh/plugins/virtualenvwrapper/README.md b/zsh/.oh-my-zsh/plugins/virtualenvwrapper/README.md new file mode 100644 index 0000000..63eb585 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/virtualenvwrapper/README.md @@ -0,0 +1,38 @@ +# Virtualenvwrapper plugin + +This plugin loads Python's [virtualenvwrapper](https://virtualenvwrapper.readthedocs.io/en/latest/) shell tools. + +To use it, add `virtualenvwrapper` to the plugins array in your zshrc file: + +```zsh +plugins=(... virtualenvwrapper) +``` + +## Usage + +The plugin allows to automatically activate virtualenvs on cd into git repositories with a matching name: + +``` +➜ github $ cd ansible +(ansible) ➜ ansible git:(devel) $ cd docs +(ansible) ➜ docs git:(devel) $ cd .. +(ansible) ➜ ansible git:(devel) $ cd .. +➜ github $ +``` + +We can override this by having a `.venv` file in the directory containing a differently named virtualenv: + +``` +➜ github $ cat ansible/.venv +myvirtualenv +➜ github $ cd ansible +(myvirtualenv) ➜ ansible git:(devel) $ cd .. +➜ github $ +``` + +We can disable this behaviour by setting `DISABLE_VENV_CD=1` before Oh My Zsh is sourced: +```zsh +DISABLE_VENV_CD=1 +plugins=(... virtualenvwrapper) +source $ZSH/oh-my-zsh.sh +``` diff --git a/zsh/.oh-my-zsh/plugins/yii/README.md b/zsh/.oh-my-zsh/plugins/yii/README.md new file mode 100644 index 0000000..f1b72e9 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/yii/README.md @@ -0,0 +1,14 @@ +# Yii plugin + +The plugin adds autocomplete commands and subcommands for [yii](https://www.yiiframework.com/). + +To use it, add `yii` to the plugins array of your zshrc file: +``` +plugins=(... yii) +``` + +## Aliases + +| Alias | Command | +|--------|----------------------| +| yiic | `protected/yiic` | diff --git a/zsh/.oh-my-zsh/themes/pygmalion-virtualenv.zsh-theme b/zsh/.oh-my-zsh/themes/pygmalion-virtualenv.zsh-theme new file mode 100644 index 0000000..ea28e12 --- /dev/null +++ b/zsh/.oh-my-zsh/themes/pygmalion-virtualenv.zsh-theme @@ -0,0 +1,50 @@ +# Yay! High voltage and arrows! + + +function _virtualenv_prompt_info { + if [[ -n "$(whence virtualenv_prompt_info)" ]]; then + if [ -n "$(whence pyenv_prompt_info)" ]; then + if [ "$1" = "inline" ]; then + ZSH_THEME_VIRTUAL_ENV_PROMPT_PREFIX=%{$fg[blue]%}"::%{$fg[red]%}" + ZSH_THEME_VIRTUAL_ENV_PROMPT_SUFFIX="" + virtualenv_prompt_info + fi + [ "$(pyenv_prompt_info)" = "${PYENV_PROMPT_DEFAULT_VERSION}" ] && virtualenv_prompt_info + else + virtualenv_prompt_info + fi + fi +} + +prompt_setup_pygmalion(){ + ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" + ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " + ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}" + ZSH_THEME_GIT_PROMPT_CLEAN="" + + base_prompt='$(_virtualenv_prompt_info)%{$fg[magenta]%}%n%{$reset_color%}%{$fg[cyan]%}@%{$reset_color%}%{$fg[yellow]%}%m%{$reset_color%}%{$fg[red]%}:%{$reset_color%}%{$fg[cyan]%}%0~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}' + post_prompt='%{$fg[cyan]%}⇒%{$reset_color%} ' + + base_prompt_nocolor=$(echo "$base_prompt" | perl -pe "s/%\{[^}]+\}//g") + post_prompt_nocolor=$(echo "$post_prompt" | perl -pe "s/%\{[^}]+\}//g") + + precmd_functions+=(prompt_pygmalion_precmd) +} + +prompt_pygmalion_precmd(){ + local gitinfo=$(git_prompt_info) + local gitinfo_nocolor=$(echo "$gitinfo" | perl -pe "s/%\{[^}]+\}//g") + local exp_nocolor="$(print -P \"$base_prompt_nocolor$gitinfo_nocolor$post_prompt_nocolor\")" + local prompt_length=${#exp_nocolor} + + local nl="" + + if [[ $prompt_length -gt 40 ]]; then + nl=$'\n%{\r%}'; + fi + PROMPT="$base_prompt$gitinfo$nl$post_prompt" +} + +prompt_setup_pygmalion + +