diff options
Diffstat (limited to 'plugins')
77 files changed, 1174 insertions, 146 deletions
diff --git a/plugins/ansible/README.md b/plugins/ansible/README.md new file mode 100644 index 000000000..38bc13775 --- /dev/null +++ b/plugins/ansible/README.md @@ -0,0 +1,35 @@ +# ansible plugin + +## Introduction + +The `ansible plugin` adds several aliases for useful [ansible](https://docs.ansible.com/ansible/latest/index.html) commands and [aliases](#aliases). + +To use it, add `ansible` to the plugins array of your zshrc file: + +``` +plugins=(... ansible) +``` + +## Aliases + +| Command | Description | +|:-------------------------------------------|:--------------------------------------------------------------------| +| `ansible-version` / `aver` | Show the version on ansible installed in this host | +| `ansible-role-init <role name>` / `arinit` | Creates the Ansible Role as per Ansible Galaxy standard | +| `a` | command `ansible` | +| `aconf` | command `ansible-config` | +| `acon` | command `ansible-console` | +| `aconn` | command `ansible-connection` | +| `ainv` | command `ansible-inventory` | +| `aplay` | command `ansible-playbook` | +| `ainv` | command `ansible-inventory` | +| `adoc` | command `ansible-doc` | +| `agal` | command `ansible-galaxy` | +| `apull` | command `ansible-pull` | +| `aval` | command `ansible-vault` | + +## Maintainer + +### [Deepankumar](https://github.com/deepan10) + +[https://github.com/deepan10/oh-my-zsh/tree/features/ansible-plugin](https://github.com/deepan10/oh-my-zsh/tree/features/ansible-plugin) diff --git a/plugins/ansible/ansible.plugin.zsh b/plugins/ansible/ansible.plugin.zsh new file mode 100644 index 000000000..0e7aff528 --- /dev/null +++ b/plugins/ansible/ansible.plugin.zsh @@ -0,0 +1,29 @@ +# Functions +function ansible-version(){ + ansible --version +} + +function ansible-role-init(){ + if ! [ -z $1] ; then + echo "Ansible Role : $1 Creating...." + ansible-galaxy init $1 + tree $1 + else + echo "Usage : ansible-role-init <role name>" + echo "Example : ansible-role-init role1" + fi +} + +# Alias +alias a='ansible ' +alias aconf='ansible-config ' +alias acon='ansible-console ' +alias aconn='ansible-connection ' +alias aver='ansible-version' +alias arinit='ansible-role-init' +alias aplay='ansible-playbook ' +alias ainv='ansible-inventory ' +alias adoc='ansible-doc ' +alias agal='ansible-galaxy ' +alias apull='ansible-pull ' +alias aval='ansible-vault'
\ No newline at end of file diff --git a/plugins/ant/README.md b/plugins/ant/README.md new file mode 100644 index 000000000..5f88984ac --- /dev/null +++ b/plugins/ant/README.md @@ -0,0 +1,12 @@ +# Ant + +This plugin provides completion for [Ant](https://ant.apache.org/). + +To use it add ant to the plugins array in your zshrc file. + +```bash +plugins=(... ant) +``` + +It caches ant targets in a file named `.ant_targets`, you might want to add that to +your `.gitignore` file. diff --git a/plugins/aws/README.md b/plugins/aws/README.md new file mode 100644 index 000000000..8a45199b8 --- /dev/null +++ b/plugins/aws/README.md @@ -0,0 +1,20 @@ +# aws + +This plugin provides completion support for [awscli](https://docs.aws.amazon.com/cli/latest/reference/index.html) +and a few utilities to manage AWS profiles: a function to change profiles with autocompletion support +and a function to get the current AWS profile. The current AWS profile is also displayed in `RPROMPT`. + +To use it, add `aws` to the plugins array in your zshrc file. + +```zsh +plugins=(... aws) +``` + +## Plugin commands + +* `asp <profile>`: Sets `AWS_PROFILE` and `AWS_DEFAULT_PROFILE` (legacy) to `<profile>`. +It also adds it to your RPROMPT. + +* `agp`: Gets the current value of `AWS_PROFILE`. + +* `aws_profiles`: Lists the available profiles in the file referenced in `AWS_CONFIG_FILE` (default: ~/.aws/config). Used to provide completion for the `asp` function. diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index 183b0f226..af27e669a 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -21,10 +21,8 @@ _awscli-homebrew-installed() { [ -r $_brew_prefix/libexec/bin/aws_zsh_completer.sh ] &> /dev/null } -export AWS_HOME=~/.aws - function agp { - echo $AWS_DEFAULT_PROFILE + echo $AWS_PROFILE } function asp { @@ -33,11 +31,11 @@ function asp { export AWS_DEFAULT_PROFILE=$1 export AWS_PROFILE=$1 - export RPROMPT="<aws:$AWS_DEFAULT_PROFILE>$rprompt" + export RPROMPT="<aws:$AWS_PROFILE>$rprompt" } function aws_profiles { - reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_\.-]*\).*/\1/')) + reply=($(grep '\[profile' "${AWS_CONFIG_FILE:-$HOME/.aws/config}"|sed -e 's/.*profile \([a-zA-Z0-9_\.-]*\).*/\1/')) } compctl -K aws_profiles asp diff --git a/plugins/battery/README.md b/plugins/battery/README.md new file mode 100644 index 000000000..b7a13a7ec --- /dev/null +++ b/plugins/battery/README.md @@ -0,0 +1,13 @@ +# Battery Plugin + +This plugin adds some functions you can use to display battery information in your custom theme. + +To use, add `battery` to the list of plugins in your `.zshrc` file: + +`plugins=(... battery)` + +Then, add the `battery_pct_prompt` function to your custom theme. For example: + +``` +RPROMPT='$(battery_pct_prompt)' +``` diff --git a/plugins/bwana/README.md b/plugins/bwana/README.md new file mode 100644 index 000000000..8cbeaa32e --- /dev/null +++ b/plugins/bwana/README.md @@ -0,0 +1,9 @@ +# Bwana + +This plugin provides a function to open `man` pages directly with [Bwana](https://www.bruji.com/bwana/). + +To use it add bwana to the plugins array in your zshrc file. + +```bash +plugins=(... bwana) +``` diff --git a/plugins/cabal/README.md b/plugins/cabal/README.md new file mode 100644 index 000000000..b1106c40f --- /dev/null +++ b/plugins/cabal/README.md @@ -0,0 +1,9 @@ +# Cabal + +This plugin provides completion for [Cabal](https://www.haskell.org/cabal/), a build tool for Haskell. It +also provides a function `cabal_sandbox_info` that prints whether the current working directory is in a sandbox. + +To use it, add cabal to the plugins array of your zshrc file: +``` +plugins=(... cabal) +``` diff --git a/plugins/cake/README.md b/plugins/cake/README.md new file mode 100644 index 000000000..aad92a3ec --- /dev/null +++ b/plugins/cake/README.md @@ -0,0 +1,15 @@ +# Cake + +This plugin provides completion for [CakePHP](https://cakephp.org/). + +To use it add cake to the plugins array in your zshrc file. + +```bash +plugins=(... cake) +``` + +## Note + +This plugin generates a cache file of the cake tasks found, named `.cake_task_cache`, in the current working directory. +It is regenerated when the Cakefile is newer than the cache file. It is advised that you add the cake file to your +`.gitignore` files. diff --git a/plugins/capistrano/README.md b/plugins/capistrano/README.md new file mode 100644 index 000000000..335b794fa --- /dev/null +++ b/plugins/capistrano/README.md @@ -0,0 +1,14 @@ +# Capistrano + +This plugin provides completion for [Capistrano](https://capistranorb.com/). + +To use it add capistrano to the plugins array in your zshrc file. + +```bash +plugins=(... capistrano) +``` + +For a working completion use the `capit` command instead of `cap`, because cap is a +[reserved word in zsh](http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fcap-Module). + +`capit` automatically runs cap with bundler if a Gemfile is found. diff --git a/plugins/capistrano/capistrano.plugin.zsh b/plugins/capistrano/capistrano.plugin.zsh index 0b5559791..819572825 100644 --- a/plugins/capistrano/capistrano.plugin.zsh +++ b/plugins/capistrano/capistrano.plugin.zsh @@ -1,7 +1,7 @@ -# Added `shipit` because `cap` is a reserved word. `cap` completion doesn't work. +# Added `capit` because `cap` is a reserved word. `cap` completion doesn't work. # http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fcap-Module -func capit() { +function capit() { if [ -f Gemfile ] then bundle exec cap $* diff --git a/plugins/celery/README.md b/plugins/celery/README.md new file mode 100644 index 000000000..d2597f702 --- /dev/null +++ b/plugins/celery/README.md @@ -0,0 +1,9 @@ +# Celery + +This plugin provides completion for [Celery](http://www.celeryproject.org/). + +To use it add celery to the plugins array in your zshrc file. + +```bash +plugins=(... celery) +``` diff --git a/plugins/cloudfoundry/README.md b/plugins/cloudfoundry/README.md new file mode 100644 index 000000000..89dd9d1ce --- /dev/null +++ b/plugins/cloudfoundry/README.md @@ -0,0 +1,58 @@ +# Cloudfoundry Plugin + +This plugin is intended to offer a few simple aliases for regular users of the [Cloud Foundry Cli][1]. Most are just simple aliases that will save a bit of typing. Others include mini functions and or accept parameters. Take a look at the table below for details. + +| Alias | Command | Description | +|----------|-----------------------------|--------------------------------------------------------------------------| +| cfl | `cf login` | Login to Cloud Foundry | +| cft | `cf target` | Target the cli at a specific Org/Space in Cloud Foundry | +| cfa | `cf apps` | List all applications in the current Org/Space | +| cfs | `cf services` | List all services in the current Org/Space | +| cfm | `cf marketplace` | List the services available in the Marketplace | +| cfp | `cf push` | Push your application code to Cloud Foundry | +| cfcs | `cf create-service` | Create a service based on a Marketplace offering | +| cfbs | `cf bind-service` | Bind an application to a service you created | +| cfus | `cf unbind-service` | Unbind a service from an application | +| cfds | `cf delete-service` | Delete a service you no longer have bound | +| cfup | `cf cups` | Create a "user-provided-service" | +| cflg | `cf logs` | Tail the logs of an application (requires <APP_NAME>) | +| cfr | `cf routes` | List all the routes in the current Space | +| cfe | `cf env` | Show the environment variables for an application (requires <APP_NAME>) | +| cfsh | `cf ssh` | Attach to a running container (requires an <APP_NAME> etc.) | +| cfsc | `cf scale` | Scale an application (requires an <APP_NAME> etc.) | +| cfev | `cf events` | Show the application events (requires <APP_NAME>) | +| cfdor | `cf delete-orphaned-routes` | Delete routes that are no longer bound to applications | +| cfbpk | `cf buildpacks` | List the available buildpacks | +| cfdm | `cf domains` | List the domains associates with this Cloud Foundry foundation | +| cfsp | `cf spaces` | List all the Spaces in the current Org | +| cfap | `cf app` | Show the details of a deployed application (requires <APP_NAME>) | +| cfh. | `export CF_HOME=$PWD/.cf` | Set the current directory as CF_HOME | +| cfh~ | `export CF_HOME=~/.cf` | Set the user's root directory as CF_HOME | +| cfhu | `unset CF_HOME` | Unsets CF_HOME | +| cfpm | `cf push -f` | Push an application using a manifest (requires <MANIFEST_FILE> location) | +| cflr | `cf logs --recent` | Show the recent logs (requires <APP_NAME>) | +| cfsrt | `cf start` | Start an application (requires <APP_NAME>) | +| cfstp | `cf stop` | Stop an application (requires <APP_NAME>) | +| cfstg | `cf restage` | Restage an application (requires <APP_NAME>) | +| cfdel | `cf delete` | Delete an application (requires <APP_NAME>) | +| cfsrtall | - | Start all apps that are currently in the "Stopped" state | +| cfstpall | - | Stop all apps that are currently in the "Started" state | + +For help and advice on what any of the commands does, consult the built in `cf` help functions as follows:- + +```bash +cf help # List the most popular and commonly used commands +cf help -a # Complete list of all possible commands +cf <COMMAND_NAME> --help # Help on a specific command including arguments and examples +``` + +Alternatively, seek out the [online documentation][3]. And don't forget, there are loads of great [community plugins for the cf-cli][4] command line tool that can greatly extend its power and usefulness. + +## Contributors + +Contributed to `oh_my_zsh` by [benwilcock][2]. + +[1]: https://docs.cloudfoundry.org/cf-cli/install-go-cli.html +[2]: https://github.com/benwilcock +[3]: https://docs.cloudfoundry.org/cf-cli/getting-started.html +[4]: https://plugins.cloudfoundry.org/ diff --git a/plugins/cloudfoundry/cloudfoundry.plugin.zsh b/plugins/cloudfoundry/cloudfoundry.plugin.zsh new file mode 100644 index 000000000..b6715787e --- /dev/null +++ b/plugins/cloudfoundry/cloudfoundry.plugin.zsh @@ -0,0 +1,34 @@ +# Some Useful CloudFoundry Aliases & Functions +alias cfl="cf login" +alias cft="cf target" +alias cfa="cf apps" +alias cfs="cf services" +alias cfm="cf marketplace" +alias cfp="cf push" +alias cfcs="cf create-service" +alias cfbs="cf bind-service" +alias cfus="cf unbind-service" +alias cfds="cf delete-service" +alias cfup="cf cups" +alias cflg="cf logs" +alias cfr="cf routes" +alias cfe="cf env" +alias cfsh="cf ssh" +alias cfsc="cf scale" +alias cfev="cf events" +alias cfdor="cf delete-orphaned-routes" +alias cfbpk="cf buildpacks" +alias cfdm="cf domains" +alias cfsp="cf spaces" +function cfap() { cf app $1 } +function cfh.() { export CF_HOME=$PWD/.cf } +function cfh~() { export CF_HOME=~/.cf } +function cfhu() { unset CF_HOME } +function cfpm() { cf push -f $1 } +function cflr() { cf logs $1 --recent } +function cfsrt() { cf start $1 } +function cfstp() { cf stop $1 } +function cfstg() { cf restage $1 } +function cfdel() { cf delete $1 } +function cfsrtall() {cf apps | awk '/stopped/ { system("cf start " $1)}'} +function cfstpall() {cf apps | awk '/started/ { system("cf stop " $1)}'} diff --git a/plugins/colorize/README.md b/plugins/colorize/README.md new file mode 100644 index 000000000..c006071f9 --- /dev/null +++ b/plugins/colorize/README.md @@ -0,0 +1,18 @@ +# colorize + +With this plugin you can syntax-highlight file contents of over 300 supported languages and other text formats. + +To use it, add colorize to the plugins array of your zshrc file: +``` +plugins=(... colorize) +``` + +## Usage + +* `ccat <file> [files]`: colorize the contents of the file (or files, if more than one are provided). If no arguments are passed it will colorize the standard input or stdin. + +Colorize will highlight the content based on the filename extension. If it can't find a syntax-highlighting method for a given extension, it will try to find one by looking at the file contents. If no highlight method is found it will just cat the file normally, without syntax highlighting. + +## Requirements + +You have to install Pygments first: [pygments.org](http://pygments.org/download/) diff --git a/plugins/colorize/colorize.plugin.zsh b/plugins/colorize/colorize.plugin.zsh index e2af6d25e..8eede9a94 100644 --- a/plugins/colorize/colorize.plugin.zsh +++ b/plugins/colorize/colorize.plugin.zsh @@ -1,9 +1,4 @@ -# Plugin for highlighting file content -# Plugin highlights file content based on the filename extension. -# If no highlighting method supported for given extension then it tries -# guess it by looking for file content. - -#easier alias to use plugin +# easier alias to use the plugin alias ccat='colorize_via_pygmentize' colorize_via_pygmentize() { @@ -12,16 +7,20 @@ colorize_via_pygmentize() { return 1 fi + # pygmentize stdin if no arguments passed if [ $# -eq 0 ]; then - pygmentize -g $@ + pygmentize -g + return $? fi + # guess lexer from file extension, or + # guess it from file contents if unsuccessful + local FNAME lexer for FNAME in $@ do - filename=$(basename "$FNAME") - lexer=`pygmentize -N \"$filename\"` - if [ "Z$lexer" != "Ztext" ]; then - pygmentize -l $lexer "$FNAME" + lexer=$(pygmentize -N "$FNAME") + if [[ $lexer != text ]]; then + pygmentize -l "$lexer" "$FNAME" else pygmentize -g "$FNAME" fi diff --git a/plugins/command-not-found/README.md b/plugins/command-not-found/README.md new file mode 100644 index 000000000..df62d1f07 --- /dev/null +++ b/plugins/command-not-found/README.md @@ -0,0 +1,31 @@ +# command-not-found plugin + +This plugin uses the command-not-found package for zsh to provide suggested packages to be installed if a command cannot be found. + +To use it, add `command-not-found` to the plugins array of your zshrc file: + +```zsh +plugins=(... command-not-found) +``` + +An example of how this plugin works in Ubuntu: +``` +$ mutt +The program 'mutt' can be found in the following packages: + * mutt + * mutt-kz + * mutt-patched +Try: sudo apt install <selected package> +``` + +### Supported platforms + +It works out of the box with the command-not-found packages for: + +- [Ubuntu](https://www.porcheron.info/command-not-found-for-zsh/) +- [Debian](https://packages.debian.org/search?keywords=command-not-found) +- [Arch Linux](https://wiki.archlinux.org/index.php/Pkgfile#Command_not_found) +- [macOS (Homebrew)](https://github.com/Homebrew/homebrew-command-not-found) +- [Fedora](https://fedoraproject.org/wiki/Features/PackageKitCommandNotFound) + +You can add support for other platforms by submitting a Pull Request. diff --git a/plugins/composer/README.md b/plugins/composer/README.md new file mode 100644 index 000000000..2b4bae579 --- /dev/null +++ b/plugins/composer/README.md @@ -0,0 +1,29 @@ +# composer + +This plugin provides completion for [composer](https://getcomposer.org/), as well as aliases +for frequent composer commands. It also adds Composer's global binaries to the PATH, using +Composer if available. + +To use it add `composer` to the plugins array in your zshrc file. + +```zsh +plugins=(... composer) +``` + +## Aliases + +| Alias | Command | Description | +| ------ | -------------------------------------------- | -------------------------------------------------------------------------------------- | +| `c` | composer | Starts composer | +| `csu` | composer self-update | Updates composer to the latest version | +| `cu` | composer update | Updates composer dependencies and `composer.lock` file | +| `cr` | composer require | Adds new packages to `composer.json` | +| `crm` | composer remove | Removes packages from `composer.json` | +| `ci` | composer install | Resolves and installs dependencies from `composer.json` | +| `ccp` | composer create-project | Create new project from an existing package | +| `cdu` | composer dump-autoload | Updates the autoloader | +| `cdo` | composer dump-autoload --optimize-autoloader | Converts PSR-0/4 autoloading to classmap for a faster autoloader (good for production) | +| `cgu` | composer global update | Allows update command to run on COMPOSER_HOME directory | +| `cgr` | composer global require | Allows require command to run on COMPOSER_HOME directory | +| `cgrm` | composer global remove | Allows remove command to run on COMPOSER_HOME directory | +| `cget` | `curl -s https://getcomposer.org/installer` | Installs composer in the current directory | diff --git a/plugins/cpanm/README.md b/plugins/cpanm/README.md new file mode 100644 index 000000000..3803e3e00 --- /dev/null +++ b/plugins/cpanm/README.md @@ -0,0 +1,9 @@ +# Cpanm + +This plugin provides completion for [Cpanm](https://github.com/miyagawa/cpanminus) ([docs](https://metacpan.org/pod/App::cpanminus)). + +To use it add cpanm to the plugins array in your zshrc file. + + ```bash +plugins=(... cpanm) +``` diff --git a/plugins/cpanm/_cpanm b/plugins/cpanm/_cpanm index 58451d35a..ff9ae1c15 100644 --- a/plugins/cpanm/_cpanm +++ b/plugins/cpanm/_cpanm @@ -6,9 +6,6 @@ # # Current supported cpanm version: 1.4000 (Tue Mar 8 01:00:49 PST 2011) # -# The latest code is always located at: -# https://github.com/rshhh/cpanminus/blob/master/etc/_cpanm -# local arguments curcontext="$curcontext" typeset -A opt_args diff --git a/plugins/debian/README.md b/plugins/debian/README.md new file mode 100644 index 000000000..a676674dc --- /dev/null +++ b/plugins/debian/README.md @@ -0,0 +1,75 @@ +# debian + +This plugin provides debian related zsh aliases. +To use it add `debian` to the plugins array in your zshrc file. + +```zsh +plugins=(... debian) +``` + +## Common Aliases + +| Alias | Command | Description | +| -------- | ------------------------------------------------------------------------------|--------------------------------------------------------------------------- | +| `age` | apt-get | Command line tool for handling packages | +| `api` | aptitude | Same functionality as `apt-get`, provides extra options while installation | +| `acs` | apt-cache search | Command line tool for searching apt software package cache | +| `aps` | aptitude search | Searches installed packages using aptitude | +| `as` | aptitude -F \"* %p -> %d \n(%v/%V)\" \ -no-gui --disable-columns search | - | +| `afs` | apt-file search --regexp | Search file in packages | +| `asrc` | apt-get source | Fetch source packages through `apt-get` | +| `app` | apt-cache policy | Displays priority of package sources | + +## Superuser Operations Aliases + +| Alias | Command | Description | +| -------- | -------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------- | +| `aac` | sudo $apt_pref autoclean | Clears out the local repository of retrieved package files | +| `abd` | sudo $apt_pref build-dep | Installs all dependencies for building packages | +| `ac` | sudo $apt_pref clean | Clears out the local repository of retrieved package files except lock files | +| `ad` | sudo $apt_pref update | Updates the package lists for upgrades for packages | +| `adg` | sudo $apt_pref update && sudo $apt_pref $apt_upgr | Update and upgrade packages | +| `adu` | sudo $apt_pref update && sudo $apt_pref dist-upgrade | Smart upgrade that handles dependencies | +| `afu` | sudo apt-file update | Update the files in packages | +| `au` | sudo $apt_pref $apt_upgr | - | +| `ai` | sudo $apt_pref install | Command-line tool to install package | +| `ail` | sed -e 's/ */ /g' -e 's/ *//' | cut -s -d ' ' -f 1 | "' xargs sudo $apt_pref install | Install all packages given on the command line while using only the first word of each line | +| `ap` | sudo $apt_pref purge | Removes packages along with configuration files | +| `ar` | sudo $apt_pref remove | Removes packages, keeps the configuration files | +| `ads` | sudo apt-get dselect-upgrade | Installs packages from list and removes all not in the list | +| `dia` | sudo dpkg -i ./*.deb | Install all .deb files in the current directory | +| `di` | sudo dpkg -i | Install all .deb files in the current directory | +| `kclean` | sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) ?not(~n`uname -r`)) | Remove ALL kernel images and headers EXCEPT the one in use | + +- `$apt_pref` - Use apt or aptitude if installed, fallback is apt-get. +- `$apt_upgr` - Use upgrade. + +## Aliases - Commands using `su` + +| Alias | Command | +| -------- | ------------------------------------------------------------------------------| +| `aac` | su -ls \'$apt_pref autoclean\' root | +| `ac` | su -ls \'$apt_pref clean\' root | +| `ad` | su -lc \'$apt_pref update\' root | +| `adg` | su -lc \'$apt_pref update && aptitude $apt_upgr\' root | +| `adu` | su -lc \'$apt_pref update && aptitude dist-upgrade\' root | +| `afu` | su -lc "apt-file update | +| `ag` | su -lc \'$apt_pref $apt_upgr\' root | +| `dia` | su -lc "dpkg -i ./*.deb" root | + +## Miscellaneous Aliases + +| Alias | Command | Description | +| -------- | -------------------------------------------------|---------------------------------------- | +| `allpkgs`| aptitude search -F "%p" --disable-columns ~i | Display all installed packages | +| `mydeb` | time dpkg-buildpackage -rfakeroot -us -uc | Create a basic .deb package | + +## Functions + +| Fucntion | Description | +|-----------------------|-------------------------------------------------------------------------------| +| `apt-copy` | Create a simple script that can be used to 'duplicate' a system | +| `apt-history` | Displays apt history for a command | +| `kerndeb` | Builds kernel packages | +| `apt-list-packages` | List packages by size | + diff --git a/plugins/dirpersist/README.md b/plugins/dirpersist/README.md new file mode 100644 index 000000000..9880bc563 --- /dev/null +++ b/plugins/dirpersist/README.md @@ -0,0 +1,9 @@ +# Dirpersist plugin + +This plugin keeps a running tally of the previous 20 unique directories in the $HOME/.zdirs file. When you cd to a new directory, it is prepended to the beginning of the file. + +To use it, add `dirpersist` to the plugins array in your zshrc file: + +```zsh +plugins=(... dirpersist) +``` diff --git a/plugins/docker/_docker b/plugins/docker/_docker index 31b83c777..54b5e59c5 100644 --- a/plugins/docker/_docker +++ b/plugins/docker/_docker @@ -1,6 +1,6 @@ #compdef docker dockerd # -# zsh completion for docker (https://docker.com) +# zsh completion for docker (http://docker.com) # # version: 0.3.0 # github: https://github.com/felixr/docker-zsh-completion @@ -617,6 +617,7 @@ __docker_container_subcommand() { "($help)*--dns=[Custom DNS servers]:DNS server: " "($help)*--dns-option=[Custom DNS options]:DNS option: " "($help)*--dns-search=[Custom DNS search domains]:DNS domains: " + "($help)*--domainname=[Container NIS domain name]:domainname:_hosts" "($help)*"{-e=,--env=}"[Environment variables]:environment variable: " "($help)--entrypoint=[Overwrite the default entrypoint of the image]:entry point: " "($help)*--env-file=[Read environment variables from a file]:environment file:_files" @@ -2214,7 +2215,7 @@ __docker_stack_subcommand() { _arguments $(__docker_arguments) \ $opts_help \ "($help)--bundle-file=[Path to a Distributed Application Bundle file]:dab:_files -g \"*.dab\"" \ - "($help -c --compose-file)"{-c=,--compose-file=}"[Path to a Compose file]:compose file:_files -g \"*.(yml|yaml)\"" \ + "($help -c --compose-file)"{-c=,--compose-file=}"[Path to a Compose file, or '-' to read from stdin]:compose file:_files -g \"*.(yml|yaml)\"" \ "($help)--with-registry-auth[Send registry authentication details to Swarm agents]" \ "($help -):stack:__docker_complete_stacks" && ret=0 ;; @@ -2285,6 +2286,9 @@ __docker_swarm_subcommand() { $opts_help \ "($help)--advertise-addr=[Advertised address]:ip\:port: " \ "($help)--data-path-addr=[Data path IP or interface]:ip " \ + "($help)--data-path-port=[Data Path Port]:port " \ + "($help)--default-addr-pool=[Default address pool]" \ + "($help)--default-addr-pool-mask-length=[Default address pool subnet mask length]" \ "($help)--autolock[Enable manager autolocking]" \ "($help)--availability=[Availability of the node]:availability:(active drain pause)" \ "($help)--cert-expiry=[Validity period for node certificates]:duration: " \ diff --git a/plugins/doctl/README.md b/plugins/doctl/README.md new file mode 100644 index 000000000..a81e90b0a --- /dev/null +++ b/plugins/doctl/README.md @@ -0,0 +1,9 @@ +# Doctl + +This plugin provides completion for [Doctl](https://github.com/digitalocean/doctl). + +To use it add doctl to the plugins array in your zshrc file. + +```bash +plugins=(... doctl) +``` diff --git a/plugins/extract/README.md b/plugins/extract/README.md index c6bdd36dd..83b878c32 100644 --- a/plugins/extract/README.md +++ b/plugins/extract/README.md @@ -19,6 +19,7 @@ plugins=(... extract) | `7z` | 7zip file | | `Z` | Z archive (LZW) | | `apk` | Android app file | +| `aar` | Android library file | | `bz2` | Bzip2 file | | `deb` | Debian package | | `gz` | Gzip file | diff --git a/plugins/extract/_extract b/plugins/extract/_extract index 3baefa339..33d49fcc5 100644 --- a/plugins/extract/_extract +++ b/plugins/extract/_extract @@ -3,5 +3,5 @@ _arguments \ '(-r --remove)'{-r,--remove}'[Remove archive.]' \ - "*::archive file:_files -g '(#i)*.(7z|Z|apk|bz2|deb|gz|ipsw|jar|lzma|rar|sublime-package|tar|tar.bz2|tar.gz|tar.xz|tar.zma|tbz|tbz2|tgz|tlz|txz|war|whl|xpi|xz|zip)(-.)'" \ + "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lzma|rar|sublime-package|tar|tar.bz2|tar.gz|tar.xz|tar.zma|tbz|tbz2|tgz|tlz|txz|war|whl|xpi|xz|zip)(-.)'" \ && return 0 diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index 4c72ce870..5e9b9ff24 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -46,7 +46,7 @@ extract() { (*.xz) unxz "$1" ;; (*.lzma) unlzma "$1" ;; (*.z) uncompress "$1" ;; - (*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.whl) unzip "$1" -d $extract_dir ;; + (*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;; (*.rar) unrar x -ad "$1" ;; (*.7z) 7za x "$1" ;; (*.deb) diff --git a/plugins/fabric/README.md b/plugins/fabric/README.md new file mode 100644 index 000000000..cf0fa81f4 --- /dev/null +++ b/plugins/fabric/README.md @@ -0,0 +1,9 @@ +# Fabric + +This plugin provides completion for [Fabric](https://www.fabfile.org/). + +To use it add fabric to the plugins array in your zshrc file. + +```bash +plugins=(... fabric) +``` diff --git a/plugins/fabric/fabric.plugin.zsh b/plugins/fabric/fabric.plugin.zsh index aca411329..e69de29bb 100644 --- a/plugins/fabric/fabric.plugin.zsh +++ b/plugins/fabric/fabric.plugin.zsh @@ -1 +0,0 @@ -# DECLARION: This plugin was created by vhbit. What I did is just making a portal from https://github.com/vhbit/fabric-zsh-autocomplete. diff --git a/plugins/git-flow-avh/README.md b/plugins/git-flow-avh/README.md new file mode 100644 index 000000000..0768d93ea --- /dev/null +++ b/plugins/git-flow-avh/README.md @@ -0,0 +1,19 @@ +# git-flow (AVH Edition) plugin + +This plugin adds completion for the [git-flow (AVH Edition)](https://github.com/petervanderdoes/gitflow-avh). +The AVH Edition of the git extensions that provides high-level repository operations for [Vincent Driessen's branching model](https://nvie.com/posts/a-successful-git-branching-model/). + +To use it, add `git-flow-avh` to the plugins array in your zshrc file: + +```zsh +plugins=(... git-flow-avh) +``` + +## Requirements + +1. The git-flow tool has to be [installed](https://github.com/petervanderdoes/gitflow-avh#installing-git-flow) + separately. + +2. You have to use zsh's git completion instead of the git project's git completion. This is typically + done by default so you don't need to do anything else. If you installed git with Homebrew you + might have to uninstall the git completion it's bundled with. diff --git a/plugins/git-flow-avh/git-flow-avh.plugin.zsh b/plugins/git-flow-avh/git-flow-avh.plugin.zsh index db8b5ff89..860ca55c5 100644 --- a/plugins/git-flow-avh/git-flow-avh.plugin.zsh +++ b/plugins/git-flow-avh/git-flow-avh.plugin.zsh @@ -1,25 +1,3 @@ -#!zsh -# -# Installation -# ------------ -# -# To achieve git-flow completion nirvana: -# -# 0. Update your zsh's git-completion module to the newest version. -# From here: https://github.com/zsh-users/zsh/blob/master/Completion/Unix/Command/_git -# -# 1. Install this file. Either: -# -# a. Place it in your .zshrc: -# -# b. Or, copy it somewhere (e.g. ~/.git-flow-completion.zsh) and put the following line in -# your .zshrc: -# -# source ~/.git-flow-completion.zsh -# -# c. Or, use this file as a oh-my-zsh plugin. -# - _git-flow () { local curcontext="$curcontext" state line diff --git a/plugins/git-hubflow/README.md b/plugins/git-hubflow/README.md new file mode 100644 index 000000000..dada60d78 --- /dev/null +++ b/plugins/git-hubflow/README.md @@ -0,0 +1,24 @@ +# git-hubflow plugin + +This plugin adds completion for [HubFlow](https://datasift.github.io/gitflow/) (GitFlow for GitHub), as well as some +aliases for common commands. HubFlow is a git extension to make it easy to use GitFlow with GitHub. Based on the +original gitflow extension for git. + +The hubflow tool has to be [installed](https://github.com/datasift/gitflow#installation) separately. + +To use it, add `git-hubflow` to the plugins array in your zshrc file: + +```zsh +plugins=(... git-hubflow) +``` + +## Aliases + +| Alias | Command | Description | +|-------|------------------|------------------------------------------------------------------| +| ghf | `git hf` | Print command overview | +| ghff | `git hf feature` | Manage your feature branches | +| ghfr | `git hf release` | Manage your release branches | +| ghfh | `git hf hotfix` | Manage your hotfix branches | +| ghfs | `git hf support` | Manage your support branches | +| ghfu | `git hf update` | Pull upstream changes down into your master and develop branches | diff --git a/plugins/git-hubflow/git-hubflow.plugin.zsh b/plugins/git-hubflow/git-hubflow.plugin.zsh index 8d968229f..05479f7e6 100644 --- a/plugins/git-hubflow/git-hubflow.plugin.zsh +++ b/plugins/git-hubflow/git-hubflow.plugin.zsh @@ -1,25 +1,3 @@ -#!zsh -# -# Installation -# ------------ -# -# To achieve git-hubflow completion nirvana: -# -# 0. Update your zsh's git-completion module to the newest version. -# From here: https://github.com/zsh-users/zsh/blob/master/Completion/Unix/Command/_git -# -# 1. Install this file. Either: -# -# a. Place it in your .zshrc: -# -# b. Or, copy it somewhere (e.g. ~/.git-hubflow-completion.zsh) and put the following line in -# your .zshrc: -# -# source ~/.git-hubflow-completion.zsh -# -# c. Or, use this file as an oh-my-zsh plugin. -# - alias ghf='git hf' alias ghff='git hf feature' alias ghfr='git hf release' diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 45a706173..12400ede4 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -112,8 +112,8 @@ ggf() { git push --force origin "${b:=$1}" } ggfl() { -[[ "$#" != 1 ]] && local b="$(git_current_branch)" -git push --force-with-lease origin "${b:=$1}" + [[ "$#" != 1 ]] && local b="$(git_current_branch)" + git push --force-with-lease origin "${b:=$1}" } compdef _git ggf=git-checkout @@ -155,10 +155,10 @@ compdef _git ggu=git-checkout alias ggpur='ggu' compdef _git ggpur=git-checkout -alias ggpull='git pull origin $(git_current_branch)' +alias ggpull='git pull origin "$(git_current_branch)"' compdef _git ggpull=git-checkout -alias ggpush='git push origin $(git_current_branch)' +alias ggpush='git push origin "$(git_current_branch)"' compdef _git ggpush=git-checkout alias ggsup='git branch --set-upstream-to=origin/$(git_current_branch)' diff --git a/plugins/gitignore/README.md b/plugins/gitignore/README.md new file mode 100644 index 000000000..753dd31fd --- /dev/null +++ b/plugins/gitignore/README.md @@ -0,0 +1,17 @@ +# gitignore + +This plugin enables you the use of [gitignore.io](https://www.gitignore.io/) from the command line. You need an active internet connection. + +To use it, add `gitignore` to the plugins array in your zshrc file: + +```zsh +plugins=(... gitignore) +``` + +## Plugin commands + +* `gi list`: List all the currently supported gitignore.io templates. + +* `gi [TEMPLATENAME]`: Show git-ignore output on the command line, e.g. `gi java` to exclude class and package files. + +* `gi [TEMPLATENAME] >> .gitignore`: Appending programming language settings to your projects .gitignore. diff --git a/plugins/golang/golang.plugin.zsh b/plugins/golang/golang.plugin.zsh index 919c98629..8284ab83c 100644 --- a/plugins/golang/golang.plugin.zsh +++ b/plugins/golang/golang.plugin.zsh @@ -126,6 +126,7 @@ __go_tool_complete() { ;; help) _values "${commands[@]}" \ + 'environment[show Go environment variables available]' \ 'gopath[GOPATH environment variable]' \ 'packages[description of package lists]' \ 'remote[remote import path syntax]' \ diff --git a/plugins/gpg-agent/README.md b/plugins/gpg-agent/README.md new file mode 100644 index 000000000..a9711f923 --- /dev/null +++ b/plugins/gpg-agent/README.md @@ -0,0 +1,8 @@ +# gpg-agent + +Enables [GPG's gpg-agent](https://www.gnupg.org/documentation/manuals/gnupg/) if it is not running. + +To use it, add gpg-agent to the plugins array of your zshrc file: +``` +plugins=(... gpg-agent) +``` diff --git a/plugins/grails/README.md b/plugins/grails/README.md new file mode 100644 index 000000000..64b4a9f07 --- /dev/null +++ b/plugins/grails/README.md @@ -0,0 +1,71 @@ +# Grails plugin + +This plugin adds completion for the [Grails 2 CLI](https://grails.github.io/grails2-doc/2.5.x/guide/commandLine.html) + +To use it, add `grails` to the plugins array in your zshrc file: + +```zsh +plugins=(... grails) +``` + +It looks for scripts in the following paths: + +- `$GRAILS_HOME/scripts` +- `~/.grails/scripts` +- `./scripts` +- `./plugins/*/scripts` + +## Grails Commands +- `add-proxy` +- `alias` +- `bootstrap` +- `bug-report` +- `clean` +- `clean-all` +- `clear-proxy` +- `compile` +- `console` +- `create-app` +- `create-controller` +- `create-domain-class` +- `create-filters` +- `create-integration-test` +- `create-multi-project-build` +- `create-plugin` +- `create-pom` +- `create-script` +- `create-service` +- `create-tag-lib` +- `create-unit-test` +- `dependency-report` +- `doc` +- `help` +- `init` +- `install-app-templates` +- `install-dependency` +- `install-plugin` +- `install-templates` +- `integrate-with` +- `interactive` +- `list-plugin-updates` +- `list-plugins` +- `migrate-docs` +- `package` +- `package-plugin` +- `plugin-info` +- `refresh-dependencies` +- `remove-proxy` +- `run-app` +- `run-script` +- `run-war` +- `set-grails-version` +- `set-proxy` +- `set-version` +- `shell` +- `stats` +- `stop-app` +- `test-app` +- `uninstall-plugin` +- `url-mappings-report` +- `war` +- `wrapper` diff --git a/plugins/helm/README.md b/plugins/helm/README.md new file mode 100644 index 000000000..49844c78f --- /dev/null +++ b/plugins/helm/README.md @@ -0,0 +1,9 @@ +# Helm plugin + +This plugin adds completion for [Helm](https://helm.sh/), the Kubernetes package manager. + +To use it, add `helm` to the plugins array in your zshrc file: + +```zsh +plugins=(... helm) +``` diff --git a/plugins/heroku/README.md b/plugins/heroku/README.md new file mode 100644 index 000000000..2bf92c9de --- /dev/null +++ b/plugins/heroku/README.md @@ -0,0 +1,9 @@ +# Heroku + +This plugin provides completion for the [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli). + +To use it add heroku to the plugins array in your zshrc file: + +```bash +plugins=(... heroku) +``` diff --git a/plugins/homestead/README.md b/plugins/homestead/README.md new file mode 100644 index 000000000..476302371 --- /dev/null +++ b/plugins/homestead/README.md @@ -0,0 +1,9 @@ +# Homestead + +This plugin provides completion for [Homestead](https://laravel.com/docs/homestead). + +To use it add homestead to the plugins array in your zshrc file. + +```bash +plugins=(... homestead) +``` diff --git a/plugins/jake-node/README.md b/plugins/jake-node/README.md new file mode 100644 index 000000000..78ca8d85f --- /dev/null +++ b/plugins/jake-node/README.md @@ -0,0 +1,9 @@ +# Jake + +This plugin provides completion for [Jake](http://jakejs.com/). + +To use it add jake-node to the plugins array in your zshrc file. + +```bash +plugins=(... jake-node) +``` diff --git a/plugins/jump/jump.plugin.zsh b/plugins/jump/jump.plugin.zsh index a19a86022..d161a6da0 100644 --- a/plugins/jump/jump.plugin.zsh +++ b/plugins/jump/jump.plugin.zsh @@ -28,11 +28,18 @@ unmark() { } marks() { + local max=0 + for link in $MARKPATH/*(@); do + if [[ ${#link:t} -gt $max ]]; then + max=${#link:t} + fi + done + local printf_markname_template="$(printf -- "%%%us " "$max")" for link in $MARKPATH/*(@); do local markname="$fg[cyan]${link:t}$reset_color" local markpath="$fg[blue]$(readlink $link)$reset_color" - printf "%s\t" $markname - printf -- "-> %s \t\n" $markpath + printf -- "$printf_markname_template" "$markname" + printf -- "-> %s\n" "$markpath" done } diff --git a/plugins/keychain/README.md b/plugins/keychain/README.md new file mode 100644 index 000000000..c603f6790 --- /dev/null +++ b/plugins/keychain/README.md @@ -0,0 +1,45 @@ +# keychain plugin + +This plugin starts automatically [`keychain`](https://www.funtoo.org/Keychain) +to set up and load whichever credentials you want for both gpg and ssh +connections. + +To enable it, add `keychain` to your plugins: + +```zsh +plugins=(... keychain) +``` + +**NOTE**: It is HIGHLY recommended to also enable the `gpg-agent` plugin. + +## Instructions + +**IMPORTANT: put these settings _before_ the line that sources oh-my-zsh** + +**To adjust the agents** that keychain manages, use the `agents` style as +shown below. By default, only the `gpg` agent is managed. + +```zsh +zstyle :omz:plugins:keychain agents gpg,ssh +``` + +To **load multiple identities** use the `identities` style, For example: + +```zsh +zstyle :omz:plugins:keychain identities id_ed25519 id_github 2C5879C2 +``` + +**To pass additional options** to the `keychain` program, use the +`options` style; for example: + +```zsh +zstyle :omz:plugins:keychain options --quiet +``` + +## Credits + +Based on code from the `ssh-agent` plugin. + +## References + +- [Keychain](https://www.funtoo.org/Keychain) diff --git a/plugins/keychain/keychain.plugin.zsh b/plugins/keychain/keychain.plugin.zsh new file mode 100644 index 000000000..af34793e7 --- /dev/null +++ b/plugins/keychain/keychain.plugin.zsh @@ -0,0 +1,32 @@ +function _start_agent() { + local agents + local -a identities + local -a options + local _keychain_env_sh + local _keychain_env_sh_gpg + + # load agents to start. + zstyle -s :omz:plugins:keychain agents agents + + # load identities to manage. + zstyle -a :omz:plugins:keychain identities identities + + # load additional options + zstyle -a :omz:plugins:keychain options options + + # start keychain... + keychain ${^options:-} --agents ${agents:-gpg} ${^identities} + + # Get the filenames to store/lookup the environment from + _keychain_env_sh="$HOME/.keychain/$SHORT_HOST-sh" + _keychain_env_sh_gpg="$HOME/.keychain/$SHORT_HOST-sh-gpg" + + # Source environment settings. + [ -f "$_keychain_env_sh" ] && . "$_keychain_env_sh" + [ -f "$_keychain_env_sh_gpg" ] && . "$_keychain_env_sh_gpg" +} + +_start_agent + +# tidy up after ourselves +unfunction _start_agent diff --git a/plugins/kitchen/README.md b/plugins/kitchen/README.md new file mode 100644 index 000000000..89a6d7002 --- /dev/null +++ b/plugins/kitchen/README.md @@ -0,0 +1,9 @@ +# kitchen plugin + +This plugin adds completion support for the [Test Kitchen](https://kitchen.ci). + +To use it, add `kitchen` to the plugins array in your zshrc file: + +```zsh +plugins=(... kitchen) +``` diff --git a/plugins/kops/README.md b/plugins/kops/README.md new file mode 100644 index 000000000..5d9b5f8d6 --- /dev/null +++ b/plugins/kops/README.md @@ -0,0 +1,12 @@ +# kops + +This plugin provides completion for [kops](https://github.com/kubernetes/kops) (Kubernetes Operations), +the command line interface to get a production grade Kubernetes cluster up and running. + +To use it, add `kops` to the plugins array in your zshrc file. + +``` +plugins=(... kops) +``` + +**Author:** [@nmrony](https://github.com/nmrony) diff --git a/plugins/kops/kops.plugin.zsh b/plugins/kops/kops.plugin.zsh index f707f3aff..0c38ce2df 100644 --- a/plugins/kops/kops.plugin.zsh +++ b/plugins/kops/kops.plugin.zsh @@ -1,9 +1,3 @@ -# Autocompletion for kops (Kubernetes Operations), -# the command line interface to get a production grade -# Kubernetes cluster up and running - -# Author: https://github.com/nmrony - if [ $commands[kops] ]; then source <(kops completion zsh) fi diff --git a/plugins/man/README.md b/plugins/man/README.md new file mode 100644 index 000000000..4601252c0 --- /dev/null +++ b/plugins/man/README.md @@ -0,0 +1,13 @@ +# Man plugin + +This plugin adds a shortcut to insert man before the previous command. + +To use it, add `man` to the plugins array in your zshrc file: + +```zsh +plugins=(... man) +``` +# Keyboard Shortcuts +| Shortcut | Description | +|-----------------------------------|------------------------------------------------------------------------| +| <kbd>Esc</kbd> + man | add man before the previous command to see the manual for this command | diff --git a/plugins/minikube/README.md b/plugins/minikube/README.md new file mode 100644 index 000000000..eb2dd9b46 --- /dev/null +++ b/plugins/minikube/README.md @@ -0,0 +1,9 @@ +# minikube + +This plugin provides completion for [minikube](https://github.com/kubernetes/minikube). + +To use it, add `minikube` to the plugins array in your zshrc file. + +``` +plugins=(... minikube) +``` diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index 74583c6dc..f367fecce 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -20,9 +20,9 @@ BACKGROUND_CYAN=$(tput setab 6) BACKGROUND_WHITE=$(tput setab 7) RESET_FORMATTING=$(tput sgr0) -# if found a ./mvnw file execute it otherwise execute orignal mvn +# if found an executable ./mvnw file execute it otherwise execute orignal mvn mvn-or-mvnw() { - if [ -f ./mvnw ] ; then + if [ -x ./mvnw ] ; then echo "executing mvnw instead of mvn" ./mvnw "$@"; else diff --git a/plugins/nanoc/README.md b/plugins/nanoc/README.md index 9e21805f4..d5d437d8a 100644 --- a/plugins/nanoc/README.md +++ b/plugins/nanoc/README.md @@ -10,14 +10,11 @@ plugins=(... nanoc) ## Aliases -| Alias | Command | Description | -|-------|-----------------------|----------------------------------------------------| -| n | `nanoc` | Main Nanoc command | -| na | `nanoc autocompile` | The autocompile command has been deprecated since Nanoc 3.6. Use [guard-nanoc](https://github.com/nanoc/nanoc/tree/master/guard-nanoc) instead. | -| nco | `nanoc compile` | Compile all items of the current site. | -| nci | `nanoc create_item` | Command was deprecated in Nanoc v.3 and completely removed in v.4 | -| ncl | `nanoc create_layout` | Command was deprecated in Nanoc v.3 and completely removed in v.4 | -| ncs | `nanoc create_site` | Create a new site at the given path. The site will use the filesystem data source. | -| nd | `nanoc deploy` | Deploys the compiled site. The compiled site contents in the output directory will be uploaded to the destination, which is specified using the --target option. | -| nv | `nanoc view` | Start the static web server. Unless specified, the web server will run on port 3000 and listen on all IP addresses. | -| nw | `nanoc watch` | The watch command has been deprecated since Nanoc 3.6. Use [guard-nanoc](https://github.com/nanoc/nanoc/tree/master/guard-nanoc) instead. |
\ No newline at end of file +| Alias | Command | Description | +|-------|-----------------------|-----------------------------------------------------------------------------------| +| n | `nanoc` | Main Nanoc command | +| nco | `nanoc compile` | Compile all items of the current site | +| ncs | `nanoc create-site` | Create a new site at the given path. The site will use the filesystem data source | +| nd | `nanoc deploy` | Deploy the compiled site to the destination (specified with `--target`) | +| np | `nanoc prune` | Remove files not managed by Nanoc from the output directory | +| nv | `nanoc view` | Start the static web server (on port 3000 and all IP addresses, unless specified) | diff --git a/plugins/nanoc/_nanoc b/plugins/nanoc/_nanoc index fde07c3fc..a6a4792ad 100644 --- a/plugins/nanoc/_nanoc +++ b/plugins/nanoc/_nanoc @@ -1,28 +1,21 @@ #compdef nanoc #autoload -# nanoc zsh completion - based on the homebrew zsh completion # requires the 'nanoc' gem to be installed local -a _1st_arguments _1st_arguments=( - 'autocompile:start the autocompiler' + 'check:run issue checks' 'compile:compile items of this site' - 'create-item:create an item' - 'create-layout:create a layout' 'create-site:create a site' 'deploy:deploy the compiled site' 'help:show help' 'prune:remove files not managed by nanoc from the output directory' + 'shell:open a shell on the Nanoc environment' 'show-data:show data in this site' 'show-plugins:show all available plugins' 'show-rules:describe the rules for each item' - 'update:update the data stored by the data source to a newer version' - 'validate-css:validate the site’s CSS' - 'validate-html:validate the site’s HTML' - 'validate-links:validate links in site' 'view:start the web server that serves static files' - 'watch:start the watcher' ) local expl @@ -31,13 +24,68 @@ local -a pkgs installed_pkgs _arguments \ '(--color)--color[enable color]' \ '(--debug)--debug[enable debugging]' \ + '(--env)--env[set environment]' \ '(--help)--help[show the help message and quit]' \ '(--no-color)--no-color[disable color]' \ - '(--verbose)--verbose[make nanoc output more detailed]' \ + '(--verbose)--verbose[make output more detailed]' \ '(--version)--version[show version information and quit]' \ '(--warn)--warn[enable warnings]' \ '*:: :->subcmds' && return 0 +case "$state" in + subcmds) + case $words[1] in + check) + _arguments \ + '(--preprocess)--preprocess[run preprocessor]' + ;; + + compile) + _arguments \ + '(--diff)--diff[generate diff]' + ;; + + compile) + _arguments \ + '(--diff)--diff[generate diff]' + ;; + + create-site) + _arguments \ + '(--force)--force[force creation of new site]' + ;; + + deploy) + _arguments \ + '(--target)--target[specify the location to deploy to (default: `default`)]' \ + '(--no-check)--no-check[do not run the issue checks marked for deployment]' \ + '(--list)--list[list available locations to deploy to]' \ + '(--list-deployers)--list-deployers[list available deployers]' \ + '(--dry-run)--dry-run[show what would be deployed]' + ;; + + prune) + _arguments \ + '(--yes)--yes[confirm deletion]' \ + '(--dry-run)--dry-run[print files to be deleted instead of actually deleting them]' + ;; + + shell) + _arguments \ + '(--preprocess)--preprocess[run preprocessor]' + ;; + + view) + _arguments \ + '(--handler)--handler[specify the handler to use (webrick/mongrel/...)]' \ + '(--host)--host[specify the host to listen on (default: 127.0.0.1)]' \ + '(--port)--port[specify the port to listen on (default: 3000]' \ + '(--live-reload)--live-reload[reload on changes]' + ;; + esac + ;; +esac + if (( CURRENT == 1 )); then _describe -t commands "nanoc subcommand" _1st_arguments return diff --git a/plugins/nanoc/nanoc.plugin.zsh b/plugins/nanoc/nanoc.plugin.zsh index 5a5064613..05272ed66 100644 --- a/plugins/nanoc/nanoc.plugin.zsh +++ b/plugins/nanoc/nanoc.plugin.zsh @@ -1,9 +1,6 @@ alias n='nanoc' -alias na='nanoc autocompile' alias nco='nanoc compile' -alias nci='nanoc create_item' -alias ncl='nanoc create_layout' -alias ncs='nanoc create_site' +alias ncs='nanoc create-site' alias nd='nanoc deploy' +alias np='nanoc prune' alias nv='nanoc view' -alias nw='nanoc watch' diff --git a/plugins/osx/README.md b/plugins/osx/README.md index 7c75c65f5..3559dee02 100644 --- a/plugins/osx/README.md +++ b/plugins/osx/README.md @@ -56,6 +56,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | `man-preview` | Open a specified man page in Preview app | | `showfiles` | Show hidden files | | `hidefiles` | Hide the hidden files | -| `itunes` | Control iTunes. User `itunes -h` for usage details | +| `itunes` | Control iTunes. Use `itunes -h` for usage details | | `spotify` | Control Spotify and search by artist, album, track… | | `rmdsstore` | Remove .DS\_Store files recursively in a directory | diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh index 6a4b6eec4..a1c73a184 100644 --- a/plugins/osx/osx.plugin.zsh +++ b/plugins/osx/osx.plugin.zsh @@ -284,6 +284,6 @@ alias showfiles="defaults write com.apple.finder AppleShowAllFiles -bool true && alias hidefiles="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder" # Remove .DS_Store files recursively in a directory, default . -rmdsstore() { +function rmdsstore() { find "${@:-.}" -type f -name .DS_Store -delete } diff --git a/plugins/pylint/README.md b/plugins/pylint/README.md new file mode 100644 index 000000000..8c1de88ba --- /dev/null +++ b/plugins/pylint/README.md @@ -0,0 +1,15 @@ +# pylint + +This plugin adds code analysis for python through [Pylint](https://www.pylint.org/). + +To use it, add `pylint` to the plugins array in your zshrc file: + +```zsh +plugins=(... pylint) +``` + +## Aliases + +| Alias | Command | Description | +| -------------| -------------------- | -------------------------------------------------------------------------------------------------------------------------| +| pylint-quick | `pylint --reports=n` | Displays a set of reports each one focusing on a particular aspect of the project, default set `no` for multiple reports | | diff --git a/plugins/sbt/README.md b/plugins/sbt/README.md new file mode 100644 index 000000000..f1a5753b9 --- /dev/null +++ b/plugins/sbt/README.md @@ -0,0 +1,32 @@ +# sbt plugin + +This plugin adds completion for the [sbt, the interactive build tool](https://scala-sbt.org/), +as well as some aliases for common sbt commands. + +To use it, add `sbt` to the plugins array in your zshrc file: + +```zsh +plugins=(... sbt) +``` + +## Aliases + +| Alias | Command | Description | +|-------|-----------------------|--------------------------------------------------------------| +| sbc | `sbt compile` | Compiles the main sources | +| sbcln | `sbt clean` | Deletes all generated files | +| sbcc | `sbt clean compile` | Deletes generated files, compiles the main sources | +| sbco | `sbt console` | Starts Scala with the compiled sources and all dependencies | +| sbcq | `sbt console-quick` | Starts Scala with all dependencies | +| sbcp | `sbt console-project` | Starts Scala with sbt and the build definitions | +| sbd | `sbt doc` | Generates API documentation for Scala source files | +| sbdc | `sbt dist:clean` | Deletes the distribution packages | +| sbdi | `sbt dist` | Creates the distribution packages | +| sbgi | `sbt gen-idea` | Create Idea project files | +| sbp | `sbt publish` | Publishes artifacts to the repository | +| sbpl | `sbt publish-local` | Publishes artifacts to the local Ivy repository | +| sbr | `sbt run` | Runs the main class for the project | +| sbrm | `sbt run-main` | Runs the specified main class for the project | +| sbu | `sbt update` | Resolves and retrieves external dependencies | +| sbx | `sbt test` | Compiles and runs all tests | +| sba | `sbt assembly` | Create a fat JAR with all dependencies | diff --git a/plugins/scala/README.md b/plugins/scala/README.md new file mode 100644 index 000000000..957261d9e --- /dev/null +++ b/plugins/scala/README.md @@ -0,0 +1,15 @@ +## Scala plugin + +Completion script for [scala and scalac](https://www.scala-lang.org/) commands. + +To use it, add `scala` to the plugins array of your zshrc file: +``` +plugins=(... scala) +``` + +## Aliases + +| Command | Description | +|------------------|---------------------------------------------------------------------------------| +| `scala` | Run code in the Scala language | +| `scalac` | Compiler for the Scala language | diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index fe4946c6d..a7a4ee33a 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -2,20 +2,51 @@ typeset _agent_forwarding _ssh_env_cache function _start_agent() { local lifetime - local -a identities - - # start ssh-agent and setup environment zstyle -s :omz:plugins:ssh-agent lifetime lifetime + # start ssh-agent and setup environment + echo starting ssh-agent... ssh-agent -s ${lifetime:+-t} ${lifetime} | sed 's/^echo/#echo/' >! $_ssh_env_cache chmod 600 $_ssh_env_cache . $_ssh_env_cache > /dev/null +} - # load identies +function _add_identities() { + local id line sig + local -a identities loaded_sigs loaded_ids not_loaded zstyle -a :omz:plugins:ssh-agent identities identities - echo starting ssh-agent... - ssh-add $HOME/.ssh/${^identities} + # check for .ssh folder presence + if [[ ! -d $HOME/.ssh ]]; then + return + fi + + # add default keys if no identities were set up via zstyle + # this is to mimic the call to ssh-add with no identities + if [[ ${#identities} -eq 0 ]]; then + # key list found on `ssh-add` man page's DESCRIPTION section + for id in id_rsa id_dsa id_ecdsa id_ed25519 identity; do + # check if file exists + [[ -f "$HOME/.ssh/$id" ]] && identities+=$id + done + fi + + # get list of loaded identities' signatures and filenames + for line in ${(f)"$(ssh-add -l)"}; do + loaded_sigs+=${${(z)line}[2]} + loaded_ids+=${${(z)line}[3]} + done + + # add identities if not already loaded + for id in $identities; do + # check for filename match, otherwise try for signature match + if [[ ${loaded_ids[(I)$HOME/.ssh/$id]} -le 0 ]]; then + sig="$(ssh-keygen -lf "$HOME/.ssh/$id" | awk '{print $2}')" + [[ ${loaded_sigs[(I)$sig]} -le 0 ]] && not_loaded+="$HOME/.ssh/$id" + fi + done + + [[ -n "$not_loaded" ]] && ssh-add ${^not_loaded} } # Get the filename to store/lookup the environment from @@ -42,6 +73,8 @@ else _start_agent fi +_add_identities + # tidy up after ourselves unset _agent_forwarding _ssh_env_cache -unfunction _start_agent +unfunction _start_agent _add_identities diff --git a/plugins/stack/README.md b/plugins/stack/README.md new file mode 100644 index 000000000..da73444ad --- /dev/null +++ b/plugins/stack/README.md @@ -0,0 +1,9 @@ +# Stack + +This plugin provides completion for [Stack](https://haskellstack.org). + +To use it add stack to the plugins array in your zshrc file. + +```bash +plugins=(... stack) +``` diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh index f5bb070ab..485028d9f 100644 --- a/plugins/sublime/sublime.plugin.zsh +++ b/plugins/sublime/sublime.plugin.zsh @@ -42,8 +42,8 @@ elif [[ "$OSTYPE" = darwin* ]]; then fi done elif [[ "$OSTYPE" = 'cygwin' ]]; then - local sublime_cygwin_paths - sublime_cygwin_paths=( + local _sublime_cygwin_paths + _sublime_cygwin_paths=( "$(cygpath $ProgramW6432/Sublime\ Text\ 2)/sublime_text.exe" "$(cygpath $ProgramW6432/Sublime\ Text\ 3)/sublime_text.exe" ) diff --git a/plugins/svcat/README.md b/plugins/svcat/README.md new file mode 100644 index 000000000..0bc60b117 --- /dev/null +++ b/plugins/svcat/README.md @@ -0,0 +1,9 @@ +# svcat + +This plugin provides completion for the [Kubernetes service catalog cli](https://github.com/kubernetes-incubator/service-catalog). + +To use it, add `svcat` to the plugins array in your zshrc file. + +``` +plugins=(... svcat) +``` diff --git a/plugins/svcat/svcat.plugin.zsh b/plugins/svcat/svcat.plugin.zsh new file mode 100644 index 000000000..f90e7d8d6 --- /dev/null +++ b/plugins/svcat/svcat.plugin.zsh @@ -0,0 +1,6 @@ +# Autocompletion for svcat. +# + +if [ $commands[svcat] ]; then + source <(svcat completion zsh) +fi diff --git a/plugins/symfony/README.md b/plugins/symfony/README.md new file mode 100644 index 000000000..c58f64fdd --- /dev/null +++ b/plugins/symfony/README.md @@ -0,0 +1,9 @@ +# Symfony + +This plugin provides completion for [Symfony](https://symfony.com/). + +To use it add symfony to the plugins array in your zshrc file. + +```bash +plugins=(... symfony) +``` diff --git a/plugins/symfony2/README.md b/plugins/symfony2/README.md new file mode 100644 index 000000000..2946d0937 --- /dev/null +++ b/plugins/symfony2/README.md @@ -0,0 +1,28 @@ +# Symfony2 + +This plugin provides completion for [Symfony 2](https://symfony.com/), as well as aliases for frequent Symfony commands. + +To use it add symfony2 to the plugins array in your zshrc file. + +```bash +plugins=(... symfony2) +``` + +## Aliases + +| Alias | Command | Description | +|---------------|------------------------------|-------------------------------| +| `sf` | php app/console | Start the symfony console | +| `sfcl` | sf cache:clear | Clear the cache | +| `sfsr` | sf server:run | Run the dev server | +| `sfcw` | sf cache:warmup | Use the Bundles warmer | +| `sfroute` | sf debug:router | Show the different routes | +| `sfcontainer` | sf debug:contaner | List the different services | +| `sfgb` | sf generate:bundle | Generate a bundle | +| `sfgc` | sf generate:controller | Generate a controller | +| `sfgcom` | sf generate:command | Generate a command | +| `sfge` | sf doctrine:generate:entity | Generate an entity | +| `sfsu` | sf doctrine:schema:update | Update the schema in Database | +| `sfdc` | sf doctrine:database:create | Create the Database | +| `sfdev` | sf --env=dev | Update environment to `dev` | +| `sfprod` | sf --env=prod | Update environment to `prod` | diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh index 0b608fe2a..1498e8d02 100644 --- a/plugins/symfony2/symfony2.plugin.zsh +++ b/plugins/symfony2/symfony2.plugin.zsh @@ -25,7 +25,10 @@ alias sfcw='sf cache:warmup' alias sfroute='sf debug:router' alias sfcontainer='sf debug:container' alias sfgb='sf generate:bundle' +alias sfgc='sf generate:controller' +alias sfgcom='sf generate:command' alias sfge='sf doctrine:generate:entity' alias sfsu='sf doctrine:schema:update' +alias sfdc='sf doctrine:database:create' alias sfdev='sf --env=dev' alias sfprod='sf --env=prod' diff --git a/plugins/systemadmin/README.md b/plugins/systemadmin/README.md new file mode 100644 index 000000000..edca4d87d --- /dev/null +++ b/plugins/systemadmin/README.md @@ -0,0 +1,51 @@ +# Systemadmin plugin + +This plugin adds a series of aliases and functions which make a System Administrator's life easier. + +To use it, add `systemadmin` to the plugins array in your zshrc file: + +```zsh +plugins=(... systemadmin) +``` + +## Aliases + +| Alias | Command | Description | +|---------|------------------------------------------------------------------------|--------------------------------------------------------------------| +| ping | `ping -c 5` | Sends only 5 ICMP Messages | +| clr | `clear; echo Currently logged in on $TTY, as $USER in directory $PWD.` | Clears the screen and prints the current user, TTY, and directory | +| path | `print -l $path` | Displays PATH with each entry on a separate line | +| mkdir | `mkdir -pv` | Automatically create parent directories and display verbose output | +| psmem | `ps -e -orss=,args= \| sort -b -k1,1n` | Display the processes using the most memory | +| psmem10 | `ps -e -orss=,args= \| sort -b -k1,1n \| head -10` | Display the top 10 processes using the most memory | +| pscpu | `ps -e -o pcpu,cpu,nice,state,cputime,args \|sort -k1 -nr` | Display the top processes using the most CPU | +| pscpu10 | `ps -e -o pcpu,cpu,nice,state,cputime,args \|sort -k1 -nr \| head -10` | Display the top 10 processes using the most CPU | +| hist10 | `print -l ${(o)history%% *} \| uniq -c \| sort -nr \| head -n 10` | Display the top 10 most used commands in the history | + +## Functions + +| Function | Description | +|-------------|-----------------------------------------------------------------------------------------------------------------------| +| dls | List only directories in the current directory | +| psgrep | List all processes that match the pattern input after the command | +| killit | Kills any process that matches a regular expression passed to it | +| tree | List contents of directories in a tree-like format (if tree isn't installed) | +| sortcons | Sort connections by state | +| con80 | View all 80 Port Connections | +| sortconip | On the connected IP sorted by the number of connections | +| req20 | List the top 20 requests on port 80 | +| http20 | List the top 20 connections to port 80 based on tcpdump data | +| timewait20 | List the top 20 time_wait connections | +| syn20 | List the top 20 SYN connections | +| port_pro | Output all processes according to the port number | +| accessip10 | List the top 10 accesses to the ip address in the nginx/access.log file or another log file if specified | +| visitpage20 | List the top 20 most visited files or pages in the nginx/access.log file or another log file if specified | +| consume100 | List the 100 most time-consuming Page lists (more than 60 seconds) as well as the corresponding number of occurrences | +| webtraffic | List website traffic statistics in GB from tne nginx/access.log file or another log file if specified | +| c404 | List statistics on 404 connections in the nginx/access.log file or another log file if specified | +| httpstatus | List statistics based on http status in the nginx/access.log file or another log file if specified | +| d0 | Delete 0 byte files recursively in the current directory or another if specified | +| geteip | Gather information regarding an external IP address using [icanhazip.com](https://icanhazip.com) | +| getip | Determine the local IP Address with `ip addr` or `ifconfig` | +| clrz | Clear zombie processes | +| conssec | Show number of concurrent connections per second based on ngnix/access.log file or another log file if specified | diff --git a/plugins/systemadmin/systemadmin.plugin.zsh b/plugins/systemadmin/systemadmin.plugin.zsh index a74f818dd..bdc2219fa 100644 --- a/plugins/systemadmin/systemadmin.plugin.zsh +++ b/plugins/systemadmin/systemadmin.plugin.zsh @@ -12,14 +12,6 @@ # # ------------------------------------------------------------------------------ -function retval() { - if [[ -z $1 ]];then - echo '.' - else - echo $1 - fi -} - function retlog() { if [[ -z $1 ]];then echo '/var/log/nginx/access.log' @@ -29,8 +21,8 @@ function retlog() { } alias ping='ping -c 5' -alias clr='clear;echo "Currently logged in on $(tty), as $USER in directory $PWD."' -alias path='echo -e ${PATH//:/\\n}' +alias clr='clear; echo Currently logged in on $TTY, as $USER in directory $PWD.' +alias path='print -l $path' alias mkdir='mkdir -pv' # get top process eating memory alias psmem='ps -e -orss=,args= | sort -b -k1,1n' @@ -43,10 +35,10 @@ alias hist10='print -l ${(o)history%% *} | uniq -c | sort -nr | head -n 10' # directory LS dls () { - ls -l | grep "^d" | awk '{ print $9 }' | tr -d "/" + print -l *(/) } psgrep() { - ps aux | grep "$(retval $1)" | grep -v grep + ps aux | grep "${1:-.}" | grep -v grep } # Kills any process that matches a regexp passed to it killit() { @@ -54,10 +46,10 @@ killit() { } # list contents of directories in a tree-like format -if [ -z "\${which tree}" ]; then - tree () { - find $@ -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g' - } +if ! (( $+commands[tree] )); then + tree () { + find $@ -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g' + } fi # Sort connection state @@ -97,7 +89,7 @@ syn20() { # Printing process according to the port number port_pro() { - netstat -ntlp | grep "$(retval $1)" | awk '{print $7}' | cut -d/ -f1 + netstat -ntlp | grep "${1:-.}" | awk '{print $7}' | cut -d/ -f1 } # top10 of gain access to the ip address @@ -134,7 +126,7 @@ httpstatus() { # Delete 0 byte file d0() { - find "$(retval $1)" -type f -size 0 -exec rm -rf {} \; + find "${1:-.}" -type f -size 0 -exec rm -rf {} \; } # gather external ip address @@ -142,12 +134,12 @@ geteip() { curl -s -S https://icanhazip.com } -# determine local IP address +# determine local IP address(es) getip() { if (( ${+commands[ip]} )); then - ip addr | grep "inet " | grep -v '127.0.0.1' | awk '{print $2}' + ip addr | awk '/inet /{print $2}' | command grep -v 127.0.0.1 else - ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}' + ifconfig | awk '/inet /{print $2}' | command grep -v 127.0.0.1 fi } diff --git a/plugins/textmate/README.md b/plugins/textmate/README.md new file mode 100644 index 000000000..9fd342135 --- /dev/null +++ b/plugins/textmate/README.md @@ -0,0 +1,16 @@ +# TextMate plugin + +The plugin adds a function for the [TextMate](https://macromates.com) editor. + +To use it, add `textmate` to the plugins array of your zshrc file: +``` +plugins=(... textmate) +``` + +## Function + +The `tm` function provides the following options: + +- No arguments: Run `mate` in the current directory. +- Argument that is a directory: Run `mate` in the given directory and cd to it. +- Other arguments: Pass all arguments to `mate`. This allows for easy opening of multiple files. diff --git a/plugins/tmux/README.md b/plugins/tmux/README.md new file mode 100644 index 000000000..427119d3d --- /dev/null +++ b/plugins/tmux/README.md @@ -0,0 +1,39 @@ +# tmux + +This plugin provides aliases for [tmux](http://tmux.github.io/), the terminal multiplexer. +To use it add `tmux` to the plugins array in your zshrc file. + +```zsh +plugins=(... tmux) +``` + +The plugin also supports the following - +- determines if tmux is installed or not, if not, prompts user to install tmux +- determines if the terminal supports the 256 colors or not, sets the appropriate configuration variable +- sets the correct local config file to use + +## Aliases + +| Alias | Command | Description | +| ------ | -----------------------|---------------------------------------------------------- | +| `ta` | tmux attach -t | Attach new tmux session to already running named session | +| `tad` | tmux attach -d -t | Detach named tmux session | +| `ts` | tmux new-session -s | Create a new named tmux session | +| `tl` | tmux list-sessions | Displays a list of running tmux sessions | +| `tksv` | tmux kill-server | Terminate all running tmux sessions | +| `tkss` | tmux kill-session -t | Terminate named running tmux session | +| `tmux` | `_zsh_tmux_plugin_run` | Start a new tmux session | + + +## Configuration Variables + +| Variable | Description | +|-------------------------------------|-------------------------------------------------------------------------------| +| `ZSH_TMUX_AUTOSTART` | Automatically starts tmux (default: `false`) | +| `ZSH_TMUX_AUTOSTART_ONCE` | Autostart only if tmux hasn't been started previously (default: `true`) | +| `ZSH_TMUX_AUTOCONNECT` | Automatically connect to a previous session if it exits (default: `true`) | +| `ZSH_TMUX_AUTOQUIT` | Automatically closes terminal once tmux exits (default: `ZSH_TMUX_AUTOSTART`) | +| `ZSH_TMUX_FIXTERM` | Sets `$TERM` to 256-color term or not based on current terminal support | +| `ZSH_TMUX_ITERM2` | Sets the `-CC` option for iTerm2 tmux integration (default: `false`) | +| `ZSH_TMUX_FIXTERM_WITHOUT_256COLOR` | `$TERM` to use for non 256-color terminals (default: `screen`) | +| `ZSH_TMUX_FIXTERM_WITH_256COLOR` | `$TERM` to use for 256-color terminals (default: `screen-256color` | diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 7ddf42099..2f3c3e79d 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -36,7 +36,7 @@ alias tkss='tmux kill-session -t' : ${ZSH_TMUX_FIXTERM_WITH_256COLOR:=screen-256color} # Determine if the terminal supports 256 colors -if [[ $(tput colors) == 256 ]]; then +if [[ $terminfo[colors] == 256 ]]; then export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITH_256COLOR else export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR diff --git a/plugins/transfer/transfer.plugin.zsh b/plugins/transfer/transfer.plugin.zsh index 7a7cd85ec..db744b0cd 100644 --- a/plugins/transfer/transfer.plugin.zsh +++ b/plugins/transfer/transfer.plugin.zsh @@ -61,7 +61,9 @@ transfer() { # cat output link cat $tmpfile + # add newline + echo # cleanup rm -f $tmpfile -}
\ No newline at end of file +} diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant index a99a8f0e7..2efb4473d 100644 --- a/plugins/vagrant/_vagrant +++ b/plugins/vagrant/_vagrant @@ -6,6 +6,7 @@ local -a _1st_arguments _1st_arguments=( 'box:Box commands' + 'cloud:Manages everything related to Vagrant Cloud' 'connect:Connects to a remotely shared Vagrant environment' 'destroy:Destroys the vagrant environment' 'docker-logs:Outputs the logs from the Docker container' @@ -18,6 +19,7 @@ _1st_arguments=( 'login:Authenticates against a Vagrant Cloud server to access protected boxes' 'package:Packages a vagrant environment for distribution' 'plugin:Plugin commands' + 'port:Displays information about guest port mappings' 'provision:Run the provisioner' 'push:Deploys code in this environment to a configured destination' 'rdp:Connects to machine via RDP' @@ -33,6 +35,7 @@ _1st_arguments=( 'suspend:Suspends the currently running vagrant environment' 'snapshot:Used to manage snapshots with the guest machine' 'up:Creates the vagrant environment' + 'validate:Validates the Vagrantfile' 'version:Prints current and latest Vagrant version' '--help:[TASK] Describe available tasks or one specific task' '--version:Prints the Vagrant version information' @@ -54,7 +57,7 @@ __task_list () local expl declare -a tasks - tasks=(box destroy halt init package provision reload resume ssh ssh_config status suspend up version) + tasks=(box destroy halt init package port provision reload resume ssh ssh_config status suspend up version) _wanted tasks expl 'help' compadd $tasks } @@ -123,7 +126,7 @@ case $state in (box) __vagrant-box ;; - (up|provision|package|destroy|reload|ssh|ssh-config|halt|resume|status) + (up|provision|port|package|destroy|reload|ssh|ssh-config|halt|resume|status) _arguments ':feature:__vm_list' esac ;; diff --git a/plugins/virtualenv/README.md b/plugins/virtualenv/README.md new file mode 100644 index 000000000..e0b8c2c82 --- /dev/null +++ b/plugins/virtualenv/README.md @@ -0,0 +1,15 @@ +# virtualenv + +The plugin displays information of the created virtual container and allows background theming. + +To use it, add `virtualenv` to the plugins array of your zshrc file: +``` +plugins=(... virtualenv) +``` + +The plugin creates a `virtualenv_prompt_info` function that you can use in your theme, which displays +the basename of the current `$VIRTUAL_ENV`. It uses two variables to control how that is shown: + +- `ZSH_THEME_VIRTUALENV_PREFIX`: sets the prefix of the VIRTUAL_ENV. Defaults to `[`. + +- `ZSH_THEME_VIRTUALENV_SUFFIX`: sets the suffix of the VIRTUAL_ENV. Defaults to `]`. diff --git a/plugins/yarn/README.md b/plugins/yarn/README.md index c4e6d6da5..671a272d9 100644 --- a/plugins/yarn/README.md +++ b/plugins/yarn/README.md @@ -19,13 +19,19 @@ plugins=(... yarn) | yap | `yarn add --peer` | Install a package in peerDependencies (`package.json`) | | yb | `yarn build` | Run the build script defined in `package.json` | | ycc | `yarn cache clean` | Clean yarn's global cache of packages | +| yga | `yarn global add` | Install packages globally on your operating system | +| ygls | `yarn global list` | Lists global installed packages | +| ygrm | `yarn global remove` | Remove global installed packages from your OS | | ygu | `yarn global upgrade` | Upgrade packages installed globally to their latest version | | yh | `yarn help` | Show help for a yarn command | +| yi | `yarn init` | Interactively creates or updates a package.json file | | yin | `yarn install` | Install dependencies defined in `package.json` | | yls | `yarn list` | List installed packages | | yout | `yarn outdated` | Check for outdated package dependencies | +| yp | `yarn pack` | Create a compressed gzip archive of package dependencies | | yrm | `yarn remove` | Remove installed packages | | yrun | `yarn run` | Run a defined package script | +| ys | `yarn serve` | Start the dev server | | yst | `yarn start` | Run the start script defined in `package.json` | | yt | `yarn test` | Run the test script defined in `package.json` | | yuc | `yarn global upgrade && yarn cache clean` | Upgrade global packages and clean yarn's global cache | diff --git a/plugins/yarn/yarn.plugin.zsh b/plugins/yarn/yarn.plugin.zsh index fe752357f..9ed8322cd 100644 --- a/plugins/yarn/yarn.plugin.zsh +++ b/plugins/yarn/yarn.plugin.zsh @@ -4,13 +4,19 @@ alias yad="yarn add --dev" alias yap="yarn add --peer" alias yb="yarn build" alias ycc="yarn cache clean" +alias yga="yarn global add" +alias ygls="yarn global list" +alias ygrm="yarn global remove" alias ygu="yarn global upgrade" alias yh="yarn help" +alias yi="yarn init" alias yin="yarn install" alias yls="yarn list" alias yout="yarn outdated" +alias yp="yarn pack" alias yrm="yarn remove" alias yrun="yarn run" +alias ys="yarn serve" alias yst="yarn start" alias yt="yarn test" alias yuc="yarn global upgrade && yarn cache clean" |