From 3e05befaeee60a0f8522f470292c75046b05ceb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Schl=C3=BCter?= Date: Mon, 25 Mar 2024 12:27:21 +0100 Subject: [PATCH 01/17] fix(ssh-agent): don't start new agent if screen/tmux symlink exists (#12297) --- plugins/ssh-agent/ssh-agent.plugin.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index 49ad95a11896..77c422ce124e 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -98,8 +98,10 @@ function _add_identities() { # Add a nifty symlink for screen/tmux if agent forwarding is enabled if zstyle -t :omz:plugins:ssh-agent agent-forwarding \ - && [[ -n "$SSH_AUTH_SOCK" && ! -L "$SSH_AUTH_SOCK" ]]; then - ln -sf "$SSH_AUTH_SOCK" /tmp/ssh-agent-$USERNAME-screen + && [[ -n "$SSH_AUTH_SOCK" ]]; then + if [[ ! -L "$SSH_AUTH_SOCK" ]]; then + ln -sf "$SSH_AUTH_SOCK" /tmp/ssh-agent-$USERNAME-screen + fi else _start_agent fi From 7647c79bae1542b5f4dddc85b16058df7f83fc6c Mon Sep 17 00:00:00 2001 From: Jim Weller <31997291+jimweller@users.noreply.github.com> Date: Tue, 26 Mar 2024 01:48:14 -0700 Subject: [PATCH 02/17] feat(jira): add help/usage cmd (#12293) Co-authored-by: Carlo Sala --- plugins/jira/README.md | 5 ++++- plugins/jira/_jira | 1 + plugins/jira/jira.plugin.zsh | 17 +++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/plugins/jira/README.md b/plugins/jira/README.md index d78ea15a45e7..b1d8a8bc6403 100644 --- a/plugins/jira/README.md +++ b/plugins/jira/README.md @@ -16,18 +16,21 @@ This plugin supplies one command, `jira`, through which all its features are exp ## Commands +`jira help` or `jira usage` will print the below usage instructions + | Command | Description | | :------------ | :-------------------------------------------------------- | | `jira` | Performs the default action | | `jira new` | Opens a new Jira issue dialogue | | `jira ABC-123` | Opens an existing issue | | `jira ABC-123 m` | Opens an existing issue for adding a comment | -| `jira dashboard [rapid_view]` | # opens your JIRA dashboard | +| `jira dashboard [rapid_view]` | Opens your JIRA dashboard | | `jira mine` | Queries for your own issues | | `jira tempo` | Opens your JIRA Tempo | | `jira reported [username]` | Queries for issues reported by a user | | `jira assigned [username]` | Queries for issues assigned to a user | | `jira branch` | Opens an existing issue matching the current branch name | +| `jira help` | Prints usage instructions | ### Jira Branch usage notes diff --git a/plugins/jira/_jira b/plugins/jira/_jira index 0e37b7e9d39b..5f7dcd09d62c 100644 --- a/plugins/jira/_jira +++ b/plugins/jira/_jira @@ -11,6 +11,7 @@ _1st_arguments=( 'assigned:search for issues assigned to a user' 'branch:open the issue named after the git branch of the current directory' 'dumpconfig:display effective jira configuration' + 'help:print usage help to stdout' ) _arguments -C \ diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh index b6ee9f100d10..9bcf4cc7b07f 100644 --- a/plugins/jira/jira.plugin.zsh +++ b/plugins/jira/jira.plugin.zsh @@ -2,6 +2,21 @@ # # See README.md for details +function _jira_usage() { +cat < Date: Tue, 26 Mar 2024 09:52:01 +0100 Subject: [PATCH 03/17] feat(terraform): add `tft` (`terraform test`) (#12299) --- plugins/terraform/README.md | 27 +++++++++++++------------- plugins/terraform/terraform.plugin.zsh | 1 + 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/plugins/terraform/README.md b/plugins/terraform/README.md index 135fd78ef92d..2b535517ca61 100644 --- a/plugins/terraform/README.md +++ b/plugins/terraform/README.md @@ -15,19 +15,20 @@ plugins=(... terraform) ## Aliases -| Alias | Command | -| ----- | -------------------- | -| `tf` | `terraform` | -| `tfa` | `terraform apply` | -| `tfc` | `terraform console` | -| `tfd` | `terraform destroy` | -| `tff` | `terraform fmt` | -| `tfi` | `terraform init` | -| `tfo` | `terraform output` | -| `tfp` | `terraform plan` | -| `tfv` | `terraform validate` | -| `tfs` | `terraform state` | -| `tfsh`| `terraform show` | +| Alias | Command | +| ------ | -------------------- | +| `tf` | `terraform` | +| `tfa` | `terraform apply` | +| `tfc` | `terraform console` | +| `tfd` | `terraform destroy` | +| `tff` | `terraform fmt` | +| `tfi` | `terraform init` | +| `tfo` | `terraform output` | +| `tfp` | `terraform plan` | +| `tfv` | `terraform validate` | +| `tfs` | `terraform state` | +| `tft` | `terraform test` | +| `tfsh` | `terraform show` | ## Prompt function diff --git a/plugins/terraform/terraform.plugin.zsh b/plugins/terraform/terraform.plugin.zsh index f66a8eac946b..8ef392efd0ce 100644 --- a/plugins/terraform/terraform.plugin.zsh +++ b/plugins/terraform/terraform.plugin.zsh @@ -25,4 +25,5 @@ alias tfo='terraform output' alias tfp='terraform plan' alias tfv='terraform validate' alias tfs='terraform state' +alias tft='terraform test' alias tfsh='terraform show' From a168efe73e467c7164ef9b49dea61e9aefd27a48 Mon Sep 17 00:00:00 2001 From: Zikoeng Xi Date: Tue, 26 Mar 2024 16:54:04 +0800 Subject: [PATCH 04/17] fix(poetry-env): activate only if env exists (#12301) --- plugins/poetry-env/poetry-env.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/poetry-env/poetry-env.plugin.zsh b/plugins/poetry-env/poetry-env.plugin.zsh index 86e5fad4ec25..97ca52492191 100644 --- a/plugins/poetry-env/poetry-env.plugin.zsh +++ b/plugins/poetry-env/poetry-env.plugin.zsh @@ -14,10 +14,10 @@ _togglePoetryShell() { # activate the environment if pyproject.toml exists if [[ "$poetry_active" != 1 ]]; then if [[ -f "$PWD/pyproject.toml" ]]; then - if grep -q 'tool.poetry' "$PWD/pyproject.toml"; then + if grep -q 'tool.poetry' "$PWD/pyproject.toml" && venv_dir=$(poetry env info --path); then export poetry_active=1 export poetry_dir="$PWD" - source "$(poetry env info --path)/bin/activate" + source "${venv_dir}/bin/activate" fi fi fi From 1d09c6bb0a950756a65b02457842933e3aa493eb Mon Sep 17 00:00:00 2001 From: vladislav doster <10052309+vladdoster@users.noreply.github.com> Date: Tue, 26 Mar 2024 03:55:16 -0500 Subject: [PATCH 05/17] style: remove trailing whitespace (#12303) --- custom/example.zsh | 6 ++--- custom/themes/example.zsh-theme | 2 +- lib/compfix.zsh | 2 +- lib/diagnostics.zsh | 24 +++++++++---------- oh-my-zsh.sh | 2 +- plugins/ansible/README.md | 2 +- plugins/aws/aws.plugin.zsh | 2 +- plugins/branch/README.md | 2 +- plugins/chruby/chruby.plugin.zsh | 4 ++-- plugins/cloudfoundry/README.md | 2 +- plugins/coffee/README.md | 2 +- plugins/compleat/compleat.plugin.zsh | 4 ++-- plugins/copybuffer/copybuffer.plugin.zsh | 2 +- plugins/dash/README.md | 2 +- plugins/dotnet/dotnet.plugin.zsh | 2 +- plugins/emoji/emoji.plugin.zsh | 18 +++++++------- plugins/emotty/emotty.plugin.zsh | 2 +- plugins/encode64/README.md | 2 +- plugins/fancy-ctrl-z/README.md | 8 +++---- plugins/fastfile/README.md | 4 ++-- plugins/forklift/forklift.plugin.zsh | 4 ++-- plugins/fzf/fzf.plugin.zsh | 2 +- plugins/gnu-utils/gnu-utils.plugin.zsh | 4 ++-- plugins/grails/grails.plugin.zsh | 14 +++++------ plugins/history-substring-search/README.md | 8 +++---- plugins/ionic/ionic.plugin.zsh | 12 +++++----- plugins/iterm2/README.md | 2 +- plugins/iterm2/iterm2.plugin.zsh | 2 +- plugins/iterm2/iterm2_shell_integration.zsh | 4 ++-- plugins/jira/README.md | 2 +- plugins/juju/juju.plugin.zsh | 2 +- plugins/kn/kn.plugin.zsh | 2 +- plugins/macports/_port | 8 +++---- plugins/marked2/README.md | 2 +- plugins/marktext/README.md | 2 +- plugins/mongo-atlas/README.md | 2 +- plugins/n98-magerun/n98-magerun.plugin.zsh | 2 +- plugins/nmap/nmap.plugin.zsh | 2 +- plugins/nomad/_nomad | 2 +- plugins/npm/npm.plugin.zsh | 2 +- plugins/nvm/nvm.plugin.zsh | 2 +- plugins/otp/README.md | 2 +- plugins/pm2/_pm2 | 2 +- plugins/poetry-env/README.md | 2 +- plugins/ros/_ros | 2 +- plugins/sbt/sbt.plugin.zsh | 2 +- plugins/screen/screen.plugin.zsh | 2 +- plugins/singlechar/singlechar.plugin.zsh | 2 +- plugins/systemadmin/README.md | 2 +- plugins/thor/README.md | 2 +- plugins/ufw/README.md | 2 +- plugins/vagrant-prompt/README.md | 2 +- plugins/vi-mode/README.md | 2 +- plugins/vim-interaction/README.md | 2 +- .../vim-interaction.plugin.zsh | 2 +- .../virtualenvwrapper.plugin.zsh | 2 +- plugins/wd/README.md | 2 +- plugins/wd/_wd.sh | 2 +- plugins/z/MANUAL.md | 2 +- themes/Soliah.zsh-theme | 10 ++++---- themes/adben.zsh-theme | 2 +- themes/agnoster.zsh-theme | 2 +- themes/avit.zsh-theme | 2 +- themes/crunch.zsh-theme | 6 ++--- themes/eastwood.zsh-theme | 2 +- themes/emotty.zsh-theme | 4 ++-- themes/essembeh.zsh-theme | 4 ++-- themes/josh.zsh-theme | 8 +++---- themes/junkfood.zsh-theme | 4 ++-- themes/mlh.zsh-theme | 2 +- themes/mortalscumbag.zsh-theme | 2 +- themes/sonicradish.zsh-theme | 2 +- themes/wedisagree.zsh-theme | 14 +++++------ 73 files changed, 138 insertions(+), 138 deletions(-) diff --git a/custom/example.zsh b/custom/example.zsh index 21a8d8be7c86..c194f49d78fb 100644 --- a/custom/example.zsh +++ b/custom/example.zsh @@ -1,12 +1,12 @@ # Put files in this folder to add your own custom functionality. # See: https://github.com/ohmyzsh/ohmyzsh/wiki/Customization -# +# # Files in the custom/ directory will be: # - loaded automatically by the init script, in alphabetical order # - loaded last, after all built-ins in the lib/ directory, to override them # - ignored by git by default -# +# # Example: add custom/shortcuts.zsh for shortcuts to your local projects -# +# # brainstormr=~/Projects/development/planetargon/brainstormr # cd $brainstormr diff --git a/custom/themes/example.zsh-theme b/custom/themes/example.zsh-theme index 494d029e89f0..5551207f8c9d 100644 --- a/custom/themes/example.zsh-theme +++ b/custom/themes/example.zsh-theme @@ -1,6 +1,6 @@ # Put your custom themes in this folder. # See: https://github.com/ohmyzsh/ohmyzsh/wiki/Customization#overriding-and-adding-themes -# +# # Example: PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% " diff --git a/lib/compfix.zsh b/lib/compfix.zsh index b09b283f2785..2fe9d9e64a5b 100644 --- a/lib/compfix.zsh +++ b/lib/compfix.zsh @@ -13,7 +13,7 @@ function handle_completion_insecurities() { # /usr/share/zsh/5.0.6 # # Since the ignorable first line is printed to stderr and thus not captured, - # stderr is squelched to prevent this output from leaking to the user. + # stderr is squelched to prevent this output from leaking to the user. local -aU insecure_dirs insecure_dirs=( ${(f@):-"$(compaudit 2>/dev/null)"} ) diff --git a/lib/diagnostics.zsh b/lib/diagnostics.zsh index eaeba7d2313b..d67e6fab43e6 100644 --- a/lib/diagnostics.zsh +++ b/lib/diagnostics.zsh @@ -30,7 +30,7 @@ # # This is written in a defensive style so it still works (and can detect) cases when # basic functionality like echo and which have been redefined. In particular, almost -# everything is invoked with "builtin" or "command", to work in the face of user +# everything is invoked with "builtin" or "command", to work in the face of user # redefinitions. # # OPTIONS @@ -59,7 +59,7 @@ function omz_diagnostic_dump() { emulate -L zsh builtin echo "Generating diagnostic dump; please be patient..." - + local thisfcn=omz_diagnostic_dump local -A opts local opt_verbose opt_noverbose opt_outfile @@ -90,7 +90,7 @@ function omz_diagnostic_dump() { builtin echo builtin echo Diagnostic dump file created at: "$outfile" builtin echo - builtin echo To share this with OMZ developers, post it as a gist on GitHub + builtin echo To share this with OMZ developers, post it as a gist on GitHub builtin echo at "https://gist.github.com" and share the link to the gist. builtin echo builtin echo "WARNING: This dump file contains all your zsh and omz configuration files," @@ -105,8 +105,8 @@ function _omz_diag_dump_one_big_text() { builtin echo oh-my-zsh diagnostic dump builtin echo builtin echo $outfile - builtin echo - + builtin echo + # Basic system and zsh information command date command uname -a @@ -151,7 +151,7 @@ function _omz_diag_dump_one_big_text() { # Core command definitions _omz_diag_dump_check_core_commands || return 1 - builtin echo + builtin echo # ZSH Process state builtin echo Process state: @@ -167,7 +167,7 @@ function _omz_diag_dump_one_big_text() { #TODO: Should this include `env` instead of or in addition to `export`? builtin echo Exported: builtin echo $(builtin export | command sed 's/=.*//') - builtin echo + builtin echo builtin echo Locale: command locale builtin echo @@ -181,7 +181,7 @@ function _omz_diag_dump_one_big_text() { builtin echo builtin echo 'compaudit output:' compaudit - builtin echo + builtin echo builtin echo '$fpath directories:' command ls -lad $fpath builtin echo @@ -224,7 +224,7 @@ function _omz_diag_dump_one_big_text() { local cfgfile cfgfiles # Some files for bash that zsh does not use are intentionally included # to help with diagnosing behavior differences between bash and zsh - cfgfiles=( /etc/zshenv /etc/zprofile /etc/zshrc /etc/zlogin /etc/zlogout + cfgfiles=( /etc/zshenv /etc/zprofile /etc/zshrc /etc/zlogin /etc/zlogout $zdotdir/.zshenv $zdotdir/.zprofile $zdotdir/.zshrc $zdotdir/.zlogin $zdotdir/.zlogout ~/.zsh.pre-oh-my-zsh /etc/bashrc /etc/profile ~/.bashrc ~/.profile ~/.bash_profile ~/.bash_logout ) @@ -258,8 +258,8 @@ function _omz_diag_dump_check_core_commands() { # (For back-compatibility, if any of these are newish, they should be removed, # or at least made conditional on the version of the current running zsh.) # "history" is also excluded because OMZ is known to redefine that - reserved_words=( do done esac then elif else fi for case if while function - repeat time until select coproc nocorrect foreach end '!' '[[' '{' '}' + reserved_words=( do done esac then elif else fi for case if while function + repeat time until select coproc nocorrect foreach end '!' '[[' '{' '}' ) builtins=( alias autoload bg bindkey break builtin bye cd chdir command comparguments compcall compctl compdescribe compfiles compgroups compquote comptags @@ -331,7 +331,7 @@ function _omz_diag_dump_os_specific_version() { case "$OSTYPE" in darwin*) osname=$(command sw_vers -productName) - osver=$(command sw_vers -productVersion) + osver=$(command sw_vers -productVersion) builtin echo "OS Version: $osname $osver build $(sw_vers -buildVersion)" ;; cygwin) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 137ca3b6fc14..2fb20298a013 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -152,7 +152,7 @@ unset zcompdump_revision zcompdump_fpath zcompdump_refresh # zcompile the completion dump file if the .zwc is older or missing. if command mkdir "${ZSH_COMPDUMP}.lock" 2>/dev/null; then zrecompile -q -p "$ZSH_COMPDUMP" - command rm -rf "$ZSH_COMPDUMP.zwc.old" "${ZSH_COMPDUMP}.lock" + command rm -rf "$ZSH_COMPDUMP.zwc.old" "${ZSH_COMPDUMP}.lock" fi _omz_source() { diff --git a/plugins/ansible/README.md b/plugins/ansible/README.md index ce21e7075393..dd0e1ce03ebc 100644 --- a/plugins/ansible/README.md +++ b/plugins/ansible/README.md @@ -28,6 +28,6 @@ plugins=(... ansible) ## Maintainer -### [Deepankumar](https://github.com/deepan10) +### [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/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index 071dd1f0b9a9..0c43031df6b2 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -280,7 +280,7 @@ if [[ "$AWS_PROFILE_STATE_ENABLED" == true ]]; then test -s "${AWS_STATE_FILE}" || return aws_state=($(cat $AWS_STATE_FILE)) - + export AWS_DEFAULT_PROFILE="${aws_state[1]}" export AWS_PROFILE="$AWS_DEFAULT_PROFILE" export AWS_EB_PROFILE="$AWS_DEFAULT_PROFILE" diff --git a/plugins/branch/README.md b/plugins/branch/README.md index a15dd22df2ae..2b6d12d291ef 100644 --- a/plugins/branch/README.md +++ b/plugins/branch/README.md @@ -39,7 +39,7 @@ index 2fd5f2cd..9d89a464 100644 PROMPT="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )" -PROMPT+=' %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)' +PROMPT+=' %{$fg[cyan]%}%c%{$reset_color%} $(branch_prompt_info)' - + ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " ``` diff --git a/plugins/chruby/chruby.plugin.zsh b/plugins/chruby/chruby.plugin.zsh index d7a28d4e285f..1210897c4a5f 100644 --- a/plugins/chruby/chruby.plugin.zsh +++ b/plugins/chruby/chruby.plugin.zsh @@ -2,7 +2,7 @@ _source-from-omz-settings() { local _chruby_path _chruby_auto - + zstyle -s :omz:plugins:chruby path _chruby_path || return 1 zstyle -s :omz:plugins:chruby auto _chruby_auto || return 1 @@ -23,7 +23,7 @@ _source-from-homebrew() { if [[ -h /usr/local/opt/chruby ]];then _brew_prefix="/usr/local/opt/chruby" else - # ok , it is not default prefix + # ok , it is not default prefix # this call to brew is expensive ( about 400 ms ), so at least let's make it only once _brew_prefix=$(brew --prefix chruby) fi diff --git a/plugins/cloudfoundry/README.md b/plugins/cloudfoundry/README.md index 89dd9d1ce2da..567a9056bb67 100644 --- a/plugins/cloudfoundry/README.md +++ b/plugins/cloudfoundry/README.md @@ -50,7 +50,7 @@ Alternatively, seek out the [online documentation][3]. And don't forget, there a ## Contributors -Contributed to `oh_my_zsh` by [benwilcock][2]. +Contributed to `oh_my_zsh` by [benwilcock][2]. [1]: https://docs.cloudfoundry.org/cf-cli/install-go-cli.html [2]: https://github.com/benwilcock diff --git a/plugins/coffee/README.md b/plugins/coffee/README.md index 2baade844b73..c2ab192b670b 100644 --- a/plugins/coffee/README.md +++ b/plugins/coffee/README.md @@ -24,7 +24,7 @@ Also provides the following aliases: * **cfc:** Copies the compiled JS to your clipboard. Very useful when you want to run the code in a JS console. -* **cfp:** Compiles from your currently copied clipboard. Useful when you want +* **cfp:** Compiles from your currently copied clipboard. Useful when you want to compile large/multi-line snippets * **cfpc:** Paste coffeescript from clipboard, compile to JS, then copy the diff --git a/plugins/compleat/compleat.plugin.zsh b/plugins/compleat/compleat.plugin.zsh index 38f1b396aabf..7fbd2b953593 100644 --- a/plugins/compleat/compleat.plugin.zsh +++ b/plugins/compleat/compleat.plugin.zsh @@ -7,7 +7,7 @@ if (( ${+commands[compleat]} )); then local prefix="${commands[compleat]:h:h}" - local setup="${prefix}/share/compleat-1.0/compleat_setup" + local setup="${prefix}/share/compleat-1.0/compleat_setup" if [[ -f "$setup" ]]; then if ! bashcompinit >/dev/null 2>&1; then @@ -15,6 +15,6 @@ if (( ${+commands[compleat]} )); then bashcompinit -i fi - source "$setup" + source "$setup" fi fi diff --git a/plugins/copybuffer/copybuffer.plugin.zsh b/plugins/copybuffer/copybuffer.plugin.zsh index e67f920f031b..88bda32a080f 100644 --- a/plugins/copybuffer/copybuffer.plugin.zsh +++ b/plugins/copybuffer/copybuffer.plugin.zsh @@ -1,4 +1,4 @@ -# copy the active line from the command line buffer +# copy the active line from the command line buffer # onto the system clipboard copybuffer () { diff --git a/plugins/dash/README.md b/plugins/dash/README.md index 0ca3e4e44d7a..970c6541fb2a 100644 --- a/plugins/dash/README.md +++ b/plugins/dash/README.md @@ -19,7 +19,7 @@ dash - Query for something in dash app: `dash query` ``` -dash golang +dash golang ``` - You can optionally provide a keyword: `dash [keyword:]query` diff --git a/plugins/dotnet/dotnet.plugin.zsh b/plugins/dotnet/dotnet.plugin.zsh index 40ee7efaeafb..ed7c55024135 100644 --- a/plugins/dotnet/dotnet.plugin.zsh +++ b/plugins/dotnet/dotnet.plugin.zsh @@ -11,7 +11,7 @@ _dotnet_completion() { compdef _dotnet_completion dotnet # Aliases bellow are here for backwards compatibility -# added by Shaun Tabone (https://github.com/xontab) +# added by Shaun Tabone (https://github.com/xontab) alias dn='dotnet new' alias dr='dotnet run' diff --git a/plugins/emoji/emoji.plugin.zsh b/plugins/emoji/emoji.plugin.zsh index f9e476ebf884..f7be56cf75be 100644 --- a/plugins/emoji/emoji.plugin.zsh +++ b/plugins/emoji/emoji.plugin.zsh @@ -24,7 +24,7 @@ unset _omz_emoji_plugin_dir # This is a combining character that can be placed after any other character to surround # it in a "keycap" symbol. -# The digits 0-9 are already in the emoji table as keycap_digit_, keycap_ten, etc. +# The digits 0-9 are already in the emoji table as keycap_digit_, keycap_ten, etc. # It's unclear whether this should be in the $emoji array, because those characters are all ones # which can be displayed on their own. @@ -63,9 +63,9 @@ function random_emoji() { [[ $list_size -eq 0 ]] && return 1 local random_index=$(( ( RANDOM % $list_size ) + 1 )) local name=${names[$random_index]} - if [[ "$group" == "flags" ]]; then + if [[ "$group" == "flags" ]]; then echo ${emoji_flags[$name]} - else + else echo ${emoji[$name]} fi } @@ -86,22 +86,22 @@ function display_emoji() { # terminals treat these emoji chars as single-width. local counter=1 for i in $names; do - if [[ "$group" == "flags" ]]; then + if [[ "$group" == "flags" ]]; then printf '%s ' "$emoji_flags[$i]" - else - printf '%s ' "$emoji[$i]" + else + printf '%s ' "$emoji[$i]" fi # New line every 20 emoji, to avoid weirdnesses if (($counter % 20 == 0)); then - printf "\n" + printf "\n" fi let counter=$counter+1 done print for i in $names; do - if [[ "$group" == "flags" ]]; then + if [[ "$group" == "flags" ]]; then echo "${emoji_flags[$i]} = $i" - else + else echo "${emoji[$i]} = $i" fi done diff --git a/plugins/emotty/emotty.plugin.zsh b/plugins/emotty/emotty.plugin.zsh index 661169a8b7b2..b48d121dce65 100644 --- a/plugins/emotty/emotty.plugin.zsh +++ b/plugins/emotty/emotty.plugin.zsh @@ -4,7 +4,7 @@ # AUTHOR: Alexis Hildebrandt (afh[at]surryhill.net) # VERSION: 1.0.0 # DEPENDS: emoji plugin -# +# # There are different sets of emoji characters available, to choose a different # set export emotty_set to the name of the set you would like to use, e.g.: # % export emotty_set=nature diff --git a/plugins/encode64/README.md b/plugins/encode64/README.md index 7cdf8c3f30d8..e3e25a742631 100644 --- a/plugins/encode64/README.md +++ b/plugins/encode64/README.md @@ -40,7 +40,7 @@ plugins=(... encode64) ### Encoding a file -Encode a file's contents to base64 and save output to text file. +Encode a file's contents to base64 and save output to text file. **NOTE:** Takes provided file and saves encoded content as new file with `.txt` extension - From parameter diff --git a/plugins/fancy-ctrl-z/README.md b/plugins/fancy-ctrl-z/README.md index f1b1dfa5cdf6..82a4fd75e724 100644 --- a/plugins/fancy-ctrl-z/README.md +++ b/plugins/fancy-ctrl-z/README.md @@ -1,14 +1,14 @@ # Use Ctrl-Z to switch back to Vim -I frequently need to execute random commands in my shell. To achieve it I pause +I frequently need to execute random commands in my shell. To achieve it I pause Vim by pressing Ctrl-z, type command and press fg to switch back to Vim. -The fg part really hurts me. I just wanted to hit Ctrl-z once again to get back -to Vim. I could not find a solution, so I developed one on my own that +The fg part really hurts me. I just wanted to hit Ctrl-z once again to get back +to Vim. I could not find a solution, so I developed one on my own that works wonderfully with ZSH. Source: http://sheerun.net/2014/03/21/how-to-boost-your-vim-productivity/ -Credits: +Credits: - original idea by @sheerun - added to OMZ by @mbologna diff --git a/plugins/fastfile/README.md b/plugins/fastfile/README.md index 32f619ffd05a..7291fde38ba8 100644 --- a/plugins/fastfile/README.md +++ b/plugins/fastfile/README.md @@ -71,13 +71,13 @@ them, add `=` to your zshrc file, before Oh My Zsh is sourced. For example: `fastfile_var_prefix='@'`. - `fastfile_var_prefix`: prefix for the global aliases created. Controls the prefix of the - created global aliases. + created global aliases. **Default:** `§` (section sign), easy to type in a german keyboard via the combination [`⇧ Shift`+`3`](https://en.wikipedia.org/wiki/German_keyboard_layout#/media/File:KB_Germany.svg), or using `⌥ Option`+`6` in macOS. - `fastfile_dir`: directory where the fastfile shortcuts are stored. Needs to end - with a trailing slash. + with a trailing slash. **Default:** `$HOME/.fastfile/`. ## Author diff --git a/plugins/forklift/forklift.plugin.zsh b/plugins/forklift/forklift.plugin.zsh index 85889481b938..848aedabf966 100644 --- a/plugins/forklift/forklift.plugin.zsh +++ b/plugins/forklift/forklift.plugin.zsh @@ -58,7 +58,7 @@ function fl { tell application forkLiftSetapp activate set forkLiftVersion to version - end tell + end tell else if forkLift3 is not null and application forkLift3 is running then tell application forkLift3 activate @@ -84,7 +84,7 @@ function fl { else if forkLift is not null then set appName to forkLift end if - + tell application appName activate set forkLiftVersion to version diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh index 7312e3d26666..9e372f498e78 100644 --- a/plugins/fzf/fzf.plugin.zsh +++ b/plugins/fzf/fzf.plugin.zsh @@ -62,7 +62,7 @@ function fzf_setup_using_base_dir() { function fzf_setup_using_debian() { if (( ! $+commands[apt] && ! $+commands[apt-get] )); then - # Not a debian based distro + # Not a debian based distro return 1 fi diff --git a/plugins/gnu-utils/gnu-utils.plugin.zsh b/plugins/gnu-utils/gnu-utils.plugin.zsh index 6023bf2b4c81..adc2bd3bbec5 100644 --- a/plugins/gnu-utils/gnu-utils.plugin.zsh +++ b/plugins/gnu-utils/gnu-utils.plugin.zsh @@ -14,7 +14,7 @@ __gnu_utils() { local -a gcmds local gcmd - # coreutils + # coreutils gcmds=('g[' 'gbase64' 'gbasename' 'gcat' 'gchcon' 'gchgrp' 'gchmod' 'gchown' 'gchroot' 'gcksum' 'gcomm' 'gcp' 'gcsplit' 'gcut' 'gdate' 'gdd' 'gdf' 'gdir' 'gdircolors' 'gdirname' 'gdu' 'gecho' 'genv' 'gexpand' @@ -41,7 +41,7 @@ __gnu_utils() { for gcmd in "${gcmds[@]}"; do # Do nothing if the command isn't found (( ${+commands[$gcmd]} )) || continue - + # This method allows for builtin commands to be primary but it's # lost if hash -r or rehash is executed, or if $PATH is updated. # Thus, a preexec hook is needed, which will only run if whoami diff --git a/plugins/grails/grails.plugin.zsh b/plugins/grails/grails.plugin.zsh index ddc25742861a..e5dceb530ff6 100644 --- a/plugins/grails/grails.plugin.zsh +++ b/plugins/grails/grails.plugin.zsh @@ -7,7 +7,7 @@ _enumerateGrailsScripts() { then directories+=(plugins/*/scripts) fi - + # Enumerate all of the Groovy files files=() for dir in $directories; @@ -17,13 +17,13 @@ _enumerateGrailsScripts() { files+=($dir/[^_]*.groovy) fi done - + # Don't try to basename () if [ ${#files} -eq 0 ]; then return fi - + scripts=() for file in $files do @@ -42,19 +42,19 @@ _enumerateGrailsScripts() { done echo $scripts } - + _grails() { if (( CURRENT == 2 )); then scripts=( $(_enumerateGrailsScripts) ) - + if [ ${#scripts} -ne 0 ]; then _multi_parts / scripts return fi fi - + _files } - + compdef _grails grails diff --git a/plugins/history-substring-search/README.md b/plugins/history-substring-search/README.md index 71a389535527..4be744c4c7b2 100644 --- a/plugins/history-substring-search/README.md +++ b/plugins/history-substring-search/README.md @@ -57,13 +57,13 @@ Using [antigen](https://github.com/zsh-users/antigen): 1. Add the `antigen bundle` command just before `antigen apply`, like this: -``` +``` antigen bundle zsh-users/zsh-history-substring-search antigen apply ``` - + 2. Then, **after** `antigen apply`, add the key binding configurations, like this: - + ``` # zsh-history-substring-search configuration bindkey '^[[A' history-substring-search-up # or '\eOA' @@ -120,7 +120,7 @@ Usage bindkey "$terminfo[kcuu1]" history-substring-search-up bindkey "$terminfo[kcud1]" history-substring-search-down - Users have also observed that `[OA` and `[OB` are correct values, + Users have also observed that `[OA` and `[OB` are correct values, _even if_ these were not the observed values. If you are having trouble with the observed values, give these a try. diff --git a/plugins/ionic/ionic.plugin.zsh b/plugins/ionic/ionic.plugin.zsh index cf388af1b072..e3913b549d0a 100644 --- a/plugins/ionic/ionic.plugin.zsh +++ b/plugins/ionic/ionic.plugin.zsh @@ -3,13 +3,13 @@ alias ih="ionic --help" alias ist="ionic start" alias ii="ionic info" alias is="ionic serve" -alias icba="ionic cordova build android" -alias icbi="ionic cordova build ios" -alias icra="ionic cordova run android" -alias icri="ionic cordova run ios" -alias icrsa="ionic cordova resources android" +alias icba="ionic cordova build android" +alias icbi="ionic cordova build ios" +alias icra="ionic cordova run android" +alias icri="ionic cordova run ios" +alias icrsa="ionic cordova resources android" alias icrsi="ionic cordova resources ios" -alias icpaa="ionic cordova platform add android" +alias icpaa="ionic cordova platform add android" alias icpai="ionic cordova platform add ios" alias icpra="ionic cordova platform rm android" alias icpri="ionic cordova platform rm ios" diff --git a/plugins/iterm2/README.md b/plugins/iterm2/README.md index 3d11622dfd88..86bd77f1de13 100644 --- a/plugins/iterm2/README.md +++ b/plugins/iterm2/README.md @@ -9,7 +9,7 @@ plugins=(... iterm2) ``` Optionally, the plugin also applies the [Shell Integration Script for iTerm2](https://iterm2.com/documentation-shell-integration.html). -You can enable the integration with zstyle. It's important to add this line +You can enable the integration with zstyle. It's important to add this line before the line sourcing oh-my-zsh: ``` diff --git a/plugins/iterm2/iterm2.plugin.zsh b/plugins/iterm2/iterm2.plugin.zsh index d00232a30a27..03a63a70c5e9 100644 --- a/plugins/iterm2/iterm2.plugin.zsh +++ b/plugins/iterm2/iterm2.plugin.zsh @@ -8,7 +8,7 @@ if [[ "$OSTYPE" == darwin* ]] && [[ -n "$ITERM_SESSION_ID" ]] ; then # maybe make it the default in the future and allow opting out? - if zstyle -t ':omz:plugins:iterm2' shell-integration; then + if zstyle -t ':omz:plugins:iterm2' shell-integration; then # Handle $0 according to the standard: # https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html 0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" diff --git a/plugins/iterm2/iterm2_shell_integration.zsh b/plugins/iterm2/iterm2_shell_integration.zsh index 7871dddedb28..281332e0d229 100644 --- a/plugins/iterm2/iterm2_shell_integration.zsh +++ b/plugins/iterm2/iterm2_shell_integration.zsh @@ -2,12 +2,12 @@ # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/plugins/jira/README.md b/plugins/jira/README.md index b1d8a8bc6403..1c6930298c88 100644 --- a/plugins/jira/README.md +++ b/plugins/jira/README.md @@ -35,7 +35,7 @@ This plugin supplies one command, `jira`, through which all its features are exp ### Jira Branch usage notes -The branch name may have prefixes ending in "/": "feature/MP-1234", and also suffixes +The branch name may have prefixes ending in "/": "feature/MP-1234", and also suffixes starting with "_": "MP-1234_fix_dashboard". In both these cases, the issue opened will be "MP-1234" This is also checks if the prefix is in the name, and adds it if not, so: "MP-1234" opens the issue "MP-1234", diff --git a/plugins/juju/juju.plugin.zsh b/plugins/juju/juju.plugin.zsh index a82ebaf84eb0..3c159da2206a 100644 --- a/plugins/juju/juju.plugin.zsh +++ b/plugins/juju/juju.plugin.zsh @@ -184,7 +184,7 @@ jmodel() { fi local model="$(yq e ".controllers.$(jcontroller).current-model" < ~/.local/share/juju/models.yaml | cut -d/ -f2)" - + if [[ -z "$model" ]]; then echo "--" return 1 diff --git a/plugins/kn/kn.plugin.zsh b/plugins/kn/kn.plugin.zsh index f60177dd9eb4..483d1d68c124 100644 --- a/plugins/kn/kn.plugin.zsh +++ b/plugins/kn/kn.plugin.zsh @@ -4,5 +4,5 @@ if [ $commands[kn] ]; then source <(kn completion zsh) - compdef _kn kn + compdef _kn kn fi diff --git a/plugins/macports/_port b/plugins/macports/_port index 897598a4608b..f40f6550b83b 100644 --- a/plugins/macports/_port +++ b/plugins/macports/_port @@ -1,6 +1,6 @@ #compdef port -local subcmds +local subcmds # we cache the list of ports # we shall use some cache policy to avoid problems with new ports @@ -31,8 +31,8 @@ subcmds=( 'file' 'help' 'info' -'install' -'installed' +'install' +'installed' 'list' 'livecheck' 'location' @@ -51,7 +51,7 @@ subcmds=( 'test' 'unarchive' 'uninstall' -'upgrade' +'upgrade' 'variants' 'version' ) diff --git a/plugins/marked2/README.md b/plugins/marked2/README.md index 101343abbae6..2f825bc4a2a7 100644 --- a/plugins/marked2/README.md +++ b/plugins/marked2/README.md @@ -1,6 +1,6 @@ ## marked2 -Plugin for Marked 2, a previewer for Markdown files on Mac OS X +Plugin for Marked 2, a previewer for Markdown files on Mac OS X ### Requirements diff --git a/plugins/marktext/README.md b/plugins/marktext/README.md index 71d287451692..254e4e7acfce 100644 --- a/plugins/marktext/README.md +++ b/plugins/marktext/README.md @@ -1,6 +1,6 @@ ## marktext -Plugin for MarkText, a previewer for Markdown files on Mac OS X +Plugin for MarkText, a previewer for Markdown files on Mac OS X ### Requirements diff --git a/plugins/mongo-atlas/README.md b/plugins/mongo-atlas/README.md index ef1b5e0d237d..94183c544e6b 100644 --- a/plugins/mongo-atlas/README.md +++ b/plugins/mongo-atlas/README.md @@ -1,6 +1,6 @@ # MongoDB Atlas plugin -This plugin adds completion for [Atlas](https://www.mongodb.com/docs/atlas/cli/stable/) a command line interface built specifically for +This plugin adds completion for [Atlas](https://www.mongodb.com/docs/atlas/cli/stable/) a command line interface built specifically for MongoDB Atlas. To use it, add `mongo-atlas` to the plugins array in your zshrc file: diff --git a/plugins/n98-magerun/n98-magerun.plugin.zsh b/plugins/n98-magerun/n98-magerun.plugin.zsh index d79aee7eb882..2744ad96e37b 100644 --- a/plugins/n98-magerun/n98-magerun.plugin.zsh +++ b/plugins/n98-magerun/n98-magerun.plugin.zsh @@ -1,6 +1,6 @@ # ------------------------------------------------------------------------------ # FILE: n98-magerun.plugin.zsh -# DESCRIPTION: oh-my-zsh n98-magerun plugin file. Adapted from composer plugin +# DESCRIPTION: oh-my-zsh n98-magerun plugin file. Adapted from composer plugin # AUTHOR: Andrew Dwyer (andrewrdwyer at gmail dot com) # AUTHOR: Jisse Reitsma (jisse at yireo dot com) # VERSION: 1.1.0 diff --git a/plugins/nmap/nmap.plugin.zsh b/plugins/nmap/nmap.plugin.zsh index 406870f00172..f649dafc205d 100644 --- a/plugins/nmap/nmap.plugin.zsh +++ b/plugins/nmap/nmap.plugin.zsh @@ -27,6 +27,6 @@ alias nmap_detect_versions="sudo nmap -sV -p1-65535 -O --osscan-guess -T4 -Pn" alias nmap_check_for_vulns="nmap --script=vuln" alias nmap_full_udp="sudo nmap -sS -sU -T4 -A -v -PE -PS22,25,80 -PA21,23,80,443,3389 " alias nmap_traceroute="sudo nmap -sP -PE -PS22,25,80 -PA21,23,80,3389 -PU -PO --traceroute " -alias nmap_full_with_scripts="sudo nmap -sS -sU -T4 -A -v -PE -PP -PS21,22,23,25,80,113,31339 -PA80,113,443,10042 -PO --script all " +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" diff --git a/plugins/nomad/_nomad b/plugins/nomad/_nomad index 4c6cb2fcb072..87f80aa8406f 100644 --- a/plugins/nomad/_nomad +++ b/plugins/nomad/_nomad @@ -89,7 +89,7 @@ __plan() { '-address=[(addr) The address of the Nomad server. Overrides the NOMAD_ADDR environment variable if set. Default = http://127.0.0.1:4646]' \ '-region=[(region) The region of the Nomad servers to forward commands to. Overrides the NOMAD_REGION environment variable if set. Defaults to the Agent s local region.]' \ '-no-color[Disables colored command output.]' \ - '-diff[Determines whether the diff between the remote job and planned job is shown. Defaults to true.]' + '-diff[Determines whether the diff between the remote job and planned job is shown. Defaults to true.]' } __run() { diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh index 23377b0856b4..c333f76eda2c 100644 --- a/plugins/npm/npm.plugin.zsh +++ b/plugins/npm/npm.plugin.zsh @@ -58,7 +58,7 @@ alias npmt="npm test" # Run npm scripts alias npmR="npm run" -# Run npm publish +# Run npm publish alias npmP="npm publish" # Run npm init diff --git a/plugins/nvm/nvm.plugin.zsh b/plugins/nvm/nvm.plugin.zsh index 6a5afecfab18..c2e8de94b5af 100644 --- a/plugins/nvm/nvm.plugin.zsh +++ b/plugins/nvm/nvm.plugin.zsh @@ -16,7 +16,7 @@ if [[ -z "$NVM_DIR" ]]; then fi fi -if [[ -z "$NVM_DIR" ]] || [[ ! -f "$NVM_DIR/nvm.sh" ]]; then +if [[ -z "$NVM_DIR" ]] || [[ ! -f "$NVM_DIR/nvm.sh" ]]; then return fi diff --git a/plugins/otp/README.md b/plugins/otp/README.md index 8331fd02b4c3..52ad9525bc19 100644 --- a/plugins/otp/README.md +++ b/plugins/otp/README.md @@ -16,7 +16,7 @@ Provided aliases: email address). Then the OTP key needs to be pasted, followed by a CTRL+D character inserted on an empty line. -- `ot`: generates a MFA code based on the given key and copies it to the clipboard +- `ot`: generates a MFA code based on the given key and copies it to the clipboard (on Linux it relies on xsel, on MacOS X it uses pbcopy instead). The plugin uses `$HOME/.otp` to store its internal files. diff --git a/plugins/pm2/_pm2 b/plugins/pm2/_pm2 index faa6a340474b..66320b810e25 100644 --- a/plugins/pm2/_pm2 +++ b/plugins/pm2/_pm2 @@ -79,7 +79,7 @@ _id_names() { local app_list app_list=`pm2 list -m` - local -a names ids + local -a names ids names=(`echo $app_list | grep '+---' | awk '{print $2}'`) ids=(`echo $app_list | grep 'pm2 id' | awk '{print $4}'`) diff --git a/plugins/poetry-env/README.md b/plugins/poetry-env/README.md index a7d16563ed69..bd99d2a91364 100644 --- a/plugins/poetry-env/README.md +++ b/plugins/poetry-env/README.md @@ -1,6 +1,6 @@ # Poetry Environment Plugin -This plugin automatically changes poetry environment when you cd into or out of the project directory. +This plugin automatically changes poetry environment when you cd into or out of the project directory. Note: Script looks for pyproject.toml file to determine poetry if its a poetry environment To use it, add `poetry-env` to the plugins array in your zshrc file: diff --git a/plugins/ros/_ros b/plugins/ros/_ros index 6a04d3c8f537..c73a7b353d53 100644 --- a/plugins/ros/_ros +++ b/plugins/ros/_ros @@ -18,7 +18,7 @@ _1st_arguments=( 'config:Get and set options' 'version:Show the roswell version information' "help:Use \"ros help [command]\" for more information about a command."$'\n\t\t'"Use \"ros help [topic]\" for more information about the topic." -) +) #local expl diff --git a/plugins/sbt/sbt.plugin.zsh b/plugins/sbt/sbt.plugin.zsh index 851302c68740..1e977140b4bc 100644 --- a/plugins/sbt/sbt.plugin.zsh +++ b/plugins/sbt/sbt.plugin.zsh @@ -4,7 +4,7 @@ # AUTHOR: Mirko Caserta (mirko.caserta@gmail.com) # VERSION: 1.0.2 # ------------------------------------------------------------------------------ - + # aliases - mnemonic: prefix is 'sb' alias sbc='sbt compile' alias sbcc='sbt clean compile' diff --git a/plugins/screen/screen.plugin.zsh b/plugins/screen/screen.plugin.zsh index c1db8ad92881..26531c40b800 100644 --- a/plugins/screen/screen.plugin.zsh +++ b/plugins/screen/screen.plugin.zsh @@ -8,7 +8,7 @@ if [[ "$TERM" == screen* ]]; then _GET_HOST='echo $HOST | sed "s/\..*//"' fi - # use the current user as the prefix of the current tab title + # use the current user as the prefix of the current tab title TAB_TITLE_PREFIX='"`'$_GET_HOST'`:`'$_GET_PATH' | sed "s:..*/::"`$PROMPT_CHAR"' # when at the shell prompt, show a truncated version of the current path (with # standard ~ replacement) as the rest of the title. diff --git a/plugins/singlechar/singlechar.plugin.zsh b/plugins/singlechar/singlechar.plugin.zsh index d4b0b6735136..6d785d9e1f8d 100644 --- a/plugins/singlechar/singlechar.plugin.zsh +++ b/plugins/singlechar/singlechar.plugin.zsh @@ -1,5 +1,5 @@ ########################### -# Settings +# Settings # These can be overwritten any time. # If they are not set yet, they will be diff --git a/plugins/systemadmin/README.md b/plugins/systemadmin/README.md index 3a9d9de66184..bd6b0876053b 100644 --- a/plugins/systemadmin/README.md +++ b/plugins/systemadmin/README.md @@ -1,7 +1,7 @@ # 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 diff --git a/plugins/thor/README.md b/plugins/thor/README.md index 09c705d9a902..484c88b84350 100644 --- a/plugins/thor/README.md +++ b/plugins/thor/README.md @@ -1,6 +1,6 @@ # Thor plugin -This plugin adds completion for [Thor](http://whatisthor.com/), +This plugin adds completion for [Thor](http://whatisthor.com/), a ruby toolkit for building powerful command-line interfaces. To use it, add `thor` to the plugins array in your zshrc file: diff --git a/plugins/ufw/README.md b/plugins/ufw/README.md index ac377cd17390..ffcc6d6f7191 100644 --- a/plugins/ufw/README.md +++ b/plugins/ufw/README.md @@ -10,7 +10,7 @@ plugins=(... ufw) Some of the commands include: -* `allow /` add an allow rule +* `allow /` add an allow rule * `default` set default policy * `delete /` delete RULE * `deny /` add deny rule diff --git a/plugins/vagrant-prompt/README.md b/plugins/vagrant-prompt/README.md index c5bc55d17741..dd0ca363be66 100644 --- a/plugins/vagrant-prompt/README.md +++ b/plugins/vagrant-prompt/README.md @@ -1,6 +1,6 @@ This plugin prompts the status of the Vagrant VMs. It supports single-host and multi-host configurations as well. -Look inside the source for documentation about custom variables. +Look inside the source for documentation about custom variables. Alberto Re diff --git a/plugins/vi-mode/README.md b/plugins/vi-mode/README.md index 84ba301052b8..6e781f29690f 100644 --- a/plugins/vi-mode/README.md +++ b/plugins/vi-mode/README.md @@ -55,7 +55,7 @@ INSERT_MODE_INDICATOR="%F{yellow}+%f" ### Adding mode indicators to your prompt -`Vi-mode` by default will add mode indicators to `RPROMPT` **unless** that is defined by +`Vi-mode` by default will add mode indicators to `RPROMPT` **unless** that is defined by a preceding plugin. If `PROMPT` or `RPROMPT` is not defined to your liking, you can add mode info manually. The `vi_mode_prompt_info` function is available to insert mode indicator information. diff --git a/plugins/vim-interaction/README.md b/plugins/vim-interaction/README.md index 681648018e69..c2b45f1d897b 100644 --- a/plugins/vim-interaction/README.md +++ b/plugins/vim-interaction/README.md @@ -3,7 +3,7 @@ The plugin presents a function called `callvim` whose usage is: usage: callvim [-b cmd] [-a cmd] [file ... fileN] - + -b cmd Run this command in GVIM before editing the first file -a cmd Run this command in GVIM after editing the first file file The file to edit diff --git a/plugins/vim-interaction/vim-interaction.plugin.zsh b/plugins/vim-interaction/vim-interaction.plugin.zsh index b73f9b4da5b2..a12b52bd50b6 100644 --- a/plugins/vim-interaction/vim-interaction.plugin.zsh +++ b/plugins/vim-interaction/vim-interaction.plugin.zsh @@ -2,7 +2,7 @@ # See README.md # # Derek Wyatt (derek@{myfirstnamemylastname}.org -# +# function callvim { if [[ $# == 0 ]]; then diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh index e037241e4396..1a3ae37b81cd 100644 --- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh +++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh @@ -52,7 +52,7 @@ if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then else ENV_NAME="" fi - + if [[ -n $CD_VIRTUAL_ENV && "$ENV_NAME" != "$CD_VIRTUAL_ENV" ]]; then # We've just left the repo, deactivate the environment # Note: this only happens if the virtualenv was activated automatically diff --git a/plugins/wd/README.md b/plugins/wd/README.md index 1d19806322b3..0ad74e805216 100644 --- a/plugins/wd/README.md +++ b/plugins/wd/README.md @@ -153,7 +153,7 @@ wd .. wd ... ``` -This is a wrapper for the zsh's `dirs` function. +This is a wrapper for the zsh's `dirs` function. _You might need to add `setopt AUTO_PUSHD` to your `.zshrc` if you are not using [oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh)._ * Remove warp point: diff --git a/plugins/wd/_wd.sh b/plugins/wd/_wd.sh index 8d5cf15a2633..52ecb12e6a7e 100644 --- a/plugins/wd/_wd.sh +++ b/plugins/wd/_wd.sh @@ -77,7 +77,7 @@ function _wd() { # complete sub directories from the warp point _path_files -W "(${points[$target]})" -/ && ret=0 fi - + # don't complete anything if warp point is not valid ;; esac diff --git a/plugins/z/MANUAL.md b/plugins/z/MANUAL.md index 67a207dbb597..106d8c107696 100644 --- a/plugins/z/MANUAL.md +++ b/plugins/z/MANUAL.md @@ -188,7 +188,7 @@ Add a backslash to the end of the last line add `'zsh-z'` to the list, e.g., Then relaunch `zsh`. ### For [zcomet](https://github.com/agkozak/zcomet) users - + Simply add zcomet load agkozak/zsh-z diff --git a/themes/Soliah.zsh-theme b/themes/Soliah.zsh-theme index c3dd6af89b8c..e297fe9caf79 100644 --- a/themes/Soliah.zsh-theme +++ b/themes/Soliah.zsh-theme @@ -5,10 +5,10 @@ ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})" # Text to display if the branch is dirty -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}" # Text to display if the branch is clean -ZSH_THEME_GIT_PROMPT_CLEAN="" +ZSH_THEME_GIT_PROMPT_CLEAN="" # Colors vary depending on time lapsed. ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}" @@ -36,7 +36,7 @@ function rvm_gemset() { GEMSET=`rvm gemset list | grep '=>' | cut -b4-` if [[ -n $GEMSET ]]; then echo "%{$fg[yellow]%}$GEMSET%{$reset_color%}|" - fi + fi fi } @@ -52,12 +52,12 @@ function git_time_since_commit() { # Totals MINUTES=$((seconds_since_last_commit / 60)) HOURS=$((seconds_since_last_commit/3600)) - + # Sub-hours and sub-minutes DAYS=$((seconds_since_last_commit / 86400)) SUB_HOURS=$((HOURS % 24)) SUB_MINUTES=$((MINUTES % 60)) - + if [[ -n $(git status -s 2> /dev/null) ]]; then if [ "$MINUTES" -gt 30 ]; then COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG" diff --git a/themes/adben.zsh-theme b/themes/adben.zsh-theme index c2fdbed2387f..cc097057f64b 100644 --- a/themes/adben.zsh-theme +++ b/themes/adben.zsh-theme @@ -79,7 +79,7 @@ ps1_command_tip() { command wget -qO- https://www.commandlinefu.com/commands/random/plaintext elif (( ${+commands[curl]} )); then command curl -fsL https://www.commandlinefu.com/commands/random/plaintext - fi + fi } | sed '1d;/^$/d' } diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index aa274a5bbf4c..bd0405efb5cd 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -111,7 +111,7 @@ prompt_git() { dirty=$(parse_git_dirty) ref=$(git symbolic-ref HEAD 2> /dev/null) || \ ref="◈ $(git describe --exact-match --tags HEAD 2> /dev/null)" || \ - ref="➦ $(git rev-parse --short HEAD 2> /dev/null)" + ref="➦ $(git rev-parse --short HEAD 2> /dev/null)" if [[ -n $dirty ]]; then prompt_segment yellow black else diff --git a/themes/avit.zsh-theme b/themes/avit.zsh-theme index 206274462825..0e39d90772a9 100644 --- a/themes/avit.zsh-theme +++ b/themes/avit.zsh-theme @@ -15,7 +15,7 @@ __RPROMPT='$(vi_mode_prompt_info)%{$(echotc UP 1)%}$(_git_time_since_commit) $(g if [[ -z $RPROMPT ]]; then RPROMPT=$__RPROMPT else - RPROMPT="${RPROMPT} ${__RPROMPT}" + RPROMPT="${RPROMPT} ${__RPROMPT}" fi function _user_host() { diff --git a/themes/crunch.zsh-theme b/themes/crunch.zsh-theme index 8278661ab8b2..d86ce1e4aed9 100644 --- a/themes/crunch.zsh-theme +++ b/themes/crunch.zsh-theme @@ -1,15 +1,15 @@ # CRUNCH - created from Steve Eley's cat waxing. # Initially hacked from the Dallas theme. Thanks, Dallas Reedy. # -# This theme assumes you do most of your oh-my-zsh'ed "colorful" work at a single machine, -# and eschews the standard space-consuming user and hostname info. Instead, only the +# This theme assumes you do most of your oh-my-zsh'ed "colorful" work at a single machine, +# and eschews the standard space-consuming user and hostname info. Instead, only the # things that vary in my own workflow are shown: # # * The time (not the date) # * The RVM version and gemset (omitting the 'ruby' name if it's MRI) # * The current directory # * The Git branch and its 'dirty' state -# +# # Colors are at the top so you can mess with those separately if you like. # For the most part I stuck with Dallas's. diff --git a/themes/eastwood.zsh-theme b/themes/eastwood.zsh-theme index 88134f8e63d2..31e24fa7ffb2 100644 --- a/themes/eastwood.zsh-theme +++ b/themes/eastwood.zsh-theme @@ -1,5 +1,5 @@ # RVM settings -if [[ -s ~/.rvm/scripts/rvm ]] ; then +if [[ -s ~/.rvm/scripts/rvm ]] ; then RPS1="%{$fg[yellow]%}rvm:%{$reset_color%}%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt)%{$reset_color%} $EPS1" else if which rbenv &> /dev/null; then diff --git a/themes/emotty.zsh-theme b/themes/emotty.zsh-theme index ba08409506ff..0fea7d9169ce 100644 --- a/themes/emotty.zsh-theme +++ b/themes/emotty.zsh-theme @@ -11,7 +11,7 @@ # # There are pre-defined different emoji sets to choose from, e.g.: # emoji, stellar, floral, zodiac, love (see emotty plugin). -# +# # To choose a different emotty set than the default (emoji) # % export emotty_set=nature # @@ -95,7 +95,7 @@ zstyle ':vcs_info:*' stagedstr "${green}${vcs_staged_glyph}" # %(k|f) reset (back|fore)ground color zstyle ':vcs_info:*' max-exports 3 zstyle ':vcs_info:*' nvcsformats "${prompt_glyph}" '%3~' '' -zstyle ':vcs_info:*' formats "${yellow}%u%c%b${vcs_branch_glyph}%f" '%S|' "$FX[bold]%r$FX[no-bold]" +zstyle ':vcs_info:*' formats "${yellow}%u%c%b${vcs_branch_glyph}%f" '%S|' "$FX[bold]%r$FX[no-bold]" zstyle ':vcs_info:*' actionformats "${red}%K{white}%a${vcs_action_glyph}%k%f" '%S|' "$FX[bold]%r$FX[no-bold]" red_if_root="%(!.%F{red}.)" diff --git a/themes/essembeh.zsh-theme b/themes/essembeh.zsh-theme index 43d4093b1daf..50b3f7772fa6 100644 --- a/themes/essembeh.zsh-theme +++ b/themes/essembeh.zsh-theme @@ -8,7 +8,7 @@ # - prefix to detect docker containers or chroot # - git plugin to display current branch and status -# git plugin +# git plugin ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[cyan]%}(" ZSH_THEME_GIT_PROMPT_SUFFIX=") %{$reset_color%}" ZSH_THEME_GIT_PROMPT_UNTRACKED="%%" @@ -35,7 +35,7 @@ if [[ -n "$SSH_CONNECTION" ]]; then ZSH_ESSEMBEH_PREFIX="%{$fg[yellow]%}[$(echo $SSH_CONNECTION | awk '{print $1}')]%{$reset_color%} " # use red color to highlight a remote connection ZSH_ESSEMBEH_COLOR="red" -elif [[ -r /etc/debian_chroot ]]; then +elif [[ -r /etc/debian_chroot ]]; then # prefix prompt in case of chroot ZSH_ESSEMBEH_PREFIX="%{$fg[yellow]%}[chroot:$(cat /etc/debian_chroot)]%{$reset_color%} " elif [[ -r /.dockerenv ]]; then diff --git a/themes/josh.zsh-theme b/themes/josh.zsh-theme index ea051c58e42b..df59280d7fca 100644 --- a/themes/josh.zsh-theme +++ b/themes/josh.zsh-theme @@ -15,7 +15,7 @@ function josh_prompt { branch_size=${#branch} ruby_size=${#ruby_version} user_machine_size=${#${(%):-%n@%m-}} - + if [[ ${#branch} -eq 0 ]] then (( ruby_size = ruby_size + 1 )) else @@ -24,15 +24,15 @@ function josh_prompt { (( branch_size = branch_size + 2 )) fi fi - + (( spare_width = ${spare_width} - (${user_machine_size} + ${path_size} + ${branch_size} + ${ruby_size}) )) while [ ${#prompt} -lt $spare_width ]; do prompt=" $prompt" done - + prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(ruby_prompt_info)%{$reset_color%} $(git_current_branch)" - + echo $prompt } diff --git a/themes/junkfood.zsh-theme b/themes/junkfood.zsh-theme index 01fae4b95fff..e3b746c7a851 100644 --- a/themes/junkfood.zsh-theme +++ b/themes/junkfood.zsh-theme @@ -3,10 +3,10 @@ # Grab the current date (%W) and time (%t): JUNKFOOD_TIME_="%{$fg_bold[red]%}#%{$fg_bold[white]%}( %{$fg_bold[yellow]%}%W%{$reset_color%}@%{$fg_bold[white]%}%t )( %{$reset_color%}" -# Grab the current machine name +# Grab the current machine name JUNKFOOD_MACHINE_="%{$fg_bold[blue]%}%m%{$fg[white]%} ):%{$reset_color%}" -# Grab the current username +# Grab the current username JUNKFOOD_CURRENT_USER_="%{$fg_bold[green]%}%n%{$reset_color%}" # Grab the current filepath, use shortcuts: ~/Desktop diff --git a/themes/mlh.zsh-theme b/themes/mlh.zsh-theme index c059bf850571..94718f8f2d58 100644 --- a/themes/mlh.zsh-theme +++ b/themes/mlh.zsh-theme @@ -15,7 +15,7 @@ # To customize symbols (e.g MLH_AT_SYMBOL), simply set them as environment variables # for example in your ~/.zshrc file, like this: # MLH_AT_SYMBOL=" at " -# +# # Settings *must* be set before sourcing oh-my-zsh.sh the .zshrc file. # # To easily discover colors and their codes, type `spectrum_ls` in the terminal diff --git a/themes/mortalscumbag.zsh-theme b/themes/mortalscumbag.zsh-theme index 36301cb76ae5..c9994c0f9550 100644 --- a/themes/mortalscumbag.zsh-theme +++ b/themes/mortalscumbag.zsh-theme @@ -1,6 +1,6 @@ function my_git_prompt() { tester=$(git rev-parse --git-dir 2> /dev/null) || return - + INDEX=$(git status --porcelain 2> /dev/null) STATUS="" diff --git a/themes/sonicradish.zsh-theme b/themes/sonicradish.zsh-theme index 508611830584..db6170969bfb 100644 --- a/themes/sonicradish.zsh-theme +++ b/themes/sonicradish.zsh-theme @@ -1,4 +1,4 @@ -#!/usr/bin/env zsh +#!/usr/bin/env zsh #local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" setopt promptsubst diff --git a/themes/wedisagree.zsh-theme b/themes/wedisagree.zsh-theme index e9e9d6ef8a06..358891992105 100644 --- a/themes/wedisagree.zsh-theme +++ b/themes/wedisagree.zsh-theme @@ -5,9 +5,9 @@ # - Place that bundle in ~/Library/Application\ Support/SIMBL/Plugins (create that folder if it doesn't exist) # - Open Terminal preferences. Go to Settings -> Text -> More # - Change default colours to your liking. -# +# # Here are the colours from Textmate's Monokai theme: -# +# # Black: 0, 0, 0 # Red: 229, 34, 34 # Green: 166, 227, 45 @@ -28,7 +28,7 @@ PROMPT='%{$fg[magenta]%}[%c] %{$reset_color%}' RPROMPT='${time} %{$fg[magenta]%}$(git_prompt_info)%{$reset_color%}$(git_prompt_status)%{$reset_color%}$(git_prompt_ahead)%{$reset_color%}' # Add this at the start of RPROMPT to include rvm info showing ruby-version@gemset-name -# $(ruby_prompt_info) +# $(ruby_prompt_info) # local time, color coded by last return code time_enabled="%(?.%{$fg[green]%}.%{$fg[red]%})%*%{$reset_color%}" @@ -53,7 +53,7 @@ ZSH_THEME_RUBY_PROMPT_SUFFIX="%{$reset_color%}" # More symbols to choose from: # ☀ ✹ ☄ ♆ ♀ ♁ ♐ ♇ ♈ ♉ ♚ ♛ ♜ ♝ ♞ ♟ ♠ ♣ ⚢ ⚲ ⚳ ⚴ ⚥ ⚤ ⚦ ⚒ ⚑ ⚐ ♺ ♻ ♼ ☰ ☱ ☲ ☳ ☴ ☵ ☶ ☷ -# ✡ ✔ ✖ ✚ ✱ ✤ ✦ ❤ ➜ ➟ ➼ ✂ ✎ ✐ ⨀ ⨁ ⨂ ⨍ ⨎ ⨏ ⨷ ⩚ ⩛ ⩡ ⩱ ⩲ ⩵ ⩶ ⨠ +# ✡ ✔ ✖ ✚ ✱ ✤ ✦ ❤ ➜ ➟ ➼ ✂ ✎ ✐ ⨀ ⨁ ⨂ ⨍ ⨎ ⨏ ⨷ ⩚ ⩛ ⩡ ⩱ ⩲ ⩵ ⩶ ⨠ # ⬅ ⬆ ⬇ ⬈ ⬉ ⬊ ⬋ ⬒ ⬓ ⬔ ⬕ ⬖ ⬗ ⬘ ⬙ ⬟ ⬤ 〒 ǀ ǁ ǂ ĭ Ť Ŧ # Determine if we are using a gemset. @@ -61,7 +61,7 @@ function rvm_gemset() { GEMSET=`rvm gemset list | grep '=>' | cut -b4-` if [[ -n $GEMSET ]]; then echo "%{$fg[yellow]%}$GEMSET%{$reset_color%}|" - fi + fi } # Determine the time since last commit. If branch is clean, @@ -76,12 +76,12 @@ function git_time_since_commit() { # Totals MINUTES=$((seconds_since_last_commit / 60)) HOURS=$((seconds_since_last_commit/3600)) - + # Sub-hours and sub-minutes DAYS=$((seconds_since_last_commit / 86400)) SUB_HOURS=$((HOURS % 24)) SUB_MINUTES=$((MINUTES % 60)) - + if [[ -n $(git status -s 2> /dev/null) ]]; then if [ "$MINUTES" -gt 30 ]; then COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG" From 62a76353ab73532c2681c6b168623f7f1e7d96ae Mon Sep 17 00:00:00 2001 From: Masaru Iritani <25241373+masaru-iritani@users.noreply.github.com> Date: Sat, 30 Mar 2024 16:25:34 +0900 Subject: [PATCH 06/17] fix(starship): keep `ZSH_THEME` if not installed (#12309) --- plugins/starship/starship.plugin.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/starship/starship.plugin.zsh b/plugins/starship/starship.plugin.zsh index 8c5d9135e006..fc415e64cc0e 100644 --- a/plugins/starship/starship.plugin.zsh +++ b/plugins/starship/starship.plugin.zsh @@ -1,7 +1,7 @@ -# ignore oh-my-zsh theme -unset ZSH_THEME - if (( $+commands[starship] )); then + # ignore oh-my-zsh theme + unset ZSH_THEME + eval "$(starship init zsh)" else echo '[oh-my-zsh] starship not found, please install it from https://starship.rs' From 6dfa9507ce0eb0f4d386bd03268e33943ea55c0f Mon Sep 17 00:00:00 2001 From: Jason D'Amour Date: Sat, 30 Mar 2024 00:26:14 -0700 Subject: [PATCH 07/17] feat(gcloud): add homebrew installation path (#12308) --- plugins/gcloud/gcloud.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/gcloud/gcloud.plugin.zsh b/plugins/gcloud/gcloud.plugin.zsh index cf3d650ea609..fa8f884a4a45 100644 --- a/plugins/gcloud/gcloud.plugin.zsh +++ b/plugins/gcloud/gcloud.plugin.zsh @@ -9,6 +9,7 @@ if [[ -z "${CLOUDSDK_HOME}" ]]; then "/usr/local/share/google-cloud-sdk" "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk" "/opt/homebrew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk" + "/opt/homebrew/share/google-cloud-sdk" "/usr/share/google-cloud-sdk" "/snap/google-cloud-sdk/current" "/snap/google-cloud-cli/current" From 130002a79e8567befa409177990bb2724b8edefc Mon Sep 17 00:00:00 2001 From: Gregory Reshetniak Date: Wed, 3 Apr 2024 09:10:33 +0200 Subject: [PATCH 08/17] feat(httpie): complete https command (#12314) --- plugins/httpie/_httpie | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/httpie/_httpie b/plugins/httpie/_httpie index 11bc8e1f8c0c..2c0db229f1bb 100644 --- a/plugins/httpie/_httpie +++ b/plugins/httpie/_httpie @@ -1,4 +1,4 @@ -#compdef http +#compdef http https # ------------------------------------------------------------------------------ # Copyright (c) 2015 GitHub zsh-users - http://github.com/zsh-users # All rights reserved. From b43b84abc77850a3734c127c38afdd7cf7739dc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Yhuel?= Date: Wed, 3 Apr 2024 19:42:47 +0200 Subject: [PATCH 09/17] fix(async): avoid blocking the shell while waiting (#12304) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marc Cornellà --- lib/async_prompt.zsh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/async_prompt.zsh b/lib/async_prompt.zsh index 384e49d33e9c..ac95bcd73c03 100644 --- a/lib/async_prompt.zsh +++ b/lib/async_prompt.zsh @@ -82,10 +82,8 @@ function _omz_async_request { exec {fd}< <( # Tell parent process our PID builtin echo ${sysparams[pid]} - # Store handler name for callback - builtin echo $handler # Set exit code for the handler if used - (exit $ret) + () { return $ret } # Run the async function handler $handler ) @@ -98,8 +96,7 @@ function _omz_async_request { command true # Save the PID from the handler child process - read pid <&$fd - _OMZ_ASYNC_PIDS[$handler]=$pid + read -u $fd "_OMZ_ASYNC_PIDS[$handler]" # When the fd is readable, call the response handler zle -F "$fd" _omz_async_callback @@ -114,15 +111,14 @@ function _omz_async_callback() { local err=$2 # Second arg will be passed in case of error if [[ -z "$err" || "$err" == "hup" ]]; then - # Get handler name from first line - local handler - read handler <&$fd + # Get handler name from fd + local handler="${(k)_OMZ_ASYNC_FDS[(r)$fd]}" # Store old output which is supposed to be already printed local old_output="${_OMZ_ASYNC_OUTPUT[$handler]}" # Read output from fd - _OMZ_ASYNC_OUTPUT[$handler]="$(cat <&$fd)" + IFS= read -r -u $fd -d '' "_OMZ_ASYNC_OUTPUT[$handler]" # Repaint prompt if output has changed if [[ "$old_output" != "${_OMZ_ASYNC_OUTPUT[$handler]}" ]]; then From ec1afe9dd683c36e6384db25fc1e95acbb0cbc7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 3 Apr 2024 19:55:46 +0200 Subject: [PATCH 10/17] feat(git)!: enable async git prompt (now for real) BREAKING CHANGE: the new async prompt feature will render prompt information asyncronously and degrade nicely when the calls take too long to finish, as the prompt will already be first drawn and interactive. This is enabled by default for the git prompt and themes that use it (`git_prompt_info`). If you find that it's not working for you, please open an issue if one is not already opened, and see https://github.com/ohmyzsh/ohmyzsh#disable-async-git-prompt for how to turn it off. --- README.md | 12 ++++++++++++ lib/git.zsh | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b3561a833d40..2ba374335e8e 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://twi - [Custom Plugins And Themes](#custom-plugins-and-themes) - [Enable GNU ls In macOS And freeBSD Systems](#enable-gnu-ls-in-macos-and-freebsd-systems) - [Skip Aliases](#skip-aliases) + - [Disable async git prompt](#disable-async-git-prompt) - [Getting Updates](#getting-updates) - [Updates Verbosity](#updates-verbosity) - [Manual Updates](#manual-updates) @@ -361,6 +362,17 @@ Instead, you can now use the following: zstyle ':omz:lib:directories' aliases no ``` +### Disable async git prompt + +Async prompt functions are an experimental feature (included on April 3, 2024) that allows Oh My Zsh to render prompt information +asyncronously. This can improve prompt rendering performance, but it might not work well with some setups. We hope that's not an +issue, but if you're seeing problems with this new feature, you can turn it of by setting the following in your .zshrc file, +before Oh My Zsh is sourced: + +```sh +zstyle ':omz:alpha:lib:git' async-prompt no +``` + #### Notice > This feature is currently in a testing phase and it may be subject to change in the future. diff --git a/lib/git.zsh b/lib/git.zsh index 96df5589dfb9..4d6681c5b086 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -38,7 +38,7 @@ function _omz_git_prompt_status() { } # Enable async prompt by default unless the setting is at false / no -if zstyle -t ':omz:alpha:lib:git' async-prompt; then +if zstyle -T ':omz:alpha:lib:git' async-prompt; then function git_prompt_info() { if [[ -n "$_OMZ_ASYNC_OUTPUT[_omz_git_prompt_status]" ]]; then echo -n "$_OMZ_ASYNC_OUTPUT[_omz_git_prompt_status]" From 04007a0e5d0a458efff23da896cf70dc40df585d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Yhuel?= Date: Wed, 3 Apr 2024 21:32:16 +0200 Subject: [PATCH 11/17] feat(git): implement async completion for `git_prompt_status` (#12319) This is important for themes using it, since it is usually a little slower than git_prompt_info. Also two small fixes : - the handler for git_prompt_info was incorrectly named _omz_git_prompt_status - _defer_async_git_register was kept in precmd, there is no need to call it on each prompt --- lib/git.zsh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/lib/git.zsh b/lib/git.zsh index 4d6681c5b086..76b3778db571 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -9,7 +9,7 @@ function __git_prompt_git() { GIT_OPTIONAL_LOCKS=0 command git "$@" } -function _omz_git_prompt_status() { +function _omz_git_prompt_info() { # If we are on a folder not tracked by git, get out. # Otherwise, check for hide-info at global and local repository level if ! __git_prompt_git rev-parse --git-dir &> /dev/null \ @@ -40,6 +40,12 @@ function _omz_git_prompt_status() { # Enable async prompt by default unless the setting is at false / no if zstyle -T ':omz:alpha:lib:git' async-prompt; then function git_prompt_info() { + if [[ -n "$_OMZ_ASYNC_OUTPUT[_omz_git_prompt_info]" ]]; then + echo -n "$_OMZ_ASYNC_OUTPUT[_omz_git_prompt_info]" + fi + } + + function git_prompt_status() { if [[ -n "$_OMZ_ASYNC_OUTPUT[_omz_git_prompt_status]" ]]; then echo -n "$_OMZ_ASYNC_OUTPUT[_omz_git_prompt_status]" fi @@ -51,8 +57,13 @@ if zstyle -T ':omz:alpha:lib:git' async-prompt; then # Check if git_prompt_info is used in a prompt variable case "${PS1}:${PS2}:${PS3}:${PS4}:${RPS1}:${RPS2}:${RPS3}:${RPS4}" in *(\$\(git_prompt_info\)|\`git_prompt_info\`)*) + _omz_register_handler _omz_git_prompt_info + ;; + esac + + case "${PS1}:${PS2}:${PS3}:${PS4}:${RPS1}:${RPS2}:${RPS3}:${RPS4}" in + *(\$\(git_prompt_status\)|\`git_prompt_status\`)*) _omz_register_handler _omz_git_prompt_status - return ;; esac @@ -65,6 +76,9 @@ if zstyle -T ':omz:alpha:lib:git' async-prompt; then precmd_functions=(_defer_async_git_register $precmd_functions) else function git_prompt_info() { + _omz_git_prompt_info + } + function git_prompt_status() { _omz_git_prompt_status } fi @@ -197,7 +211,7 @@ function git_prompt_long_sha() { SHA=$(__git_prompt_git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER" } -function git_prompt_status() { +function _omz_git_prompt_status() { [[ "$(__git_prompt_git config --get oh-my-zsh.hide-status 2>/dev/null)" = 1 ]] && return # Maps a git status prefix to an internal constant From 6d0362ef2f355a05cf945fae882ad1fa95428991 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 4 Apr 2024 10:08:28 +0200 Subject: [PATCH 12/17] fix(archlinux): make `upgrade` work with non-english Closes #12316 --- plugins/archlinux/archlinux.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index fca6548c037f..e20a3115665a 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -179,8 +179,8 @@ fi # Check Arch Linux PGP Keyring before System Upgrade to prevent failure. function upgrade() { echo ":: Checking Arch Linux PGP Keyring..." - local installedver="$(sudo pacman -Qi archlinux-keyring | grep -Po '(?<=Version : ).*')" - local currentver="$(sudo pacman -Si archlinux-keyring | grep -Po '(?<=Version : ).*')" + local installedver="$(LANG= sudo pacman -Qi archlinux-keyring | grep -Po '(?<=Version : ).*')" + local currentver="$(LANG= sudo pacman -Si archlinux-keyring | grep -Po '(?<=Version : ).*')" if [ $installedver != $currentver ]; then echo " Arch Linux PGP Keyring is out of date." echo " Updating before full system upgrade." From 114b58ed4e93faee352187779c7151f8580f24fe Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 4 Apr 2024 11:58:43 +0200 Subject: [PATCH 13/17] fix(git): disable locally `ksharrays` Fixes #12321 --- lib/git.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/git.zsh b/lib/git.zsh index 76b3778db571..23d11db2d738 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -40,12 +40,14 @@ function _omz_git_prompt_info() { # Enable async prompt by default unless the setting is at false / no if zstyle -T ':omz:alpha:lib:git' async-prompt; then function git_prompt_info() { + setopt localoptions noksharrays if [[ -n "$_OMZ_ASYNC_OUTPUT[_omz_git_prompt_info]" ]]; then echo -n "$_OMZ_ASYNC_OUTPUT[_omz_git_prompt_info]" fi } function git_prompt_status() { + setopt localoptions noksharrays if [[ -n "$_OMZ_ASYNC_OUTPUT[_omz_git_prompt_status]" ]]; then echo -n "$_OMZ_ASYNC_OUTPUT[_omz_git_prompt_status]" fi From 9d529c41cc82580d0a947ce8bcf5ff7775585fe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Yhuel?= Date: Thu, 4 Apr 2024 16:20:20 +0200 Subject: [PATCH 14/17] perf(async): avoid executing `true` if not required (#12318) The issue which required "command true" was fixed in zsh 5.8. --- lib/async_prompt.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/async_prompt.zsh b/lib/async_prompt.zsh index ac95bcd73c03..a83c57f35327 100644 --- a/lib/async_prompt.zsh +++ b/lib/async_prompt.zsh @@ -3,6 +3,7 @@ # https://github.com/woefe/git-prompt.zsh/blob/master/git-prompt.zsh zmodload zsh/system +autoload -Uz is-at-least # For now, async prompt function handlers are set up like so: # First, define the async function handler and register the handler @@ -93,7 +94,8 @@ function _omz_async_request { # There's a weird bug here where ^C stops working unless we force a fork # See https://github.com/zsh-users/zsh-autosuggestions/issues/364 - command true + # and https://github.com/zsh-users/zsh-autosuggestions/pull/612 + is-at-least 5.8 || command true # Save the PID from the handler child process read -u $fd "_OMZ_ASYNC_PIDS[$handler]" From 038931039030911852d456215d6f39385d5b7a6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Fri, 5 Apr 2024 07:38:36 +0200 Subject: [PATCH 15/17] fix(lib/git): fix detection of function use in prompt RPS1 and RPROMPT are not equivalent, though they have the same effect. Added both to detect if `git_prompt_*` is used. Fixes #12325 --- lib/git.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/git.zsh b/lib/git.zsh index 23d11db2d738..c4265970bb97 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -57,13 +57,13 @@ if zstyle -T ':omz:alpha:lib:git' async-prompt; then # or any of the other prompt variables function _defer_async_git_register() { # Check if git_prompt_info is used in a prompt variable - case "${PS1}:${PS2}:${PS3}:${PS4}:${RPS1}:${RPS2}:${RPS3}:${RPS4}" in + case "${PS1}:${PS2}:${PS3}:${PS4}:${RPROMPT}:${RPS1}:${RPS2}:${RPS3}:${RPS4}" in *(\$\(git_prompt_info\)|\`git_prompt_info\`)*) _omz_register_handler _omz_git_prompt_info ;; esac - case "${PS1}:${PS2}:${PS3}:${PS4}:${RPS1}:${RPS2}:${RPS3}:${RPS4}" in + case "${PS1}:${PS2}:${PS3}:${PS4}:${RPROMPT}:${RPS1}:${RPS2}:${RPS3}:${RPS4}" in *(\$\(git_prompt_status\)|\`git_prompt_status\`)*) _omz_register_handler _omz_git_prompt_status ;; From d893dd9b83d518f2b2bd4b9a5b6a92ca0e4e33e2 Mon Sep 17 00:00:00 2001 From: Dee'Kej Date: Sat, 6 Apr 2024 19:12:05 +0200 Subject: [PATCH 16/17] fix(autojump): add macOS 'pkgsrc' installation location (#12329) --- plugins/autojump/autojump.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh index 84333a89fccc..5a52e306799e 100644 --- a/plugins/autojump/autojump.plugin.zsh +++ b/plugins/autojump/autojump.plugin.zsh @@ -13,6 +13,7 @@ autojump_paths=( /opt/local/etc/profile.d/autojump.sh # macOS with MacPorts /usr/local/etc/profile.d/autojump.sh # macOS with Homebrew (default) /opt/homebrew/etc/profile.d/autojump.sh # macOS with Homebrew (default on M1 macs) + /opt/pkg/share/autojump/autojump.zsh # macOS with pkgsrc /etc/profiles/per-user/$USER/etc/profile.d/autojump.sh # macOS Nix, Home Manager and flakes ) From bf713e2c112ee1f0daf10deffa1215c982513f9b Mon Sep 17 00:00:00 2001 From: David Chin Date: Sun, 7 Apr 2024 01:23:19 +0800 Subject: [PATCH 17/17] Update README for git-prompt to clarify how to use (#10922) * Add note about need to customise theme. It may not be obvious that the theme needs to be customised. See: https://github.com/ohmyzsh/ohmyzsh/issues/9395 * Clarify type of theme customisation needed. --- plugins/git-prompt/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/git-prompt/README.md b/plugins/git-prompt/README.md index 05208d72f81a..8f42c6842731 100644 --- a/plugins/git-prompt/README.md +++ b/plugins/git-prompt/README.md @@ -9,6 +9,10 @@ To use it, add `git-prompt` to the plugins array in your zshrc file: plugins=(... git-prompt) ``` +You may also need to [customize your theme](https://github.com/ohmyzsh/ohmyzsh/issues/9395#issuecomment-1027130429) +to change the way the prompt is built. See the +[OMZ wiki on customizing themes](https://github.com/ohmyzsh/ohmyzsh/wiki/Customization#overriding-and-adding-themes). + See the [original repository](https://github.com/olivierverdier/zsh-git-prompt). ## Requirements