From c840594c6ffdcecc241c9ccb130daeb630831ef7 Mon Sep 17 00:00:00 2001 From: Robert McLeod Date: Fri, 10 Apr 2015 15:07:29 +1200 Subject: added aliases for vagrant --- plugins/vagrant/vagrant.plugin.zsh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 plugins/vagrant/vagrant.plugin.zsh (limited to 'plugins') diff --git a/plugins/vagrant/vagrant.plugin.zsh b/plugins/vagrant/vagrant.plugin.zsh new file mode 100644 index 000000000..a238d9ffe --- /dev/null +++ b/plugins/vagrant/vagrant.plugin.zsh @@ -0,0 +1,31 @@ +alias vgi="vagrant init" + +alias vup="vagrant up" +alias vd="vagrant destroy" +alias vdf="vagrant destroy -f" + +alias vssh="vagrant ssh" +alias vrdp="vagrant rdp" + +alias vh="vagrant halt" +alias vssp="vagrant suspend" +alias vst="vagrant status" +alias vre="vagrant resume" + +alias vpr="vagrant provision" +alias vr="vagrant reload" +alias vrp="vagrant reload --provision" + +alias vp="vagrant push" +alias vsh="vagrant share" + +alias vba="vagrant box add" +alias vbr="vagrant box remove" +alias vbl="vagrant box list" +alias vbo="vagrant box outdated" +alias vbu="vagrant box update" + +alias vpli="vagrant plugin install" +alias vpll="vagrant plugin list" +alias vplun="vagrant plugin uninstall" +alias vplu="vagrant plugin update" -- cgit v1.2.3-70-g09d2 From b6ed2e7ac378438689d3348b4be00b2bce4fd9a8 Mon Sep 17 00:00:00 2001 From: Robert McLeod Date: Wed, 8 Jul 2015 07:54:42 +1200 Subject: added aliases for ssh-config and global-status So the following aliases call the respective commands: vgs = vagrant global-status vsshc = vagrant ssh-config --- plugins/vagrant/vagrant.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'plugins') diff --git a/plugins/vagrant/vagrant.plugin.zsh b/plugins/vagrant/vagrant.plugin.zsh index a238d9ffe..a4e9b06c2 100644 --- a/plugins/vagrant/vagrant.plugin.zsh +++ b/plugins/vagrant/vagrant.plugin.zsh @@ -5,12 +5,14 @@ alias vd="vagrant destroy" alias vdf="vagrant destroy -f" alias vssh="vagrant ssh" +alias vsshc="vagrant ssh-config" alias vrdp="vagrant rdp" alias vh="vagrant halt" alias vssp="vagrant suspend" alias vst="vagrant status" alias vre="vagrant resume" +alias vgs="vagrant global-status" alias vpr="vagrant provision" alias vr="vagrant reload" -- cgit v1.2.3-70-g09d2 From 634a50936a28ba3a57a02c92e7fe76da2d60ecf8 Mon Sep 17 00:00:00 2001 From: Maxime Richard Date: Thu, 13 Feb 2020 18:10:59 +0100 Subject: dotenv: add ZSH_DOTENV_PROMPT config (#8624) --- plugins/dotenv/README.md | 6 ++++++ plugins/dotenv/dotenv.plugin.zsh | 13 ++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'plugins') diff --git a/plugins/dotenv/README.md b/plugins/dotenv/README.md index cac552485..dbc02bf61 100644 --- a/plugins/dotenv/README.md +++ b/plugins/dotenv/README.md @@ -32,6 +32,8 @@ PORT=3001 ``` You can even mix both formats, although it's probably a bad idea. +## Plugin options + ### ZSH_DOTENV_FILE You can also modify the name of the file to be loaded with the variable `ZSH_DOTENV_FILE`. @@ -43,6 +45,10 @@ For example, this will make the plugin look for files named `.dotenv` and load t ZSH_DOTENV_FILE=.dotenv ``` +### ZSH_DOTENV_PROMPT + +Set `ZSH_DOTENV_PROMPT=false` in your zshrc file if you don't want the confirmation message. + ## Version Control **It's strongly recommended to add `.env` file to `.gitignore`**, because usually it contains sensitive information such as your credentials, secret keys, passwords etc. You don't want to commit this file, it's supposed to be local only. diff --git a/plugins/dotenv/dotenv.plugin.zsh b/plugins/dotenv/dotenv.plugin.zsh index d4a6db8f8..84815a416 100644 --- a/plugins/dotenv/dotenv.plugin.zsh +++ b/plugins/dotenv/dotenv.plugin.zsh @@ -1,10 +1,13 @@ source_env() { if [[ -f $ZSH_DOTENV_FILE ]]; then - # confirm before sourcing .env file - local confirmation - echo -n "dotenv: source '$ZSH_DOTENV_FILE' file in the directory? (Y/n) " - if read -k 1 confirmation && [[ $confirmation = [nN] ]]; then - return + + if [ "$ZSH_DOTENV_PROMPT" != "false" ]; then + # confirm before sourcing file + local confirmation + echo -n "dotenv: source '$ZSH_DOTENV_FILE' file in the directory? (Y/n) " + if read -k 1 confirmation && [[ $confirmation = [nN] ]]; then + return + fi fi # test .env syntax -- cgit v1.2.3-70-g09d2 From f17e0219fdd38d9fabce2d96d0d283d98122733f Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Thu, 13 Feb 2020 18:33:24 +0100 Subject: dotenv: fix prompt newline --- plugins/dotenv/dotenv.plugin.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/dotenv/dotenv.plugin.zsh b/plugins/dotenv/dotenv.plugin.zsh index 84815a416..54036bee3 100644 --- a/plugins/dotenv/dotenv.plugin.zsh +++ b/plugins/dotenv/dotenv.plugin.zsh @@ -1,11 +1,13 @@ source_env() { if [[ -f $ZSH_DOTENV_FILE ]]; then - if [ "$ZSH_DOTENV_PROMPT" != "false" ]; then # confirm before sourcing file local confirmation + # print same-line prompt and output newline character if necessary echo -n "dotenv: source '$ZSH_DOTENV_FILE' file in the directory? (Y/n) " - if read -k 1 confirmation && [[ $confirmation = [nN] ]]; then + read -k 1 confirmation; [[ "$confirmation" != $'\n' ]] && echo + # only bail out if confirmation character is n + if [[ "$confirmation" = [nN] ]]; then return fi fi -- cgit v1.2.3-70-g09d2 From 4fc570b0d4a14638322d904b48f237306ccf3adc Mon Sep 17 00:00:00 2001 From: Marco Seguri Date: Thu, 13 Feb 2020 18:50:56 +0100 Subject: kubectl: avoid conflict with existing f aliases in kca alias (#8625) --- plugins/kubectl/kubectl.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index cc447b87e..92688c53c 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -14,7 +14,7 @@ fi alias k=kubectl # Execute a kubectl command against all namespaces -alias kca='f(){ kubectl "$@" --all-namespaces; unset -f f; }; f' +alias kca='_kca(){ kubectl "$@" --all-namespaces; unset -f _kca; }; _kca' # Apply a YML file alias kaf='kubectl apply -f' -- cgit v1.2.3-70-g09d2 From 52f9238b16ddc8a97690b49c8b395e9fe1169b62 Mon Sep 17 00:00:00 2001 From: Roey Darwish Dror Date: Thu, 13 Feb 2020 19:57:52 +0200 Subject: fzf: support for NixOS and Void Linux (#8618) --- plugins/fzf/fzf.plugin.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh index c8aefd7ab..53bdcbc97 100644 --- a/plugins/fzf/fzf.plugin.zsh +++ b/plugins/fzf/fzf.plugin.zsh @@ -10,6 +10,7 @@ function setup_using_base_dir() { if [[ -z "${fzf_base}" ]]; then fzfdirs=( "${HOME}/.fzf" + "${HOME}/.nix-profile/share/fzf" "/usr/local/opt/fzf" "/usr/share/fzf" "/usr/local/share/examples/fzf" @@ -31,8 +32,8 @@ function setup_using_base_dir() { fi if [[ -d "${fzf_base}" ]]; then - # Fix fzf shell directory for Archlinux package - if [[ ! -d "${fzf_base}/shell" ]] && [[ -f /etc/arch-release ]]; then + # Fix fzf shell directory for Arch Linux, NixOS or Void Linux packages + if [[ ! -d "${fzf_base}/shell" ]]; then fzf_shell="${fzf_base}" else fzf_shell="${fzf_base}/shell" -- cgit v1.2.3-70-g09d2 From 72168aec3da727c4af715f095d27d429106ea79f Mon Sep 17 00:00:00 2001 From: Manuel Silva Date: Sun, 16 Feb 2020 04:26:20 +1100 Subject: cloudapp: fix copy-paste mistake in README (#8629) --- plugins/cloudapp/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/cloudapp/README.md b/plugins/cloudapp/README.md index 62975a631..6c7f9bc6c 100644 --- a/plugins/cloudapp/README.md +++ b/plugins/cloudapp/README.md @@ -5,7 +5,7 @@ To use it, add `cloudapp` to the plugins array of your `~/.zshrc` file: ``` -plugins=(... dash) +plugins=(... cloudapp) ``` ## Requirements -- cgit v1.2.3-70-g09d2 From aa4146a9a4b75bc998d74750b4f75131973ccf01 Mon Sep 17 00:00:00 2001 From: Roman Date: Sat, 15 Feb 2020 18:28:02 +0100 Subject: git: add alias for git stash --include-untracked (#8617) --- plugins/git/README.md | 1 + plugins/git/git.plugin.zsh | 1 + 2 files changed, 2 insertions(+) (limited to 'plugins') diff --git a/plugins/git/README.md b/plugins/git/README.md index 7878f747b..42a583de8 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -154,6 +154,7 @@ plugins=(... git) | gstl | git stash list | | gstp | git stash pop | | gsts | git stash show --text | +| gstu | git stash --include-untracked | | gstall | git stash --all | | gsu | git submodule update | | gsw | git switch | diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index d8c4cffd1..380ab76d8 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -236,6 +236,7 @@ alias gstd='git stash drop' alias gstl='git stash list' alias gstp='git stash pop' alias gsts='git stash show --text' +alias gstu='git stash --include-untracked' alias gstall='git stash --all' alias gsu='git submodule update' alias gsw='git switch' -- cgit v1.2.3-70-g09d2 From 0bcecf2f636b8070639b6db44b8541015f574365 Mon Sep 17 00:00:00 2001 From: Harry Date: Sat, 15 Feb 2020 19:19:57 +0100 Subject: dotnet: use official dotnet completion (#8518) --- plugins/dotnet/README.md | 2 +- plugins/dotnet/dotnet.plugin.zsh | 119 ++++++--------------------------------- 2 files changed, 17 insertions(+), 104 deletions(-) (limited to 'plugins') diff --git a/plugins/dotnet/README.md b/plugins/dotnet/README.md index a663fc88d..7554b4e3c 100644 --- a/plugins/dotnet/README.md +++ b/plugins/dotnet/README.md @@ -20,4 +20,4 @@ plugins=(... dotnet) | ds | dotnet sln | Modify Visual Studio solution files. | | da | dotnet add | Add a package or reference to a .NET project. | | dp | dotnet pack | Create a NuGet package. | -| dng | dotnet nuget | Provides additional NuGet commands. | \ No newline at end of file +| dng | dotnet nuget | Provides additional NuGet commands. | diff --git a/plugins/dotnet/dotnet.plugin.zsh b/plugins/dotnet/dotnet.plugin.zsh index ed6c68e5d..6bd4b7af8 100644 --- a/plugins/dotnet/dotnet.plugin.zsh +++ b/plugins/dotnet/dotnet.plugin.zsh @@ -1,114 +1,27 @@ -# --------------------------------------------------------------------- # -# Aliases and Completions for .NET Core (https://dotnet.microsoft.com/) # -# Author: Shaun Tabone (https://github.com/xontab) # -# --------------------------------------------------------------------- # +# This scripts is copied from (MIT License): +# https://github.com/dotnet/toolset/blob/master/scripts/register-completions.zsh -# Helper function to cache and load completions -local cache_base_path="${ZSH_CACHE_DIR}/dotnet_" -_dotnet_cache_completion() { - local cache="${cache_base_path}$(echo $1)_completion" - if [[ ! -f $cache ]]; then - $2 $cache - fi +_dotnet_zsh_complete() +{ + local completions=("$(dotnet complete "$words")") - [[ -f $cache ]] && cat $cache -} + # If the completion list is empty, just continue with filename selection + if [ -z "$completions" ] + then + _arguments '*::arguments: _normal' + return + fi -_dotnet_cache_completion_cleanup() { - local cache="${cache_base_path}$(echo $1)_completion" - rm -f $cache + # This is not a variable assigment, don't remove spaces! + _values = "${(ps:\n:)completions}" } -# --------------------------------------------------------------------- # -# dotnet new # -# ALIAS: dn # -# --------------------------------------------------------------------- # -_dotnet_new_completion() { - if [ $commands[dotnet] ]; then - dotnet new -l | tail -n +21 | sed 's/ \+/:/g' | cut -d : -f 2 >$1 - fi -} +compdef _dotnet_zsh_complete dotnet -_dotnet_new_completion_cached() { - _dotnet_cache_completion 'new' _dotnet_new_completion -} - -_dotnet_cache_completion_cleanup 'new' +# Aliases bellow are here for backwards compatibility +# added by Shaun Tabone (https://github.com/xontab) alias dn='dotnet new' - -# --------------------------------------------------------------------- # -# dotnet # -# --------------------------------------------------------------------- # -_dotnet() { - if [ $CURRENT -eq 2 ]; then - _arguments \ - '--diagnostics[Enable diagnostic output.]' \ - '--help[Show command line help.]' \ - '--info[Display .NET Core information.]' \ - '--list-runtimes[Display the installed runtimes.]' \ - '--list-sdks[Display the installed SDKs.]' \ - '--version[Display .NET Core SDK version in use.]' - - _values \ - 'add[Add a package or reference to a .NET project.]' \ - 'build[Build a .NET project.]' \ - 'build-server[Interact with servers started by a build.]' \ - 'clean[Clean build outputs of a .NET project.]' \ - 'help[Show command line help.]' \ - 'list[List project references of a .NET project.]' \ - 'msbuild[Run Microsoft Build Engine (MSBuild) commands.]' \ - 'new[Create a new .NET project or file.]' \ - 'nuget[Provides additional NuGet commands.]' \ - 'pack[Create a NuGet package.]' \ - 'publish[Publish a .NET project for deployment.]' \ - 'remove[Remove a package or reference from a .NET project.]' \ - 'restore[Restore dependencies specified in a .NET project.]' \ - 'run[Build and run a .NET project output.]' \ - 'sln[Modify Visual Studio solution files.]' \ - 'store[Store the specified assemblies in the runtime package store.]' \ - 'test[Run unit tests using the test runner specified in a .NET project.]' \ - 'tool[Install or manage tools that extend the .NET experience.]' \ - 'vstest[Run Microsoft Test Engine (VSTest) commands.]' \ - 'dev-certs[Create and manage development certificates.]' \ - 'fsi[Start F# Interactive / execute F# scripts.]' \ - 'sql-cache[SQL Server cache command-line tools.]' \ - 'user-secrets[Manage development user secrets.]' \ - 'watch[Start a file watcher that runs a command when files change.]' - return - fi - - if [ $CURRENT -eq 3 ]; then - case ${words[2]} in - "new") - compadd -X ".NET Installed Templates" $(_dotnet_new_completion_cached) - return - ;; - "sln") - _values \ - 'add[Add one or more projects to a solution file.]' \ - 'list[List all projects in a solution file.]' \ - 'remove[Remove one or more projects from a solution file.]' - return - ;; - "nuget") - _values \ - 'delete[Deletes a package from the server.]' \ - 'locals[Clears or lists local NuGet resources such as http requests cache, packages folder, plugin operations cache or machine-wide global packages folder.]' \ - 'push[Pushes a package to the server and publishes it.]' - return - ;; - esac - fi - - _arguments '*::arguments: _normal' -} - -compdef _dotnet dotnet - -# --------------------------------------------------------------------- # -# Other Aliases # -# --------------------------------------------------------------------- # alias dr='dotnet run' alias dt='dotnet test' alias dw='dotnet watch' -- cgit v1.2.3-70-g09d2 From fbbfd0f8a89dfca51bee7b36c774c718207c5bb1 Mon Sep 17 00:00:00 2001 From: Alexandre GOMES Date: Mon, 17 Feb 2020 17:44:48 +0100 Subject: arcanist: add `arc diff --create` alias (#8610) --- plugins/arcanist/arcanist.plugin.zsh | 1 + 1 file changed, 1 insertion(+) (limited to 'plugins') diff --git a/plugins/arcanist/arcanist.plugin.zsh b/plugins/arcanist/arcanist.plugin.zsh index 3f4eb07f4..8918bffdd 100644 --- a/plugins/arcanist/arcanist.plugin.zsh +++ b/plugins/arcanist/arcanist.plugin.zsh @@ -9,6 +9,7 @@ alias arco='arc cover' alias arci='arc commit' alias ard='arc diff' +alias ardc='arc diff --create' alias ardnu='arc diff --nounit' alias ardnupc='arc diff --nounit --plan-changes' alias ardpc='arc diff --plan-changes' -- cgit v1.2.3-70-g09d2 From 1381da15a458112eace99a997b961b6e522c4a7c Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Mon, 17 Feb 2020 17:47:43 +0100 Subject: arcanist: document aliases --- plugins/arcanist/README.md | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/arcanist/README.md b/plugins/arcanist/README.md index f2ca8cf55..9c15f09b5 100644 --- a/plugins/arcanist/README.md +++ b/plugins/arcanist/README.md @@ -1,5 +1,29 @@ ## arcanist -**Maintainer:** [@emzar](https://github.com/emzar) - This plugin adds many useful aliases for [arcanist](https://github.com/phacility/arcanist). + +To use it, add `arcanist` to the plugins array of your zshrc file: + +```zsh +plugins=(... arcanist) +``` + +## Aliases + +| Alias | Command | +|---------|------------------------------------| +| ara | `arc amend` | +| arb | `arc branch` | +| arco | `arc cover` | +| arci | `arc commit` | +| ard | `arc diff` | +| ardc | `arc diff --create` | +| ardnu | `arc diff --nounit` | +| ardnupc | `arc diff --nounit --plan-changes` | +| ardpc | `arc diff --plan-changes` | +| are | `arc export` | +| arh | `arc help` | +| arl | `arc land` | +| arli | `arc lint` | +| arls | `arc list` | +| arpa | `arc patch` | -- cgit v1.2.3-70-g09d2 From 47eae26bf6fb378c8186602eab4c998916ac5b34 Mon Sep 17 00:00:00 2001 From: Kshitij Nikhal Date: Tue, 18 Feb 2020 03:20:54 -0600 Subject: web-search: add wolframalpha search engine (#8638) --- plugins/web-search/README.md | 1 + plugins/web-search/web-search.plugin.zsh | 2 ++ 2 files changed, 3 insertions(+) (limited to 'plugins') diff --git a/plugins/web-search/README.md b/plugins/web-search/README.md index d04042506..9c01f0724 100644 --- a/plugins/web-search/README.md +++ b/plugins/web-search/README.md @@ -39,6 +39,7 @@ Available search contexts are: | `qwant` | `https://www.qwant.com/?q=` | | `givero` | `https://www.givero.com/search?q=` | | `stackoverflow` | `https://stackoverflow.com/search?q=` | +| `wolframalpha` | `https://wolframalpha.com/input?i=` | Also there are aliases for bang-searching DuckDuckGo: diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh index 5b76eeae2..f975bad7a 100644 --- a/plugins/web-search/web-search.plugin.zsh +++ b/plugins/web-search/web-search.plugin.zsh @@ -19,6 +19,7 @@ function web_search() { qwant "https://www.qwant.com/?q=" givero "https://www.givero.com/search?q=" stackoverflow "https://stackoverflow.com/search?q=" + wolframalpha "https://www.wolframalpha.com/input/?i=" ) # check whether the search engine is supported @@ -55,6 +56,7 @@ alias goodreads='web_search goodreads' alias qwant='web_search qwant' alias givero='web_search givero' alias stackoverflow='web_search stackoverflow' +alias wolframalpha='web_search wolframalpha' #add your own !bang searches here alias wiki='web_search duckduckgo \!w' -- cgit v1.2.3-70-g09d2 From e8609b857caf730c626ab27910ece30420bc6693 Mon Sep 17 00:00:00 2001 From: Ujwal Dhakal Date: Wed, 19 Feb 2020 01:50:52 +0545 Subject: git: add `grename` to rename a local branch and in the origin remote (#8622) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marc Cornellà --- plugins/git/README.md | 357 +++++++++++++++++++++++---------------------- plugins/git/git.plugin.zsh | 14 ++ 2 files changed, 193 insertions(+), 178 deletions(-) (limited to 'plugins') diff --git a/plugins/git/README.md b/plugins/git/README.md index 42a583de8..009a74016 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -10,195 +10,196 @@ plugins=(... git) ## Aliases -| Alias | Command | -|:---------------------|:------------------------------------------------------------------------------------------------------------------------------| -| g | git | -| ga | git add | -| gaa | git add --all | -| gapa | git add --patch | -| gau | git add --update | -| gav | git add --verbose | -| gap | git apply | -| gb | git branch | -| gba | git branch -a | -| gbd | git branch -d | +| Alias | Command | +|:---------------------|:---------------------------------------------------------------------------------------------------------------------------------| +| g | git | +| ga | git add | +| gaa | git add --all | +| gapa | git add --patch | +| gau | git add --update | +| gav | git add --verbose | +| gap | git apply | +| gb | git branch | +| gba | git branch -a | +| gbd | git branch -d | | gbda | git branch --no-color --merged \| command grep -vE "^(\+|\*\|\s*(master\|develop\|dev)\s*$)" \| command xargs -n 1 git branch -d | -| gbD | git branch -D | -| gbl | git blame -b -w | -| gbnm | git branch --no-merged | -| gbr | git branch --remote | -| gbs | git bisect | -| gbsb | git bisect bad | -| gbsg | git bisect good | -| gbsr | git bisect reset | -| gbss | git bisect start | -| gc | git commit -v | -| gc! | git commit -v --amend | -| gcn! | git commit -v --no-edit --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 | -| gcam | git commit -a -m | -| gcsm | git commit -s -m | -| gcb | git checkout -b | -| gcf | git config --list | -| gcl | git clone --recurse-submodules | -| gclean | git clean -id | -| gpristine | git reset --hard && git clean -dfx | -| gcm | git checkout master | -| gcd | git checkout develop | -| gcmsg | git commit -m | -| gco | git checkout | -| gcount | git shortlog -sn | -| gcp | git cherry-pick | -| gcpa | git cherry-pick --abort | -| gcpc | git cherry-pick --continue | -| gcs | git commit -S | -| gd | git diff | -| gdca | git diff --cached | -| gdcw | git diff --cached --word-diff | -| gdct | git describe --tags $(git rev-list --tags --max-count=1) | -| gds | git diff --staged | -| gdt | git diff-tree --no-commit-id --name-only -r | -| gdv | git diff -w $@ \| view - | -| gdw | git diff --word-diff | -| gf | git fetch | -| gfa | git fetch --all --prune | -| gfg | git ls-files \| grep | -| gfo | git fetch origin | -| gg | git gui citool | -| gga | git gui citool --amend | -| ggf | git push --force origin $(current_branch) | -| ggfl | git push --force-with-lease origin $(current_branch) | -| ggl | git pull origin $(current_branch) | -| ggp | git push origin $(current_branch) | -| ggpnp | ggl && ggp | -| ggpull | git pull origin "$(git_current_branch)" | -| ggpur | ggu | -| ggpush | git push origin "$(git_current_branch)" | -| ggsup | git branch --set-upstream-to=origin/$(git_current_branch) | -| ggu | git pull --rebase origin $(current_branch) | -| gpsup | git push --set-upstream origin $(git_current_branch) | -| ghh | git help | -| gignore | git update-index --assume-unchanged | -| gignored | git ls-files -v \| grep "^[[:lower:]]" | -| git-svn-dcommit-push | git svn dcommit && git push github master:svntrunk | -| gk | gitk --all --branches | -| gke | gitk --all $(git log -g --pretty=%h) | -| gl | git pull | -| glg | git log --stat | -| glgp | git log --stat -p | -| glgg | git log --graph | -| glgga | git log --graph --decorate --all | -| glgm | git log --graph --max-count=10 | -| glo | git log --oneline --decorate | -| glol | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' | -| glols | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --stat | -| glod | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' | -| glods | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --date=short | -| glola | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --all | -| glog | git log --oneline --decorate --graph | -| gloga | git log --oneline --decorate --graph --all | -| glp | `_git_log_prettily` | -| gm | git merge | -| gmom | git merge origin/master | -| gmt | git mergetool --no-prompt | -| gmtvim | git mergetool --no-prompt --tool=vimdiff | -| gmum | git merge upstream/master | -| gma | git merge --abort | -| gp | git push | -| gpd | git push --dry-run | -| gpf | git push --force-with-lease | -| gpf! | git push --force | -| gpoat | git push origin --all && git push origin --tags | -| gpu | git push upstream | -| gpv | git push -v | -| gr | git remote | -| gra | git remote add | -| grb | git rebase | -| grba | git rebase --abort | -| grbc | git rebase --continue | -| grbd | git rebase develop | -| grbi | git rebase -i | -| grbm | git rebase master | -| grbs | git rebase --skip | -| grev | git revert | -| grh | git reset | -| grhh | git reset --hard | -| groh | git reset origin/$(git_current_branch) --hard | -| grm | git rm | -| grmc | git rm --cached | -| grmv | git remote rename | -| grrm | git remote remove | -| grs | git restore | -| grset | git remote set-url | -| grss | git restore --source | -| grt | cd "$(git rev-parse --show-toplevel \|\| echo .)" | -| gru | git reset -- | -| grup | git remote update | -| grv | git remote -v | -| gsb | git status -sb | -| gsd | git svn dcommit | -| gsh | git show | -| gsi | git submodule init | -| gsps | git show --pretty=short --show-signature | -| gsr | git svn rebase | -| gss | git status -s | -| gst | git status | -| gsta | git stash push | -| gsta | git stash save | -| gstaa | git stash apply | -| gstc | git stash clear | -| gstd | git stash drop | -| gstl | git stash list | -| gstp | git stash pop | -| gsts | git stash show --text | -| gstu | git stash --include-untracked | -| gstall | git stash --all | -| gsu | git submodule update | -| gsw | git switch | -| gswc | git switch -c | -| gts | git tag -s | -| gtv | git tag \| sort -V | -| gtl | gtl(){ git tag --sort=-v:refname -n -l ${1}* }; noglob gtl | -| gunignore | git update-index --no-assume-unchanged | -| gunwip | git log -n 1 \| grep -q -c "\-\-wip\-\-" && git reset HEAD~1 | -| gup | git pull --rebase | -| gupv | git pull --rebase -v | -| gupa | git pull --rebase --autostash | -| gupav | git pull --rebase --autostash -v | -| glum | git pull upstream master | -| gwch | git whatchanged -p --abbrev-commit --pretty=medium | -| gwip | git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]" | +| gbD | git branch -D | +| gbl | git blame -b -w | +| gbnm | git branch --no-merged | +| gbr | git branch --remote | +| gbs | git bisect | +| gbsb | git bisect bad | +| gbsg | git bisect good | +| gbsr | git bisect reset | +| gbss | git bisect start | +| gc | git commit -v | +| gc! | git commit -v --amend | +| gcn! | git commit -v --no-edit --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 | +| gcam | git commit -a -m | +| gcsm | git commit -s -m | +| gcb | git checkout -b | +| gcf | git config --list | +| gcl | git clone --recurse-submodules | +| gclean | git clean -id | +| gpristine | git reset --hard && git clean -dfx | +| gcm | git checkout master | +| gcd | git checkout develop | +| gcmsg | git commit -m | +| gco | git checkout | +| gcount | git shortlog -sn | +| gcp | git cherry-pick | +| gcpa | git cherry-pick --abort | +| gcpc | git cherry-pick --continue | +| gcs | git commit -S | +| gd | git diff | +| gdca | git diff --cached | +| gdcw | git diff --cached --word-diff | +| gdct | git describe --tags $(git rev-list --tags --max-count=1) | +| gds | git diff --staged | +| gdt | git diff-tree --no-commit-id --name-only -r | +| gdv | git diff -w $@ \| view - | +| gdw | git diff --word-diff | +| gf | git fetch | +| gfa | git fetch --all --prune | +| gfg | git ls-files \| grep | +| gfo | git fetch origin | +| gg | git gui citool | +| gga | git gui citool --amend | +| ggf | git push --force origin $(current_branch) | +| ggfl | git push --force-with-lease origin $(current_branch) | +| ggl | git pull origin $(current_branch) | +| ggp | git push origin $(current_branch) | +| ggpnp | ggl && ggp | +| ggpull | git pull origin "$(git_current_branch)" | +| ggpur | ggu | +| ggpush | git push origin "$(git_current_branch)" | +| ggsup | git branch --set-upstream-to=origin/$(git_current_branch) | +| ggu | git pull --rebase origin $(current_branch) | +| gpsup | git push --set-upstream origin $(git_current_branch) | +| ghh | git help | +| gignore | git update-index --assume-unchanged | +| gignored | git ls-files -v \| grep "^[[:lower:]]" | +| git-svn-dcommit-push | git svn dcommit && git push github master:svntrunk | +| gk | gitk --all --branches | +| gke | gitk --all $(git log -g --pretty=%h) | +| gl | git pull | +| glg | git log --stat | +| glgp | git log --stat -p | +| glgg | git log --graph | +| glgga | git log --graph --decorate --all | +| glgm | git log --graph --max-count=10 | +| glo | git log --oneline --decorate | +| glol | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' | +| glols | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --stat | +| glod | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' | +| glods | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --date=short | +| glola | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --all | +| glog | git log --oneline --decorate --graph | +| gloga | git log --oneline --decorate --graph --all | +| glp | `_git_log_prettily` | +| gm | git merge | +| gmom | git merge origin/master | +| gmt | git mergetool --no-prompt | +| gmtvim | git mergetool --no-prompt --tool=vimdiff | +| gmum | git merge upstream/master | +| gma | git merge --abort | +| gp | git push | +| gpd | git push --dry-run | +| gpf | git push --force-with-lease | +| gpf! | git push --force | +| gpoat | git push origin --all && git push origin --tags | +| gpu | git push upstream | +| gpv | git push -v | +| gr | git remote | +| gra | git remote add | +| grb | git rebase | +| grba | git rebase --abort | +| grbc | git rebase --continue | +| grbd | git rebase develop | +| grbi | git rebase -i | +| grbm | git rebase master | +| grbs | git rebase --skip | +| grev | git revert | +| grh | git reset | +| grhh | git reset --hard | +| groh | git reset origin/$(git_current_branch) --hard | +| grm | git rm | +| grmc | git rm --cached | +| grmv | git remote rename | +| grrm | git remote remove | +| grs | git restore | +| grset | git remote set-url | +| grss | git restore --source | +| grt | cd "$(git rev-parse --show-toplevel \|\| echo .)" | +| gru | git reset -- | +| grup | git remote update | +| grv | git remote -v | +| gsb | git status -sb | +| gsd | git svn dcommit | +| gsh | git show | +| gsi | git submodule init | +| gsps | git show --pretty=short --show-signature | +| gsr | git svn rebase | +| gss | git status -s | +| gst | git status | +| gsta | git stash push | +| gsta | git stash save | +| gstaa | git stash apply | +| gstc | git stash clear | +| gstd | git stash drop | +| gstl | git stash list | +| gstp | git stash pop | +| gsts | git stash show --text | +| gstu | git stash --include-untracked | +| gstall | git stash --all | +| gsu | git submodule update | +| gsw | git switch | +| gswc | git switch -c | +| gts | git tag -s | +| gtv | git tag \| sort -V | +| gtl | gtl(){ git tag --sort=-v:refname -n -l ${1}* }; noglob gtl | +| gunignore | git update-index --no-assume-unchanged | +| gunwip | git log -n 1 \| grep -q -c "\-\-wip\-\-" && git reset HEAD~1 | +| gup | git pull --rebase | +| gupv | git pull --rebase -v | +| gupa | git pull --rebase --autostash | +| gupav | git pull --rebase --autostash -v | +| glum | git pull upstream master | +| gwch | git whatchanged -p --abbrev-commit --pretty=medium | +| gwip | git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]" | ### Deprecated These are aliases that have been removed, renamed, or otherwise modified in a way that may, or may not, receive further support. -| Alias | Command | Modification | -| :----- | :----------------------------------------------------------------------------------| --------------------------------------------------------------------------------------------------- | -| gap | git add --patch | new alias `gapa` | -| gcl | git config --list | new alias `gcf` | -| gdc | git diff --cached | new alias `gdca` | -| gdt | git difftool | no replacement | -| ggpull | git pull origin $(current_branch) | new alias `ggl` (`ggpull` still exists for now though) | -| ggpur | git pull --rebase origin $(current_branch) | new alias `ggu` (`ggpur` still exists for now though) | -| ggpush | git push origin $(current_branch) | new alias `ggp` (`ggpush` still exists for now though) | -| gk | gitk --all --branches | now aliased to `gitk --all --branches` | -| glg | git log --stat --max-count = 10 | now aliased to `git log --stat --color` | -| glgg | git log --graph --max-count = 10 | now aliased to `git log --graph --color` | -| gwc | git whatchanged -p --abbrev-commit --pretty = medium | new alias `gwch` | +| Alias | Command | Modification | +| :----- | :----------------------------------------------------- | :----------------------------------------------------- | +| gap | `git add --patch` | new alias `gapa` | +| gcl | `git config --list` | new alias `gcf` | +| gdc | `git diff --cached` | new alias `gdca` | +| gdt | `git difftool` | no replacement | +| ggpull | `git pull origin $(current_branch)` | new alias `ggl` (`ggpull` still exists for now though) | +| ggpur | `git pull --rebase origin $(current_branch)` | new alias `ggu` (`ggpur` still exists for now though) | +| ggpush | `git push origin $(current_branch)` | new alias `ggp` (`ggpush` still exists for now though) | +| gk | `gitk --all --branches` | now aliased to `gitk --all --branches` | +| glg | `git log --stat --max-count = 10` | now aliased to `git log --stat --color` | +| glgg | `git log --graph --max-count = 10` | now aliased to `git log --graph --color` | +| gwc | `git whatchanged -p --abbrev-commit --pretty = medium` | new alias `gwch` | ## Functions ### Current -| Command | Description | -|:-----------------------|:----------------------------------------| -| current_branch | Return the name of the current branch | -| git_current_user_name | Returns the `user.name` config value | -| git_current_user_email | Returns the `user.email` config value | +| Command | Description | +|:-----------------------|:---------------------------------------------------------| +| `grename ` | Rename `old` branch to `new`, including in origin remote | +| current_branch | Return the name of the current branch | +| git_current_user_name | Returns the `user.name` config value | +| git_current_user_email | Returns the `user.email` config value | ### Work in Progress (WIP) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 380ab76d8..ffb3e506a 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -256,3 +256,17 @@ alias glum='git pull upstream master' alias gwch='git whatchanged -p --abbrev-commit --pretty=medium' alias gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]"' + +function grename() { + if [[ -z "$1" || -z "$2" ]]; then + echo "Usage: $0 old_branch new_branch" + return 1 + fi + + # Rename branch locally + git branch -m "$1" "$2" + # Rename branch in origin remote + if git push origin :"$1"; then + git push --set-upstream origin "$2" + fi +} -- cgit v1.2.3-70-g09d2 From eeb49bf5b0b8b700713e5b91464003cc09d1b44d Mon Sep 17 00:00:00 2001 From: Sir Mobus Gochfulshigan Dorphin Esquire XXIII Date: Tue, 18 Feb 2020 17:04:14 -0500 Subject: systemd: add prompt function to show systemd units' status (#7657) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marc Cornellà --- plugins/systemd/README.md | 41 ++++++++++++++++++++++++++++++++++++++ plugins/systemd/systemd.plugin.zsh | 15 ++++++++++++++ 2 files changed, 56 insertions(+) (limited to 'plugins') diff --git a/plugins/systemd/README.md b/plugins/systemd/README.md index d91329290..3fa1d2118 100644 --- a/plugins/systemd/README.md +++ b/plugins/systemd/README.md @@ -51,3 +51,44 @@ plugins=(... systemd) You can use the above aliases as `--user` by using the prefix `scu` instead of `sc`. For example: `scu-list-units` will be aliased to `systemctl --user list-units`. + +### Unit Status Prompt + +You can add a token to your prompt in a similar way to the gitfast plugin. To add the token +to your prompt, drop `$(systemd_prompt_info [unit]...)` into your prompt (more than one unit +may be specified). + +The plugin will add the following to your prompt for each `$unit`. +``` +: +``` +You can control these parts with the following variables: + +- ``: Set `$ZSH_THEME_SYSTEMD_PROMPT_PREFIX`. + +- ``: Set `$ZSH_THEME_SYSTEMD_PROMPT_SUFFIX`. + +- ``: name passed as parameter to the function. If you want it to be in ALL CAPS, + you can set the variable `$ZSH_THEME_SYSTEMD_PROMPT_CAPS` to a non-empty string. + +- ``: shown if the systemd unit is active. + Set `$ZSH_THEME_SYSTEMD_PROMPT_ACTIVE`. + +- ``: shown if the systemd unit is *not* active. + Set `$ZSH_THEME_SYSTEMD_PROMPT_NOTACTIVE`. + +For example, if your prompt contains `PROMPT='$(systemd_prompt_info dhcpd httpd)'` and you set the following variables: + +``` +ZSH_THEME_SYSTEMD_PROMPT_PREFIX="[" +ZSH_THEME_SYSTEMD_PROMPT_SUFFIX="]" +ZSH_THEME_SYSTEMD_PROMPT_ACTIVE="+" +ZSH_THEME_SYSTEMD_PROMPT_NOTACTIVE="X" +ZSH_THEME_SYSTEMD_PROMPT_CAPS=1 +``` + +If `dhcpd` is running, and `httpd` is not, then your prompt will look like this: + +``` +[DHCPD: +][HTTPD: X] +``` diff --git a/plugins/systemd/systemd.plugin.zsh b/plugins/systemd/systemd.plugin.zsh index 201ffd998..f2d1d6f1c 100644 --- a/plugins/systemd/systemd.plugin.zsh +++ b/plugins/systemd/systemd.plugin.zsh @@ -73,3 +73,18 @@ alias sc-mask-now="sc-mask --now" alias scu-enable-now="scu-enable --now" alias scu-disable-now="scu-disable --now" alias scu-mask-now="scu-mask --now" + +function systemd_prompt_info { + local unit + for unit in $@; do + echo -n "$ZSH_THEME_SYSTEMD_PROMPT_PREFIX" + [[ -n "$ZSH_THEME_SYSTEMD_PROMPT_CAPS" ]] && echo "${(U)unit}:" || echo "$unit:" + if systemctl is-active $unit &>/dev/null; then + echo -n "$ZSH_THEME_SYSTEMD_PROMPT_ACTIVE" + else + echo -n "$ZSH_THEME_SYSTEMD_PROMPT_NOTACTIVE" + fi + echo -n "$ZSH_THEME_SYSTEMD_PROMPT_SUFFIX" + done +} + -- cgit v1.2.3-70-g09d2 From 6adad5c300a6bfde33b593489cc1c3b645b721e8 Mon Sep 17 00:00:00 2001 From: Willy Weiskopf Date: Wed, 16 Jul 2014 22:21:09 -0600 Subject: Move random theme functionality into "random" theme The statements for selecting a random theme in oh-my-zsh.sh and the themes plugin are duplicate. Most people eventually settle on a theme, making those lines in oh-my-zsh.sh superfluous. To address those, it may makes sense to put the random theme functionality into a theme of its own (since themes are just zsh scripts. --- oh-my-zsh.sh | 25 ++++++------------------- plugins/themes/themes.plugin.zsh | 24 +++++++++++------------- themes/random.zsh-theme | 10 ++++++++++ 3 files changed, 27 insertions(+), 32 deletions(-) create mode 100644 themes/random.zsh-theme (limited to 'plugins') diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index c3fae6efb..30259372c 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -97,25 +97,12 @@ done unset config_file # Load the theme -if [[ "$ZSH_THEME" == "random" ]]; then - if [[ "${(t)ZSH_THEME_RANDOM_CANDIDATES}" = "array" ]] && [[ "${#ZSH_THEME_RANDOM_CANDIDATES[@]}" -gt 0 ]]; then - themes=($ZSH/themes/${^ZSH_THEME_RANDOM_CANDIDATES}.zsh-theme) +if [ ! "$ZSH_THEME" = "" ]; then + if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ]; then + source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" + elif [ -f "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" ]; then + source "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" else - themes=($ZSH/themes/*zsh-theme) - fi - N=${#themes[@]} - ((N=(RANDOM%N)+1)) - RANDOM_THEME=${themes[$N]} - source "$RANDOM_THEME" - echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..." -else - if [ ! "$ZSH_THEME" = "" ]; then - if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ]; then - source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" - elif [ -f "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" ]; then - source "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" - else - source "$ZSH/themes/$ZSH_THEME.zsh-theme" - fi + source "$ZSH/themes/$ZSH_THEME.zsh-theme" fi fi diff --git a/plugins/themes/themes.plugin.zsh b/plugins/themes/themes.plugin.zsh index 2cd0ee327..ac4ccc980 100644 --- a/plugins/themes/themes.plugin.zsh +++ b/plugins/themes/themes.plugin.zsh @@ -1,19 +1,17 @@ function theme { - if [ -z "$1" ] || [ "$1" = "random" ]; then - themes=($ZSH/themes/*zsh-theme) - N=${#themes[@]} - ((N=(RANDOM%N)+1)) - RANDOM_THEME=${themes[$N]} - source "$RANDOM_THEME" - echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..." + if [ -z "$1" ]; then + 1="random" + fi + + if [ -f "$ZSH_CUSTOM/$1.zsh-theme" ] + then + source "$ZSH_CUSTOM/$1.zsh-theme" + elif [ -f "$ZSH_CUSTOM/themes/$1.zsh-theme" ] + then + source "$ZSH_CUSTOM/themes/$1.zsh-theme" else - if [ -f "$ZSH_CUSTOM/themes/$1.zsh-theme" ] - then - source "$ZSH_CUSTOM/themes/$1.zsh-theme" - else - source "$ZSH/themes/$1.zsh-theme" - fi + source "$ZSH/themes/$1.zsh-theme" fi } diff --git a/themes/random.zsh-theme b/themes/random.zsh-theme new file mode 100644 index 000000000..739567662 --- /dev/null +++ b/themes/random.zsh-theme @@ -0,0 +1,10 @@ +if [[ "${(t)ZSH_THEME_RANDOM_CANDIDATES}" = "array" ]] && [[ "${#ZSH_THEME_RANDOM_CANDIDATES[@]}" -gt 0 ]]; then + themes=($ZSH/themes/${^ZSH_THEME_RANDOM_CANDIDATES}.zsh-theme) +else + themes=($ZSH/themes/*zsh-theme) +fi +N=${#themes[@]} +((N=(RANDOM%N)+1)) +RANDOM_THEME=${themes[$N]} +source "$RANDOM_THEME" +echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..." -- cgit v1.2.3-70-g09d2 From f4b4a446aca37987bc2612d6115d156417628364 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Wed, 19 Feb 2020 19:32:28 +0100 Subject: Polish themes plugin and error out if theme not found --- plugins/themes/_theme | 3 --- plugins/themes/themes.plugin.zsh | 29 ++++++++++++++++------------- 2 files changed, 16 insertions(+), 16 deletions(-) delete mode 100644 plugins/themes/_theme (limited to 'plugins') diff --git a/plugins/themes/_theme b/plugins/themes/_theme deleted file mode 100644 index 8214ddb0d..000000000 --- a/plugins/themes/_theme +++ /dev/null @@ -1,3 +0,0 @@ -#compdef theme - -_arguments "1: :($(lstheme | tr "\n" " "))" diff --git a/plugins/themes/themes.plugin.zsh b/plugins/themes/themes.plugin.zsh index ac4ccc980..1fbde5b64 100644 --- a/plugins/themes/themes.plugin.zsh +++ b/plugins/themes/themes.plugin.zsh @@ -1,24 +1,27 @@ -function theme -{ - if [ -z "$1" ]; then - 1="random" - fi +function theme { + : ${1:=random} # Use random theme if none provided - if [ -f "$ZSH_CUSTOM/$1.zsh-theme" ] - then + if [[ -f "$ZSH_CUSTOM/$1.zsh-theme" ]]; then source "$ZSH_CUSTOM/$1.zsh-theme" - elif [ -f "$ZSH_CUSTOM/themes/$1.zsh-theme" ] - then + elif [[ -f "$ZSH_CUSTOM/themes/$1.zsh-theme" ]]; then source "$ZSH_CUSTOM/themes/$1.zsh-theme" - else + elif [[ -f "$ZSH/themes/$1.zsh-theme" ]]; then source "$ZSH/themes/$1.zsh-theme" + else + echo "$0: Theme '$1' not found" + return 1 fi } -function lstheme -{ +function _theme { + _arguments "1: :($(lstheme))" +} + +compdef _theme theme + +function lstheme { # Resources: # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Modifiers # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Glob-Qualifiers - print -l {$ZSH,$ZSH_CUSTOM}/themes/*.zsh-theme(N:t:r) + print "$ZSH_CUSTOM"/*.zsh-theme(N:t:r) {"$ZSH_CUSTOM","$ZSH"}/themes/*.zsh-theme(N:t:r) } -- cgit v1.2.3-70-g09d2 From f9a2d8cae39a0fb42e22aa17222c7da7b44b7ede Mon Sep 17 00:00:00 2001 From: Andy Pickle <39109475+pickleat@users.noreply.github.com> Date: Mon, 24 Feb 2020 13:13:16 -0600 Subject: vscode: add documentation for running in macOS (#8674) --- plugins/vscode/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'plugins') diff --git a/plugins/vscode/README.md b/plugins/vscode/README.md index 2c6530650..469c57ea8 100644 --- a/plugins/vscode/README.md +++ b/plugins/vscode/README.md @@ -8,6 +8,15 @@ To start using it, add the `vscode` plugin to your `plugins` array in `~/.zshrc` plugins=(... vscode) ``` +## Requirements + +To use VS Code in the terminal **in macOS**, first you need to install the `code` command in the PATH, +otherwise you might receive this message: `zsh: command not found: code`. + +[As the docs say](https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line), open +the Command Palette via (F1 or ⇧⌘P) and type shell command to find the Shell Command: +> Install 'code' command in PATH + ## VS Code Insiders 🍏 **If you are only using [VS Code Insiders](https://code.visualstudio.com/insiders/), the plugin will automatically bind to your Insiders installation.** -- cgit v1.2.3-70-g09d2 From 7290a08bf6098993b783877c8feab4c33cf49c38 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Tue, 25 Feb 2020 11:54:52 +0100 Subject: battery: fix floating point output in macOS Fixes #8676 --- plugins/battery/battery.plugin.zsh | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'plugins') diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh index 6fe801c9f..857ab6e8c 100644 --- a/plugins/battery/battery.plugin.zsh +++ b/plugins/battery/battery.plugin.zsh @@ -21,7 +21,8 @@ if [[ "$OSTYPE" = darwin* ]]; then local smart_battery_status="$(ioreg -rc AppleSmartBattery)" local -F maxcapacity=$(command grep '^.*"MaxCapacity"\ =\ ' <<< $smart_battery_status | sed -e 's/^.*"MaxCapacity"\ =\ //') local -F currentcapacity=$(command grep '^.*"CurrentCapacity"\ =\ ' <<< $smart_battery_status | sed -e 's/^.*CurrentCapacity"\ =\ //') - echo $(( (currentcapacity/maxcapacity) * 100 )) + local -i pct=$(( (currentcapacity/maxcapacity) * 100 )) + echo $pct } function battery_pct_remaining() { @@ -47,16 +48,17 @@ if [[ "$OSTYPE" = darwin* ]]; then } function battery_pct_prompt () { + local battery_pct color if ioreg -rc AppleSmartBattery | command grep -q '^.*"ExternalConnected"\ =\ No'; then - b=$(battery_pct_remaining) - if [[ $b -gt 50 ]]; then + battery_pct=$(battery_pct_remaining) + if [[ $battery_pct -gt 50 ]]; then color='green' - elif [[ $b -gt 20 ]]; then + elif [[ $battery_pct -gt 20 ]]; then color='yellow' else color='red' fi - echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}" + echo "%{$fg[$color]%}[${battery_pct}%%]%{$reset_color%}" else echo "∞" fi @@ -93,19 +95,19 @@ elif [[ "$OSTYPE" = freebsd* ]]; then } function battery_pct_prompt() { - local b color - b=$(battery_pct_remaining) + local battery_pct color + battery_pct=$(battery_pct_remaining) if battery_is_charging; then echo "∞" else - if [[ $b -gt 50 ]]; then + if [[ $battery_pct -gt 50 ]]; then color='green' - elif [[ $b -gt 20 ]]; then + elif [[ $battery_pct -gt 20 ]]; then color='yellow' else color='red' fi - echo "%{$fg[$color]%}$(battery_pct_remaining)%%%{$reset_color%}" + echo "%{$fg[$color]%}${battery_pct}%%%{$reset_color%}" fi } @@ -136,19 +138,19 @@ elif [[ "$OSTYPE" = linux* ]]; then } function battery_pct_prompt() { - local b color - b=$(battery_pct_remaining) + local battery_pct color + battery_pct=$(battery_pct_remaining) if battery_is_charging; then echo "∞" else - if [[ $b -gt 50 ]]; then + if [[ $battery_pct -gt 50 ]]; then color='green' - elif [[ $b -gt 20 ]]; then + elif [[ $battery_pct -gt 20 ]]; then color='yellow' else color='red' fi - echo "%{$fg[$color]%}$(battery_pct_remaining)%%%{$reset_color%}" + echo "%{$fg[$color]%}${battery_pct}%%%{$reset_color%}" fi } -- cgit v1.2.3-70-g09d2 From b72607bc8e83c9ffc02409ae8a7fed6a8866e022 Mon Sep 17 00:00:00 2001 From: Yahav Itzhak Date: Tue, 25 Feb 2020 13:00:25 +0200 Subject: Add JFrog CLI plugin (#8250) --- plugins/jfrog/README.md | 11 +++++++++++ plugins/jfrog/jfrog.plugin.zsh | 10 ++++++++++ 2 files changed, 21 insertions(+) create mode 100644 plugins/jfrog/README.md create mode 100644 plugins/jfrog/jfrog.plugin.zsh (limited to 'plugins') diff --git a/plugins/jfrog/README.md b/plugins/jfrog/README.md new file mode 100644 index 000000000..1d858620b --- /dev/null +++ b/plugins/jfrog/README.md @@ -0,0 +1,11 @@ +# JFrog CLI + +This plugin provides completion for [JFrog CLI](https://github.com/jfrog/jfrog-cli). + +JFrog CLI provides a simple interface that automates access to [Artifactory](https://jfrog.com/artifactory), [Xray](https://jfrog.com/xray), [Bintray](https://jfrog.com/bintray) and [Mission Control](https://jfrog.com/mission-control) through their respective REST APIs. + +To use it, add `jfrog` to the plugins array in your zshrc file: + +```zsh +plugins=(... jfrog) +``` diff --git a/plugins/jfrog/jfrog.plugin.zsh b/plugins/jfrog/jfrog.plugin.zsh new file mode 100644 index 000000000..064ffa2db --- /dev/null +++ b/plugins/jfrog/jfrog.plugin.zsh @@ -0,0 +1,10 @@ +_jfrog() { + local -a opts + opts=("${(@f)$(_CLI_ZSH_AUTOCOMPLETE_HACK=1 ${words[@]:0:#words[@]-1} --generate-bash-completion)}") + _describe 'values' opts + if [[ $compstate[nmatches] -eq 0 && $words[$CURRENT] != -* ]]; then + _files + fi +} + +compdef _jfrog jfrog \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 3e9e385d98da148a7ad8e8d99da35ce6b7aae9ca Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Tue, 25 Feb 2020 15:41:17 +0100 Subject: battery: remove redundant grep calls in battery_pct function --- plugins/battery/battery.plugin.zsh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'plugins') diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh index 857ab6e8c..4c4d0d4fc 100644 --- a/plugins/battery/battery.plugin.zsh +++ b/plugins/battery/battery.plugin.zsh @@ -18,11 +18,10 @@ if [[ "$OSTYPE" = darwin* ]]; then } function battery_pct() { - local smart_battery_status="$(ioreg -rc AppleSmartBattery)" - local -F maxcapacity=$(command grep '^.*"MaxCapacity"\ =\ ' <<< $smart_battery_status | sed -e 's/^.*"MaxCapacity"\ =\ //') - local -F currentcapacity=$(command grep '^.*"CurrentCapacity"\ =\ ' <<< $smart_battery_status | sed -e 's/^.*CurrentCapacity"\ =\ //') - local -i pct=$(( (currentcapacity/maxcapacity) * 100 )) - echo $pct + local battery_status="$(ioreg -rc AppleSmartBattery)" + local -i capacity=$(sed -n -e '/MaxCapacity/s/^.*"MaxCapacity"\ =\ //p' <<< $battery_status) + local -i current=$(sed -n -e '/CurrentCapacity/s/^.*"CurrentCapacity"\ =\ //p' <<< $battery_status) + echo $(( current * 100 / capacity )) } function battery_pct_remaining() { -- cgit v1.2.3-70-g09d2 From 609890847d3e3b222431952ee7be99803bd16ccc Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Tue, 25 Feb 2020 22:23:37 +0100 Subject: npm: hardcode completion function and delete cached one (#8679) Fixes #8665 --- plugins/npm/npm.plugin.zsh | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'plugins') diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh index f62174a4f..87c68f3fb 100644 --- a/plugins/npm/npm.plugin.zsh +++ b/plugins/npm/npm.plugin.zsh @@ -1,14 +1,16 @@ (( $+commands[npm] )) && { - __NPM_COMPLETION_FILE="${ZSH_CACHE_DIR:-$ZSH/cache}/npm_completion" - - if [[ ! -f $__NPM_COMPLETION_FILE ]]; then - npm completion >! $__NPM_COMPLETION_FILE 2>/dev/null - [[ $? -ne 0 ]] && rm -f $__NPM_COMPLETION_FILE - fi - - [[ -f $__NPM_COMPLETION_FILE ]] && source $__NPM_COMPLETION_FILE - - unset __NPM_COMPLETION_FILE + rm -f "${ZSH_CACHE_DIR:-$ZSH/cache}/npm_completion" + + _npm_completion() { + local si=$IFS + compadd -- $(COMP_CWORD=$((CURRENT-1)) \ + COMP_LINE=$BUFFER \ + COMP_POINT=0 \ + npm completion -- "${words[@]}" \ + 2>/dev/null) + IFS=$si + } + compdef _npm_completion npm } # Install dependencies globally -- cgit v1.2.3-70-g09d2 From 01bfb57446fdc77e8b4ae696729688284392c0e6 Mon Sep 17 00:00:00 2001 From: wallace11 <11wallace11@gmail.com> Date: Thu, 27 Feb 2020 00:59:59 +0900 Subject: zsh-interactive-cd: add vi-mode support (#8681) --- plugins/zsh-interactive-cd/zsh-interactive-cd.plugin.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/zsh-interactive-cd/zsh-interactive-cd.plugin.zsh b/plugins/zsh-interactive-cd/zsh-interactive-cd.plugin.zsh index 0f15aeef0..b0520c239 100644 --- a/plugins/zsh-interactive-cd/zsh-interactive-cd.plugin.zsh +++ b/plugins/zsh-interactive-cd/zsh-interactive-cd.plugin.zsh @@ -144,4 +144,5 @@ zic-completion() { } zle -N zic-completion -bindkey '^I' zic-completion +bindkey -M emacs '^I' zic-completion +bindkey -M viins '^I' zic-completion -- cgit v1.2.3-70-g09d2 From 6cb8ff391d0258434485dbe246f9885ba85cf839 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Thu, 27 Feb 2020 15:21:10 +0100 Subject: vagrant: document aliases --- plugins/vagrant/README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'plugins') diff --git a/plugins/vagrant/README.md b/plugins/vagrant/README.md index f6ea87b0e..331bfa143 100644 --- a/plugins/vagrant/README.md +++ b/plugins/vagrant/README.md @@ -8,3 +8,33 @@ To use it, add `vagrant` to the plugins array in your zshrc file: plugins=(... vagrant) ``` +## Aliases + +| Alias | Command | +|---------|------------------------------| +| `vgi` | `vagrant init` | +| `vup` | `vagrant up` | +| `vd` | `vagrant destroy` | +| `vdf` | `vagrant destroy -f` | +| `vssh` | `vagrant ssh` | +| `vsshc` | `vagrant ssh-config` | +| `vrdp` | `vagrant rdp` | +| `vh` | `vagrant halt` | +| `vssp` | `vagrant suspend` | +| `vst` | `vagrant status` | +| `vre` | `vagrant resume` | +| `vgs` | `vagrant global-status` | +| `vpr` | `vagrant provision` | +| `vr` | `vagrant reload` | +| `vrp` | `vagrant reload --provision` | +| `vp` | `vagrant push` | +| `vsh` | `vagrant share` | +| `vba` | `vagrant box add` | +| `vbr` | `vagrant box remove` | +| `vbl` | `vagrant box list` | +| `vbo` | `vagrant box outdated` | +| `vbu` | `vagrant box update` | +| `vpli` | `vagrant plugin install` | +| `vpll` | `vagrant plugin list` | +| `vplun` | `vagrant plugin uninstall` | +| `vplu` | `vagrant plugin update` | -- cgit v1.2.3-70-g09d2 From 6b54302b90720437300967b3506bffe00a3e243c Mon Sep 17 00:00:00 2001 From: Petr Bělohlávek Date: Fri, 20 Jan 2017 11:05:01 +0100 Subject: python: add alias to run the proper IPython based on virtualenv Current state: a user invokes `ipython` and is provided with the IPython instance regarding the `$PATH`. Proposed state: a user invokes `ipython` (which is a new alias in the *python plugin*) and is provided with the proper IPython instance regarding the currently activated virtualenv. Example: the user's default Python is 2.7 with installed IPython 2.7. User activates Python 3.5 virtualenv where he installs IPython 3.5. After activating the environment, one expects `ipython` to run the version 3.5, which does not happen by default. Instead, IPython 2.7 is used, which in counter-intuitive and often causes problem. Closes #5797 --- plugins/python/README.md | 1 + plugins/python/python.plugin.zsh | 2 ++ 2 files changed, 3 insertions(+) (limited to 'plugins') diff --git a/plugins/python/README.md b/plugins/python/README.md index 2d955c5cb..e391bcfd4 100644 --- a/plugins/python/README.md +++ b/plugins/python/README.md @@ -14,3 +14,4 @@ plugins=(... python) | `pyfind` | Finds .py files recursively in the current directory | | `pyclean [dirs]` | Deletes byte-code and cache files from a list of directories or the current one | | `pygrep ` | Looks for `text` in .py files | +| `ipython` | Runs the appropriate `ipython` version according to the activated virtualenv | diff --git a/plugins/python/python.plugin.zsh b/plugins/python/python.plugin.zsh index f39cd80b7..62855fca2 100644 --- a/plugins/python/python.plugin.zsh +++ b/plugins/python/python.plugin.zsh @@ -14,3 +14,5 @@ function pyclean() { # Grep among .py files alias pygrep='grep -r --include="*.py"' +# Run proper IPython regarding current virtualenv (if any) +alias ipython="python -c 'import IPython; IPython.terminal.ipapp.launch_new_instance()'" -- cgit v1.2.3-70-g09d2 From 011c7153d589b52eb1d48fdf22d4f1438449be2b Mon Sep 17 00:00:00 2001 From: Ciacho Date: Wed, 27 Jan 2016 21:39:53 +0100 Subject: nmap: add alias for ICMP scan (#4807) Closes #4807 --- plugins/nmap/README.md | 54 ++++++++++++++++++-------------------------- plugins/nmap/nmap.plugin.zsh | 2 +- 2 files changed, 23 insertions(+), 33 deletions(-) (limited to 'plugins') diff --git a/plugins/nmap/README.md b/plugins/nmap/README.md index 5cd646277..0a60068c2 100644 --- a/plugins/nmap/README.md +++ b/plugins/nmap/README.md @@ -1,37 +1,27 @@ -# Nmap aliases plugin +# Nmap plugin -Adds some useful aliases for nmap similar to the profiles in zenmap. +Adds some useful aliases for [Nmap](https://nmap.org/) similar to the profiles in zenmap. -Nmap options are: - * -sS - TCP SYN scan - * -v - verbose - * -T1 - timing of scan. Options are paranoid (0), sneaky (1), polite (2), normal (3), aggressive (4), and insane (5) - * -sF - FIN scan (can sneak through non-stateful firewalls) - * -PE - ICMP echo discovery probe - * -PP - timestamp discovery probe - * -PY - SCTP init ping - * -g - use given number as source port - * -A - enable OS detection, version detection, script scanning, and traceroute (aggressive) - * -O - enable OS detection - * -sA - TCP ACK scan - * -F - fast scan - * --script=vulscan - also access vulnerabilities in target +To use it, add `nmap` to the plugins array in your zshrc file: -## Aliases explained +```zsh +plugins=(... nmap) +``` - * nmap_open_ports - Scan for open ports on target - * nmap_list_interfaces - List all network interfaces on host where the command runs - * nmap_slow - Slow scan that avoids to spam the targets logs - * nmap_fin - Scan to see if hosts are up with TCP FIN scan - * nmap_full - Aggressive full scan that scans all ports, tries to determine OS and service versions - * nmap_check_for_firewall - TCP ACK scan to check for firewall existence - * nmap_ping_through_firewall - Host discovery with SYN and ACK probes instead of just pings to avoid firewall - restrictions - * nmap_fast - Fast scan of the top 300 popular ports - * nmap_detect_versions - Detects versions of services and OS, runs on all ports - * nmap_check_for_vulns - Uses vulscan script to check target services for vulnerabilities - * nmap_full_udp - Same as full but via UDP - * nmap_traceroute - Try to traceroute using the most common ports - * nmap_full_with_scripts - Same as nmap_full but also runs all the scripts - * nmap_web_safe_osscan - Little "safer" scan for OS version as connecting to only HTTP and HTTPS ports doesn't look so attacking. +## Aliases +- `nmap_open_ports`: scan for open ports on target. +- `nmap_list_interfaces`: list all network interfaces on host where the command runs. +- `nmap_slow`: slow scan that avoids to spam the targets logs. +- `nmap_fin`: scan to see if hosts are up with TCP FIN scan. +- `nmap_full`: aggressive full scan that scans all ports, tries to determine OS and service versions. +- `nmap_check_for_firewall`: TCP ACK scan to check for firewall existence. +- `nmap_ping_through_firewall`: host discovery with SYN and ACK probes instead of just pings to avoid firewall restrictions. +- `nmap_fast`: fast scan of the top 300 popular ports. +- `nmap_detect_versions`: detects versions of services and OS, runs on all ports. +- `nmap_check_for_vulns`: uses vulscan script to check target services for vulnerabilities. +- `nmap_full_udp`: same as full but via UDP. +- `nmap_traceroute`: try to traceroute using the most common ports. +- `nmap_full_with_scripts`: same as nmap_full but also runs all the scripts. +- `nmap_web_safe_osscan`: little "safer" scan for OS version as connecting to only HTTP and HTTPS ports doesn't look so attacking. +- `nmap_ping_scan`: ICMP scan for active hosts. diff --git a/plugins/nmap/nmap.plugin.zsh b/plugins/nmap/nmap.plugin.zsh index 8c691bdaa..406870f00 100644 --- a/plugins/nmap/nmap.plugin.zsh +++ b/plugins/nmap/nmap.plugin.zsh @@ -29,4 +29,4 @@ alias nmap_full_udp="sudo nmap -sS -sU -T4 -A -v -PE -PS22,25,80 -PA21,23,80,443 alias nmap_traceroute="sudo nmap -sP -PE -PS22,25,80 -PA21,23,80,3389 -PU -PO --traceroute " alias nmap_full_with_scripts="sudo nmap -sS -sU -T4 -A -v -PE -PP -PS21,22,23,25,80,113,31339 -PA80,113,443,10042 -PO --script all " alias nmap_web_safe_osscan="sudo nmap -p 80,443 -O -v --osscan-guess --fuzzy " - +alias nmap_ping_scan="nmap -n -sP" -- cgit v1.2.3-70-g09d2 From 573901dd46d657c4c3d14f6e03a85f1522fb299b Mon Sep 17 00:00:00 2001 From: Adrien Plazas Date: Thu, 27 Feb 2020 18:45:53 +0100 Subject: jhbuild: add shell alias (#3707) This adds "jhsh" as an alias for "jhbuild shell" to the JHBuild plugin. --- plugins/jhbuild/jhbuild.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'plugins') diff --git a/plugins/jhbuild/jhbuild.plugin.zsh b/plugins/jhbuild/jhbuild.plugin.zsh index fed1bc9fc..05e56039d 100644 --- a/plugins/jhbuild/jhbuild.plugin.zsh +++ b/plugins/jhbuild/jhbuild.plugin.zsh @@ -23,6 +23,8 @@ alias jhu='jhbuild update' alias jhuo='jhbuild updateone' # Uninstall alias jhun='jhbuild uninstall' +# Shell +alias jhsh='jhbuild shell' -- cgit v1.2.3-70-g09d2 From ee7a9f6fe679239f7c21f32df135f9c79b606336 Mon Sep 17 00:00:00 2001 From: Miguel Vaello Martínez Date: Thu, 30 Jun 2016 12:25:00 +0200 Subject: jhbuild: add some missing commands and update README (#5195) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commands: make, tinderbox. Closes #5195 Co-authored-by: Marc Cornellà --- plugins/jhbuild/README.md | 34 ++++++++++++++++++++++++++++++++-- plugins/jhbuild/jhbuild.plugin.zsh | 14 ++++++++------ 2 files changed, 40 insertions(+), 8 deletions(-) (limited to 'plugins') diff --git a/plugins/jhbuild/README.md b/plugins/jhbuild/README.md index 910526966..3220e0daf 100644 --- a/plugins/jhbuild/README.md +++ b/plugins/jhbuild/README.md @@ -1,4 +1,34 @@ -## JHBuild +# JHBuild + +This plugin adds some [JHBuild](https://developer.gnome.org/jhbuild/) aliases. + +To use it, add `jhbuild` to the plugins array of your zshrc file: + +```zsh +plugins=(... jhbuild) +``` + **Maintainer:** [Miguel Vaello](https://github.com/miguxbe) -This plugin adds some jhbuild aliases and increase the completion function provided by zsh. +## Aliases + +| Alias | Command | +|---------|---------------------------| +| `jh` | `jhbuild` | +| `jhb` | `jhbuild build` | +| `jhbo` | `jhbuild buildone` | +| `jhckb` | `jhbuild checkbranches` | +| `jhckm` | `jhbuild checkmodulesets` | +| `jhi` | `jhbuild info` | +| `jhl` | `jhbuild list` | +| `jhc` | `jhbuild clean` | +| `jhco` | `jhbuild cleanone` | +| `jhm` | `jhbuild make` | +| `jhr` | `jhbuild run` | +| `jhrd` | `jhbuild rdepends` | +| `jhsd` | `jhbuild sysdeps` | +| `jhu` | `jhbuild update` | +| `jhuo` | `jhbuild updateone` | +| `jhun` | `jhbuild uninstall` | +| `jhsh` | `jhbuild shell` | +| `jht` | `jhbuild tinderbox` | diff --git a/plugins/jhbuild/jhbuild.plugin.zsh b/plugins/jhbuild/jhbuild.plugin.zsh index 05e56039d..416745d27 100644 --- a/plugins/jhbuild/jhbuild.plugin.zsh +++ b/plugins/jhbuild/jhbuild.plugin.zsh @@ -1,5 +1,6 @@ -# Aliases -# +# JHBuild Aliases + +# Base alias jh='jhbuild' # Build alias jhb='jhbuild build' @@ -7,12 +8,14 @@ alias jhbo='jhbuild buildone' # Checks alias jhckb='jhbuild checkbranches' alias jhckm='jhbuild checkmodulesets' -# Info & list +# Info & List alias jhi='jhbuild info' alias jhl='jhbuild list' # Clean alias jhc='jhbuild clean' alias jhco='jhbuild cleanone' +# Make +alias jhm='jhbuild make' # Run alias jhr='jhbuild run' # Depends @@ -25,6 +28,5 @@ alias jhuo='jhbuild updateone' alias jhun='jhbuild uninstall' # Shell alias jhsh='jhbuild shell' - - - +# Tinderbox +alias jht='jhbuild tinderbox' -- cgit v1.2.3-70-g09d2 From 79fff1ee492a2c4d8ab09678bd5e7440cfbf03dd Mon Sep 17 00:00:00 2001 From: Guillermo del Fresno Date: Thu, 27 Feb 2020 14:55:14 -0300 Subject: macports: add rdeps and rdependents completion (#4717) --- plugins/macports/_port | 2 ++ 1 file changed, 2 insertions(+) (limited to 'plugins') diff --git a/plugins/macports/_port b/plugins/macports/_port index 06d7fb426..6a9ebe0c6 100644 --- a/plugins/macports/_port +++ b/plugins/macports/_port @@ -41,6 +41,8 @@ subcmds=( 'patch' 'pkg' 'provides' +'rdependents' +'rdeps' 'rpmpackage' 'search' 'selfupdate' -- cgit v1.2.3-70-g09d2 From 2c0315dba4297ec2e87d6f503a6d907c33f51958 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Thu, 27 Feb 2020 19:26:03 +0100 Subject: ng: refactor README --- plugins/ng/README.md | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) (limited to 'plugins') diff --git a/plugins/ng/README.md b/plugins/ng/README.md index 94a450c18..29ac15aa4 100644 --- a/plugins/ng/README.md +++ b/plugins/ng/README.md @@ -1,37 +1,10 @@ -## NG Plugin +# ng plugin -This [ng plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/ng) - adds completion support for Angular's CLI (named ng). +This plugin adds autocompletion support for [Angular's CLI](https://github.com/angular/angular-cli) +(named `ng`). -Ng is hosted on [ng home](https://github.com/catull/angular-cli) - -It is used to generate Angular 2 app "stubs", build those apps, configure them, -test them, lint them etc. - -Ahem, "stubs" is not what Angular engineers refer to the items ng can generate -for you. - -"Stubs" can be any one of: -- class -- component -- directive -- enum -- module -- pipe -- route -- service - -At the moment, `ng completion` creates a very rough completion for Zsh and -Bash. - -It is missing most of the options and a few arguments. -In future, this plugin may be shortened to simply being +To use it, add `ng` to the plugins array of your zshrc file: ```zsh -eval `ng completion` +plugins=(... ng) ``` - -There is hope this materialises in the 21st century. - -### CONTRIBUTOR - - Carlo Dapor ([catull](https://github.com/catull)) -- cgit v1.2.3-70-g09d2 From 368198b7616eb69b396de86d9ec4ff0f35bd72f0 Mon Sep 17 00:00:00 2001 From: Chai Feng Date: Fri, 28 Feb 2020 05:47:06 +0800 Subject: Fix an issue with escape characters (#7979) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Francisco de Zuviría --- plugins/copybuffer/copybuffer.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/copybuffer/copybuffer.plugin.zsh b/plugins/copybuffer/copybuffer.plugin.zsh index cc205d40f..483ed5a5f 100644 --- a/plugins/copybuffer/copybuffer.plugin.zsh +++ b/plugins/copybuffer/copybuffer.plugin.zsh @@ -1,9 +1,9 @@ # copy the active line from the command line buffer -# onto the system clipboard (requires clipcopy plugin) +# onto the system clipboard copybuffer () { if which clipcopy &>/dev/null; then - echo $BUFFER | clipcopy + printf "%s" "$BUFFER" | clipcopy else echo "clipcopy function not found. Please make sure you have Oh My Zsh installed correctly." fi -- cgit v1.2.3-70-g09d2