From a9b6af5b231227f8ab91f922adc5e0d0a2e6fc08 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Tue, 2 Jan 2024 21:01:17 +0100 Subject: [PATCH 001/453] refactor(minikube): standardize completion generation Closes #10763 --- plugins/minikube/minikube.plugin.zsh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/plugins/minikube/minikube.plugin.zsh b/plugins/minikube/minikube.plugin.zsh index e87abceaf..0d2737052 100644 --- a/plugins/minikube/minikube.plugin.zsh +++ b/plugins/minikube/minikube.plugin.zsh @@ -1,13 +1,13 @@ -# Autocompletion for Minikube. -# -if (( $+commands[minikube] )); then - __MINIKUBE_COMPLETION_FILE="${ZSH_CACHE_DIR}/minikube_completion" - - if [[ ! -f $__MINIKUBE_COMPLETION_FILE ]]; then - minikube completion zsh >! $__MINIKUBE_COMPLETION_FILE - fi - - [[ -f $__MINIKUBE_COMPLETION_FILE ]] && source $__MINIKUBE_COMPLETION_FILE - - unset __MINIKUBE_COMPLETION_FILE +if (( ! $+commands[minikube] )); then + return fi + +# If the completion file doesn't exist yet, we need to autoload it and +# bind it to `minikube`. Otherwise, compinit will have already done that. +if [[ ! -f "$ZSH_CACHE_DIR/completions/_minikube" ]]; then + typeset -g -A _comps + autoload -Uz _minikube + _comps[minikube]=_minikube +fi + +minikube completion zsh >| "$ZSH_CACHE_DIR/completions/_minikube" &| From b5583a321644218702c4ef588934575f46a2159b Mon Sep 17 00:00:00 2001 From: Jared Allard Date: Wed, 3 Jan 2024 04:02:43 -0800 Subject: [PATCH 002/453] fix(rtx)!: rename `rtx` plugin to `mise` (#12143) BREAKING CHANGE: Rename `rtx` plugin to `mise`. The project swapped name in `v2024.1.0`. Replace references to `rtx` with `mise` while maintaining backwards compatibility for `rtx` installations. Co-authored-by: Carlo Sala --- plugins/mise/README.md | 32 ++++++++++++++++++++++++++++++++ plugins/mise/mise.plugin.zsh | 23 +++++++++++++++++++++++ plugins/rtx/README.md | 30 ------------------------------ plugins/rtx/rtx.plugin.zsh | 20 ++------------------ 4 files changed, 57 insertions(+), 48 deletions(-) create mode 100644 plugins/mise/README.md create mode 100644 plugins/mise/mise.plugin.zsh delete mode 100644 plugins/rtx/README.md diff --git a/plugins/mise/README.md b/plugins/mise/README.md new file mode 100644 index 000000000..8ec05aab9 --- /dev/null +++ b/plugins/mise/README.md @@ -0,0 +1,32 @@ +# mise + +Adds integration with [mise](https://github.com/jdx/mise) (formerly `rtx`), a runtime executor compatible with +npm, nodenv, pyenv, etc. mise is written in rust and is very fast. 20x-200x faster than asdf. With that being +said, mise is compatible with asdf plugins and .tool-versions files. It can be used as a drop-in replacement. + +## Installation + +1. [Download & install mise](https://github.com/jdx/mise#installation) by running the following: + +```bash +curl https://mise.jdx.dev/install.sh | sh +``` + +2. [Enable mise](https://github.com/jdx/mise#quickstart) by adding it to your `plugins` definition in + `~/.zshrc`. + +```bash +plugins=(mise) +``` + +## Usage + +See the [mise readme](https://github.com/jdx/mise#table-of-contents) for information on how to use mise. Here +are a few examples: + +```bash +mise install node Install the current version specified in .tool-versions/.mise.toml +mise use -g node@system Use system node as global default +mise install node@20.0.0 Install a specific version number +mise use -g node@20 Use node-20.x as global default +``` diff --git a/plugins/mise/mise.plugin.zsh b/plugins/mise/mise.plugin.zsh new file mode 100644 index 000000000..1b4d3ae81 --- /dev/null +++ b/plugins/mise/mise.plugin.zsh @@ -0,0 +1,23 @@ +# TODO: 2024-01-03 remove rtx support +local __mise=mise +if (( ! $+commands[mise] )); then + if (( $+commands[rtx] )); then + __mise=rtx + else + return + fi +fi + +# Load mise hooks +eval "$($__mise activate zsh)" + +# If the completion file doesn't exist yet, we need to autoload it and +# bind it to `mise`. Otherwise, compinit will have already done that. +if [[ ! -f "$ZSH_CACHE_DIR/completions/_$__mise" ]]; then + typeset -g -A _comps + autoload -Uz _$__mise + _comps[$__mise]=_$__mise +fi + +# Generate and load mise completion +$__mise completion zsh >| "$ZSH_CACHE_DIR/completions/_$__mise" &| diff --git a/plugins/rtx/README.md b/plugins/rtx/README.md deleted file mode 100644 index c6436d3a7..000000000 --- a/plugins/rtx/README.md +++ /dev/null @@ -1,30 +0,0 @@ -## rtx - - -Adds integration with [rtx](https://github.com/jdx/rtx), a runtime executor compatible with npm, nodenv, pyenv, etc. rtx is written in rust and is very fast. 20x-200x faster than asdf. With that being said, rtx is compatible with asdf plugins and .tool-versions files. It can be used as a drop-in replacement. - -### Installation - -1. [Download & install rtx](https://github.com/jdx/rtx#installation) by running the following: - - ``` - curl https://rtx.pub/install.sh | sh - ``` - - -2. [Enable rtx](https://github.com/jdx/rtx#quickstart) by adding it to your `plugins` definition in `~/.zshrc`. - - ``` - plugins=(rtx) - ``` - -### Usage - -See the [rtx readme](https://github.com/jdx/rtx#table-of-contents) for information on how to use rtx. Here are a few examples: - -``` -rtx install node Install the current version specified in .tool-versions/.rtx.toml -rtx use -g node@system Use system node as global default -rtx install node@20.0.0 Install a specific version number -rtx use -g node@20 Use node-20.x as global default -``` diff --git a/plugins/rtx/rtx.plugin.zsh b/plugins/rtx/rtx.plugin.zsh index a01828afd..43127a25f 100644 --- a/plugins/rtx/rtx.plugin.zsh +++ b/plugins/rtx/rtx.plugin.zsh @@ -1,18 +1,2 @@ -# rtx needs to be in $PATH -if (( ! ${+commands[rtx]} )); then - return -fi - -# Load rtx hooks -eval "$(rtx activate zsh)" - -# If the completion file doesn't exist yet, we need to autoload it and -# bind it to `rtx`. Otherwise, compinit will have already done that. -if [[ ! -f "$ZSH_CACHE_DIR/completions/_rtx" ]]; then - typeset -g -A _comps - autoload -Uz _rtx - _comps[rtx]=_rtx -fi - -# Generate and load rtx completion -rtx completion zsh >! "$ZSH_CACHE_DIR/completions/_rtx" &| +# TODO: 2024-01-03 remove rtx support +echo "[oh-my-zsh] 'rtx' plugin has been renamed to 'mise'" From f4435a4522c1070b04d4e3a5b6b705bcebc309e5 Mon Sep 17 00:00:00 2001 From: Zacharias Knudsen Date: Thu, 4 Jan 2024 10:30:14 +0100 Subject: [PATCH 003/453] feat(rails): update completion script (#12145) Source: https://github.com/zsh-users/zsh-completions/blob/f7c3173886f4f56bf97d622677c6d46ab005831f/src/_rails --- plugins/rails/_rails | 1004 +++++++++++++++++++----------------------- 1 file changed, 459 insertions(+), 545 deletions(-) diff --git a/plugins/rails/_rails b/plugins/rails/_rails index ac90d45cc..48fd1909e 100644 --- a/plugins/rails/_rails +++ b/plugins/rails/_rails @@ -1,6 +1,6 @@ #compdef rails # ------------------------------------------------------------------------------ -# Copyright (c) 2016 GitHub zsh-users - http://github.com/zsh-users +# Copyright (c) 2016 GitHub zsh-users - https://github.com/zsh-users # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -28,136 +28,494 @@ # Description # ----------- # -# Completion script for Ruby on Rails (http://rubyonrails.org/). +# Completion script for Ruby on Rails 7.1.0 (https://rubyonrails.org/). # # ------------------------------------------------------------------------------ # Authors # ------- # # * Kazuya Takeshima (https://github.com/mitukiii) +# * Shohei Yoshida (https://github.com/syohex) # # ------------------------------------------------------------------------------ - _rails() { - local context state line curcontext="$curcontext" + local context state state_descr line curcontext="$curcontext" + typeset -A opt_args - if (( CURRENT > 2 )); then - (( CURRENT-- )) - shift words - _call_function - "_rails_${words[1]}" || _nothing - else - __rails_commands - fi -} - -__rails_commands() { - local context state line curcontext="$curcontext" - - local -a rails_options - __rails_setup_rails_options - - _arguments -C \ - $rails_options \ - ': :->command' - - case "$state" in - command) - local -a commands - local application_directory - __rails_setup_application_directory - - if [ -n "$application_directory" ]; then - commands=( - {generate,g}'[Generate new code]' - {console,c}'[Start the Rails console]' - {server,s}'[Start the Rails server]' - {dbconsole,db}'[Start a console for the database specified in config/database.yml]' - application'[Generate the Rails application code]' - {destroy,d}'[Undo code generated with "generate"]' - benchmarker'[See how fast a piece of code runs]' - profiler'[Get profile information from a piece of code]' - plugin'[Install a plugin]' - {runner,r}'[Run a piece of code in the application environment]' - {test,t}'[Run tests]' - ) - else - commands=( - new'[Create a new Rails application]' - ) - fi - - _values 'command' $commands - ;; - esac -} - -__rails_setup_application_directory() { - application_directory="$(pwd)" - - while [ -n "$application_directory" ]; do - if [ -f "${application_directory}/script/rails" -o -f "${application_directory}/bin/rails" ]; then - return - fi - application_directory="${application_directory%/*}" - done - - application_directory= -} - -__rails_setup_rails_options() { - rails_options=( - {-h,--help}'[Show this help message and quit]' - {-v,--version}'[Show Rails version number and quit]' + local -a runtime_options rails_options + runtime_options=( + '(- *)'{-h,--help}'[Show this help message and quit]' + '(- *)'{-v,--version}'[Show Rails version and quit]' ) -} -__rails_setup_runtime_options() { runtime_options=( '(-f --force)'{-f,--force}'[Overwrite files that already exist]' '(-p --pretend)'{-p,--pretend}'[Run but do not make any changes]' '(-q --quiet)'{-q,--quiet}'[Suppress status output]' '(-s --skip)'{-s,--skip}'[Skip files that already exist]' ) + + local ret=1 + + _arguments -C \ + $rails_options \ + '1: :_rails_subcommands' \ + '*:: :->command' && ret=0 + + case "$state" in + (command) + case $words[1] in + (new) + _rails_new && ret=0 + ;; + (generate|g|destroy|d) + _rails_generate && ret=0 + ;; + (console|c) + _arguments \ + '(- *)'{-h,--help}'[Show this help message and quit]' \ + '(-e --environment)'{-e,--environment=}'[The environment to run "console" in]:env:(test development production)' \ + '(-s --sandbox)'{-s,--sandbox}'[Rollback database modifications on exit]' \ + && ret=0 + ;; + (server|s) + _arguments \ + '(- *)'{-h,--help}'[Show this help message and quit]' \ + '(-e --environment)'{-e,--environment=}'[The environment to run "server" in]:env:(test development production)' \ + '(-p --port)'{-p,--port}'[Run Rails on the specified port]:port' \ + '(-b --binding)'{-b,--binding=}'[Bind Rails to the specified IP]:binding' \ + '(-c --config)'{-c,--config=}'[Use a custom rackup configuration]:config file:_files -g "*.ru"' \ + '(-d --daemon)'{-d,--daemon}'[Run server as a Daemon]' \ + '(-u --using)'{-u,--using=}'[Specify the Rack server used to run the application]:server:(thin puma webrick)' \ + '(-P --pid)'{-P,--pid=}'[Specify the PID file]:pid file:_files -g "*.pid"' \ + '(-C --dev-caching --no-dev-caching)'{-C,--dev-caching}'[Perform caching in development]' \ + '(-C --dev-caching --no-dev-caching)--no-dev-caching[Not perform caching in development]' \ + '--early-hints[Enable HTTP/2 early hints]' \ + '(--log-to-stdout --no-log-to-stdout)--log-to-stdout[Log to stdout]' \ + '(--log-to-stdout --no-log-to-stdout)--no-log-to-stdout[Not log to stdout]' \ + && ret=0 + ;; + (dbconsole|db) + _arguments \ + '(- *)'{-h,--help}'[Show this help message and quit]' \ + '(-e --environment)'{-e,--environment=}'[The environment to run "server" in]:env:(test development production)' \ + '(-p --include-password)'{-p,--include-password}'[Automatically provide the password from database.yml]' \ + '--mode=[Automatically put the sqlite3 database in the specified mode]:mode:(html list line column)' \ + '(--header --no-header)--header[Display header]' \ + '(--header --no-header)--no-header[Not display header]' \ + '(--db --database)'{--db=,--database=}'[Specify the database to use]:database:_files' \ + && ret=0 + ;; + (test|t|test:system) + _arguments \ + '(- *)'{-h,--help}'[Show this help message and quit]' \ + '--no-plugins[Bypass minitest plugin auto-loading]' \ + '(-s --seed)'{-s,--seed=}'[Sets random seed]:seed' \ + '(-v -verbose)'{-v,--verbose}'[Show progress processing files]' \ + '--show-skips[Show skipped at the end of run]' \ + \*{-n,--name=}'[Filter run on /regexp/ or string]:pattern' \ + *--exclude='[Exclude /regexp/ or string from run]:pattern' \ + \*{-S,--skip=}'[Skip reporting of certain types of results]' \ + '(-w --warnings)'{-w,--warnings}'[Run with Ruby warnings enabled]' \ + '(-e --environment)'{-e,--environment=}'[Run tests in the given environment]' \ + '(-b --backtrace)'{-b,--backtrace}'[Show the complete backtrace]' \ + '(-d --defer-output)'{-d,--defer-output}'[Output test failures and errors after the test run]' \ + '(-f --fail-fast)'{-f,--fail-fast}'[Abort test run on first failure or error]' \ + '(-c --color --no-color)'{-c,--color}'[Enable color in the output]' \ + '(-c --color --no-color)--no-color[Disable color in the output]' \ + '--profile=[Enable profiling of tests and list the slowest test cases]:count' \ + '(-p --pride)'{-p,--pride}'[Show your testing pride]' \ + '*:: :_files -g "*.rb"' \ + && ret=0 + ;; + (runner|r) + _arguments \ + '(- *)'{-h,--help}'[Show this help message and quit]' \ + '(-e --environment)'{-e,--environment=}'[The environment to run "runner"]:env:(test development production)' \ + '*:: :_files -g "*.rb"' \ + && ret=0 + ;; + (plugin) + _arguments \ + '1: :(new)' \ + '*:: :_rails_new' \ + && ret=0 + ;; + (routes) + _arguments \ + '(- *)'{-h,--help}'[Show this help message and quit]' \ + '(-c --controller)'{-c,--controller=}'[Filter by a specific controller]:controller' \ + '(-g --grep)'{-g,--grep}'[Grep routes by a specific pattern]' \ + '(-E --expanded)'{-E,--expanded}'[Print routes expanded vertically with parts explained]' \ + '(-u --unused)'{-u,--unused}'[Print unused routes]' \ + && ret=0 + ;; + (*) + _arguments \ + '(- *)'{-h,--help}'[Show help message and quit]' \ + '*:: :_files' \ + && ret=0 + ;; + esac + ;; + esac + + return ret } -__rails_setup_generators_options() { - local -a runtime_options - __rails_setup_runtime_options +(( $+functions[_rails_subcommands] )) || +_rails_subcommands() { + local -a commands - generators_options=( - $runtime_options - --skip-namespace'[Skip namespace (affects only isolated applications)]' - --old-style-hash"[Force using old style hash (:foo => 'bar') on Ruby >= 1.9]" + _rails_is_in_app + + if (( $? == 1 )); then + # is not in rails app directory + commands=( + new'[Create a new Rails application]' + ) + else + commands=( + {generate,g}'[Generate new code]' + {console,c}'[Start the Rails console]' + {server,s}'[Start the Rails server]' + {test,t}'[Run tests]' + "test\\:system[Run systems test only]" + {dbconsole,db}'[Start a console for the database specified in config/database.yml]' + plugin'[Install a plugin]' + + # generated by ./bin/rails --help | ruby -ne '(b=$2;printf("%s[%s]\n", $1.gsub(/:/,"\\:"),b.strip)) if /^([a-z0-9_:]+)\S*\s+([^(\n]+)/' + "about[List versions of all Rails frameworks and the environment]" + "action_mailbox\:ingress\:exim[Relay an inbound email from Exim to Action Mailbox]" + "action_mailbox\:ingress\:postfix[Relay an inbound email from Postfix to Action Mailbox]" + "action_mailbox\:ingress\:qmail[Relay an inbound email from Qmail to Action Mailbox]" + "action_mailbox\:install[Install Action Mailbox and its dependencies]" + "action_mailbox\:install\:migrations[Copy migrations from action_mailbox to application]" + "action_text\:install[Copy over the migration, stylesheet, and JavaScript files]" + "action_text\:install\:migrations[Copy migrations from action_text to application]" + "active_storage\:install[Copy over the migration needed to the application]" + "app\:template[Apply the template supplied by LOCATION=]" + "app\:update[Update configs and some other initially generated files]" + "assets\:clean[Remove old compiled assets]" + "assets\:clobber[Remove compiled assets]" + "assets\:environment[Load asset compile environment]" + "assets\:precompile[Compile all the assets named in config.assets.precompile]" + "cache_digests\:dependencies[Lookup first-level dependencies for TEMPLATE]" + "cache_digests\:nested_dependencies[Lookup nested dependencies for TEMPLATE]" + "credentials\:diff[Enroll/disenroll in decrypted diffs of credentials using git]" + "credentials\:edit[Open the decrypted credentials in $VISUAL or $EDITOR for editing]" + "credentials\:show[Show the decrypted credentials]" + "db\:create[Create the database from DATABASE_URL or config/database.yml for the current RAILS_ENV]" + "db\:drop[Drop the database from DATABASE_URL or config/database.yml for the current RAILS_ENV]" + "db\:encryption\:init[Generate a set of keys for configuring Active Record encryption in a given environment]" + "db\:environment\:set[Set the environment value for the database]" + "db\:fixtures\:load[Load fixtures into the current environment's database]" + "db\:migrate[Migrate the database]" + "db\:migrate\:down[Run the 'down' for a given migration VERSION]" + "db\:migrate\:redo[Roll back the database one migration and re-migrate up]" + "db\:migrate\:status[Display status of migrations]" + "db\:migrate\:up[Run the 'up' for a given migration VERSION]" + "db\:prepare[Run setup if database does not exist, or run migrations if it does]" + "db\:reset[Drop and recreate all databases from their schema for the current environment and load the seeds]" + "db\:rollback[Roll the schema back to the previous version]" + "db\:schema\:cache\:clear[Clear a db/schema_cache.yml file]" + "db\:schema\:cache\:dump[Create a db/schema_cache.yml file]" + "db\:schema\:dump[Create a database schema file]" + "db\:schema\:load[Load a database schema file]" + "db\:seed[Load the seed data from db/seeds.rb]" + "db\:seed\:replant[Truncate tables of each database for current environment and load the seeds]" + "db\:setup[Create all databases, load all schemas, and initialize with the seed data]" + "db\:system\:change[Change 'config/database.yml' and your database gem to the target database]" + "db\:version[Retrieve the current schema version number]" + "destroy[Remove code generated by 'bin/rails generate']" + "dev\:cache[Toggle development mode caching on/off]" + "encrypted\:edit[Open the decrypted file in $VISUAL or $EDITOR for editing]" + "encrypted\:show[Show the decrypted contents of the file]" + "importmap\:install[Setup Importmap for the app]" + "initializers[Print out all defined initializers in the order they are invoked by Rails.]" + "log\:clear[Truncate all/specified *.log files in log/ to zero bytes]" + "middleware[Print out your Rack middleware stack]" + "notes[Show comments in your code annotated with FIXME, OPTIMIZE, and TODO]" + "restart[Restart app by touching tmp/restart.txt]" + "routes[List all the defined routes]" + "runner[Run Ruby code in the context of your application]" + "secret[Generate a cryptographically secure secret key]" + "secrets\:edit[**deprecated** Open the secrets in $VISUAL or $EDITOR for editing]" + "secrets\:show[**deprecated** Show the decrypted secrets]" + "stats[Report code statistics]" + "stimulus\:install[Install Stimulus into the app]" + "stimulus\:install\:importmap[Install Stimulus on an app running importmap-rails]" + "stimulus\:install\:node[Install Stimulus on an app running node]" + "test\:all[Run all tests, including system tests]" + "test\:channels[Run tests in test/channels]" + "test\:controllers[Run tests in test/controllers]" + "test\:db[Reset the database and run 'bin/rails test']" + "test\:functionals[Run tests in test/controllers, test/mailers, and test/functional]" + "test\:generators[Run tests in test/lib/generators]" + "test\:helpers[Run tests in test/helpers]" + "test\:integration[Run tests in test/integration]" + "test\:jobs[Run tests in test/jobs]" + "test\:mailboxes[Run tests in test/mailboxes]" + "test\:mailers[Run tests in test/mailers]" + "test\:models[Run tests in test/models]" + "test\:units[Run tests in test/models, test/helpers, and test/unit]" + "time\:zones[List all time zones, list by two-letter country code]" + "tmp\:clear[Clear cache, socket and screenshot files from tmp/]" + "tmp\:create[Create tmp directories for cache, sockets, and pids]" + "turbo\:install[Install Turbo into the app]" + "turbo\:install\:importmap[Install Turbo into the app with asset pipeline]" + "turbo\:install\:node[Install Turbo into the app with webpacker]" + "turbo\:install\:redis[Switch on Redis and use it in development]" + "version[Show the Rails version]" + "yarn\:install[Install all JavaScript dependencies as specified via Yarn]" + "zeitwerk\:check[Check project structure for Zeitwerk compatibility]" + ) + fi + + _values 'command' $commands +} + +# rails new +(( $+functions[_rails_new] )) || +_rails_new() { + local ret=1 + + _arguments \ + $runtime_options \ + $rails_options \ + --skip-namespace'[Skip namespace]' \ + '(-n --name)'{-n,--name=}'[Name of the app]:name' \ + '(-r --ruby)'{-r,--ruby=}'[Path to the Ruby binary of your choice]:path:_files' \ + '(-b --builder)'{-b,--builder=}'[Path to a application builder(can be a filesystem path or URL)]: :_rails_path_or_url' \ + '(-m --template)'{-m,--template=}'[Path to an application template(can be a filesystem path or URL)]: :_rails_path_or_url' \ + '(-d --database)'{-d,--database=}'[Preconfigure for selected database]:database:(mysql trilogy oracle postgresql sqlite3 frontbase ibm_db sqlserver jdbcmysql jdbcsqlite3 jdbcpostgresql jdbc)' \ + --skip-gemfile"[Don't create a Gemfile]" \ + --skip-bundle"[Don't run bundle install]" \ + '(-G --skip-git)'{-G,--skip-git}'[Skip git init]' \ + --skip-docker'[Skip Dockerfile]' \ + --skip-keeps'[Skip source control .keep files]' \ + '(-M --skip-action-mailer)'{-M,--skip-action-mailer}'[Skip Action Mailer files]' \ + --skip-action-mailbox'[Skip Action Mailbox gem]' \ + --skip-action-text'[Skip Action Text gem]' \ + '(-O --skip-active-record)'{-O,--skip-active-record}'[Skip Active Record files]' \ + --skip-active-job'[Skip Active Job]' \ + --skip-active-storage'[Skip Active Storage files]' \ + '(-C --skip-action-cable)'{-C,--skip-action-cable}'[Skip Action Cable files]' \ + '(-A --skip-asset-pipeline)'{-A,--skip-asset-pipeline}'[Skip asset pipeline]' \ + '(-a --asset-pipeline)'{-a,--asset-pipeline=}'[Choose your asset pipeline]:asset pipeline:(sprockets propshaft)' \ + '(-J --skip-js)'{-J,--skip-js}'[Skip JavaScript files]' \ + --skip-hotwire'[Skip Hotwire integration]' \ + --skip-jbuilder'[Skip jbuilder gem]' \ + '(-T --skip-test)'{-T,--skip-test}'[Skip test files]' \ + --skip-system-test'[Skip system test files]' \ + --skip-bootsnap'[Skip bootsnap gem]' \ + --skip-dev-gems'[Skip development gems(e.g. web-console)]' \ + --dev'[Setup the application with Gemfile pointing to your Rails checkout]' \ + --edge'[Setup the application with Gemfile pointing to Rails repository]' \ + --master'[Set up the application with Gemfile pointing to Rails repository main branch]' \ + --rc='[Path to file containing extra configuration options for rails command]:rc:_files' \ + --api'[Preconfigure smaller stack for API only apps]' \ + --minimal'[Preconfigure a minimal rails app]' \ + '(-j --js)'{-j,--js=}'[Choose JavaScript approach]:javascript:(importmap bun webpack esbuild rollup)' \ + '(-c --css)'{-c,--css=}'[Choose CSS processor]:css processor:(tailwind bootstrap bulma postcss sass)' \ + '(-B --skip-bundle)'{-B,--skip-bundle}"[Don't run bundle install]" \ + --skip-decrypted-diffs"[Don't configure git to show decrypted diffs of encrypted credentials]" \ + ':app path:_directories' && ret=0 + + return ret +} + +# rails generate +(( $+functions[_rails_generate] )) || +_rails_generate() { + local ret=1 + + _arguments -C \ + '(- *)'{-h,--help}"[Print generator's options and usage]" \ + $runtime_options \ + '1:generator:_rails_generate_generator' \ + '*:: :->generate' && ret=0 + + case "$state" in + (generate) + local -a opts + opts=( + '(- *)'{-h,--help}'[Show this help message and quit]' + $runtime_options + '--skip-namespace[Skip namespace]' + '--skip-collision-check[Skip collision check]' + ) + + case $words[1] in + (application_record|migration|model|resource|scaffold|scaffold_controller) + opts+=( + '(-o --orm)'{-o,--orm=}'[ORM to be invoked]:orm:(active_record)' + ) + ;| + (channel) + opts+=( + '--no-assets[Not generate assets]' + ) + ;| + (controller|resource|scaffold|scaffold_controller) + opts+=( + '--skip-routes[Do not add routes to config/routes.rb]' + '--no-helper[Not generate helper]' + ) + ;| + (controller|job|model|resource|scaffold) + opts+=( + '--parent=[The parent class for the generated controler]:parent class' + ) + ;| + (controler|mailer|resource|scaffold|scaffold_controller) + opts+=( + '(-e --template-engine)'{-e,--template-engine=}'[Template engine to be invoked]:engine:(erb)' + ) + ;| + (channel|controller|generator|helper|job|mailbox|mailer|model|scaffold|scaffold_controller) + opts+=( + '(-t --test-framework)'{-t,--test-framework=}'[Test framework to be invoked]:test_framework:(test_unit)' + ) + ;| + (generator|test_unit:channel) + opts+=( + '--no-namespace[Not generate namespace generate]' + ) + ;| + (integration_test) + opts+=( + '--integration-tool=[Integration tool to be invoked]:tool:(test_unit)' + ) + ;| + (jbuilder|resource|scaffold|scaffold_controller) + opts+=( + '--model-name=[ModelName to be used]:name' + ) + ;| + (jbuilder|model|resource|scaffold|scaffold_controller) + opts+=( + '--force-plural[Do not singularize the model name]' + ) + ;| + (jbuilder|migration|model|resource|scaffold_controller) + opts+=( + '--no-timestamps[Not generate timestamps]' + ) + ;| + (job) + opts+=( + '--queue=[The queue name for the generated job]:name' + ) + ;| + (migration|model|resource|scaffold) + opts+=( + '--primary-key-type=[The type for primary key]' + '(--db --database)'{--db,--database=}'[The database for your migration]:db' + ) + ;| + (model|resource|scaffold) + opts+=( + '--no-migration[Not generate migration]' + '--no-indexes[Not add indexes for references and belongs_to columns]' + '--no-fixture[Not generate fixture]' + '(-r --fixture-replacement)'{-r,--fixture-replacement=}'[Fixture replacement to be invoked]:fixture' + ) + ;| + (resource) + opts+=( + '(-c --resource-controller)'{-c,--resource-controller=}'[Resource controller to be invoked]:controller:(controller)' + '(-a --actions)'{-a,--actions=}'[Actions for the source controller]:action' + ) + ;| + (resource|scaffold|scaffold_controller) + opts+=( + '--no-resource-route[Not generate resource route]' + ) + ;| + (scaffold) + opts+=( + '(-c --scaffold-controller)'{-c,--scaffold-controller=}'[Scaffold controller to be invoked]:controller:(scaffold_controller)' + + ) + ;| + (scaffold|scaffold_controller) + opts+=( + '--api[Generate API-only controller and tests, with no view templates]' + '--no-jbuilder[Not generate jbuilder]' + ) + ;| + (scaffold|scaffold_controller|system_test) + opts+=( + '--system-tests=[System test framework to be invoked]:framework:(test_unit)' + ) + ;| + (stimulus) + opts+=( + '--skip-manifest[Do not update the stimulus manifest]' + ) + ;| + (jbuilder|migration|resource|scaffold) + opts+=( + '*:field:_rails_migration_fields' + ) + ;| + esac + + _arguments $opts && ret=0 + ;; + esac + + return ret +} + +(( $+functions[_rails_generate_generator] )) || +_rails_generate_generator() { + local -a generators=( + # rails + application_record benchmark channel controller generator helper integration_test + jbuilder job mailbox mailer migration model resource scaffold scaffold_controller + system_test task + + # active record + "active_record\\:application_record" + "active_record\\:multi_db" + + # Stimulus + stimulus + + # TestUnit + "test_unit\\:channel" "test_unit\\:generator" "test_unit\\:install" + "test_unit\\:mailbox" "test_unit\\:plugin" ) + + _values 'generators' $generators } -__rails_setup_model_generators_options() { - local -a generators_options - __rails_setup_generators_options +# Utilities +(( $+functions[_rails_is_in_app] )) || +_rails_is_in_app() { + local dir="$PWD" + while [ -n "$dir" ]; do + if [[ -f "${dir}/bin/rails" ]]; then + return 0 + fi + dir="${dir/*}" + done - model_generators_options=( - $generators_options - '(-o --orm)'{-o,--orm=}'[Orm to be invoked]:orm' - ) + return 1 } -__rails_setup_resource_generators_options() { - local -a model_generators_options - __rails_setup_model_generators_options - - resource_generators_options=( - $model_generators_options - --force-plural'[Forces the use of a plural ModelName]' - --resource-route'[Indicates when to generate resource route]: :__rails_boolean' - ) +(( $+functions[_rails_path_or_url] )) || +_rails_path_or_url() { + _alternative \ + 'files:path:_files -g "*.rb"' \ + 'url:url:_urls' } -__rails_boolean() { - _values 'boolean' 'true' 'false' -} - -__rails_migration_fields() { +(( $+functions[_rails_migration_fields] )) || +_rails_migration_fields() { if compset -P '*:*:'; then _values 'index' 'index' 'uniq' else @@ -169,450 +527,6 @@ __rails_migration_fields() { fi } -_rails_generate() { - local context state line curcontext="$curcontext" - - if (( CURRENT > 2 )); then - (( CURRENT-- )) - shift words - _call_function - "_rails_generate_${words[1]}" || _rails_generate_default - else - __rails_generate_commands - fi -} - -_rails_g() { - _rails_generate -} - -__rails_generate_commands() { - local context curcontext="$curcontext" update_policy - - zstyle -s ":completion:${curcontext}:" cache-policy update_policy - if [ -z "$update_policy" ]; then - zstyle ":completion:${curcontext}:" cache-policy _rails_generate_commands_caching_policy - fi - - local application_directory - __rails_setup_application_directory - local cache_name - cache_name="rails/${application_directory##*/}/all_generators" - if ! _retrieve_cache ${cache_name}; then - local -a all_generators - all_generators=($(_call_program rails_generators rails generate 2> /dev/null | awk '/^ [a-zA-Z_]+/{ print $1 }')) - _store_cache ${cache_name} all_generators - fi - - local -a rails_generators - rails_generators=(${all_generators:#*:*}) - _describe -t rails_generators 'rails generator' rails_generators - - local -a -U namespaces - local namespace - local -a generators - namespaces=(${(R)${(M)all_generators:#*:*}%:*}) - for namespace in $namespaces; do - generators=(${${(M)all_generators:#${namespace}:*}/:/\\:}) - _describe -t ${namespace}_generators "${namespace/_/ } generator" generators - done -} - -_rails_generate_commands_caching_policy() { - local application_directory - __rails_setup_application_directory - - if [ "${application_directory}/Gemfile" -nt "$1" ]; then - return 0 - fi - - local -a oldp - oldp=( "$1"(Nmw+1) ) - (( $#oldp )) -} - -_rails_generate_default() { - local -a generators_options - __rails_setup_generators_options - - _arguments \ - $generators_options \ - '*:argument' -} - -_rails_generate_assets() { - local -a generators_options - __rails_setup_generators_options - - _arguments \ - $generators_options \ - '(-j --javascripts)'{-j,--javascripts}'[Generate JavaScripts]: :__rails_boolean' \ - '(-y --stylesheets)'{-y,--stylesheets}'[Generate Stylesheets]: :__rails_boolean' \ - '(-je --javascript-engine)'{-je,--javascript-engine=}'[Engine for JavaScripts]:javascript engine' \ - '(-se --stylesheet-engine)'{-se,--stylesheet-engine=}'[Engine for Stylesheets]:stylesheet engine' \ - ': :_guard "^-*" "name"' -} - -_rails_generate_controller() { - local -a generators_options - __rails_setup_generators_options - - _arguments \ - $generators_options \ - '(-e --template-engine)'{-e,--template-engine=}'[Template engine to be invoked]:template engine' \ - '(-t --test-framework)'{-t,--test-framework=}'[Test framework to be invoked]:test framework' \ - --helper'[Indicates when to generate helper]: :__rails_boolean' \ - --assets'[Indicates when to generate assets]: :__rails_boolean' \ - ': :_guard "^-*" "name"' \ - '*: :_guard "^-*" "action"' -} - -_rails_generate_generator() { - local -a generators_options - __rails_setup_generators_options - - _arguments \ - $generators_options \ - --namespace'[Namespace generator under lib/generators/name]: :__rails_boolean' \ - ': :_guard "^-*" "name"' -} - -_rails_generate_helper() { - local -a generators_options - __rails_setup_generators_options - - _arguments \ - $generators_options \ - '(-t --test-framework)'{-t,--test-framework=}'[Test framework to be invoked]:test framework' \ - ': :_guard "^-*" "name"' \ -} - -_rails_generate_integration_test() { - local -a generators_options - __rails_setup_generators_options - - _arguments \ - $generators_options \ - --integration-tool='[Integration tool to be invoke]:integration tool' \ - ': :_guard "^-*" "name"' \ -} - -_rails_generate_jbuilder() { - local -a generators_options - __rails_setup_generators_options - - _arguments \ - $generators_options \ - ': :_guard "^-*" "name"' \ - '*: :__rails_migration_fields' -} - -_rails_generate_mailer() { - local -a generators_options - __rails_setup_generators_options - - _arguments \ - $generators_options \ - '(-e --template-engine)'{-e,--template-engine=}'[Template engine to be invoked]:template engine' \ - '(-t --test-framework)'{-t,--test-framework=}'[Test framework to be invoked]:test framework' \ - ': :_guard "^-*" "name"' \ - '*: :_guard "^-*" "method"' -} - -_rails_generate_migration() { - local -a modelgenerators_options - __rails_setup_model_generators_options - - _arguments \ - $model_generators_options \ - ': :_guard "^-*" "name"' \ - '*: :__rails_migration_fields' -} - -_rails_generate_model() { - _rails_generate_migration -} - -_rails_generate_observer() { - local -a model_generators_options - __rails_setup_model_generators_options - - _arguments \ - $model_generators_options \ - ': :_guard "^-*" "name"' -} - -_rails_generate_performance_test() { - local -a generators_options - __rails_setup_generators_options - - _arguments \ - $generators_options \ - --performance-tool='[Performance tool to be invoked]:performance tool' \ - ': :_guard "^-*" "name"' \ -} - -_rails_generate_resource() { - local context state line curcontext="$curcontext" - - local -a resource_generators_options - __rails_setup_resource_generators_options - - _arguments -C \ - $resource_generators_options \ - '(-c --resource-controller)'{-c,--resource-controller=}'[Resource controller to be invoked]:name' \ - '(-a --actions)'{-a,--actions=}'[Actions for the resource controller]: :->actions' \ - ': :->name' \ - '*: :->fields' - - if (( words[(I)(--actions=*|-a)] > 0 && words[(I)(--actions=*|-a)] == words[(I)-*] )); then - state=actions - fi - - case "$state" in - actions) - _guard "[[:alnum:]_]#" "actions" - ;; - name) - _guard "^-*" "name" - ;; - fields) - __rails_migration_fields - ;; - esac -} - -_rails_generate_scaffold() { - local -a resource_generators_options - __rails_setup_resource_generators_options - - _arguments \ - $resource_generators_options \ - '(-y --stylesheets)'{-y,--stylesheets}'[Generate Stylesheets]: :__rails_boolean' \ - '(-se --stylesheet-engine)'{-se,--stylesheet-engine=}'[Engine for Stylesheets]:stylesheet engine' \ - '(-c --scaffold-controller)'{-c,--scaffold-controller=}'[Scaffold controller to be invoked]:name' \ - --assets'[Indicates when to generate assets]:boolean:(true false)' \ - ': :_guard "^-*" "name"' \ - '*: :__rails_migration_fields' -} - -_rails_generate_scaffold_controller() { - local -a model_generators_options - __rails_setup_model_generators_options - - _arguments \ - $model_generators_options \ - '(-e --template-engine)'{-e,--template-engine=}'[Template engine to be invoked]:template engine' \ - '(-t --test-framework)'{-t,--test-framework=}'[Test framework to be invoked]:test framework' \ - --helper'[Indicates when to generate helper]: :__rails_boolean' \ - ': :_guard "^-*" "name"' -} - -_rails_generate_session_migration() { - local -a model_generators_options - __rails_setup_model_generators_options - - _arguments \ - $model_generators_options \ - ': :_guard "^-*" "name"' -} - -_rails_generate_task() { - local -a generators_options - __rails_setup_generators_options - - _arguments \ - $generators_options \ - ': :_guard "^-*" "name"' \ - '*: :_guard "^-*" "action"' -} - -_rails_console() { - _arguments \ - '(- *)'{-h,--help}'[Show this help message]' \ - '(-s --sandbox)'{-s,--sandbox}'[Rollback database modifications on exit]' \ - --debugger'[Enable ruby-debugging for the console]' -} - -_rails_c() { - _rails_console -} - -_rails_server() { - _arguments \ - '(- *)'{-h,--help}'[Show this help message]' \ - '(-p --port)'{-p,--port=}'[Runs Rails on the specified port]: :_guard "[[\:digit\:]]#" "port"' \ - '(-b --binding)'{-b,--binding=}'[Binds Rails to the specified ip]:ip:_hosts' \ - '(-c --config)'{-c,--config=}'[Use custom rackup configuration file]:file:_files -g "*.ru"' \ - '(-d --daemon)'{-d,--daemon}'[Make server run as a Daemon]' \ - '(-u --debugger)'{-u,--debugger}'[Enable ruby-debugging for the server]' \ - '(-e --environment)'{-e,--environment=}'[Specifies the environment to run this server under (test/development/production)]:name:(test development production)' \ - '(-P --pid)'{-P,--pid=}'[Specifies the PID file]:pid:_files -g "*.pid"' -} - -_rails_s() { - _rails_server -} - -_rails_dbconsole() { - _arguments \ - '(- *)'--help'[Show this help message]' \ - '(-p --include-password)'{-p,--include-password}'[Automatically provide the password from database.yml]' \ - --mode'[Automatically put the sqlite3 database in the specified mode (html, list, line, column)]:mode:(html list line column)' \ - --header -} - -_rails_new() { - local context state line curcontext="$curcontext" - - local _a rails_options runtime_options - __rails_setup_rails_options - __rails_setup_runtime_options - - _arguments -C \ - $rails_options \ - $runtime_options \ - '(-r --ruby)'{-r,--ruby=}'[Path to the Ruby binary of your choice]:path' \ - '(-b --builder)'{-b,--builder=}'[Path to a application builder (can be a filesystem path or URL)]: :->path_or_url' \ - '(-m --template)'{-m,--template=}'[Path to an application template (can be a filesystem path or URL)]: :->path_or_url' \ - --skip-gemfile"[Don't create a Gemfile]" \ - --skip-bundle"[Don't run bundle install]" \ - '(-G --skip-git)'{-G,--skip-git}'[Skip Git ignores and keeps]' \ - '(-O --skip-active-record)'{-O,--skip-active-record}'[Skip Active Record files]' \ - '(-S --skip-sprockets)'{-S,--skip-sprockets}'[Skip Sprockets files]' \ - '(-d --database)'{-d,--database=}'[Preconfigure for selected database]:database:(mysql oracle postgresql sqlite3 frontbase ibm_db sqlserver jdbcmysql jdbcsqlite3 jdbcpostgresql jdbc)' \ - '(-j --javascript)'{-j,--javascript=}'[Preconfigure for selected JavaScript library]:javascript' \ - '(-J --skip-javascript)'{-J,--skip-javascript}'[Skip JavaScript files]' \ - --dev'[Setup the application with Gemfile pointing to your Rails checkout]' \ - --edge'[Setup the application with Gemfile pointing to Rails repository]' \ - '(-T --skip-test-unit)'{-T,--skip-test-unit}'[Skip Test::Unit files]' \ - --old-style-hash"[Force using old style hash (:foo => 'bar') on Ruby >= 1.9]" \ - ':app path:_directories' - - case "$state" in - path_or_url) - _alternative \ - 'files:path:_files -g "*.rb"' \ - 'url:url:_urls' - ;; - esac -} - -_rails_application() { - _rails_new -} - -_rails_db() { - _rails_dbconsole -} - -_rails_destroy() { - _rails_generate -} - -_rails_d() { - _rails_destroy -} - -_rails_benchmarker() { - _arguments \ - '(- *)'{-h,--help}'[Show this help message]' \ - '(-r --runs)'{-r,--runs}'[Number of runs]: :_guard "[[\:digit\:]]#" "number"' \ - '(-o --output)'{-o,--output}'[Directory to use when writing the results]:directory:_directories' \ - '(-m --metrics)'{-m,--metrics}'[Metrics to use]: :_values -s "," "metrics" "wall_time" "memory" "objects" "gc_runs" "gc_time"' \ - '*: :_guard "^-*" "ruby code"' -} - -_rails_profiler() { - _arguments \ - '(- *)'{-h,--help}'[Show this help message]' \ - '(-r --runs)'{-r,--runs}'[Number of runs]: :_guard "[[\:digit\:]]#" "number"' \ - '(-o --output)'{-o,--output}'[Directory to use when writing the results]:directory:_directories' \ - '(-m --metrics)'{-m,--metrics}'[Metrics to use]: :_values -s "," "metrics" "process_time" "memory" "objects"' \ - '(-f --formats)'{-f,--formats}'[Formats to output to]: :_values -s "," "formats" "flat" "graph" "html" "call_tree" "call_stack"' \ - '*: :_guard "^-*" "ruby code"' -} - -_rails_plugin() { - local context state line curcontext="$curcontext" - - if (( CURRENT > 2 )); then - (( CURRENT-- )) - shift words - _call_function - "_rails_plugin_${words[1]}" || _nothing - else - __rails_plugin_commands - fi -} - -__rails_plugin_commands() { - _values 'plugin command' \ - install'[Install plugin(s) from known repositories or URLs]' \ - remove'[Uninstall plugins]' \ - new -} - -_rails_plugin_install() { - _arguments \ - '(-x --externals)'{-x,--externals}'[Use svn:externals to grab the plugin. Enables plugin updates and plugin versioning]' \ - '(-o --checkout)'{-o,--checkout}'[Use svn checkout to grab the plugin. Enables updating but does not add a svn:externals entry]' \ - '(-e --export)'{-e,--export}'[Use svn export to grab the plugin. Exports the plugin, allowing you to check it into your local repository. Does not enable updates or add an svn:externals entry]' \ - '(-q --quiet)'{-q,--quiet}'[Suppresses the output from installation. Ignored if -v is passed (rails plugin -v install ...)]' \ - '(-r --revision)'{-r,--revision=}'[Checks out the given revision from subversion or git. Ignored if subversion/git is not used]:revision' \ - '(-f --force)'{-f,--force}"[Reinstalls a plugin if it's already installed]" \ - '*:plugin:_urls' -} - -_rails_plugin_remove() { - local -a plugins - - plugins=($(_call_program rails_plugins ls -1 vendor/plugins)) - - _describe -t plugins 'plugin' plugins -} - -_rails_plugin_new() { - _rails_new -} - -_rails_runner() { - local context state line curcontext="$curcontext" - - _arguments -C \ - '(- *)'{-h,--help}'[Show this help message]' \ - '(-e --environment)'{-e,--environment=}'[Specifies the environment for the runner to operate under (test/development/production)]:name:(test development production)' \ - ': :->code_or_path' - - case "$state" in - code_or_path) - _alternative \ - 'files:filename:_files -g "*.rb"' \ - 'codes:ruby code:_guard "^-*" "ruby code"' - ;; - esac -} - -_rails_r() { - _rails_runner -} - -_rails_test() { - local context state line curcontext="$curcontext" - - _arguments -C \ - ': :->path' - - case "$state" in - path) - _alternative \ - 'files:filename:_files -g "*.rb"' - ;; - esac -} - -_rails_t() { - _rails_test -} - _rails "$@" # Local Variables: From 8980ffebbc8e38e8a25cdeba2ef78d7e5d0d0d62 Mon Sep 17 00:00:00 2001 From: Mete Date: Fri, 5 Jan 2024 12:38:26 +0300 Subject: [PATCH 004/453] feat(gcloud): add asdf installation dir (#12146) --- 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 9a4213aaf..cf3d650ea 100644 --- a/plugins/gcloud/gcloud.plugin.zsh +++ b/plugins/gcloud/gcloud.plugin.zsh @@ -17,6 +17,7 @@ if [[ -z "${CLOUDSDK_HOME}" ]]; then "/opt/google-cloud-sdk" "/opt/google-cloud-cli" "/opt/local/libexec/google-cloud-sdk" + "$HOME/.asdf/installs/gcloud/*/" ) for gcloud_sdk_location in $search_locations; do From 428866e28def25593e7dd73f1c3bd909db47635b Mon Sep 17 00:00:00 2001 From: Johan Kaving Date: Sat, 6 Jan 2024 12:32:18 +0100 Subject: [PATCH 005/453] fix(macos): print usage for `man-preview` with no args (#12147) --- plugins/macos/macos.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/macos/macos.plugin.zsh b/plugins/macos/macos.plugin.zsh index e27d412c8..a4347005e 100644 --- a/plugins/macos/macos.plugin.zsh +++ b/plugins/macos/macos.plugin.zsh @@ -224,6 +224,8 @@ function quick-look() { } function man-preview() { + [[ $# -eq 0 ]] && >&2 echo "Usage: $0 command1 [command2 ...]" && return 1 + local page for page in "${(@f)"$(man -w $@)"}"; do command mandoc -Tpdf $page | open -f -a Preview From 5ea2c68be88452b33b35ba8004fc9094618bcd87 Mon Sep 17 00:00:00 2001 From: ChaosInventor Date: Mon, 8 Jan 2024 11:02:20 +0100 Subject: [PATCH 006/453] fix(rkj-repos): check if `~/.hgrc` exists (#12148) --- themes/rkj-repos.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/rkj-repos.zsh-theme b/themes/rkj-repos.zsh-theme index 3cb452335..a9fe1a9af 100644 --- a/themes/rkj-repos.zsh-theme +++ b/themes/rkj-repos.zsh-theme @@ -1,7 +1,7 @@ # user, host, full path, and time/date on two lines for easier vgrepping function hg_prompt_info { - if (( $+commands[hg] )) && grep -q "prompt" ~/.hgrc; then + if (( $+commands[hg] )) && [[ -e ~/.hgrc ]] && grep -q "prompt" ~/.hgrc; then hg prompt --angle-brackets "\ %{$reset_color%}><:%{$fg[magenta]%}%{$reset_color%}>\ %{$reset_color%}>\ From 1c8dee848dad169c9eb1a7b0148842b48a99cad1 Mon Sep 17 00:00:00 2001 From: Albert Still Date: Wed, 10 Jan 2024 20:41:43 +0000 Subject: [PATCH 007/453] docs(git): align `gpristine` alias (#12155) Co-authored-by: Carlo Sala --- plugins/git/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git/README.md b/plugins/git/README.md index b7b9a6635..cbdfdca0f 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -163,7 +163,7 @@ plugins=(... git) | `grhh` | `git reset --hard` | | `grhk` | `git reset --keep` | | `grhs` | `git reset --soft` | -| `gpristine` | `git reset --hard && git clean -dffx` | +| `gpristine` | `git reset --hard && git clean --force -dfx` | | `groh` | `git reset origin/$(git_current_branch) --hard` | | `grs` | `git restore` | | `grss` | `git restore --source` | From 15479ca5aee5cd430540794d1f5aae90e2f59cd0 Mon Sep 17 00:00:00 2001 From: reda Date: Sat, 13 Jan 2024 12:36:26 +0100 Subject: [PATCH 008/453] feat(terraform): add new terraform and helm aliases (#11923) --- plugins/helm/README.md | 13 +++++++------ plugins/helm/helm.plugin.zsh | 1 + plugins/terraform/README.md | 3 +++ plugins/terraform/terraform.plugin.zsh | 2 ++ 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/plugins/helm/README.md b/plugins/helm/README.md index 8be024bfb..dcbb30b6c 100644 --- a/plugins/helm/README.md +++ b/plugins/helm/README.md @@ -10,9 +10,10 @@ plugins=(... helm) ## Aliases -| Alias | Full command | -| ----- | ------------ | -| h | helm | -| hin | helm install | -| hse | helm search | -| hup | helm upgrade | +| Alias | Full command | +| ----- | -------------- | +| h | helm | +| hin | helm install | +| hun | helm uninstall | +| hse | helm search | +| hup | helm upgrade | diff --git a/plugins/helm/helm.plugin.zsh b/plugins/helm/helm.plugin.zsh index 7fc05be98..e754a6541 100644 --- a/plugins/helm/helm.plugin.zsh +++ b/plugins/helm/helm.plugin.zsh @@ -14,5 +14,6 @@ fi alias h='helm' alias hin='helm install' +alias hun='helm uninstall' alias hse='helm search' alias hup='helm upgrade' diff --git a/plugins/terraform/README.md b/plugins/terraform/README.md index fc9a9f005..135fd78ef 100644 --- a/plugins/terraform/README.md +++ b/plugins/terraform/README.md @@ -26,6 +26,9 @@ plugins=(... terraform) | `tfo` | `terraform output` | | `tfp` | `terraform plan` | | `tfv` | `terraform validate` | +| `tfs` | `terraform state` | +| `tfsh`| `terraform show` | + ## Prompt function diff --git a/plugins/terraform/terraform.plugin.zsh b/plugins/terraform/terraform.plugin.zsh index ccca54684..f66a8eac9 100644 --- a/plugins/terraform/terraform.plugin.zsh +++ b/plugins/terraform/terraform.plugin.zsh @@ -24,3 +24,5 @@ alias tfi='terraform init' alias tfo='terraform output' alias tfp='terraform plan' alias tfv='terraform validate' +alias tfs='terraform state' +alias tfsh='terraform show' From 11b0ea33d1c770d69b1418bc78b27a936cc5a17e Mon Sep 17 00:00:00 2001 From: Gautam krishna R Date: Sat, 13 Jan 2024 23:17:54 +0530 Subject: [PATCH 009/453] fix(python): add support for cli args (#12159) --- plugins/python/python.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/python/python.plugin.zsh b/plugins/python/python.plugin.zsh index 3d7ca55c9..77d4bf425 100644 --- a/plugins/python/python.plugin.zsh +++ b/plugins/python/python.plugin.zsh @@ -44,7 +44,7 @@ function pyuserpaths() { alias pygrep='grep -nr --include="*.py"' # Run proper IPython regarding current virtualenv (if any) -alias ipython="python3 -c 'import IPython; IPython.terminal.ipapp.launch_new_instance()'" +alias ipython='python3 -c "import IPython, sys; sys.exit(IPython.start_ipython())"' # Share local directory as a HTTP server alias pyserver="python3 -m http.server" From cb7ff9fb148d14b19699d9bc35272253b698c3d8 Mon Sep 17 00:00:00 2001 From: Mladen Plavsic Date: Sat, 13 Jan 2024 18:54:56 +0100 Subject: [PATCH 010/453] feat(git): add `gcann!` alias (#12041) --- plugins/git/README.md | 1 + plugins/git/git.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/git/README.md b/plugins/git/README.md index cbdfdca0f..be3f85827 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -70,6 +70,7 @@ plugins=(... git) | `gca!` | `git commit --verbose --all --amend` | | `gcan!` | `git commit --verbose --all --no-edit --amend` | | `gcans!` | `git commit --verbose --all --signoff --no-edit --amend` | +| `gcann!` | `git commit --verbose --all --date=now --no-edit --amend` | | `gc!` | `git commit --verbose --amend` | | `gcn!` | `git commit --verbose --no-edit --amend` | | `gcs` | `git commit -S` | diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index bee9eb67d..f2e472f06 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -194,6 +194,7 @@ alias gca='git commit --verbose --all' alias gca!='git commit --verbose --all --amend' alias gcan!='git commit --verbose --all --no-edit --amend' alias gcans!='git commit --verbose --all --signoff --no-edit --amend' +alias gcann!='git commit --verbose --all --date=now --no-edit --amend' alias gc!='git commit --verbose --amend' alias gcn!='git commit --verbose --no-edit --amend' alias gcf='git config --list' From 8be4789bbbef06fe5eed581dc8c58df51e3cd9fd Mon Sep 17 00:00:00 2001 From: Mohammad Al Zouabi Date: Sun, 14 Jan 2024 01:56:23 +0800 Subject: [PATCH 011/453] feat(git): add `greva` and `grevc` aliases (#12042) --- plugins/git/git.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index f2e472f06..5c3064e8a 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -354,6 +354,8 @@ alias grss='git restore --source' alias grst='git restore --staged' alias gunwip='git rev-list --max-count=1 --format="%s" HEAD | grep -q "\--wip--" && git reset HEAD~1' alias grev='git revert' +alias greva='git revert --abort' +alias grevc='git revert --continue' alias grm='git rm' alias grmc='git rm --cached' alias gcount='git shortlog --summary --numbered' From 35a5357704ace1d9732a15cc3a5d792df53f2170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=A8=E3=82=93=E3=81=A8=E3=82=93=E3=81=BC?= <70003919+KaitoMuraoka@users.noreply.github.com> Date: Tue, 16 Jan 2024 18:37:13 +0900 Subject: [PATCH 012/453] feat(web-search): add `deepL` (#12165) --- plugins/web-search/README.md | 1 + plugins/web-search/web-search.plugin.zsh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/plugins/web-search/README.md b/plugins/web-search/README.md index 6e4b4d7b8..cf5bab3f7 100644 --- a/plugins/web-search/README.md +++ b/plugins/web-search/README.md @@ -45,6 +45,7 @@ Available search contexts are: | `scholar` | `https://scholar.google.com/scholar?q=` | | `ask` | `https://www.ask.com/web?q=` | | `youtube` | `https://www.youtube.com/results?search_query=` | +| `deepl` | `https://www.deepl.com/translator#auto/auto/` | 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 a8848fd95..1b42abe86 100644 --- a/plugins/web-search/web-search.plugin.zsh +++ b/plugins/web-search/web-search.plugin.zsh @@ -26,6 +26,7 @@ function web_search() { scholar "https://scholar.google.com/scholar?q=" ask "https://www.ask.com/web?q=" youtube "https://www.youtube.com/results?search_query=" + deepl "https://www.deepl.com/translator#auto/auto/" ) # check whether the search engine is supported @@ -68,6 +69,7 @@ alias archive='web_search archive' alias scholar='web_search scholar' alias ask='web_search ask' alias youtube='web_search youtube' +alias deepl='web_search deepl' #add your own !bang searches here alias wiki='web_search duckduckgo \!w' From d93401c642d1e5c87b06d7622bddb9bfd5eab383 Mon Sep 17 00:00:00 2001 From: Tabrez Mohammed Date: Tue, 16 Jan 2024 01:39:45 -0800 Subject: [PATCH 013/453] feat(history-substring-search): update to upstream (#12164) --- plugins/history-substring-search/README.md | 80 +++++- .../history-substring-search.plugin.zsh | 8 +- .../history-substring-search.zsh | 231 ++++++++++++------ 3 files changed, 231 insertions(+), 88 deletions(-) diff --git a/plugins/history-substring-search/README.md b/plugins/history-substring-search/README.md index 6d8b56425..eee279dfd 100644 --- a/plugins/history-substring-search/README.md +++ b/plugins/history-substring-search/README.md @@ -23,7 +23,15 @@ Install Using the [Homebrew]( https://brew.sh ) package manager: brew install zsh-history-substring-search - echo 'source /usr/local/share/zsh-history-substring-search/zsh-history-substring-search.zsh' >> ~/.zshrc + echo 'source $(brew --prefix)/share/zsh-history-substring-search/zsh-history-substring-search.zsh' >> ~/.zshrc + +Using [Fig](https://fig.io): + +Fig adds apps, shortcuts, and autocomplete to your existing terminal. + +Install `zsh-history-substring-search` in just one click. + + Using [Oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh): @@ -33,24 +41,63 @@ Using [Oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh): 2. Activate the plugin in `~/.zshrc`: - plugins=( [plugins...] history-substring-search) + plugins=( [plugins...] zsh-history-substring-search) -3. Source `~/.zshrc` to take changes into account: +3. Run `exec zsh` to take changes into account: - source ~/.zshrc + exec zsh + +Using [zplug](https://github.com/zplug/zplug): + +1. Add this repo to `~/.zshrc`: + + zplug "zsh-users/zsh-history-substring-search", as: plugin + +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' +bindkey '^[[B' history-substring-search-down # or '\eOB' +HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=1 +``` + +Using [Zinit](https://github.com/zdharma-continuum/zinit): + +1. Use the `Oh-my-zsh` Zinit snippet in `~/.zshrc`: + + zinit snippet OMZ::plugins/git/git.plugin.zsh` + +2. Load the plugin in `~/.zshrc`: + + zinit load 'zsh-users/zsh-history-substring-search + zinit ice wait atload'_history_substring_search_config' + +3. Run `exec zsh` to take changes into account: + + exec zsh Usage ------------------------------------------------------------------------------ 1. Load this script into your interactive ZSH session: - % source zsh-history-substring-search.zsh + source zsh-history-substring-search.zsh If you want to use [zsh-syntax-highlighting][6] along with this script, then make sure that you load it *before* you load this script: - % source zsh-syntax-highlighting.zsh - % source zsh-history-substring-search.zsh + source zsh-syntax-highlighting.zsh + source zsh-history-substring-search.zsh 2. Bind keyboard shortcuts to this script's functions. @@ -73,6 +120,10 @@ 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, + _even if_ these were not the observed values. If you are having trouble + with the observed values, give these a try. + You might also want to bind the Control-P/N keys for use in EMACS mode: bindkey -M emacs '^P' history-substring-search-up @@ -115,7 +166,7 @@ Configuration ------------------------------------------------------------------------------ This script defines the following global variables. You may override their -default values only after having loaded this script into your ZSH session. +default values. * `HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND` is a global variable that defines how the query should be highlighted inside a matching command. Its default @@ -141,6 +192,12 @@ default values only after having loaded this script into your ZSH session. value, causes this script to perform a fuzzy search by words, matching in given order e.g. `ab c` will match `*ab*c*` +* `HISTORY_SUBSTRING_SEARCH_PREFIXED` is a global variable that defines how + the command history will be searched for your query. If set to a non-empty + value, your query will be matched against the start of each history entry. + For example, if this variable is empty, `ls` will match `ls -l` and `echo + ls`; if it is non-empty, `ls` will only match `ls -l`. + * `HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE` is a global variable that defines whether all search results returned are _unique_. If set to a non-empty value, then only unique search results are presented. This behaviour is off @@ -155,6 +212,9 @@ default values only after having loaded this script into your ZSH session. receive globally unique search results only once, then use this configuration variable, or use `setopt HIST_IGNORE_ALL_DUPS`. +* `HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_TIMEOUT` is a global variable that + defines a timeout in seconds for clearing the search highlight. + History ------------------------------------------------------------------------------ @@ -187,8 +247,8 @@ https://github.com/zsh-users/zsh-history-substring-search. This downstream copy was last updated from the following upstream commit: - SHA: 0f80b8eb3368b46e5e573c1d91ae69eb095db3fb - Commit date: 2019-05-12 17:35:54 -0700 + SHA: 8dd05bfcc12b0cd1ee9ea64be725b3d9f713cf64 + Commit date: 2023-11-23 12:12:14 +0200 Everything above this section is a copy of the original upstream's README, so things may differ slightly when you're using this inside OMZ. In particular, you do not diff --git a/plugins/history-substring-search/history-substring-search.plugin.zsh b/plugins/history-substring-search/history-substring-search.plugin.zsh index 63f0bdd42..05bdbcd75 100644 --- a/plugins/history-substring-search/history-substring-search.plugin.zsh +++ b/plugins/history-substring-search/history-substring-search.plugin.zsh @@ -1,9 +1,5 @@ -# 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}}" -0="${${(M)0:#/*}:-$PWD/$0}" - -source ${0:A:h}/history-substring-search.zsh +0=${(%):-%N} +source ${0:A:h}/zsh-history-substring-search.zsh # Bind terminal-specific up and down keys diff --git a/plugins/history-substring-search/history-substring-search.zsh b/plugins/history-substring-search/history-substring-search.zsh index c326778d4..471cc9ad1 100644 --- a/plugins/history-substring-search/history-substring-search.zsh +++ b/plugins/history-substring-search/history-substring-search.zsh @@ -43,11 +43,12 @@ # declare global configuration variables #----------------------------------------------------------------------------- -typeset -g HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND='bg=magenta,fg=white,bold' -typeset -g HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND='bg=red,fg=white,bold' -typeset -g HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS='i' -typeset -g HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE='' -typeset -g HISTORY_SUBSTRING_SEARCH_FUZZY='' +: ${HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND='bg=magenta,fg=white,bold'} +: ${HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND='bg=red,fg=white,bold'} +: ${HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS='i'} +: ${HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=''} +: ${HISTORY_SUBSTRING_SEARCH_FUZZY=''} +: ${HISTORY_SUBSTRING_SEARCH_PREFIXED=''} #----------------------------------------------------------------------------- # declare internal global variables @@ -64,6 +65,7 @@ typeset -g -i _history_substring_search_raw_match_index typeset -g -a _history_substring_search_matches typeset -g -i _history_substring_search_match_index typeset -g -A _history_substring_search_unique_filter +typeset -g -i _history_substring_search_zsh_5_9 #----------------------------------------------------------------------------- # the main ZLE widgets @@ -97,6 +99,11 @@ zle -N history-substring-search-down #----------------------------------------------------------------------------- zmodload -F zsh/parameter +autoload -Uz is-at-least + +if is-at-least 5.9 $ZSH_VERSION; then + _history_substring_search_zsh_5_9=1 +fi # # We have to "override" some keys and widgets if the @@ -117,80 +124,125 @@ if [[ $+functions[_zsh_highlight] -eq 0 ]]; then } # - # The following snippet was taken from the zsh-syntax-highlighting project: + # Check if $1 denotes the name of a callable function, i.e. it is fully + # defined or it is marked for autoloading and autoloading it at the first + # call to it will succeed. In particular, if $1 has been marked for + # autoloading but is not available in $fpath, then it will return 1 (false). # - # https://github.com/zsh-users/zsh-syntax-highlighting/blob/56b134f5d62ae3d4e66c7f52bd0cc2595f9b305b/zsh-syntax-highlighting.zsh#L126-161 + # This is based on the zsh-syntax-highlighting plugin. # - # Copyright (c) 2010-2011 zsh-syntax-highlighting contributors - # All rights reserved. + _history-substring-search-function-callable() { + if (( ${+functions[$1]} )) && ! [[ "$functions[$1]" == *"builtin autoload -X"* ]]; then + return 0 # already fully loaded + else + # "$1" is either an autoload stub, or not a function at all. + # We expect 'autoload +X' to return non-zero if it fails to fully load + # the function. + ( autoload -U +X -- "$1" 2>/dev/null ) + return $? + fi + } + # - # Redistribution and use in source and binary forms, with or without - # modification, are permitted provided that the following conditions are - # met: + # The zsh-syntax-highlighting plugin uses zle-line-pre-redraw hook instead + # of the legacy "bind all widgets" if 1) zsh has the memo= feature (added in + # version 5.9) and 2) add-zle-hook-widget is available. # - # * Redistributions of source code must retain the above copyright - # notice, this list of conditions and the following disclaimer. - # - # * Redistributions in binary form must reproduce the above copyright - # notice, this list of conditions and the following disclaimer in the - # documentation and/or other materials provided with the distribution. - # - # * Neither the name of the zsh-syntax-highlighting contributors nor the - # names of its contributors may be used to endorse or promote products - # derived from this software without specific prior written permission. - # - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - # - #--------------8<-------------------8<-------------------8<----------------- - # Rebind all ZLE widgets to make them invoke _zsh_highlights. - _zsh_highlight_bind_widgets() - { - # Load ZSH module zsh/zleparameter, needed to override user defined widgets. - zmodload zsh/zleparameter 2>/dev/null || { - echo 'zsh-syntax-highlighting: failed loading zsh/zleparameter.' >&2 - return 1 + if [[ $_history_substring_search_zsh_5_9 -eq 1 ]] && _history-substring-search-function-callable add-zle-hook-widget; then + # + # The following code is based on the zsh-syntax-highlighting plugin. + # + autoload -U add-zle-hook-widget + + _history-substring-search-zle-line-finish() { + # + # Reset $WIDGET since the 'main' highlighter depends on it. + # + # Since $WIDGET is declared by zle as read-only in this function's scope, + # a nested function is required in order to shadow its built-in value; + # see "User-defined widgets" in zshall. + # + () { + local -h -r WIDGET=zle-line-finish + _zsh_highlight + } } - # Override ZLE widgets to make them invoke _zsh_highlight. - local cur_widget - for cur_widget in ${${(f)"$(builtin zle -la)"}:#(.*|_*|orig-*|run-help|which-command|beep|yank*)}; do - case $widgets[$cur_widget] in + _history-substring-search-zle-line-pre-redraw() { + # + # If the zsh-syntax-highlighting plugin has been loaded (after our plugin + # plugin, otherwise this hook wouldn't be called), remove our hooks. + # + if [[ $+ZSH_HIGHLIGHT_VERSION -eq 1 ]]; then + autoload -U add-zle-hook-widget + add-zle-hook-widget -d zle-line-pre-redraw _history-substring-search-zle-line-pre-redraw + add-zle-hook-widget -d zle-line-finish _history-substring-search-zle-line-finish + return 0 + fi + # + # Set $? to 0 for _zsh_highlight. Without this, subsequent + # zle-line-pre-redraw hooks won't run, since add-zle-hook-widget happens to + # call us with $? == 1 in the common case. + # + true && _zsh_highlight "$@" + } - # Already rebound event: do nothing. - user:$cur_widget|user:_zsh_highlight_widget_*);; + if [[ -o zle ]]; then + add-zle-hook-widget zle-line-pre-redraw _history-substring-search-zle-line-pre-redraw + add-zle-hook-widget zle-line-finish _history-substring-search-zle-line-finish + fi + else + # + # The following snippet was taken from the zsh-syntax-highlighting project: + # https://github.com/zsh-users/zsh-syntax-highlighting/blob/56b134f5d62ae3d4e66c7f52bd0cc2595f9b305b/zsh-syntax-highlighting.zsh#L126-161 + # + # SPDX-SnippetBegin + # SPDX-License-Identifier: BSD-3-Clause + # SPDX-SnippetCopyrightText: 2010-2011 zsh-syntax-highlighting contributors + #--------------8<-------------------8<-------------------8<----------------- + # Rebind all ZLE widgets to make them invoke _zsh_highlights. + _zsh_highlight_bind_widgets() + { + # Load ZSH module zsh/zleparameter, needed to override user defined widgets. + zmodload zsh/zleparameter 2>/dev/null || { + echo 'zsh-syntax-highlighting: failed loading zsh/zleparameter.' >&2 + return 1 + } - # User defined widget: override and rebind old one with prefix "orig-". - user:*) eval "zle -N orig-$cur_widget ${widgets[$cur_widget]#*:}; \ - _zsh_highlight_widget_$cur_widget() { builtin zle orig-$cur_widget -- \"\$@\" && _zsh_highlight }; \ - zle -N $cur_widget _zsh_highlight_widget_$cur_widget";; + # Override ZLE widgets to make them invoke _zsh_highlight. + local cur_widget + for cur_widget in ${${(f)"$(builtin zle -la)"}:#(.*|_*|orig-*|run-help|which-command|beep|yank*)}; do + case $widgets[$cur_widget] in - # Completion widget: override and rebind old one with prefix "orig-". - completion:*) eval "zle -C orig-$cur_widget ${${widgets[$cur_widget]#*:}/:/ }; \ - _zsh_highlight_widget_$cur_widget() { builtin zle orig-$cur_widget -- \"\$@\" && _zsh_highlight }; \ - zle -N $cur_widget _zsh_highlight_widget_$cur_widget";; + # Already rebound event: do nothing. + user:$cur_widget|user:_zsh_highlight_widget_*);; - # Builtin widget: override and make it call the builtin ".widget". - builtin) eval "_zsh_highlight_widget_$cur_widget() { builtin zle .$cur_widget -- \"\$@\" && _zsh_highlight }; \ - zle -N $cur_widget _zsh_highlight_widget_$cur_widget";; + # User defined widget: override and rebind old one with prefix "orig-". + user:*) eval "zle -N orig-$cur_widget ${widgets[$cur_widget]#*:}; \ + _zsh_highlight_widget_$cur_widget() { builtin zle orig-$cur_widget -- \"\$@\" && _zsh_highlight }; \ + zle -N $cur_widget _zsh_highlight_widget_$cur_widget";; - # Default: unhandled case. - *) echo "zsh-syntax-highlighting: unhandled ZLE widget '$cur_widget'" >&2 ;; - esac - done - } - #-------------->8------------------->8------------------->8----------------- + # Completion widget: override and rebind old one with prefix "orig-". + completion:*) eval "zle -C orig-$cur_widget ${${widgets[$cur_widget]#*:}/:/ }; \ + _zsh_highlight_widget_$cur_widget() { builtin zle orig-$cur_widget -- \"\$@\" && _zsh_highlight }; \ + zle -N $cur_widget _zsh_highlight_widget_$cur_widget";; - _zsh_highlight_bind_widgets + # Builtin widget: override and make it call the builtin ".widget". + builtin) eval "_zsh_highlight_widget_$cur_widget() { builtin zle .$cur_widget -- \"\$@\" && _zsh_highlight }; \ + zle -N $cur_widget _zsh_highlight_widget_$cur_widget";; + + # Default: unhandled case. + *) echo "zsh-syntax-highlighting: unhandled ZLE widget '$cur_widget'" >&2 ;; + esac + done + } + #-------------->8------------------->8------------------->8----------------- + # SPDX-SnippetEnd + + _zsh_highlight_bind_widgets + fi + + unfunction _history-substring-search-function-callable fi _history-substring-search-begin() { @@ -243,10 +295,17 @@ _history-substring-search-begin() { fi # - # Escape and join query parts with wildcard character '*' as separator - # `(j:CHAR:)` join array to string with CHAR as separator + # Escape and join query parts with wildcard character '*' as seperator + # `(j:CHAR:)` join array to string with CHAR as seperator # - local search_pattern="*${(j:*:)_history_substring_search_query_parts[@]//(#m)[\][()|\\*?#<>~^]/\\$MATCH}*" + local search_pattern="${(j:*:)_history_substring_search_query_parts[@]//(#m)[\][()|\\*?#<>~^]/\\$MATCH}*" + + # + # Support anchoring history search to the beginning of the command + # + if [[ -z $HISTORY_SUBSTRING_SEARCH_PREFIXED ]]; then + search_pattern="*${search_pattern}" + fi # # Find all occurrences of the search pattern in the history file. @@ -304,12 +363,21 @@ _history-substring-search-begin() { _history-substring-search-end() { setopt localoptions extendedglob + local highlight_memo= _history_substring_search_result=$BUFFER + if [[ $_history_substring_search_zsh_5_9 -eq 1 ]]; then + highlight_memo='memo=history-substring-search' + fi + # the search was successful so display the result properly by clearing away # existing highlights and moving the cursor to the end of the result buffer if [[ $_history_substring_search_refresh_display -eq 1 ]]; then - region_highlight=() + if [[ -n $highlight_memo ]]; then + region_highlight=( "${(@)region_highlight:#*${highlight_memo}*}" ) + else + region_highlight=() + fi CURSOR=${#BUFFER} fi @@ -329,7 +397,9 @@ _history-substring-search-end() { if [[ $query_part_match_index -le ${#BUFFER:$highlight_start_index} ]]; then highlight_start_index=$(( $highlight_start_index + $query_part_match_index )) highlight_end_index=$(( $highlight_start_index + ${#query_part} )) - region_highlight+=("$(($highlight_start_index - 1)) $(($highlight_end_index - 1)) $_history_substring_search_query_highlight") + region_highlight+=( + "$(($highlight_start_index - 1)) $(($highlight_end_index - 1)) ${_history_substring_search_query_highlight}${highlight_memo:+,$highlight_memo}" + ) fi done fi @@ -338,6 +408,23 @@ _history-substring-search-end() { # zle -R "mn: "$_history_substring_search_match_index" m#: "${#_history_substring_search_matches} # read -k -t 200 && zle -U $REPLY + # + # When this function returns, z-sy-h runs its line-pre-redraw hook. It has no + # logic for determining highlight priority, when two different memo= marked + # region highlights overlap; instead, it always prioritises itself. Below is + # a workaround for dealing with it. + # + if [[ $_history_substring_search_zsh_5_9 -eq 1 ]]; then + zle -R + # + # After line redraw with desired highlight, wait for timeout or user input + # before removing search highlight and exiting. This ensures no highlights + # are left lingering after search is finished. + # + read -k -t ${HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_TIMEOUT:-1} && zle -U $REPLY + region_highlight=( "${(@)region_highlight:#*${highlight_memo}*}" ) + fi + # Exit successfully from the history-substring-search-* widgets. return 0 } From d2ffe8306a7a901569764979be917384d7e97f0f Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Tue, 16 Jan 2024 10:47:06 +0100 Subject: [PATCH 014/453] feat(history-substring-search): use new dependencies updater --- .github/dependencies.yml | 7 + .../update-from-upstream.zsh | 129 ------------------ 2 files changed, 7 insertions(+), 129 deletions(-) delete mode 100755 plugins/history-substring-search/update-from-upstream.zsh diff --git a/.github/dependencies.yml b/.github/dependencies.yml index 6d138736c..be46a7973 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -18,3 +18,10 @@ dependencies: set -e test -e _zshz && mv -f _zshz _z test -e zsh-z.plugin.zsh && mv -f zsh-z.plugin.zsh z.plugin.zsh + plugins/history-substring-search: + repo: zsh-users/zsh-history-substring-search + branch: master + version: 8f5d8a5aa9942da7b2a764c7fa79e0f36ba802f7 + precopy: | + set -e + test -e zsh-history-substring-search.plugin.zsh && mv zsh-history-substring-search.plugin.zsh history-substring-search.plugin.zsh diff --git a/plugins/history-substring-search/update-from-upstream.zsh b/plugins/history-substring-search/update-from-upstream.zsh deleted file mode 100755 index 81e1942a5..000000000 --- a/plugins/history-substring-search/update-from-upstream.zsh +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env zsh -# -# update-from-upstream.zsh -# -# This script updates the Oh My Zsh version of the zsh-history-substring-search -# plugin from the independent upstream repo. This is to be run by OMZ developers -# when they want to pull in new changes from upstream to OMZ. It is not run -# during normal use of the plugin. -# -# The official upstream repo is zsh-users/zsh-history-substring-search -# https://github.com/zsh-users/zsh-history-substring-search -# -# This is a zsh script, not a function. Call it with `zsh update-from-upstream.zsh` -# from the command line, running it from within the plugin directory. -# -# You can set the environment variable REPO_PATH to point it at an upstream -# repo you have already prepared. Otherwise, it will do a clean checkout of -# upstream's HEAD to a temporary local repo and use that. - - -# Just bail on any error so we don't have to do extra checking. -# This is a developer-use script, so terse output like that should -# be fine. -set -e - - -upstream_basename=zsh-history-substring-search -plugin_basename=history-substring-search -UPSTREAM_REPO=zsh-users/$upstream_basename -need_repo_cleanup=false -upstream_github_url="https://github.com/$UPSTREAM_REPO" - -if [[ -z "$UPSTREAM_REPO_PATH" ]]; then - # Do a clean checkout - my_tempdir=$(mktemp -d -t omz-update-histsubstrsrch) - UPSTREAM_REPO_PATH="$my_tempdir/$upstream_basename" - git clone "$upstream_github_url" "$UPSTREAM_REPO_PATH" - need_repo_cleanup=true - print "Checked out upstream repo to $UPSTREAM_REPO_PATH" -else - print "Using existing $upstream_basename repo at $UPSTREAM_REPO_PATH" -fi - -upstream="$UPSTREAM_REPO_PATH" - -# Figure out what we're pulling in -upstream_sha=$(cd $upstream && git rev-parse HEAD) -upstream_commit_date=$(cd $upstream && git log -1 --pretty=format:%ci) -upstream_just_date=${${=upstream_commit_date}[1]} -print "upstream SHA: $upstream_sha" -print "upstream commit time: $upstream_commit_date" -print "upstream commit date: $upstream_just_date" -print - -# Copy the files over, using the OMZ plugin's names where needed -cp -v "$upstream"/* . -mv -v zsh-history-substring-search.zsh $plugin_basename.zsh -mv -v zsh-history-substring-search.plugin.zsh $plugin_basename.plugin.zsh - -if [[ $need_repo_cleanup == true ]]; then - print "Removing temporary repo at $my_tempdir" - rm -rf "$my_tempdir" -fi - -# Do OMZ-specific edits - -print -print "Updating files with OMZ-specific stuff" -print - -# OMZ binds the keys as part of the plugin loading - -cat >> $plugin_basename.plugin.zsh <> README.md < Date: Tue, 16 Jan 2024 11:01:39 +0100 Subject: [PATCH 015/453] fix(history-substring-search): source properly plugin --- .../history-substring-search.plugin.zsh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/history-substring-search/history-substring-search.plugin.zsh b/plugins/history-substring-search/history-substring-search.plugin.zsh index 05bdbcd75..63f0bdd42 100644 --- a/plugins/history-substring-search/history-substring-search.plugin.zsh +++ b/plugins/history-substring-search/history-substring-search.plugin.zsh @@ -1,5 +1,9 @@ -0=${(%):-%N} -source ${0:A:h}/zsh-history-substring-search.zsh +# 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}}" +0="${${(M)0:#/*}:-$PWD/$0}" + +source ${0:A:h}/history-substring-search.zsh # Bind terminal-specific up and down keys From d44ec1492bd46f6f0f9d6606649fee3fc11aac13 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Tue, 16 Jan 2024 11:02:07 +0100 Subject: [PATCH 016/453] ci(dependencies): create history-substring-search files as expected --- .github/dependencies.yml | 6 +++++- .../dependencies/OMZ-README.md | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 plugins/history-substring-search/dependencies/OMZ-README.md diff --git a/.github/dependencies.yml b/.github/dependencies.yml index be46a7973..f644322ff 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -24,4 +24,8 @@ dependencies: version: 8f5d8a5aa9942da7b2a764c7fa79e0f36ba802f7 precopy: | set -e - test -e zsh-history-substring-search.plugin.zsh && mv zsh-history-substring-search.plugin.zsh history-substring-search.plugin.zsh + rm -f zsh-history-substring-search.plugin.zsh + test -e zsh-history-substring-search.zsh && mv zsh-history-substring-search.zsh history-substring-search.zsh + postcopy: | + set -e + test -e dependencies/OMZ-README.md && cat dependencies/OMZ-README.md >> README.md diff --git a/plugins/history-substring-search/dependencies/OMZ-README.md b/plugins/history-substring-search/dependencies/OMZ-README.md new file mode 100644 index 000000000..9a2ef4d46 --- /dev/null +++ b/plugins/history-substring-search/dependencies/OMZ-README.md @@ -0,0 +1,19 @@ + +--- + +## Oh My Zsh Distribution Notes + +What you are looking at now is Oh My Zsh's repackaging of zsh-history-substring-search as an OMZ module inside +the Oh My Zsh distribution. + +The upstream repo, zsh-users/zsh-history-substring-search, can be found on GitHub at +https://github.com/zsh-users/zsh-history-substring-search. + +This downstream copy was last updated from the following upstream commit: + +SHA: 8dd05bfcc12b0cd1ee9ea64be725b3d9f713cf64 Commit date: 2023-11-23 12:12:14 +0200 + +Everything above this section is a copy of the original upstream's README, so things may differ slightly when +you're using this inside OMZ. In particular, you do not need to set up key bindings for the up and down arrows +yourself in `~/.zshrc`; the OMZ plugin does that for you. You may still want to set up additional emacs- or +vi-specific bindings as mentioned above. From c0074974313215360a9529e01204792cdf6ca473 Mon Sep 17 00:00:00 2001 From: "ohmyzsh[bot]" <54982679+ohmyzsh[bot]@users.noreply.github.com> Date: Tue, 16 Jan 2024 11:06:19 +0100 Subject: [PATCH 017/453] feat(history-substring-search): update to version 8dd05bfc (#12167) Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com> Co-authored-by: Carlo Sala --- .github/dependencies.yml | 2 +- plugins/history-substring-search/README.md | 27 +++++++------------ .../dependencies/OMZ-README.md | 4 --- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/.github/dependencies.yml b/.github/dependencies.yml index f644322ff..12beaecbb 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -21,7 +21,7 @@ dependencies: plugins/history-substring-search: repo: zsh-users/zsh-history-substring-search branch: master - version: 8f5d8a5aa9942da7b2a764c7fa79e0f36ba802f7 + version: 8dd05bfcc12b0cd1ee9ea64be725b3d9f713cf64 precopy: | set -e rm -f zsh-history-substring-search.plugin.zsh diff --git a/plugins/history-substring-search/README.md b/plugins/history-substring-search/README.md index eee279dfd..71a389535 100644 --- a/plugins/history-substring-search/README.md +++ b/plugins/history-substring-search/README.md @@ -235,24 +235,17 @@ History * March 2016: Geza Lore (@gezalore) greatly refactored it in pull request #55. ------------------------------------------------------------------------------- -Oh My Zsh Distribution Notes ------------------------------------------------------------------------------- +--- -What you are looking at now is Oh My Zsh's repackaging of zsh-history-substring-search -as an OMZ module inside the Oh My Zsh distribution. +## Oh My Zsh Distribution Notes -The upstream repo, zsh-users/zsh-history-substring-search, can be found on GitHub at +What you are looking at now is Oh My Zsh's repackaging of zsh-history-substring-search as an OMZ module inside +the Oh My Zsh distribution. + +The upstream repo, zsh-users/zsh-history-substring-search, can be found on GitHub at https://github.com/zsh-users/zsh-history-substring-search. -This downstream copy was last updated from the following upstream commit: - - SHA: 8dd05bfcc12b0cd1ee9ea64be725b3d9f713cf64 - Commit date: 2023-11-23 12:12:14 +0200 - -Everything above this section is a copy of the original upstream's README, so things -may differ slightly when you're using this inside OMZ. In particular, you do not -need to set up key bindings for the up and down arrows yourself in `~/.zshrc`; the OMZ -plugin does that for you. You may still want to set up additional emacs- or vi-specific -bindings as mentioned above. - +Everything above this section is a copy of the original upstream's README, so things may differ slightly when +you're using this inside OMZ. In particular, you do not need to set up key bindings for the up and down arrows +yourself in `~/.zshrc`; the OMZ plugin does that for you. You may still want to set up additional emacs- or +vi-specific bindings as mentioned above. diff --git a/plugins/history-substring-search/dependencies/OMZ-README.md b/plugins/history-substring-search/dependencies/OMZ-README.md index 9a2ef4d46..c5967bb7d 100644 --- a/plugins/history-substring-search/dependencies/OMZ-README.md +++ b/plugins/history-substring-search/dependencies/OMZ-README.md @@ -9,10 +9,6 @@ the Oh My Zsh distribution. The upstream repo, zsh-users/zsh-history-substring-search, can be found on GitHub at https://github.com/zsh-users/zsh-history-substring-search. -This downstream copy was last updated from the following upstream commit: - -SHA: 8dd05bfcc12b0cd1ee9ea64be725b3d9f713cf64 Commit date: 2023-11-23 12:12:14 +0200 - Everything above this section is a copy of the original upstream's README, so things may differ slightly when you're using this inside OMZ. In particular, you do not need to set up key bindings for the up and down arrows yourself in `~/.zshrc`; the OMZ plugin does that for you. You may still want to set up additional emacs- or From c6ce22f1d221ea99e0d63edb445038a747c78884 Mon Sep 17 00:00:00 2001 From: Ali Sajid Imami <395482+AliSajid@users.noreply.github.com> Date: Wed, 17 Jan 2024 10:50:23 -0500 Subject: [PATCH 018/453] feat(vscode): add `vscp` alias (#12092) Co-authored-by: Carlo Sala --- plugins/vscode/README.md | 28 +++++++++++++++++----------- plugins/vscode/vscode.plugin.zsh | 2 ++ 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/plugins/vscode/README.md b/plugins/vscode/README.md index 726b23d35..f91b533c9 100644 --- a/plugins/vscode/README.md +++ b/plugins/vscode/README.md @@ -1,6 +1,7 @@ # VS Code -This plugin provides useful aliases to simplify the interaction between the command line and VS Code or VSCodium editor. +This plugin provides useful aliases to simplify the interaction between the command line and VS Code or +VSCodium editor. To start using it, add the `vscode` plugin to your `plugins` array in `~/.zshrc`: @@ -14,26 +15,30 @@ This plugin requires to have a flavour of VS Code installed and it's executable You can install either: -* VS Code (code) -* VS Code Insiders (code-insiders) -* VSCodium (codium) +- VS Code (code) +- VS Code Insiders (code-insiders) +- VSCodium (codium) ### MacOS + While Linux installations will add the executable to PATH, MacOS users might still have to do this manually: -[For VS Code and VS Code Insiders](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: +[For VS Code and VS Code Insiders](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: + > Shell Command: Install 'code' command in PATH -[For VSCodium](https://github.com/VSCodium/vscodium/blob/master/DOCS.md#how-do-i-open-vscodium-from-the-terminal), open -the Command Palette via (F1 or ⇧⌘P) and type shell command to find the Shell Command: +[For VSCodium](https://github.com/VSCodium/vscodium/blob/master/DOCS.md#how-do-i-open-vscodium-from-the-terminal), +open the Command Palette via (F1 or ⇧⌘P) and type shell command to find the Shell Command: + > Shell Command: Install 'codium' command in PATH ## Using multiple flavours -If for any reason, you ever require to use multiple flavours of VS Code i.e. VS Code (stable) and VS Code Insiders, you can -manually specify the flavour's executable. Add the following line to the .zshrc file (between the `ZSH_THEME` and the `plugins=()` lines). -This will make the plugin use your manually defined executable. +If for any reason, you ever require to use multiple flavours of VS Code i.e. VS Code (stable) and VS Code +Insiders, you can manually specify the flavour's executable. Add the following line to the .zshrc file +(between the `ZSH_THEME` and the `plugins=()` lines). This will make the plugin use your manually defined +executable. ```zsh ZSH_THEME=... @@ -61,6 +66,7 @@ source $ZSH/oh-my-zsh.sh | vscr | code --reuse-window | Force to open a file or folder in the last active window. | | vscw | code --wait | Wait for the files to be closed before returning. | | vscu `dir` | code --user-data-dir `dir` | Specifies the directory that user data is kept in. Can be used to open multiple distinct instances of Code. | +| vscp `profile` | code --profile `profile` | Specifies the profile to open Code with. | ## Extensions aliases diff --git a/plugins/vscode/vscode.plugin.zsh b/plugins/vscode/vscode.plugin.zsh index 356c62360..77367bcac 100644 --- a/plugins/vscode/vscode.plugin.zsh +++ b/plugins/vscode/vscode.plugin.zsh @@ -3,6 +3,7 @@ # https://github.com/MarsiBarsi (original author) # https://github.com/babakks # https://github.com/SteelShot +# https://github.com/AliSajid # Verify if any manual user choice of VS Code exists first. if [[ -n "$VSCODE" ]] && ! which $VSCODE &>/dev/null; then @@ -38,6 +39,7 @@ alias vscn="$VSCODE --new-window" alias vscr="$VSCODE --reuse-window" alias vscw="$VSCODE --wait" alias vscu="$VSCODE --user-data-dir" +alias vscp="$VSCODE --profile" alias vsced="$VSCODE --extensions-dir" alias vscie="$VSCODE --install-extension" From 486e56aba890e143dd02265bcd05ae32751eb55b Mon Sep 17 00:00:00 2001 From: Brian McKenna Date: Thu, 18 Jan 2024 03:09:43 +1100 Subject: [PATCH 019/453] feat(autojump): add path for nix per-user (#11935) Co-authored-by: Carlo Sala --- plugins/autojump/autojump.plugin.zsh | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh index 1b868ee8d..84333a89f 100644 --- a/plugins/autojump/autojump.plugin.zsh +++ b/plugins/autojump/autojump.plugin.zsh @@ -1,18 +1,19 @@ declare -a autojump_paths autojump_paths=( - $HOME/.autojump/etc/profile.d/autojump.zsh # manual installation - $HOME/.autojump/share/autojump/autojump.zsh # manual installation - $HOME/.nix-profile/etc/profile.d/autojump.sh # NixOS installation - /run/current-system/sw/share/autojump/autojump.zsh # NixOS installation - /usr/share/autojump/autojump.zsh # Debian and Ubuntu package - /etc/profile.d/autojump.zsh # manual installation - /etc/profile.d/autojump.sh # Gentoo installation - /usr/local/share/autojump/autojump.zsh # FreeBSD installation - /usr/pkg/share/autojump/autojump.zsh # NetBSD installation - /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) - /etc/profiles/per-user/$USER/etc/profile.d/autojump.sh # macOS Nix, Home Manager and flakes + $HOME/.autojump/etc/profile.d/autojump.zsh # manual installation + $HOME/.autojump/share/autojump/autojump.zsh # manual installation + $HOME/.nix-profile/etc/profile.d/autojump.sh # NixOS installation + /run/current-system/sw/share/autojump/autojump.zsh # NixOS installation + /etc/profiles/per-user/$USER/share/autojump/autojump.zsh # Home Manager, NixOS with user-scoped packages + /usr/share/autojump/autojump.zsh # Debian and Ubuntu package + /etc/profile.d/autojump.zsh # manual installation + /etc/profile.d/autojump.sh # Gentoo installation + /usr/local/share/autojump/autojump.zsh # FreeBSD installation + /usr/pkg/share/autojump/autojump.zsh # NetBSD installation + /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) + /etc/profiles/per-user/$USER/etc/profile.d/autojump.sh # macOS Nix, Home Manager and flakes ) for file in $autojump_paths; do From d43f03ba91c47934a40b436a6ea9e79449a4583a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlio=20Selva?= Date: Thu, 18 Jan 2024 15:34:30 -0300 Subject: [PATCH 020/453] feat(virtualenvwrapper): run function on startup (#12163) --- plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh index d359e0c21..e037241e4 100644 --- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh +++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh @@ -88,4 +88,5 @@ if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then # http://zsh.sourceforge.net/Doc/Release/Functions.html autoload -U add-zsh-hook add-zsh-hook chpwd workon_cwd + [[ $PWD != ~ ]] && workon_cwd fi From f7b647e1b13ed9cd2f34f3559c112e61b8c03108 Mon Sep 17 00:00:00 2001 From: Michal Date: Sun, 21 Jan 2024 05:25:50 +0100 Subject: [PATCH 021/453] feat(spectrum): add `FX[dim]` format (#12172) --- lib/spectrum.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/spectrum.zsh b/lib/spectrum.zsh index 97f5c360a..31e37792c 100644 --- a/lib/spectrum.zsh +++ b/lib/spectrum.zsh @@ -7,6 +7,7 @@ typeset -AHg FX FG BG FX=( reset "%{%}" bold "%{%}" no-bold "%{%}" + dim "%{%}" no-dim "%{%}" italic "%{%}" no-italic "%{%}" underline "%{%}" no-underline "%{%}" blink "%{%}" no-blink "%{%}" From e656377d36077b0ca757d995c9c35f0fea7c7fdd Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Wed, 24 Jan 2024 10:10:55 +0100 Subject: [PATCH 022/453] fix(web-search): encode spaces as `%20` --- plugins/web-search/web-search.plugin.zsh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh index 1b42abe86..0fa2852dc 100644 --- a/plugins/web-search/web-search.plugin.zsh +++ b/plugins/web-search/web-search.plugin.zsh @@ -37,9 +37,14 @@ function web_search() { # search or go to main page depending on number of arguments passed if [[ $# -gt 1 ]]; then + # if search goes in the query string ==> space as +, otherwise %20 + # see https://stackoverflow.com/questions/1634271/url-encoding-the-space-character-or-20 + local param="-P" + [[ "$urls[$1]" =~ .*\?.*=$ ]] && param="" + # build search url: # join arguments passed with '+', then append to search engine URL - url="${urls[$1]}$(omz_urlencode ${@[2,-1]})" + url="${urls[$1]}$(omz_urlencode $param ${@[2,-1]})" else # build main page url: # split by '/', then rejoin protocol (1) and domain (2) parts with '//' From 652037ebdfbe581e4c7dfcd0862ac2d1577c86d9 Mon Sep 17 00:00:00 2001 From: ditzy Date: Thu, 25 Jan 2024 03:19:01 -0600 Subject: [PATCH 023/453] fix(jump)!: only resolve mark symlink (#11074) BREAKING CHANGE: Previously, `jump` would resolve the symlink to the mark directory and resolve again if the mark directory was also a symlink. It only resolves once after this commit. --- plugins/jump/jump.plugin.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/jump/jump.plugin.zsh b/plugins/jump/jump.plugin.zsh index 829c9d9cb..c2b21e92e 100644 --- a/plugins/jump/jump.plugin.zsh +++ b/plugins/jump/jump.plugin.zsh @@ -8,8 +8,10 @@ # export MARKPATH=$HOME/.marks + jump() { - builtin cd -P "$MARKPATH/$1" 2>/dev/null || {echo "No such mark: $1"; return 1} + local markpath="$(readlink $MARKPATH/$1)" || {echo "No such mark: $1"; return 1} + builtin cd "$markpath" 2>/dev/null || {echo "Destination does not exist for mark [$1]: $markpath"; return 2} } mark() { From 80c114cb3a64044ea50b623f96a35bc022db5e8d Mon Sep 17 00:00:00 2001 From: Eemil Lagerspetz Date: Thu, 25 Jan 2024 10:23:07 +0100 Subject: [PATCH 024/453] fix(awesomepanda): new line wrap Closes #5982 Co-authored-by: Carlo Sala --- themes/awesomepanda.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/awesomepanda.zsh-theme b/themes/awesomepanda.zsh-theme index 85036e4ac..000697397 100644 --- a/themes/awesomepanda.zsh-theme +++ b/themes/awesomepanda.zsh-theme @@ -1,6 +1,6 @@ # the svn plugin has to be activated for this to work. local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)" -PROMPT='${ret_status}%{$fg_bold[green]%} %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}$(svn_prompt_info)%{$reset_color%}' +PROMPT='%{${ret_status}%}%{$fg_bold[green]%} %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}$(svn_prompt_info)%{$reset_color%}' ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" From 8b2ce98578da743fbc4a208285f33744d6abd3cf Mon Sep 17 00:00:00 2001 From: Frank Dana Date: Tue, 30 Jan 2024 05:43:03 -0500 Subject: [PATCH 025/453] feat(ssh): add plugin (#12186) Closes #2707 Co-authored-by: Frank Wittig Co-authored-by: Frank Wittig --- plugins/ssh/ssh.plugin.zsh | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 plugins/ssh/ssh.plugin.zsh diff --git a/plugins/ssh/ssh.plugin.zsh b/plugins/ssh/ssh.plugin.zsh new file mode 100644 index 000000000..085e71fa1 --- /dev/null +++ b/plugins/ssh/ssh.plugin.zsh @@ -0,0 +1,46 @@ +############################################################ +# Take all host sections in .ssh/config and offer them for +# completion as hosts (e.g. for ssh, rsync, scp and the like) +# Filter out wildcard host sections. +_ssh_configfile="$HOME/.ssh/config" +if [[ -f "$_ssh_configfile" ]]; then + _hosts=($(egrep '^Host.*' "$_ssh_configfile" | awk '{print $2}' | grep -v '^*' | sed -e 's/\.*\*$//')) + zstyle ':completion:*:hosts' hosts $_hosts + unset _hosts +fi +unset _ssh_configfile + +############################################################ +# Remove host key from known hosts based on a host section +# name from .ssh/config +function ssh_rmhkey { + local ssh_configfile="$HOME/.ssh/config" + local ssh_host="$1" + if [[ -z "$ssh_host" ]]; then return; fi + ssh-keygen -R $(grep -A10 "$ssh_host" "$ssh_configfile" | grep -i HostName | head -n 1 | awk '{print $2}') +} +compctl -k hosts ssh_rmhkey + +############################################################ +# Load SSH key into agent +function ssh_load_key() { + local key="$1" + if [[ -z "$key" ]]; then return; fi + local keyfile="$HOME/.ssh/$key" + local keysig=$(ssh-keygen -l -f "$keyfile") + if ( ! ssh-add -l | grep -q "$keysig" ); then + ssh-add "$keyfile" + fi +} + +############################################################ +# Remove SSH key from agent +function ssh_unload_key { + local key="$1" + if [[ -z "$key" ]]; then return; fi + local keyfile="$HOME/.ssh/$key" + local keysig=$(ssh-keygen -l -f "$keyfile") + if ( ssh-add -l | grep -q "$keysig" ); then + ssh-add -d "$keyfile" + fi +} From e195c7cb438224e8bcea20bdbc2e4b8a6bb3949b Mon Sep 17 00:00:00 2001 From: Gauthier Delacroix <1533042+gdlx@users.noreply.github.com> Date: Tue, 30 Jan 2024 21:36:18 +0100 Subject: [PATCH 026/453] fix(aws): pass default region to fetch regions (#12175) Co-authored-by: Gauthier Delacroix --- plugins/aws/aws.plugin.zsh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index fd00714e7..7a2e08a7c 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -202,8 +202,17 @@ function aws_change_access_key() { } function aws_regions() { + local region + if [[ $AWS_DEFAULT_REGION ]];then + region="$AWS_DEFAULT_REGION" + elif [[ $AWS_REGION ]];then + region="$AWS_REGION" + else + region="us-west-1" + fi + if [[ $AWS_DEFAULT_PROFILE || $AWS_PROFILE ]];then - aws ec2 describe-regions |grep RegionName | awk -F ':' '{gsub(/"/, "", $2);gsub(/,/, "", $2);gsub(/ /, "", $2); print $2}' + aws ec2 describe-regions --region $region |grep RegionName | awk -F ':' '{gsub(/"/, "", $2);gsub(/,/, "", $2);gsub(/ /, "", $2); print $2}' else echo "You must specify a AWS profile." fi From 4efad7ab1ba0d1715af62e484c6852808581cfb9 Mon Sep 17 00:00:00 2001 From: Rejman Nascimento <72097727+rejmann@users.noreply.github.com> Date: Thu, 1 Feb 2024 12:54:24 -0300 Subject: [PATCH 027/453] feat(git-commit): add `wip` kind (#12188) --- plugins/git-commit/README.md | 4 +++- plugins/git-commit/git-commit.plugin.zsh | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/git-commit/README.md b/plugins/git-commit/README.md index 91cc73b44..a00983935 100644 --- a/plugins/git-commit/README.md +++ b/plugins/git-commit/README.md @@ -29,8 +29,9 @@ Where `type` is one of the following: - `rev` - `style` - `test` +- `wip` -> NOTE: the alias for `revert` type is `rev`, as otherwise it conflicts with the git command of the same name. +> NOTE: the alias for `revert` type is `rev`, as otherwise it conflicts with the git command of the same name. > It will still generate a commit message in the format `revert: ` ## Examples @@ -38,5 +39,6 @@ Where `type` is one of the following: | Git alias | Command | | --------------------------------------------- | ---------------------------------------------------- | | `git style "remove trailing whitespace"` | `git commit -m "style: remove trailing whitespace"` | +| `git wip "work in progress"` | `git commit -m "work in progress"` | | `git fix -s "router" "correct redirect link"` | `git commit -m "fix(router): correct redirect link"` | | `git rev -s "api" "rollback v2"` | `git commit -m "revert(api): rollback v2"` | diff --git a/plugins/git-commit/git-commit.plugin.zsh b/plugins/git-commit/git-commit.plugin.zsh index 72cecb1d6..3f0c2121d 100644 --- a/plugins/git-commit/git-commit.plugin.zsh +++ b/plugins/git-commit/git-commit.plugin.zsh @@ -11,6 +11,7 @@ _git_commit_aliases=( 'revert' 'style' 'test' + 'wip' ) local alias type From 6f215cd6922a76cf8ac6f629d0de386c3eb6667a Mon Sep 17 00:00:00 2001 From: Harkesh <100549064+harkeshbirman@users.noreply.github.com> Date: Thu, 1 Feb 2024 21:30:27 +0530 Subject: [PATCH 028/453] feat(git): add `grf` alias (#12176) --- plugins/git/README.md | 1 + plugins/git/git.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/git/README.md b/plugins/git/README.md index be3f85827..4acb0c858 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -152,6 +152,7 @@ plugins=(... git) | `grbd` | `git rebase $(git_develop_branch)` | | `grbm` | `git rebase $(git_main_branch)` | | `grbom` | `git rebase origin/$(git_main_branch)` | +| `grf` | `git reflog` | | `gr` | `git remote` | | `grv` | `git remote --verbose` | | `gra` | `git remote add` | diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 5c3064e8a..692a36a73 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -335,6 +335,7 @@ alias grbs='git rebase --skip' alias grbd='git rebase $(git_develop_branch)' alias grbm='git rebase $(git_main_branch)' alias grbom='git rebase origin/$(git_main_branch)' +alias grf='git reflog' alias gr='git remote' alias grv='git remote --verbose' alias gra='git remote add' From 05bf69c604e34300b02406462d4376c86d595470 Mon Sep 17 00:00:00 2001 From: 0rxa Date: Thu, 1 Feb 2024 17:11:13 +0100 Subject: [PATCH 029/453] feat(aws): implement permanent state (#12018) Co-authored-by: Rei Arifi Co-authored-by: Hysen Ndregjoni --- plugins/aws/README.md | 5 +++++ plugins/aws/aws.plugin.zsh | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/plugins/aws/README.md b/plugins/aws/README.md index dbf8dcfeb..0d0773f63 100644 --- a/plugins/aws/README.md +++ b/plugins/aws/README.md @@ -47,6 +47,11 @@ plugins=(... aws) Some themes might overwrite the value of RPROMPT instead of appending to it, so they'll need to be fixed to see the AWS profile/region prompt. +* Set `AWS_PROFILE_STATE_ENABLED=true` in your zshrc file if you want the aws profile to persist between shell sessions. + This option might slow down your shell startup time. + By default the state file path is `/tmp/.aws_current_profile`. This means that the state won't survive a reboot or otherwise GC. + You can control the state file path using the `AWS_STATE_FILE` environment variable. + ## Theme The plugin creates an `aws_prompt_info` function that you can use in your theme, which displays diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index 7a2e08a7c..071dd1f0b 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -6,10 +6,26 @@ function agr() { echo $AWS_REGION } +# Update state file if enabled +function _aws_update_state() { + if [[ "$AWS_PROFILE_STATE_ENABLED" == true ]]; then + test -d $(dirname ${AWS_STATE_FILE}) || exit 1 + echo "${AWS_PROFILE} ${AWS_REGION}" > "${AWS_STATE_FILE}" + fi +} + +function _aws_clear_state() { + if [[ "$AWS_PROFILE_STATE_ENABLED" == true ]]; then + test -d $(dirname ${AWS_STATE_FILE}) || exit 1 + echo -n > "${AWS_STATE_FILE}" + fi +} + # AWS profile selection function asp() { if [[ -z "$1" ]]; then unset AWS_DEFAULT_PROFILE AWS_PROFILE AWS_EB_PROFILE AWS_PROFILE_REGION + _aws_clear_state echo AWS profile cleared. return fi @@ -28,6 +44,8 @@ function asp() { export AWS_PROFILE_REGION=$(aws configure get region) + _aws_update_state + if [[ "$2" == "login" ]]; then if [[ -n "$3" ]]; then aws sso login --sso-session $3 @@ -43,6 +61,7 @@ function asp() { function asr() { if [[ -z "$1" ]]; then unset AWS_DEFAULT_REGION AWS_REGION + _aws_update_state echo AWS region cleared. return fi @@ -56,6 +75,7 @@ function asr() { export AWS_REGION=$1 export AWS_DEFAULT_REGION=$1 + _aws_update_state } # AWS profile switch @@ -255,6 +275,22 @@ if [[ "$SHOW_AWS_PROMPT" != false && "$RPROMPT" != *'$(aws_prompt_info)'* ]]; th RPROMPT='$(aws_prompt_info)'"$RPROMPT" fi +if [[ "$AWS_PROFILE_STATE_ENABLED" == true ]]; then + AWS_STATE_FILE="${AWS_STATE_FILE:-/tmp/.aws_current_profile}" + 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" + + test -z "${aws_state[2]}" && AWS_REGION=$(aws configure get region) + + export AWS_REGION=${AWS_REGION:-$aws_state[2]} + export AWS_DEFAULT_REGION="$AWS_REGION" +fi + # Load awscli completions # AWS CLI v2 comes with its own autocompletion. Check if that is there, otherwise fall back From d6658f9af321e615a9b8be696f557a113cd6b026 Mon Sep 17 00:00:00 2001 From: Eric Schultz Date: Thu, 1 Feb 2024 10:16:34 -0600 Subject: [PATCH 030/453] feat(stripe): add completion plugin (#12064) Co-authored-by: Carlo Sala --- plugins/stripe/README.md | 9 +++++++++ plugins/stripe/stripe.plugin.zsh | 13 +++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 plugins/stripe/README.md create mode 100644 plugins/stripe/stripe.plugin.zsh diff --git a/plugins/stripe/README.md b/plugins/stripe/README.md new file mode 100644 index 000000000..9f0f32bc2 --- /dev/null +++ b/plugins/stripe/README.md @@ -0,0 +1,9 @@ +# Struoe + +This plugin provides completion for the [Stripe CLI](https://stripe.com/docs/stripe-cli). + +To use it add stripe to the plugins array in your zshrc file. + +```bash +plugins=(... stripe) +``` diff --git a/plugins/stripe/stripe.plugin.zsh b/plugins/stripe/stripe.plugin.zsh new file mode 100644 index 000000000..e2041bef2 --- /dev/null +++ b/plugins/stripe/stripe.plugin.zsh @@ -0,0 +1,13 @@ +if (( ! $+commands[stripe] )); then + return +fi + +# If the completion file doesn't exist yet, we need to autoload it and +# bind it to `stripe`. Otherwise, compinit will have already done that. +if [[ ! -f "$ZSH_CACHE_DIR/completions/_stripe" ]]; then + typeset -g -A _comps + autoload -Uz _stripe + _comps[stripe]=_stripe +fi + +stripe completion --shell zsh --write-to-stdout >| "$ZSH_CACHE_DIR/completions/_stripe" &| From b5e6392f2140b7aa49c248aa6c232a6922d3311b Mon Sep 17 00:00:00 2001 From: Markus Hofbauer Date: Thu, 1 Feb 2024 17:37:37 +0100 Subject: [PATCH 031/453] feat(hazel): add some aliases (#12070) --- plugins/bazel/README.md | 12 ++++++++++-- plugins/bazel/bazel.plugin.zsh | 5 +++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 plugins/bazel/bazel.plugin.zsh diff --git a/plugins/bazel/README.md b/plugins/bazel/README.md index fc375d219..eba4175bc 100644 --- a/plugins/bazel/README.md +++ b/plugins/bazel/README.md @@ -1,7 +1,6 @@ # Bazel plugin -This plugin adds completion for [bazel](https://bazel.build), an open-source build and -test tool that scalably supports multi-language and multi-platform projects. +This plugin adds completion and aliases for [bazel](https://bazel.build), an open-source build and test tool that scalably supports multi-language and multi-platform projects. To use it, add `bazel` to the plugins array in your zshrc file: @@ -12,3 +11,12 @@ plugins=(... bazel) The plugin has a copy of [the completion script from the git repository][1]. [1]: https://github.com/bazelbuild/bazel/blob/master/scripts/zsh_completion/_bazel + +## Aliases + +| Alias | Command | Description | +| ------- | -------------------------------------- | ------------------------------------------------------ | +| bzb | `bazel build` | The `bazel build` command | +| bzt | `bazel test` | The `bazel test` command | +| bzr | `bazel run` | The `bazel run` command | +| bzq | `bazel query` | The `bazel query` command | diff --git a/plugins/bazel/bazel.plugin.zsh b/plugins/bazel/bazel.plugin.zsh new file mode 100644 index 000000000..d239a06b5 --- /dev/null +++ b/plugins/bazel/bazel.plugin.zsh @@ -0,0 +1,5 @@ +# Aliases for bazel +alias bzb='bazel build' +alias bzt='bazel test' +alias bzr='bazel run' +alias bzq='bazel query' From 69b0dfeadf35a6da8de41501149cf3a3817218cf Mon Sep 17 00:00:00 2001 From: lutra <49721741+lutra@users.noreply.github.com> Date: Fri, 2 Feb 2024 17:12:36 +0100 Subject: [PATCH 032/453] fix(kubectx): k8s contexts with spaces (#12191) --- plugins/kubectx/kubectx.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/kubectx/kubectx.plugin.zsh b/plugins/kubectx/kubectx.plugin.zsh index 6096feeae..a3210facc 100644 --- a/plugins/kubectx/kubectx.plugin.zsh +++ b/plugins/kubectx/kubectx.plugin.zsh @@ -9,5 +9,5 @@ function kubectx_prompt_info() { # use value in associative array if it exists # otherwise fall back to the context name - echo "${kubectx_mapping[$current_ctx]:-${current_ctx:gs/%/%%}}" + echo "${kubectx_mapping[\"$current_ctx\"]:-${current_ctx:gs/%/%%}}" } From bebd9ea59f6f5ed629b659dc1f230ac71b1fd1a8 Mon Sep 17 00:00:00 2001 From: Markus Hofbauer Date: Sat, 3 Feb 2024 10:18:33 +0100 Subject: [PATCH 033/453] chore(brew): remove duplicated alias (#12192) --- plugins/brew/brew.plugin.zsh | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh index 447036376..b15137e0f 100644 --- a/plugins/brew/brew.plugin.zsh +++ b/plugins/brew/brew.plugin.zsh @@ -36,7 +36,6 @@ fi alias bcubc='brew upgrade --cask && brew cleanup' alias bcubo='brew update && brew outdated --cask' -alias bcubc='brew upgrade --cask && brew cleanup' alias brewp='brew pin' alias brewsp='brew list --pinned' alias bubc='brew upgrade && brew cleanup' From 70bf12402ceb5599f209bd687d4ee9d9dbf1776a Mon Sep 17 00:00:00 2001 From: Taylor Cochran Date: Sat, 3 Feb 2024 13:50:44 -0800 Subject: [PATCH 034/453] fix(prompt): quote ruby prompt (#12195) --- lib/prompt_info_functions.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/prompt_info_functions.zsh b/lib/prompt_info_functions.zsh index 3dc9b6d10..29aca9b48 100644 --- a/lib/prompt_info_functions.zsh +++ b/lib/prompt_info_functions.zsh @@ -40,5 +40,5 @@ ZSH_THEME_RVM_PROMPT_OPTIONS="i v g" # use this to enable users to see their ruby version, no matter which # version management system they use function ruby_prompt_info() { - echo $(rvm_prompt_info || rbenv_prompt_info || chruby_prompt_info) + echo "$(rvm_prompt_info || rbenv_prompt_info || chruby_prompt_info)" } From 212437090032ea1c8c7ccbc1bc2937083c2e7185 Mon Sep 17 00:00:00 2001 From: Rayzeq Date: Sun, 4 Feb 2024 18:21:31 +0100 Subject: [PATCH 035/453] fix(sublime): pass user's env to `sst` (#12194) --- plugins/sublime/sublime.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh index dadf37574..cc84de737 100644 --- a/plugins/sublime/sublime.plugin.zsh +++ b/plugins/sublime/sublime.plugin.zsh @@ -4,7 +4,7 @@ alias st=subl alias stt='subl .' # Define sst only if sudo exists -(( $+commands[sudo] )) && alias sst='sudo subl' +(( $+commands[sudo] )) && alias sst='sudo -EH subl' alias stp=find_project alias stn=create_project @@ -62,7 +62,7 @@ alias stn=create_project for _sublime_path in $_sublime_paths; do if [[ -a $_sublime_path ]]; then alias subl="'$_sublime_path'" - (( $+commands[sudo] )) && alias sst="sudo '$_sublime_path'" + (( $+commands[sudo] )) && alias sst="sudo -EH '$_sublime_path'" break fi done From 883da63320806532f3d3246b03f934e15aff3bab Mon Sep 17 00:00:00 2001 From: Mateus Fernandes de Mello Date: Tue, 6 Feb 2024 07:26:30 -0300 Subject: [PATCH 036/453] feat(web-search): add programming packages search (#12199) --- plugins/web-search/README.md | 4 ++++ plugins/web-search/web-search.plugin.zsh | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/plugins/web-search/README.md b/plugins/web-search/README.md index cf5bab3f7..d21c81ca9 100644 --- a/plugins/web-search/README.md +++ b/plugins/web-search/README.md @@ -46,6 +46,10 @@ Available search contexts are: | `ask` | `https://www.ask.com/web?q=` | | `youtube` | `https://www.youtube.com/results?search_query=` | | `deepl` | `https://www.deepl.com/translator#auto/auto/` | +| `dockerhub` | `https://hub.docker.com/search?q=` | +| `npmpkg` | `https://www.npmjs.com/search?q=` | +| `packagist` | `https://packagist.org/?query=` | +| `gopkg` | `https://pkg.go.dev/search?m=package&q=` | 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 0fa2852dc..2fe4aea84 100644 --- a/plugins/web-search/web-search.plugin.zsh +++ b/plugins/web-search/web-search.plugin.zsh @@ -27,6 +27,10 @@ function web_search() { ask "https://www.ask.com/web?q=" youtube "https://www.youtube.com/results?search_query=" deepl "https://www.deepl.com/translator#auto/auto/" + dockerhub "https://hub.docker.com/search?q=" + npmpkg "https://www.npmjs.com/search?q=" + packagist "https://packagist.org/?query=" + gopkg "https://pkg.go.dev/search?m=package&q=" ) # check whether the search engine is supported @@ -75,6 +79,10 @@ alias scholar='web_search scholar' alias ask='web_search ask' alias youtube='web_search youtube' alias deepl='web_search deepl' +alias dockerhub='web_search dockerhub' +alias npmpkg='web_search npmpkg' +alias packagist='web_search packagist' +alias gopkg='web_search gopkg' #add your own !bang searches here alias wiki='web_search duckduckgo \!w' From 43613d7b710f9a06971fac48dea3301bbc15b579 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Wed, 7 Feb 2024 11:16:36 +0100 Subject: [PATCH 037/453] fix(web-search): use pattern instead of regex Closes #12202 --- plugins/web-search/web-search.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh index 2fe4aea84..c602e0623 100644 --- a/plugins/web-search/web-search.plugin.zsh +++ b/plugins/web-search/web-search.plugin.zsh @@ -44,7 +44,7 @@ function web_search() { # if search goes in the query string ==> space as +, otherwise %20 # see https://stackoverflow.com/questions/1634271/url-encoding-the-space-character-or-20 local param="-P" - [[ "$urls[$1]" =~ .*\?.*=$ ]] && param="" + [[ "$urls[$1]" == *\?*= ]] && param="" # build search url: # join arguments passed with '+', then append to search engine URL From fff073b55defed72a0a1aac4e853b165f208735b Mon Sep 17 00:00:00 2001 From: vladislav doster <10052309+vladdoster@users.noreply.github.com> Date: Thu, 8 Feb 2024 08:41:34 -0600 Subject: [PATCH 038/453] style(completion): remove extra space (#12206) --- lib/completion.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/completion.zsh b/lib/completion.zsh index 63379b53f..5a233a322 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -49,7 +49,7 @@ zstyle ':completion:*:*:*:users' ignored-patterns \ adm amanda apache at avahi avahi-autoipd beaglidx bin cacti canna \ clamav daemon dbus distcache dnsmasq dovecot fax ftp games gdm \ gkrellmd gopher hacluster haldaemon halt hsqldb ident junkbust kdm \ - ldap lp mail mailman mailnull man messagebus mldonkey mysql nagios \ + ldap lp mail mailman mailnull man messagebus mldonkey mysql nagios \ named netdump news nfsnobody nobody nscd ntp nut nx obsrun openvpn \ operator pcap polkitd postfix postgres privoxy pulse pvm quagga radvd \ rpc rpcuser rpm rtkit scard shutdown squid sshd statd svn sync tftp \ From bdcb4d9d1f36d5d82720dfd53f0c95242ab62dae Mon Sep 17 00:00:00 2001 From: SgtDaJim Date: Mon, 12 Feb 2024 16:43:52 +0800 Subject: [PATCH 039/453] feat(bira): add support for `kube-ps1` prompt (#8437) --- themes/bira.zsh-theme | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/themes/bira.zsh-theme b/themes/bira.zsh-theme index 42a70a018..f909afa62 100644 --- a/themes/bira.zsh-theme +++ b/themes/bira.zsh-theme @@ -6,10 +6,15 @@ local current_dir="%B%{$fg[blue]%}%~ %{$reset_color%}" local vcs_branch='$(git_prompt_info)$(hg_prompt_info)' local rvm_ruby='$(ruby_prompt_info)' local venv_prompt='$(virtualenv_prompt_info)' +if [[ "${plugins[@]}" =~ 'kube-ps1' ]]; then + local kube_prompt='$(kube_ps1)' +else + local kube_prompt='' +fi ZSH_THEME_RVM_PROMPT_OPTIONS="i v g" -PROMPT="╭─${user_host}${current_dir}${rvm_ruby}${vcs_branch}${venv_prompt} +PROMPT="╭─${user_host}${current_dir}${rvm_ruby}${vcs_branch}${venv_prompt}${kube_prompt} ╰─%B${user_symbol}%b " RPROMPT="%B${return_code}%b" From 8f22370af8bd390ea3b8610da1ccf388826d909d Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Mon, 12 Feb 2024 09:48:38 +0100 Subject: [PATCH 040/453] fix(key-bindings): bind default arrow keys to `beginning-search` Fixes #12197 --- lib/key-bindings.zsh | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index aaa73046e..a5650dd81 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -32,19 +32,26 @@ if [[ -n "${terminfo[knp]}" ]]; then fi # Start typing + [Up-Arrow] - fuzzy find history forward -if [[ -n "${terminfo[kcuu1]}" ]]; then - autoload -U up-line-or-beginning-search - zle -N up-line-or-beginning-search +autoload -U up-line-or-beginning-search +zle -N up-line-or-beginning-search +bindkey -M emacs "^[[A" up-line-or-beginning-search +bindkey -M viins "^[[A" up-line-or-beginning-search +bindkey -M vicmd "^[[A" up-line-or-beginning-search +if [[ -n "${terminfo[kcuu1]}" ]]; then bindkey -M emacs "${terminfo[kcuu1]}" up-line-or-beginning-search bindkey -M viins "${terminfo[kcuu1]}" up-line-or-beginning-search bindkey -M vicmd "${terminfo[kcuu1]}" up-line-or-beginning-search fi -# Start typing + [Down-Arrow] - fuzzy find history backward -if [[ -n "${terminfo[kcud1]}" ]]; then - autoload -U down-line-or-beginning-search - zle -N down-line-or-beginning-search +# Start typing + [Down-Arrow] - fuzzy find history backward +autoload -U down-line-or-beginning-search +zle -N down-line-or-beginning-search + +bindkey -M emacs "^[[B" down-line-or-beginning-search +bindkey -M viins "^[[B" down-line-or-beginning-search +bindkey -M vicmd "^[[B" down-line-or-beginning-search +if [[ -n "${terminfo[kcud1]}" ]]; then bindkey -M emacs "${terminfo[kcud1]}" down-line-or-beginning-search bindkey -M viins "${terminfo[kcud1]}" down-line-or-beginning-search bindkey -M vicmd "${terminfo[kcud1]}" down-line-or-beginning-search From 514d5736ea7b1af2cb2e6617048236aa9b34fc51 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Tue, 13 Feb 2024 17:25:16 +0100 Subject: [PATCH 041/453] ci: enable dependabot --- .github/dependabot.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..4dc9f3854 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: "weekly" + day: "sunday" + - package-ecosystem: "pip" + directory: "/.github/workflows/dependencies" + schedule: + interval: "weekly" + day: "sunday" From f9bbf6047b35ff00ea398857d2a09ffea5cd8bfa Mon Sep 17 00:00:00 2001 From: Raphael Boidol Date: Tue, 13 Feb 2024 17:32:44 +0100 Subject: [PATCH 042/453] ci: bump `actions/checkout` version (#12210) --- .github/workflows/installer.yml | 4 ++-- .github/workflows/main.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index cad5d445b..5593c9175 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -26,7 +26,7 @@ jobs: - macos-latest steps: - name: Set up git repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install zsh if: runner.os == 'Linux' run: sudo apt-get update; sudo apt-get install zsh @@ -42,7 +42,7 @@ jobs: - test steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Vercel CLI run: npm install -g vercel - name: Setup project and deploy diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index de7d98262..264ac31f3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,7 +24,7 @@ jobs: if: github.repository == 'ohmyzsh/ohmyzsh' steps: - name: Set up git repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install zsh run: sudo apt-get update; sudo apt-get install zsh - name: Check syntax From 872b5cd4086a5547dbf788dda4e96ab3868cf59b Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Wed, 14 Feb 2024 12:14:08 +0100 Subject: [PATCH 043/453] docs(kubectx): add quoting to array keys (#12216) --- plugins/kubectx/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/kubectx/README.md b/plugins/kubectx/README.md index 98f1cf032..d924e745c 100644 --- a/plugins/kubectx/README.md +++ b/plugins/kubectx/README.md @@ -17,9 +17,9 @@ One can rename default context name for better readability. _Example_. Add to **.zshrc**: ``` -kubectx_mapping[minikube]="mini" -kubectx_mapping[context_name_from_kubeconfig]="$emoji[wolf_face]" -kubectx_mapping[production_cluster]="%{$fg[yellow]%}prod!%{$reset_color%}" +kubectx_mapping["minikube"]="mini" +kubectx_mapping["context_name_from_kubeconfig"]="$emoji[wolf_face]" +kubectx_mapping["production_cluster"]="%{$fg[yellow]%}prod!%{$reset_color%}" ``` ![staging](stage.png) From 15ffbdd346daa58de6701d3421787012420aa6cc Mon Sep 17 00:00:00 2001 From: Julian <489233+naydichev@users.noreply.github.com> Date: Mon, 19 Feb 2024 10:29:37 +0100 Subject: [PATCH 044/453] feat(zoxide): add option to override cmd (#12218) --- plugins/zoxide/README.md | 3 +++ plugins/zoxide/zoxide.plugin.zsh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/zoxide/README.md b/plugins/zoxide/README.md index f326effe6..45f77bdf5 100644 --- a/plugins/zoxide/README.md +++ b/plugins/zoxide/README.md @@ -10,5 +10,8 @@ To use it, add `zoxide` to the plugins array in your `.zshrc` file: ```zsh plugins=(... zoxide) ``` +## Overriding `z` Alias + +You can set the `ZOXIDE_CMD_OVERRIDE`, which will be passed to the `--cmd` flag of `zoxide init`. This allows you to set your `z` command to a default of `cd`. **Note:** you have to [install zoxide](https://github.com/ajeetdsouza/zoxide#step-1-install-zoxide) first. diff --git a/plugins/zoxide/zoxide.plugin.zsh b/plugins/zoxide/zoxide.plugin.zsh index e5658b8f0..25d2e8377 100644 --- a/plugins/zoxide/zoxide.plugin.zsh +++ b/plugins/zoxide/zoxide.plugin.zsh @@ -1,5 +1,5 @@ if (( $+commands[zoxide] )); then - eval "$(zoxide init zsh)" + eval "$(zoxide init --cmd ${ZOXIDE_CMD_OVERRIDE:-z} zsh)" else echo '[oh-my-zsh] zoxide not found, please install it from https://github.com/ajeetdsouza/zoxide' fi From 40ff950fcd081078a8cd3de0eaab784f85c681d5 Mon Sep 17 00:00:00 2001 From: Oren Date: Tue, 20 Feb 2024 11:59:12 +0200 Subject: [PATCH 045/453] fix(docker): support completion on snap installs (#12224) --- plugins/docker/docker.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/docker/docker.plugin.zsh b/plugins/docker/docker.plugin.zsh index 7e657f2df..b429ae211 100644 --- a/plugins/docker/docker.plugin.zsh +++ b/plugins/docker/docker.plugin.zsh @@ -57,6 +57,6 @@ fi ! is-at-least 23.0.0 ${${(s:,:z)"$(command docker --version)"}[3]}; then command cp "${0:h}/completions/_docker" "$ZSH_CACHE_DIR/completions/_docker" else - command docker completion zsh >| "$ZSH_CACHE_DIR/completions/_docker" + command docker completion zsh | tee "$ZSH_CACHE_DIR/completions/_docker" > /dev/null fi } &| From fcab8f161139d04fb1137be815d8130584a99713 Mon Sep 17 00:00:00 2001 From: Juan Morete Date: Fri, 23 Feb 2024 11:25:53 +0100 Subject: [PATCH 046/453] docs(ansible): remove duplicated alias entry (#12235) --- plugins/ansible/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/ansible/README.md b/plugins/ansible/README.md index e0e6a19bb..ce21e7075 100644 --- a/plugins/ansible/README.md +++ b/plugins/ansible/README.md @@ -21,7 +21,6 @@ plugins=(... ansible) | `acon` | command `ansible-console` | | `ainv` | command `ansible-inventory` | | `aplaybook` | command `ansible-playbook` | -| `ainv` | command `ansible-inventory` | | `adoc` | command `ansible-doc` | | `agal` | command `ansible-galaxy` | | `apull` | command `ansible-pull` | From c891b7e6ada5427f4c8cca05c8ed1ae33cb49943 Mon Sep 17 00:00:00 2001 From: Dusk Date: Tue, 27 Feb 2024 15:09:02 -0400 Subject: [PATCH 047/453] feat(tmux): add option for detached mode (#12242) --- plugins/tmux/README.md | 15 ++++++++------- plugins/tmux/tmux.plugin.zsh | 6 ++++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/plugins/tmux/README.md b/plugins/tmux/README.md index b4516ef26..a253457f2 100644 --- a/plugins/tmux/README.md +++ b/plugins/tmux/README.md @@ -19,13 +19,13 @@ The plugin also supports the following: | ---------- | -------------------------- | -------------------------------------------------------- | | `ta` | tmux attach -t | Attach new tmux session to already running named session | | `tad` | tmux attach -d -t | Detach named tmux session | -| `ts` | tmux new-session -s | Create a new named tmux session | -| `tl` | tmux list-sessions | Displays a list of running tmux sessions | -| `tksv` | tmux kill-server | Terminate all running tmux sessions | +| `tds` | `_tmux_directory_session` | Creates or attaches to a session for the current path | | `tkss` | tmux kill-session -t | Terminate named running tmux session | +| `tksv` | tmux kill-server | Terminate all running tmux sessions | +| `tl` | tmux list-sessions | Displays a list of running tmux sessions | | `tmux` | `_zsh_tmux_plugin_run` | Start a new tmux session | | `tmuxconf` | `$EDITOR $ZSH_TMUX_CONFIG` | Open .tmux.conf file with an editor | -| `tds` | `_tmux_directory_session` | Creates or attaches to a session for the current path | +| `ts` | tmux new-session -s | Create a new named tmux session | ## Configuration Variables @@ -35,10 +35,11 @@ The plugin also supports the following: | `ZSH_TMUX_AUTOSTART_ONCE` | Autostart only if tmux hasn't been started previously (default: `true`) | | `ZSH_TMUX_AUTOCONNECT` | Automatically connect to a previous session if it exits (default: `true`) | | `ZSH_TMUX_AUTOQUIT` | Automatically closes terminal once tmux exits (default: `ZSH_TMUX_AUTOSTART`) | +| `ZSH_TMUX_CONFIG` | Set the configuration path (default: `$HOME/.tmux.conf`, `$XDG_CONFIG_HOME/tmux/tmux.conf`) | +| `ZSH_TMUX_DEFAULT_SESSION_NAME` | Set tmux default session name when autostart is enabled | +| `ZSH_TMUX_DETACHED` | Set the detached mode (default: `false`) | | `ZSH_TMUX_FIXTERM` | Sets `$TERM` to 256-color term or not based on current terminal support | -| `ZSH_TMUX_ITERM2` | Sets the `-CC` option for iTerm2 tmux integration (default: `false`) | | `ZSH_TMUX_FIXTERM_WITHOUT_256COLOR` | `$TERM` to use for non 256-color terminals (default: `screen`) | | `ZSH_TMUX_FIXTERM_WITH_256COLOR` | `$TERM` to use for 256-color terminals (default: `screen-256color` | -| `ZSH_TMUX_CONFIG` | Set the configuration path (default: `$HOME/.tmux.conf`, `$XDG_CONFIG_HOME/tmux/tmux.conf`) | +| `ZSH_TMUX_ITERM2` | Sets the `-CC` option for iTerm2 tmux integration (default: `false`) | | `ZSH_TMUX_UNICODE` | Set `tmux -u` option to support unicode | -| `ZSH_TMUX_DEFAULT_SESSION_NAME` | Set tmux default session name when autostart is enabled | diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 72cdd4818..0ecb0a5b5 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -14,6 +14,8 @@ fi # Automatically close the terminal when tmux exits : ${ZSH_TMUX_AUTOQUIT:=$ZSH_TMUX_AUTOSTART} # Set term to screen or screen-256color based on current terminal support +: ${ZSH_TMUX_DETACHED:=false} +# Set detached mode : ${ZSH_TMUX_FIXTERM:=true} # Set '-CC' option for iTerm2 tmux integration : ${ZSH_TMUX_ITERM2:=false} @@ -79,9 +81,9 @@ function _zsh_tmux_plugin_run() { # Try to connect to an existing session. if [[ -n "$ZSH_TMUX_DEFAULT_SESSION_NAME" ]]; then - [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] && $tmux_cmd attach -t $ZSH_TMUX_DEFAULT_SESSION_NAME + [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] && $tmux_cmd attach ${ZSH_TMUX_DETACHED:+"-d"} -t $ZSH_TMUX_DEFAULT_SESSION_NAME else - [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] && $tmux_cmd attach + [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] && $tmux_cmd attach ${ZSH_TMUX_DETACHED:+"-d"} fi # If failed, just run tmux, fixing the TERM variable if requested. From 51bf9fc2def19f1d3059c15059df21ddddb518fd Mon Sep 17 00:00:00 2001 From: Pandu E POLUAN Date: Wed, 28 Feb 2024 16:52:09 +0700 Subject: [PATCH 048/453] feat(tmux): prioritize `tmux` terminfo (#12243) Co-authored-by: Carlo Sala --- plugins/tmux/README.md | 32 ++++++++++++++++---------------- plugins/tmux/tmux.plugin.zsh | 16 ++++++++++++---- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/plugins/tmux/README.md b/plugins/tmux/README.md index a253457f2..50f8b2c2f 100644 --- a/plugins/tmux/README.md +++ b/plugins/tmux/README.md @@ -1,7 +1,7 @@ # tmux -This plugin provides aliases for [tmux](https://tmux.github.io/), the terminal multiplexer. -To use it add `tmux` to the plugins array in your zshrc file. +This plugin provides aliases for [tmux](https://tmux.github.io/), the terminal multiplexer. To use it add +`tmux` to the plugins array in your zshrc file. ```zsh plugins=(... tmux) @@ -29,17 +29,17 @@ The plugin also supports the following: ## Configuration Variables -| Variable | Description | -| ----------------------------------- | ------------------------------------------------------------------------------------------- | -| `ZSH_TMUX_AUTOSTART` | Automatically starts tmux (default: `false`) | -| `ZSH_TMUX_AUTOSTART_ONCE` | Autostart only if tmux hasn't been started previously (default: `true`) | -| `ZSH_TMUX_AUTOCONNECT` | Automatically connect to a previous session if it exits (default: `true`) | -| `ZSH_TMUX_AUTOQUIT` | Automatically closes terminal once tmux exits (default: `ZSH_TMUX_AUTOSTART`) | -| `ZSH_TMUX_CONFIG` | Set the configuration path (default: `$HOME/.tmux.conf`, `$XDG_CONFIG_HOME/tmux/tmux.conf`) | -| `ZSH_TMUX_DEFAULT_SESSION_NAME` | Set tmux default session name when autostart is enabled | -| `ZSH_TMUX_DETACHED` | Set the detached mode (default: `false`) | -| `ZSH_TMUX_FIXTERM` | Sets `$TERM` to 256-color term or not based on current terminal support | -| `ZSH_TMUX_FIXTERM_WITHOUT_256COLOR` | `$TERM` to use for non 256-color terminals (default: `screen`) | -| `ZSH_TMUX_FIXTERM_WITH_256COLOR` | `$TERM` to use for 256-color terminals (default: `screen-256color` | -| `ZSH_TMUX_ITERM2` | Sets the `-CC` option for iTerm2 tmux integration (default: `false`) | -| `ZSH_TMUX_UNICODE` | Set `tmux -u` option to support unicode | +| Variable | Description | +| ----------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `ZSH_TMUX_AUTOSTART` | Automatically starts tmux (default: `false`) | +| `ZSH_TMUX_AUTOSTART_ONCE` | Autostart only if tmux hasn't been started previously (default: `true`) | +| `ZSH_TMUX_AUTOCONNECT` | Automatically connect to a previous session if it exits (default: `true`) | +| `ZSH_TMUX_AUTOQUIT` | Automatically closes terminal once tmux exits (default: `ZSH_TMUX_AUTOSTART`) | +| `ZSH_TMUX_CONFIG` | Set the configuration path (default: `$HOME/.tmux.conf`, `$XDG_CONFIG_HOME/tmux/tmux.conf`) | +| `ZSH_TMUX_DEFAULT_SESSION_NAME` | Set tmux default session name when autostart is enabled | +| `ZSH_TMUX_DETACHED` | Set the detached mode (default: `false`) | +| `ZSH_TMUX_FIXTERM` | Sets `$TERM` to 256-color term or not based on current terminal support | +| `ZSH_TMUX_FIXTERM_WITHOUT_256COLOR` | `$TERM` to use for non 256-color terminals (default: `tmux` if available, `screen` otherwise) | +| `ZSH_TMUX_FIXTERM_WITH_256COLOR` | `$TERM` to use for 256-color terminals (default: `tmux-256color` if available, `screen-256color` otherwise) | +| `ZSH_TMUX_ITERM2` | Sets the `-CC` option for iTerm2 tmux integration (default: `false`) | +| `ZSH_TMUX_UNICODE` | Set `tmux -u` option to support unicode | diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 0ecb0a5b5..09e326344 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -20,13 +20,21 @@ fi # Set '-CC' option for iTerm2 tmux integration : ${ZSH_TMUX_ITERM2:=false} # The TERM to use for non-256 color terminals. -# Tmux states this should be screen, but you may need to change it on +# Tmux states this should be tmux|screen, but you may need to change it on # systems without the proper terminfo -: ${ZSH_TMUX_FIXTERM_WITHOUT_256COLOR:=screen} +if [[ -e /usr/share/terminfo/t/tmux ]]; then + : ${ZSH_TMUX_FIXTERM_WITHOUT_256COLOR:=tmux} +else + : ${ZSH_TMUX_FIXTERM_WITHOUT_256COLOR:=screen} +fi # The TERM to use for 256 color terminals. -# Tmux states this should be screen-256color, but you may need to change it on +# Tmux states this should be (tmux|screen)-256color, but you may need to change it on # systems without the proper terminfo -: ${ZSH_TMUX_FIXTERM_WITH_256COLOR:=screen-256color} +if [[ -e /usr/share/terminfo/t/tmux-256color ]]; then + : ${ZSH_TMUX_FIXTERM_WITH_256COLOR:=tmux-256color} +else + : ${ZSH_TMUX_FIXTERM_WITH_256COLOR:=screen-256color} +fi # Set the configuration path if [[ -e $HOME/.tmux.conf ]]; then : ${ZSH_TMUX_CONFIG:=$HOME/.tmux.conf} From 6a65ac90259d87f7549c581372403405ef01b7d2 Mon Sep 17 00:00:00 2001 From: Pandu E POLUAN Date: Thu, 29 Feb 2024 15:40:40 +0700 Subject: [PATCH 049/453] feat(eza): create plugin (#12237) Co-authored-by: Carlo Sala --- .github/CODEOWNERS | 5 +- plugins/eza/README.md | 101 +++++++++++++++++++++++++++++++++++++ plugins/eza/eza.plugin.zsh | 62 +++++++++++++++++++++++ 3 files changed, 166 insertions(+), 2 deletions(-) create mode 100644 plugins/eza/README.md create mode 100644 plugins/eza/eza.plugin.zsh diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 0c5f3acee..361ed624b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,13 +1,14 @@ # Plugin owners plugins/archlinux/ @ratijas +plugins/dbt/ @msempere +plugins/eza/ @pepoluan plugins/genpass/ @atoponce plugins/git-lfs/ @hellovietduc plugins/gitfast/ @felipec plugins/react-native @esthor plugins/sdk/ @rgoldberg plugins/shell-proxy/ @septs +plugins/starship/ @axieax plugins/universalarchive/ @Konfekt plugins/wp-cli/ @joshmedeski plugins/zoxide/ @ajeetdsouza -plugins/starship/ @axieax -plugins/dbt/ @msempere diff --git a/plugins/eza/README.md b/plugins/eza/README.md new file mode 100644 index 000000000..5de935c2c --- /dev/null +++ b/plugins/eza/README.md @@ -0,0 +1,101 @@ +# eza plugin + +This provides aliases that invoke the [`eza`](https://github.com/eza-community/eza) utility rather than `ls` + +To use it add `eza` to the plugins array in your zshrc file: + +```zsh +plugins=(... eza) +``` + +## Configuration + +All configurations are done using the `zstyle` command in the `:omz:plugins:eza` namespace. + +**NOTE:** The configuring needs to be done prior to OMZ loading the plugins. When the plugin is loaded, +changing the `zstyle` won't have any effect. + +### `dirs-first` + +```zsh +zstyle ':omz:plugins:eza' 'dirs-first' yes|no +``` + +If `yes`, directories will be grouped first. + +Default: `no` + +### `git-status` + +```zsh +zstyle ':omz:plugins:eza' 'git-status' yes|no +``` + +If `yes`, always add `--git` flag to indicate git status (if tracked / in a git repo). + +Default: `no` + +### `header` + +```zsh +zstyle ':omz:plugins:eza' 'header' yes|no +``` + +If `yes`, always add `-h` flag to add a header row for each column. + +Default: `no` + +### `show-group` + +```zsh +zstyle ':omz:plugins:eza' 'show-group' yes|no +``` + +If `yes` (default), always add `-g` flag to show the group ownership. + +Default: `yes` + +### `size-prefix` + +```zsh +zstyle ':omz:plugins:eza' 'size-prefix' (binary|none|si) +``` + +Choose the prefix to be used in displaying file size: + +- `binary` -- use [binary prefixes](https://en.wikipedia.org/wiki/Binary_prefix) such as "Ki", "Mi", "Gi" and + so on +- `none` -- don't use any prefix, show size in bytes +- `si` (default) -- use [Metric/S.I. prefixes](https://en.wikipedia.org/wiki/Metric_prefix) + +Default: `si` + +### `time-style` + +```zsh +zstyle ':omz:plugins:eza' 'time-style' $TIME_STYLE +``` + +Sets the `--time-style` option of `eza`. (See `man eza` for the options) + +Default: Not set, which means the default behavior of `eza` will take place. + +## Aliases + +**Notes:** + +- Aliases may be modified by Configuration +- The term "files" without "only" qualifier means both files & directories + +| Alias | Command | Description | +| ------ | ----------------- | -------------------------------------------------------------------------- | +| `la` | `eza -la` | List all files (except . and ..) as a long list | +| `ldot` | `eza -ld .*` | List dotfiles only (directories shown as entries instead of recursed into) | +| `lD` | `eza -lD` | List only directories (excluding dotdirs) as a long list | +| `lDD` | `eza -laD` | List only directories (including dotdirs) as a long list | +| `ll` | `eza -l` | List files as a long list | +| `ls` | `eza` | Plain eza call | +| `lsd` | `eza -d` | List specified files with directories as entries, in a grid | +| `lsdl` | `eza -dl` | List specified files with directories as entries, in a long list | +| `lS` | `eza -l -ssize` | List files as a long list, sorted by size | +| `lT` | `eza -l -snewest` | List files as a long list, sorted by date (newest last) | diff --git a/plugins/eza/eza.plugin.zsh b/plugins/eza/eza.plugin.zsh new file mode 100644 index 000000000..6d7f720bd --- /dev/null +++ b/plugins/eza/eza.plugin.zsh @@ -0,0 +1,62 @@ +if ! (( $+commands[eza] )); then + print "zsh eza plugin: eza not found. Please install eza before using this plugin." >&2 + return 1 +fi + +typeset -a _EZA_HEAD +typeset -a _EZA_TAIL + +function _configure_eza() { + local _val + # Get the head flags + if zstyle -T ':omz:plugins:eza' 'show-group'; then + _EZA_HEAD+=("g") + fi + if zstyle -t ':omz:plugins:eza' 'header'; then + _EZA_HEAD+=("h") + fi + zstyle -s ':omz:plugins:eza' 'size-prefix' _val + case "${_val:l}" in + binary) + _EZA_HEAD+=("b") + ;; + none) + _EZA_HEAD+=("B") + ;; + esac + # Get the tail long-options + if zstyle -t ':omz:plugins:eza' 'dirs-first'; then + _EZA_TAIL+=("--group-directories-first") + fi + if zstyle -t ':omz:plugins:eza' 'git-status'; then + _EZA_TAIL+=("--git") + fi + zstyle -s ':omz:plugins:eza' 'time-style' _val + if [[ $_val ]]; then + _EZA_TAIL+=("--time-style='$_val'") + fi +} + +_configure_eza + +function _alias_eza() { + local _head="${(j::)_EZA_HEAD}$2" + local _tail="${(j: :)_EZA_TAIL}" + alias "$1"="eza${_head:+ -}${_head}${_tail:+ }${_tail}${3:+ }$3" +} + +_alias_eza la la +_alias_eza ldot ld ".*" +_alias_eza lD lD +_alias_eza lDD lDa +_alias_eza ll l +_alias_eza ls +_alias_eza lsd d +_alias_eza lsdl dl +_alias_eza lS "l -ssize" +_alias_eza lT "l -snewest" + +unfunction _alias_eza +unfunction _configure_eza +unset _EZA_HEAD +unset _EZA_TAIL From 65b23a3328bfd7ddf3234de4538fa7c3e9644491 Mon Sep 17 00:00:00 2001 From: Jonathan De Troye Date: Thu, 29 Feb 2024 13:05:54 -0500 Subject: [PATCH 050/453] fix(tmux): do not pass empty flags to aliases (#12232) This enables compatibility with tmux >3.3a Co-authored-by: Carlo Sala --- plugins/tmux/tmux.plugin.zsh | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 09e326344..436e2671d 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -47,14 +47,27 @@ fi : ${ZSH_TMUX_UNICODE:=false} # ALIASES -alias ta='tmux attach -t' -alias tad='tmux attach -d -t' -alias ts='tmux new-session -s' -alias tl='tmux list-sessions' +function _build_tmux_alias { + eval "function $1 { + if [[ -z \$1 ]] || [[ \${1::1} == '-' ]]; then + tmux $2 \"\$@\" + else + tmux $2 $3 \"\$@\" + fi + }" +} + alias tksv='tmux kill-server' -alias tkss='tmux kill-session -t' +alias tl='tmux list-sessions' alias tmuxconf='$EDITOR $ZSH_TMUX_CONFIG' +_build_tmux_alias "ta" "attach" "-t" +_build_tmux_alias "tad" "attach -d" "-t" +_build_tmux_alias "ts" "new-session" "-s" +_build_tmux_alias "tkss" "kill-session" "-t" + +unfunction _build_tmux_alias + # Determine if the terminal supports 256 colors if [[ $terminfo[colors] == 256 ]]; then export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITH_256COLOR From 50fd98e5a6c9d7c36b0cc678f577f7ce1d181bea Mon Sep 17 00:00:00 2001 From: Gam <1348187+Y3K@users.noreply.github.com> Date: Thu, 29 Feb 2024 14:59:27 -0600 Subject: [PATCH 051/453] fix(ssh): allow multiple definitions per host (#12227) --- plugins/ssh/ssh.plugin.zsh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/plugins/ssh/ssh.plugin.zsh b/plugins/ssh/ssh.plugin.zsh index 085e71fa1..b5b050536 100644 --- a/plugins/ssh/ssh.plugin.zsh +++ b/plugins/ssh/ssh.plugin.zsh @@ -4,9 +4,16 @@ # Filter out wildcard host sections. _ssh_configfile="$HOME/.ssh/config" if [[ -f "$_ssh_configfile" ]]; then - _hosts=($(egrep '^Host.*' "$_ssh_configfile" | awk '{print $2}' | grep -v '^*' | sed -e 's/\.*\*$//')) - zstyle ':completion:*:hosts' hosts $_hosts - unset _hosts + _ssh_hosts=($( + egrep '^Host.*' "$_ssh_configfile" |\ + awk '{for (i=2; i<=NF; i++) print $i}' |\ + sort |\ + uniq |\ + grep -v '^*' |\ + sed -e 's/\.*\*$//' + )) + zstyle ':completion:*:hosts' hosts $_ssh_hosts + unset _ssh_hosts fi unset _ssh_configfile From 9730915910c6cc7640f8af6063ffb93becf0414a Mon Sep 17 00:00:00 2001 From: Artem Babii Date: Thu, 29 Feb 2024 23:07:10 +0200 Subject: [PATCH 052/453] feat(kube-ps1): add symlink support (#12208) --- plugins/kube-ps1/README.md | 1 + plugins/kube-ps1/kube-ps1.plugin.zsh | 27 ++++++++++++++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/plugins/kube-ps1/README.md b/plugins/kube-ps1/README.md index 1ed3e4438..dd49eff39 100644 --- a/plugins/kube-ps1/README.md +++ b/plugins/kube-ps1/README.md @@ -136,6 +136,7 @@ the following environment variables: | `KUBE_PS1_SUFFIX` | `)` | Prompt closing character | | `KUBE_PS1_CLUSTER_FUNCTION` | No default, must be user supplied | Function to customize how cluster is displayed | | `KUBE_PS1_NAMESPACE_FUNCTION` | No default, must be user supplied | Function to customize how namespace is displayed | +| `KUBE_PS1_KUBECONFIG_SYMLINK` | `false` | Treat `KUBECONFIG` and `~/.kube/config` files as symbolic links | For terminals that do not support UTF-8, the symbol will be replaced with the string `k8s`. diff --git a/plugins/kube-ps1/kube-ps1.plugin.zsh b/plugins/kube-ps1/kube-ps1.plugin.zsh index 894e0f7f0..7edc62de8 100644 --- a/plugins/kube-ps1/kube-ps1.plugin.zsh +++ b/plugins/kube-ps1/kube-ps1.plugin.zsh @@ -40,6 +40,7 @@ KUBE_PS1_NS_COLOR="${KUBE_PS1_NS_COLOR-cyan}" KUBE_PS1_BG_COLOR="${KUBE_PS1_BG_COLOR}" KUBE_PS1_KUBECONFIG_CACHE="${KUBECONFIG}" +KUBE_PS1_KUBECONFIG_SYMLINK="${KUBE_PS1_KUBECONFIG_SYMLINK:-false}" KUBE_PS1_DISABLE_PATH="${HOME}/.kube/kube-ps1/disabled" KUBE_PS1_LAST_TIME=0 KUBE_PS1_CLUSTER_FUNCTION="${KUBE_PS1_CLUSTER_FUNCTION}" @@ -190,14 +191,26 @@ _kube_ps1_file_newer_than() { local file=$1 local check_time=$2 - if [[ "${KUBE_PS1_SHELL}" == "zsh" ]]; then - mtime=$(zstat +mtime "${file}") - elif stat -c "%s" /dev/null &> /dev/null; then - # GNU stat - mtime=$(stat -L -c %Y "${file}") + if [[ "${KUBE_PS1_KUBECONFIG_SYMLINK}" == "true" ]]; then + if [[ "${KUBE_PS1_SHELL}" == "zsh" ]]; then + mtime=$(zstat -L +mtime "${file}") + elif stat -c "%s" /dev/null &> /dev/null; then + # GNU stat + mtime=$(stat -c %Y "${file}") + else + # BSD stat + mtime=$(stat -f %m "$file") + fi else - # BSD stat - mtime=$(stat -L -f %m "$file") + if [[ "${KUBE_PS1_SHELL}" == "zsh" ]]; then + mtime=$(zstat +mtime "${file}") + elif stat -c "%s" /dev/null &> /dev/null; then + # GNU stat + mtime=$(stat -L -c %Y "${file}") + else + # BSD stat + mtime=$(stat -L -f %m "$file") + fi fi [[ "${mtime}" -gt "${check_time}" ]] From 0008534147a28eeeea52cfd92154ae2e801678ae Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Fri, 1 Mar 2024 16:44:20 +0100 Subject: [PATCH 053/453] fix(tmux): regression with detached sessions See https://github.com/ohmyzsh/ohmyzsh/pull/12242#issuecomment-1973236605 --- plugins/tmux/tmux.plugin.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 436e2671d..11550d687 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -100,11 +100,13 @@ function _zsh_tmux_plugin_run() { [[ "$ZSH_TMUX_ITERM2" == "true" ]] && tmux_cmd+=(-CC) [[ "$ZSH_TMUX_UNICODE" == "true" ]] && tmux_cmd+=(-u) + local _detached="" + [[ "$ZSH_TMUX_DETACHED" == "true" ]] && _detached="-d" # Try to connect to an existing session. if [[ -n "$ZSH_TMUX_DEFAULT_SESSION_NAME" ]]; then - [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] && $tmux_cmd attach ${ZSH_TMUX_DETACHED:+"-d"} -t $ZSH_TMUX_DEFAULT_SESSION_NAME + [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] && $tmux_cmd attach $_detached -t $ZSH_TMUX_DEFAULT_SESSION_NAME else - [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] && $tmux_cmd attach ${ZSH_TMUX_DETACHED:+"-d"} + [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] && $tmux_cmd attach $_detached fi # If failed, just run tmux, fixing the TERM variable if requested. From e3216d15c2d2ee81716e4c2cbc999b4bed5694d9 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Sat, 2 Mar 2024 00:57:26 +0100 Subject: [PATCH 054/453] fix(git-commit)!: allow alias update BREAKING CHANGE: Prior to this commit, git aliases were not being updated after every update of oh-my-zsh. In case you were using git-commit plugin before this commit, please remove your git aliases to proceed. --- plugins/git-commit/git-commit.plugin.zsh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/plugins/git-commit/git-commit.plugin.zsh b/plugins/git-commit/git-commit.plugin.zsh index 3f0c2121d..207c37e21 100644 --- a/plugins/git-commit/git-commit.plugin.zsh +++ b/plugins/git-commit/git-commit.plugin.zsh @@ -1,3 +1,8 @@ +if git config --global --get-all alias.$_alias >/dev/null 2>&1 \ + && ! git config --global --get-all oh-my-zsh.git-commit-alias >/dev/null 2>&1; then + return +fi + local -a _git_commit_aliases _git_commit_aliases=( 'build' @@ -14,19 +19,18 @@ _git_commit_aliases=( 'wip' ) -local alias type -for type in "${_git_commit_aliases[@]}"; do +local _alias _type +for _type in "${_git_commit_aliases[@]}"; do # an alias can't be named "revert" because the git command takes precedence # https://stackoverflow.com/a/3538791 - case "$type" in - revert) alias=rev ;; - *) alias=$type ;; + case "$_type" in + revert) _alias=rev ;; + *) _alias=$_type ;; esac - local func='!a() { if [ "$1" = "-s" ] || [ "$1" = "--scope" ]; then local scope="$2"; shift 2; git commit -m "'$type'(${scope}): ${@}"; else git commit -m "'$type': ${@}"; fi }; a' - if ! git config --global --get-all alias.${alias} >/dev/null 2>&1; then - git config --global alias.${alias} "$func" - fi + local _func='!a() { if [ "$1" = "-s" ] || [ "$1" = "--scope" ]; then local scope="$2"; shift 2; git commit -m "'$type'(${scope}): ${@}"; else git commit -m "'$type': ${@}"; fi }; a' + + git config --global alias.$_alias "$_func" done -unset _git_commit_aliases alias type func +git config --global oh-my-zsh.git-commit-alias "true" From 3ee108ccb301dd4143080e8bfd8f9ae869957a2e Mon Sep 17 00:00:00 2001 From: Rejman Date: Sat, 2 Mar 2024 01:21:30 +0100 Subject: [PATCH 055/453] feat(git-commit): add `-a | --attention` flag Refactor function as well to reduce flaws and increase stability Closes #12234 Co-authored-by: Carlo Sala --- plugins/git-commit/git-commit.plugin.zsh | 25 +++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/plugins/git-commit/git-commit.plugin.zsh b/plugins/git-commit/git-commit.plugin.zsh index 207c37e21..7ad349735 100644 --- a/plugins/git-commit/git-commit.plugin.zsh +++ b/plugins/git-commit/git-commit.plugin.zsh @@ -28,7 +28,30 @@ for _type in "${_git_commit_aliases[@]}"; do *) _alias=$_type ;; esac - local _func='!a() { if [ "$1" = "-s" ] || [ "$1" = "--scope" ]; then local scope="$2"; shift 2; git commit -m "'$type'(${scope}): ${@}"; else git commit -m "'$type': ${@}"; fi }; a' + local _func='!a() { +local _scope _attention _message +while [ $# -ne 0 ]; do +case $1 in + -s | --scope ) + if [ -z $2 ]; then + echo "Missing scope!" + return 1 + fi + _scope="$2" + shift 2 + ;; + -a | --attention ) + _attention="!" + shift 1 + ;; + * ) + _message+=" $1" + shift 1 + ;; +esac +done +git commit -m "'$_type'${_scope:+(${_scope})}${_attention}:${_message}" +}; a' git config --global alias.$_alias "$_func" done From 8e088ded8289a9db2a9f2c03cab618d6dd017dd7 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Sat, 2 Mar 2024 01:25:20 +0100 Subject: [PATCH 056/453] docs(git-commit): document attention flag --- plugins/git-commit/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git-commit/README.md b/plugins/git-commit/README.md index a00983935..49072d0fb 100644 --- a/plugins/git-commit/README.md +++ b/plugins/git-commit/README.md @@ -11,7 +11,7 @@ plugins=(... git-commit) ## Syntax ```zsh -git [(-s, --scope) ""] "" +git [(-s, --scope) ""] [(-a, --attention)] "" ``` > ⚠️ Single/Double quotes around the scope and message are required From 2c62584b8389cb9510c12f7c28b5ca7970619277 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=A4=A9=E6=B3=BD?= <35888946+zhangtianze1997@users.noreply.github.com> Date: Sat, 2 Mar 2024 16:12:34 +0800 Subject: [PATCH 057/453] fix(tmux): use full offset parameter (#12249) --- plugins/tmux/tmux.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 11550d687..791592d8f 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -49,7 +49,7 @@ fi # ALIASES function _build_tmux_alias { eval "function $1 { - if [[ -z \$1 ]] || [[ \${1::1} == '-' ]]; then + if [[ -z \$1 ]] || [[ \${1:0:1} == '-' ]]; then tmux $2 \"\$@\" else tmux $2 $3 \"\$@\" From b6c1de87b01aaf5eb434b86b1d32b92cb37467bb Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Sat, 2 Mar 2024 10:05:44 +0100 Subject: [PATCH 058/453] fix(git-commit): add omz version check --- plugins/git-commit/git-commit.plugin.zsh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/git-commit/git-commit.plugin.zsh b/plugins/git-commit/git-commit.plugin.zsh index 7ad349735..121ae59de 100644 --- a/plugins/git-commit/git-commit.plugin.zsh +++ b/plugins/git-commit/git-commit.plugin.zsh @@ -1,7 +1,8 @@ -if git config --global --get-all alias.$_alias >/dev/null 2>&1 \ - && ! git config --global --get-all oh-my-zsh.git-commit-alias >/dev/null 2>&1; then +local _rev="$(git -C $ZSH rev-parse HEAD 2> /dev/null)" +if [[ $_rev == $(git config --global --get oh-my-zsh.git-commit-alias 2> /dev/null) ]]; then return fi +git config --global oh-my-zsh.git-commit-alias "$_rev" local -a _git_commit_aliases _git_commit_aliases=( @@ -55,5 +56,3 @@ git commit -m "'$_type'${_scope:+(${_scope})}${_attention}:${_message}" git config --global alias.$_alias "$_func" done - -git config --global oh-my-zsh.git-commit-alias "true" From 458fc2e1df4757e64b036edee17ccdefdde41f73 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Sat, 2 Mar 2024 10:05:54 +0100 Subject: [PATCH 059/453] docs(git-commit): add warning --- plugins/git-commit/README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/git-commit/README.md b/plugins/git-commit/README.md index 49072d0fb..f812ee23f 100644 --- a/plugins/git-commit/README.md +++ b/plugins/git-commit/README.md @@ -1,6 +1,8 @@ # git-commit plugin -The git-commit plugin adds several [git aliases](https://www.git-scm.com/docs/git-config#Documentation/git-config.txt-alias) for [conventional commit](https://www.conventionalcommits.org/en/v1.0.0/#summary) messages. +The git-commit plugin adds several +[git aliases](https://www.git-scm.com/docs/git-config#Documentation/git-config.txt-alias) for +[conventional commit](https://www.conventionalcommits.org/en/v1.0.0/#summary) messages. To use it, add `git-commit` to the plugins array in your zshrc file: @@ -14,8 +16,6 @@ plugins=(... git-commit) git [(-s, --scope) ""] [(-a, --attention)] "" ``` -> ⚠️ Single/Double quotes around the scope and message are required - Where `type` is one of the following: - `build` @@ -34,6 +34,9 @@ Where `type` is one of the following: > NOTE: the alias for `revert` type is `rev`, as otherwise it conflicts with the git command of the same name. > It will still generate a commit message in the format `revert: ` +> ⚠️ Enabling this plugin will (potentially) overwrite all `alias.` that you manually set. Use with +> care! + ## Examples | Git alias | Command | From 70395a64637ad1a94b11f6007f29ee0c0d716884 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Sun, 3 Mar 2024 11:22:25 +0100 Subject: [PATCH 060/453] fix(git): do not use `+=` in sh script Fixes #12251 --- plugins/git-commit/git-commit.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git-commit/git-commit.plugin.zsh b/plugins/git-commit/git-commit.plugin.zsh index 121ae59de..c4df77c80 100644 --- a/plugins/git-commit/git-commit.plugin.zsh +++ b/plugins/git-commit/git-commit.plugin.zsh @@ -46,7 +46,7 @@ case $1 in shift 1 ;; * ) - _message+=" $1" + _message="${_message} $1" shift 1 ;; esac From 97a86ed1678022683d9f0113ada51f4ed8aa7375 Mon Sep 17 00:00:00 2001 From: Maxime Brunet Date: Sun, 3 Mar 2024 10:56:40 +0000 Subject: [PATCH 061/453] feat(terraform): update completion to `v1.7` (#12252) --- plugins/terraform/_terraform | 820 ++++++++++++++++++++--------------- 1 file changed, 469 insertions(+), 351 deletions(-) diff --git a/plugins/terraform/_terraform b/plugins/terraform/_terraform index 625834563..aad1c6096 100644 --- a/plugins/terraform/_terraform +++ b/plugins/terraform/_terraform @@ -1,411 +1,529 @@ #compdef terraform +compdef _terraform terraform -local -a _terraform_cmds opt_args -_terraform_cmds=( - 'apply:Builds or changes infrastructure' - 'console:Interactive console for Terraform interpolations' - 'destroy:Destroy Terraform-managed infrastructure' - 'fmt:Rewrites config files to canonical format' - 'force-unlock:Manually unlock the terraform state' - 'get:Download and install modules for the configuration' - 'graph:Create a visual graph of Terraform resources' - 'import:Import existing infrastructure into Terraform' - 'init:Initialize a Terraform working directory' +(( ${+functions[_terraform_commands]} )) || _terraform_commands() { + local -a _terraform_cmds + _terraform_cmds=( + 'apply:Create or update infrastructure' + 'console:Try Terraform expressions at an interactive command prompt' + 'destroy:Destroy previously-created infrastructure' + 'fmt:Reformat your configuration in the standard style' + 'force-unlock:Release a stuck lock on the current workspace' + 'get:Install or upgrade remote Terraform modules' + 'graph:Generate a Graphviz graph of the steps in an operation' + 'import:Associate existing infrastructure with a Terraform resource' + 'init:Prepare your working directory for other commands' 'login:Obtain and save credentials for a remote host' 'logout:Remove locally-stored credentials for a remote host' - 'output:Read an output from a state file' - 'plan:Generate and show an execution plan' - 'providers:Prints a tree of the providers used in the configuration' - 'refresh:Update local state file against real resources' - 'show:Inspect Terraform state or plan' + 'metadata:Metadata related commands' + 'output:Show output values from your root module' + 'plan:Show changes required by the current configuration' + 'providers:Show the providers required for this configuration' + 'refresh:Update the state to match remote systems' + 'show:Show the current state or a saved plan' 'state:Advanced state management' - 'taint:Manually mark a resource for recreation' - 'untaint:Manually unmark a resource as tainted' - 'validate:Validates the Terraform files' - 'version:Prints the Terraform version' + 'taint:Mark a resource instance as not fully functional' + 'test:Execute integration tests for Terraform modules' + 'untaint:Remove the '\''tainted'\'' state from a resource instance' + 'validate:Check whether the configuration is valid' + 'version:Show the current Terraform version' 'workspace:Workspace management' - '0.12upgrade:Rewrites pre-0.12 module source code for v0.12' - '0.13upgrade:Rewrites pre-0.13 module source code for v0.13' -) + ) + if ((CURRENT == 1)); then + _describe -t commands 'terraform commands' _terraform_cmds + return + fi -__012upgrade() { + local curcontext="${curcontext}" + cmd="${${_terraform_cmds[(r)$words[1]:*]%%:*}}" + curcontext="${curcontext%:*:*}:terraform-${cmd}:" + + if (( ${+functions[_terraform_$cmd]} )); then + "_terraform_${cmd}" + else + _message "no more options" + fi +} + +(( ${+functions[_terraform_apply]} )) || _terraform_apply() { _arguments \ - '-yes[Skip the initial introduction messages and interactive confirmation. This can be used to run this command in batch from a script.]' \ - '-force[ Override the heuristic that attempts to detect if a configuration is already written for v0.12 or later. Some of the transformations made by this command are not idempotent, so re-running against the same module may change the meanings expressions in the module.]' + '-auto-approve[Skip interactive approval of plan before applying.]' \ + '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -g "*.backup"' \ + '-compact-warnings[If Terraform produces any warnings that are not accompanied by errors, show them in a more compact form that includes only the summary messages.]' \ + '-destroy[Destroy Terraform-managed infrastructure. The command "terraform destroy" is a convenience alias for this option.]' \ + '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-input=[(true) Ask for input for variables if not directly set.]:input:(true false)' \ + '-no-color[If specified, output won'\''t contain any color.]' \ + '-parallelism=[(10) Limit the number of parallel resource operations.]' \ + '-refresh=[(true) Skip checking for external changes to remote objects while creating the plan. This can potentially make planning faster, but at the expense of possibly planning against a stale record of the remote system state.]:refresh:(true false)' \ + '*-replace=[(resource) Force replacement of a particular resource instance using its resource address. If applying would'\''ve normally produced an update or no-op action for this instance, Terraform will replace it instead. You can use this option multiple times to replace more than one object.]:resource:__terraform_state_resources' \ + '-state=[(terraform.tfstate) Path to read and save state (unless state-out is specified).]:statefile:_files -g "*.tfstate"' \ + '-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]:statefile:_files -g "*.tfstate"' \ + '*-target=[(resource) Limit the operation to only the given module, resource, or resource instance and all of its dependencies. You can use this option multiple times to include more than one object. This is for exceptional use only.]:target:__terraform_state_resources' \ + '*-var=[(for=bar) Set a value for one of the input variables in the root module of the configuration. Use this option more than once to set more than one variable.]' \ + '*-var-file=[(foo) Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.]:file:_files -g "*.tfvars{,.json}"' \ + ':plan:_files -' } -__013upgrade() { +(( ${+functions[_terraform_console]} )) || _terraform_console() { _arguments \ - '-yes[Skip the initial introduction messages and interactive confirmation. This can be used to run this command in batch from a script.]' + '-state=[(terraform.tfstate) Legacy option for the local backend only. See the local backend'\''s documentation for more information.]' \ + '-plan[Create a new plan (as if running "terraform plan") and then evaluate expressions against its planned state, instead of evaluating against the current state. You can use this to inspect the effects of configuration changes that haven'\''t been applied yet.]' \ + '*-var=[(for=bar) Set a variable in the Terraform configuration. This flag can be set multiple times.]' \ + '*-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]:file:_files -g "*.tfvars{,.json}"' } -__apply() { - _arguments \ - '-auto-approve[Skip interactive approval of plan before applying.]' \ - '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -g "*.backup"' \ - '-compact-warnings[If Terraform produces any warnings that are not accompanied by errors, show them in a more compact form that includes only the summary messages.]' \ - '-lock=[(true) Lock the state file when locking is supported.]:lock:(true false)' \ - '-lock-timeout=[(0s) Duration to retry a state lock.]' \ - '-input=[(true) Ask for input for variables if not directly set.]' \ - '-no-color[If specified, output will be colorless.]' \ - '-parallelism=[(10) Limit the number of parallel resource operations.]' \ - '-refresh=[(true) Update state prior to checking for differences. This has no effect if a plan file is given to apply.]' \ - '-state=[(terraform.tfstate) Path to read and save state (unless state-out is specified).]:statefile:_files -g "*.tfstate"' \ - '-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]:statefile:_files -g "*.tfstate"' \ - '*-target=[(resource) Resource to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]:target:__statelist' \ - '*-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times.]' \ - '*-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]:file:_files -g "*.tfvars{,.json}"' -} - -__console() { - _arguments \ - '-state=[(terraform.tfstate) Path to read state.]' \ - '*-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times.]' \ - '*-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]:file:_files -g "*.tfvars{,.json}"' -} - -__destroy() { - _arguments \ - '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -g "*.backup"' \ - '-auto-approve[Skip interactive approval before destroying.]' \ - '-force[Deprecated: same as auto-approve.]' \ - '-lock=[(true) Lock the state file when locking is supported.]:lock:(true false)' \ - '-lock-timeout=[(0s) Duration to retry a state lock.]' \ - '-no-color[If specified, output will contain no color.]' \ - '-parallelism=[(10) Limit the number of concurrent operations.]' \ - '-refresh=[(true) Update state prior to checking for differences. This has no effect if a plan file is given to apply.]' \ - '-state=[(terraform.tfstate) Path to read and save state (unless state-out is specified).]:statefile:_files -g "*.tfstate"' \ - '-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]:statefile:_files -g "*.tfstate"' \ - '*-target=[(resource) Resource to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]:target:__statelist' \ - '*-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times.]' \ - '*-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]:file:_files -g "*.tfvars{,.json}"' -} - -__fmt() { - _arguments \ - '-list=[(true) List files whose formatting differs (always false if using STDIN)]' \ - '-write=[(true) Write result to source file instead of STDOUT (always false if using STDIN or -check)]' \ - '-diff=[(false) Display diffs of formatting changes]' \ - '-check=[(false) Check if the input is formatted. Exit status will be 0 if all input is properly formatted and non-zero otherwise.]' \ - '-recursive=[(false) Also process files in subdirectories. By default, only the given directory (or current directory) is processed.]' -} - -__force_unlock() { - _arguments \ - "-force[Don't ask for input for unlock confirmation.]" -} - -__get() { - _arguments \ - '-update=[(false) If true, modules already downloaded will be checked for updates and updated if necessary.]' \ - '-no-color[Disable text coloring in the output.]' -} - -__graph() { - _arguments \ - '-draw-cycles[Highlight any cycles in the graph with colored edges. This helps when diagnosing cycle errors.]' \ - '-type=[(plan) Type of graph to output. Can be: plan, plan-destroy, apply, validate, input, refresh.]' -} - -__import() { - _arguments \ - '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -g "*.backup"' \ - '-config=[(path) Path to a directory of Terraform configuration files to use to configure the provider. Defaults to pwd. If no config files are present, they must be provided via the input prompts or env vars.]' \ - '-allow-missing-config[Allow import when no resource configuration block exists.]' \ - '-input=[(true) Ask for input for variables if not directly set.]' \ - '-lock=[(true) Lock the state file when locking is supported.]:lock:(true false)' \ - '-lock-timeout=[(0s) Duration to retry a state lock.]' \ - '-no-color[If specified, output will contain no color.]' \ - '-state=[(PATH) Path to the source state file. Defaults to the configured backend, or "terraform.tfstate"]:statefile:_files -g "*.tfstate"' \ - '-state-out=[(PATH) Path to the destination state file to write to. If this is not specified, the source state file will be used. This can be a new or existing path.]:statefile:_files -g "*.tfstate"' \ - '*-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times. This is only useful with the "-config" flag.]' \ - '*-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]:file:_files -g "*.tfvars{,.json}"' -} - -__init() { - _arguments \ - '-backend=[(true) Configure the backend for this configuration.]' \ - '-backend-config=[This can be either a path to an HCL file with key/value assignments (same format as terraform.tfvars) or a 'key=value' format. This is merged with what is in the configuration file. This can be specified multiple times. The backend type must be in the configuration itself.]' \ - '-force-copy[Suppress prompts about copying state data. This is equivalent to providing a "yes" to all confirmation prompts.]' \ - '-from-module=[(SOURCE) Copy the contents of the given module into the target directory before initialization.]' \ - '-get=[(true) Download any modules for this configuration.]' \ - '-get-plugins=[(true) Download any missing plugins for this configuration.]' \ - '-input=[(true) Ask for input if necessary. If false, will error if input was required.]' \ - '-lock=[(true) Lock the state file when locking is supported.]:lock:(true false)' \ - '-lock-timeout=[(0s) Duration to retry a state lock.]' \ - '-no-color[If specified, output will contain no color.]' \ - '-plugin-dir[Directory containing plugin binaries. This overrides all default search paths for plugins, and prevents the automatic installation of plugins. This flag can be used multiple times.]:plugin_dir:_files -/' \ - '-reconfigure[Reconfigure the backend, ignoring any saved configuration.]' \ - '-upgrade=[(false) If installing modules (-get) or plugins (-get-plugins), ignore previously-downloaded objects and install the latest version allowed within configured constraints.]' \ - '-verify-plugins=[(true) Verify the authenticity and integrity of automatically downloaded plugins.]' -} - -__login() { - _arguments \ - -} - -__logout() { - _arguments \ - -} - -__output() { - _arguments \ - '-state=[(path) Path to the state file to read. Defaults to "terraform.tfstate".]:statefile:_files -g "*.tfstate"' \ - '-no-color[If specified, output will contain no color.]' \ - '-json[If specified, machine readable output will be printed in JSON format]' -} - -__plan() { - _arguments \ - '-compact-warnings[If Terraform produces any warnings that are not accompanied by errors, show them in a more compact form that includes only the summary messages.]' \ - '-destroy[If set, a plan will be generated to destroy all resources managed by the given configuration and state.]' \ - '-detailed-exitcode[() Return detailed exit codes when the command exits. This will change the meaning of exit codes to: 0 - Succeeded, diff is empty (no changes); 1 - Errored, 2 - Succeeded; there is a diff]' \ - '-input=[(true) Ask for input for variables if not directly set.]' \ - '-lock=[(true) Lock the state file when locking is supported.]:lock:(true false)' \ - '-lock-timeout=[(0s) Duration to retry a state lock.]' \ - '-no-color[() If specified, output will contain no color.]' \ - '-out=[(path) Write a plan file to the given path. This can be used as input to the "apply" command.]' \ - '-parallelism=[(10) Limit the number of concurrent operations.]' \ - '-refresh=[(true) Update state prior to checking for differences.]' \ - '-state=[(statefile) Path to a Terraform state file to use to look up Terraform-managed resources. By default it will use the state "terraform.tfstate" if it exists.]:statefile:_files -g "*.tfstate"' \ - '*-target=[(resource) Resource to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]:target:__statelist' \ - '*-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times.]' \ - '*-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]:file:_files -g "*.tfvars{,.json}"' -} - -__providers() { - local -a __providers_cmds - __providers_cmds=( - 'mirror:Mirrors the provider plugins needed for the current configuration' - 'schema:Prints the schemas of the providers used in the configuration' - ) - _describe -t providers "providers commands" __providers_cmds - -} - -__providers_mirror() { - _arguments \ - '-platform=[(os_arch) Choose which target platform to build a mirror for.]' \ - "*:target_dir:_files -/" -} - -__providers_schema() { - _arguments \ - '-json[]' \ - '::' -} - -__refresh() { - _arguments \ - '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]::backupfile:_files -g "*.backup"' \ - '-compact-warnings[If Terraform produces any warnings that are not accompanied by errors, show them in a more compact form that includes only the summary messages.]' \ - '-input=[(true) Ask for input for variables if not directly set.]' \ - '-lock=[(true) Lock the state file when locking is supported.]:lock:(true false)' \ - '-lock-timeout=[(0s) Duration to retry a state lock.]' \ - '-no-color[If specified, output will not contain any color.]' \ - '-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]:statefile:_files -g "*.tfstate"' \ - '-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]:statefile:_files -g "*.tfstate"' \ - '*-target=[(resource) A Resource Address to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]:target:__statelist' \ - '*-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times.]' \ - '*-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]:file:_files -g "*.tfvars{,.json}"' -} - -__show() { - _arguments \ - '-json[If specified, output the Terraform plan or state in a machine-readable form.]' \ - '-no-color[If specified, output will not contain any color.]' -} - -__state() { - local -a __state_cmds - __state_cmds=( - 'list:List resources in the state' - 'mv:Move an item in the state' - 'pull:Pull current state and output to stdout' - 'push:Update remote state from a local state file' - 'replace-provider:Replace provider for resources in the Terraform state' - 'rm:Remove instances from the state' - 'show:Show a resource in the state' - ) - _describe -t state "state commands" __state_cmds -} - -__state_list() { +(( ${+functions[_terraform_destroy]} )) || _terraform_destroy() { _arguments \ - '-state=[(statefile) Path to a Terraform state file to use to look up Terraform-managed resources. By default, Terraform will consult the state of the currently-selected workspace.]' \ + '-auto-approve[Skip interactive approval of plan before applying.]' \ + '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -g "*.backup"' \ + '-compact-warnings[If Terraform produces any warnings that are not accompanied by errors, show them in a more compact form that includes only the summary messages.]' \ + '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-input=[(true) Ask for input for variables if not directly set.]:input:(true false)' \ + '-no-color[If specified, output won'\''t contain any color.]' \ + '-parallelism=[(10) Limit the number of parallel resource operations.]' \ + '-refresh=[(true) Update state prior to checking for differences. This has no effect if a plan file is given to apply.]:refresh:(true false)' \ + '-state=[(terraform.tfstate) Path to read and save state (unless state-out is specified).]:statefile:_files -g "*.tfstate"' \ + '-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]:statefile:_files -g "*.tfstate"' \ + '*-target=[(resource) Limit the operation to only the given module, resource, or resource instance and all of its dependencies. You can use this option multiple times to include more than one object. This is for exceptional use only.]:target:__terraform_state_resources' \ + '*-var=[(for=bar) Set a value for one of the input variables in the root module of the configuration. Use this option more than once to set more than one variable.]' \ + '*-var-file=[(foo) Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.]:file:_files -g "*.tfvars{,.json}"' +} + +(( ${+functions[_terraform_fmt]} )) || _terraform_fmt() { + _arguments \ + '-list=[(true) Don'\''t list files whose formatting differs (always disabled if using STDIN)]:list:(true false)' \ + '-write=[(true) Don'\''t write to source files (always disabled if using STDIN or -check)]:write:(true false)' \ + '-diff[Display diffs of formatting changes]' \ + '-check[Check if the input is formatted. Exit status will be 0 if all input is properly formatted and non-zero otherwise.]' \ + '-no-color[If specified, output won'\''t contain any color.]' \ + '-recursive[Also process files in subdirectories. By default, only the given directory (or current directory) is processed.]' \ + '*:targets:_files -' +} + +(( ${+functions[_terraform_force-unlock]} )) || _terraform_force-unlock() { + _arguments \ + '-force[Don'\''t ask for input for unlock confirmation.]' \ + ':lock_id:' +} + +(( ${+functions[_terraform_get]} )) || _terraform_get() { + _arguments \ + '-update[Check already-downloaded modules for available updates and install the newest versions available.]' \ + '-no-color[Disable text coloring in the output.]' \ + '-test-directory=[(tests) Set the Terraform test directory, defaults to "tests".]:test_directory:_files -/' +} + +(( ${+functions[_terraform_graph]} )) || _terraform_graph() { + _arguments \ + '-draw-cycles[Highlight any cycles in the graph with colored edges. This helps when diagnosing cycle errors. This option is supported only when illustrating a real evaluation graph, selected using the -type=TYPE option.]' \ + '-module-depth=[(-1) (deprecated) In prior versions of Terraform, specified the depth of modules to show in the output.]' \ + '-plan=[Render graph using the specified plan file instead of the configuration in the current directory. Implies -type=apply.]:plan:_files -' \ + '-type=[(plan) Type of operation graph to output. Can be: plan, plan-refresh-only, plan-destroy, or apply. By default Terraform just summarizes the relationships between the resources in your configuration, without any particular operation in mind. Full operation graphs are more detailed but therefore often harder to read.]:type:(plan plan-refresh-only plan-destroy apply)' +} + +(( ${+functions[_terraform_import]} )) || _terraform_import() { + _arguments \ + '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -g "*.backup"' \ + '-config=[(path) Path to a directory of Terraform configuration files to use to configure the provider. Defaults to pwd. If no config files are present, they must be provided via the input prompts or env vars.]:config:_files -/' \ + '-input=[(true) Disable interactive input prompts.]:input:(true false)' \ + '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-no-color[If specified, output will contain no color.]' \ + '-state=[(PATH) Path to the source state file. Defaults to the configured backend, or "terraform.tfstate"]:statefile:_files -g "*.tfstate"' \ + '-state-out=[(PATH) Path to the destination state file to write to. If this is not specified, the source state file will be used. This can be a new or existing path.]:statefile:_files -g "*.tfstate"' \ + '*-var=[(for=bar) Set a variable in the Terraform configuration. This flag can be set multiple times. This is only useful with the "-config" flag.]' \ + '*-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]:file:_files -g "*.tfvars{,.json}"' \ + ':addr:' \ + ':id:' +} + +(( ${+functions[_terraform_init]} )) || _terraform_init() { + _arguments \ + '-backend=[(true) Disable backend or Terraform Cloud initialization for this configuration and use what was previously initialized instead.]:backend:(true false)' \ + '-backend-config=[Configuration to be merged with what is in the configuration file'\''s '\''backend'\'' block. This can be either a path to an HCL file with key/value assignments (same format as terraform.tfvars) or a '\''key=value'\'' format, and can be specified multiple times. The backend type must be in the configuration itself.]:backend_config:_files -' \ + '-force-copy[Suppress prompts about copying state data. This is equivalent to providing a "yes" to all confirmation prompts.]' \ + '-from-module=[Copy the contents of the given module into the target directory before initialization.]:from_module:_files -/' \ + '-get=[(true) Disable downloading modules for this configuration.]:get:(true false)' \ + '-input=[(true) Disable interactive prompts. Note that some actions may require interactive prompts and will error if input is disabled.]:input:(true false)' \ + '-lock=[(true) Don'\''t hold a state lock during backend migration. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-no-color[If specified, output will contain no color.]' \ + '-plugin-dir[Directory containing plugin binaries. This overrides all default search paths for plugins, and prevents the automatic installation of plugins. This flag can be used multiple times.]:plugin_dir:_files -/' \ + '-reconfigure[Reconfigure the backend, ignoring any saved configuration.]' \ + '-migrate-state[Reconfigure a backend, and attempt to migrate any existing state.]' \ + '-upgrade[Install the latest module and provider versions allowed within configured constraints, overriding the default behavior of selecting exactly the version recorded in the dependency lockfile.]' \ + '-lockfile=[Set a dependency lockfile mode. Currently only "readonly" is valid.]:lockfile:( readonly )' \ + '-ignore-remote-version[A rare option used for Terraform Cloud and the remote backend only. Set this to ignore checking that the local and remote Terraform versions use compatible state representations, making an operation proceed even when there is a potential mismatch. See the documentation on configuring Terraform with Terraform Cloud for more information.]' \ + '-test-directory=[(tests) Set the Terraform test directory, defaults to "tests".]:test_directory:_files -/' +} + +(( ${+functions[_terraform_login]} )) || _terraform_login() { + _arguments \ + ':hostname:' +} + +(( ${+functions[_terraform_logout]} )) || _terraform_logout() { + _arguments \ + ':hostname:' +} + +(( ${+functions[_terraform_metadata]} )) || _terraform_metadata() { + local -a _metadata_cmds + _metadata_cmds=( + 'functions:Show signatures and descriptions for the available functions' + ) + if [[ "${CURRENT}" -lt 3 ]]; then + _describe -t commands "terraform metadata commands" _metadata_cmds + return + fi + + local curcontext="${curcontext}" + cmd="${${_metadata_cmds[(r)$words[2]:*]%%:*}}" + curcontext="${curcontext%:*:*}:terraform-metadata-${cmd}:" + + if (( ${+functions[_terraform_metadata_$cmd]} )); then + "_terraform_metadata_${cmd}" + else + _message "no more options" + fi +} + +(( ${+functions[_terraform_metadata_functions]} )) || _terraform_metadata_functions() { + _arguments \ + '-json' \ + '::' +} + +(( ${+functions[_terraform_output]} )) || _terraform_output() { + _arguments \ + '-state=[(path) Path to the state file to read. Defaults to "terraform.tfstate". Ignored when remote state is used.]:statefile:_files -g "*.tfstate"' \ + '-no-color[If specified, output will contain no color.]' \ + '-json[If specified, machine readable output will be printed in JSON format]' \ + '-raw[For value types that can be automatically converted to a string, will print the raw string directly, rather than a human-oriented representation of the value.]' \ + ':name:' +} + +(( ${+functions[_terraform_plan]} )) || _terraform_plan() { + _arguments \ + '-compact-warnings[If Terraform produces any warnings that are not accompanied by errors, show them in a more compact form that includes only the summary messages.]' \ + '-destroy[Select the "destroy" planning mode, which creates a plan to destroy all objects currently managed by this Terraform configuration instead of the usual behavior.]' \ + '-detailed-exitcode[Return detailed exit codes when the command exits. This will change the meaning of exit codes to: 0 - Succeeded, diff is empty (no changes); 1 - Errored, 2 - Succeeded; there is a diff]' \ + '-input=[(true) Ask for input for variables if not directly set.]:input:(true false)' \ + '-generate-config-out=[(path) (Experimental) If import blocks are present in configuration, instructs Terraform to generate HCL for any imported resources not already present. The configuration is written to a new file at PATH, which must not already exist. Terraform may still attempt to write configuration if the plan errors.]' \ + '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-no-color[If specified, output will contain no color.]' \ + '-out=[(path) Write a plan file to the given path. This can be used as input to the "apply" command.]' \ + '-parallelism=[(10) Limit the number of concurrent operations.]' \ + '-refresh=[(true) Skip checking for external changes to remote objects while creating the plan. This can potentially make planning faster, but at the expense of possibly planning against a stale record of the remote system state.]:refresh:(true false)' \ + '-refresh-only[Select the "refresh only" planning mode, which checks whether remote objects still match the outcome of the most recent Terraform apply but does not propose any actions to undo any changes made outside of Terraform.]' \ + '*-replace=[(resource) Force replacement of a particular resource instance using its resource address. If the plan would'\''ve normally produced an update or no-op action for this instance, Terraform will plan to replace it instead. You can use this option multiple times to replace more than one object.]:replace:__terraform_state_resources' \ + '-state=[(statefile) Path to a Terraform state file to use to look up Terraform-managed resources. By default it will use the state "terraform.tfstate" if it exists.]:statefile:_files -g "*.tfstate"' \ + '*-target=[(resource) Limit the planning operation to only the given module, resource, or resource instance and all of its dependencies. You can use this option multiple times to include more than one object. This is for exceptional use only.]:target:__terraform_state_resources' \ + '*-var=[(for=bar) Set a value for one of the input variables in the root module of the configuration. Use this option more than once to set more than one variable.]' \ + '*-var-file=[(foo) Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.]:file:_files -g "*.tfvars{,.json}"' +} + +(( ${+functions[_terraform_providers]} )) || _terraform_providers() { + local -a _providers_cmds + _providers_cmds=( + 'lock:Write out dependency locks for the configured providers' + 'mirror:Save local copies of all required provider plugins' + 'schema:Show schemas for the providers used in the configuration' + ) + + if [[ "${CURRENT}" -lt 3 ]]; then + _arguments \ + '-test-directory=[(path) Set the Terraform test directory, defaults to "tests".]:test_directory:_files -/' \ + '*:: :->command' + + _describe -t commands "terraform providers commands" _providers_cmds + return + fi + + local curcontext="${curcontext}" + cmd="${${_providers_cmds[(r)$words[2]:*]%%:*}}" + curcontext="${curcontext%:*:*}:terraform-providers-${cmd}:" + + if (( ${+functions[_terraform_providers_$cmd]} )); then + "_terraform_providers_${cmd}" + else + _message "no more options" + fi +} + +(( ${+functions[_terraform_providers_lock]} )) || _terraform_providers_lock() { + _arguments \ + '-fs-mirror=[(dir) Consult the given filesystem mirror directory instead of the origin registry for each of the given providers.]:fs_mirror:_files -/' \ + '-net-mirror=[(url) Consult the given network mirror (given as a base URL) instead of the origin registry for each of the given providers.]' \ + '*-platform=[(os_arch) Choose a target platform to request package checksums for.]' \ + '*:provider:' +} + +(( ${+functions[_terraform_providers_mirror]} )) || _terraform_providers_mirror() { + _arguments \ + '*-platform=[(os_arch) Choose which target platform to build a mirror for.]' \ + '::' \ + ':target_dir:_files -/' +} + +(( ${+functions[_terraform_providers_schema]} )) || _terraform_providers_schema() { + _arguments \ + '-json[]' \ + '::' +} + +(( ${+functions[_terraform_refresh]} )) || _terraform_refresh() { + _arguments \ + '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]::backupfile:_files -g "*.backup"' \ + '-compact-warnings[If Terraform produces any warnings that are not accompanied by errors, show them in a more compact form that includes only the summary messages.]' \ + '-input=[(true) Ask for input for variables if not directly set.]:input:(true false)' \ + '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-no-color[If specified, output will not contain any color.]' \ + '-parallelism=[(10) Limit the number of parallel resource operations.]' \ + '-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]:statefile:_files -g "*.tfstate"' \ + '-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]:statefile:_files -g "*.tfstate"' \ + '*-target=[(resource) A Resource Address to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]:target:__terraform_state_resources' \ + '*-var=[(for=bar) Set a variable in the Terraform configuration. This flag can be set multiple times.]' \ + '*-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]:file:_files -g "*.tfvars{,.json}"' +} + +(( ${+functions[_terraform_show]} )) || _terraform_show() { + _arguments \ + '-json[If specified, output the Terraform plan or state in a machine-readable form.]' \ + '-no-color[If specified, output will not contain any color.]' \ + ':path:_files -g "*.tfstate"' +} + +(( ${+functions[_terraform_state]} )) || _terraform_state() { + local -a _state_cmds + _state_cmds=( + 'list:List resources in the state' + 'mv:Move an item in the state' + 'pull:Pull current state and output to stdout' + 'push:Update remote state from a local state file' + 'replace-provider:Replace provider in the state' + 'rm:Remove instances from the state' + 'show:Show a resource in the state' + ) + if [[ "${CURRENT}" -lt 3 ]]; then + _describe -t commands "terraform state commands" _state_cmds + return + fi + + local curcontext="${curcontext}" + cmd="${${_state_cmds[(r)$words[2]:*]%%:*}}" + curcontext="${curcontext%:*:*}:terraform-state-${cmd}:" + + if (( ${+functions[_terraform_state_$cmd]} )); then + "_terraform_state_${cmd}" + else + _message "no more options" + fi +} + +(( ${+functions[_terraform_state_list]} )) || _terraform_state_list() { + _arguments \ + '-state=[(statefile) Path to a Terraform state file to use to look up Terraform-managed resources. By default, Terraform will consult the state of the currently-selected workspace.]:statefile:_files -g "*.tfstate"' \ '-id=[(id) Filters the results to include only instances whose resource types have an attribute named id whose value equals the given id string.]' \ - "*:address:__statelist" + '*:address:__terraform_state_resources' } -__state_mv() { +(( ${+functions[_terraform_state_mv]} )) || _terraform_state_mv() { _arguments \ - "-dry-run[If set, prints out what would've been moved but doesn't actually move anything.]" \ + '-dry-run[If set, prints out what would'\''ve been moved but doesn'\''t actually move anything.]' \ '-backup=[(PATH) Path where Terraform should write the backup for the original state. This can"t be disabled. If not set, Terraform will write it to the same path as the statefile with a ".backup" extension.]:backupfile:_files -g "*.backup"' \ '-backup-out=[(PATH) Path where Terraform should write the backup for the destination state. This can"t be disabled. If not set, Terraform will write it to the same path as the destination state file with a backup extension. This only needs to be specified if -state-out is set to a different path than -state.]:backupfile:_files -g "*.backup"' \ - "-lock=[(true) Lock the state files when locking is supported.]:lock:(true false)" \ - "-lock-timeout=[(0s) Duration to retry a state lock.]" \ + '-ignore-remote-version[A rare option used for the remote backend only. See the remote backend documentation for more information.]' \ + '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]' \ '-state=[(path) Path to the source state file. Defaults to the configured backend, or "terraform.tfstate"]:statefile:_files -g "*.tfstate"' \ '-state-out=[(path) Path to the destination state file to write to. If this isn"t specified, the source state file will be used. This can be a new or existing path.]:statefile:_files -g "*.tfstate"' \ - "::" \ - ":source:__statelist" \ - ":destination: " + '::' \ + ':source:__terraform_state_resources' \ + ':destination: ' } -__state_push() { +(( ${+functions[_terraform_state_push]} )) || _terraform_state_push() { _arguments \ - "-force[Write the state even if lineages don't match or the remote serial is higher.]" \ - '-lock=[(true) Lock the state file when locking is supported.]:lock:(true false)' \ - "-lock-timeout=[(0s) Duration to retry a state lock.]" \ - "::" \ - ":destination:_files" + '-force[Write the state even if lineages don'\''t match or the remote serial is higher.]' \ + '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '::' \ + ':destination:_files' } -__state_replace_provider() { +(( ${+functions[_terraform_state_replace-provider]} )) || _terraform_state_replace-provider() { _arguments \ '-auto-approve[Skip interactive approval.]' \ '-backup=[(PATH) Path where Terraform should write the backup for the state file. This can"t be disabled. If not set, Terraform will write it to the same path as the state file with a ".backup" extension.]:backupfile:_files -g "*.backup"' \ - "-lock=[(true) Lock the state files when locking is supported.]:lock:(true false)" \ - "-lock-timeout=[(0s) Duration to retry a state lock.]" \ + '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]' \ '-state=[(PATH) Path to the source state file. Defaults to the configured backend, or "terraform.tfstate"]:statefile:_files -g "*.tfstate"' \ - ":from_provider_fqn:" \ - ":to_provider_fqn:" + '::' \ + ':from_provider_fqn:' \ + ':to_provider_fqn:' } -__state_rm() { +(( ${+functions[_terraform_state_rm]} )) || _terraform_state_rm() { _arguments \ - "-dry-run[If set, prints out what would've been removed but doesn't actually remove anything.]" \ + '-dry-run[If set, prints out what would'\''ve been removed but doesn'\''t actually remove anything.]' \ '-backup=[(PATH) Path where Terraform should write the backup for the original state.]::backupfile:_files -g "*.backup"' \ - "-lock=[(true) Lock the state file when locking is supported.]:lock:(true false)" \ - "-lock-timeout=[(0s) Duration to retry a state lock.]" \ + '-ignore-remote-version[Continue even if remote and local Terraform versions are incompatible. This may result in an unusable workspace, and should be used with extreme caution.]' \ + '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]' \ '-state=[(PATH) Path to the state file to update. Defaults to the current workspace state.]:statefile:_files -g "*.tfstate"' \ - "*:address:__statelist" + '*:address:__terraform_state_resources' } - -__state_show() { +(( ${+functions[_terraform_state_show]} )) || _terraform_state_show() { _arguments \ '-state=[(statefile) Path to a Terraform state file to use to look up Terraform-managed resources. By default it will use the state "terraform.tfstate" if it exists.]:statefile:_files -g "*.tfstate"' \ - "*:address:__statelist" + "*:address:__terraform_state_resources" } -__statelist() { - compadd $(terraform state list $opt_args[-state]) +(( ${+functions[__terraform_state_resources]} )) || __terraform_state_resources() { + local resource + local -a resources + terraform state list -state="${opt_args[-state]}" 2>/dev/null | while read -r resource; do + resources+=( "${resource}" ) + done + compadd "${@}" - "${resources[@]}" } -__taint() { - _arguments \ - '-allow-missing[If specified, the command will succeed (exit code 0) even if the resource is missing.]' \ - '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -g "*.backup"' \ - '-lock=[(true) Lock the state file when locking is supported.]:lock:(true false)' \ - '-lock-timeout=[(0s) Duration to retry a state lock.]' \ - '-module=[(path) The module path where the resource lives. By default this will be root. Child modules can be specified by names. Ex. "consul" or "consul.vpc" (nested modules).]' \ - '-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]:statefile:_files -g "*.tfstate"' \ - '-state-out=[(path) Path to write updated state file. By default, the "-state" path will be used.]:statefile:_files -g "*.tfstate"' \ - "*:address:__statelist" -} - -__untaint() { - _arguments \ +(( ${+functions[_terraform_taint]} )) || _terraform_taint() { + _arguments \ '-allow-missing[If specified, the command will succeed (exit code 0) even if the resource is missing.]' \ '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -g "*.backup"' \ - '-lock=[(true) Lock the state file when locking is supported.]:lock:(true false)' \ + '-ignore-remote-version[A rare option used for the remote backend only. See the remote backend documentation for more information.]' \ + '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ '-lock-timeout=[(0s) Duration to retry a state lock.]' \ - '-module=[(path) The module path where the resource lives. By default this will be root. Child modules can be specified by names. Ex. "consul" or "consul.vpc" (nested modules).]' \ '-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]:statefile:_files -g "*.tfstate"' \ - '-state-out=[(path) Path to write updated state file. By default, the "-state" path will be used.]:statefile:_files -g "*.tfstate"' + '-state-out=[(path) Path to write updated state file. By default, the "-state" path will be used.]:statefile:_files -g "*.tfstate"' \ + '*:address:__terraform_state_resources' } -__validate() { - _arguments \ - '-no-color[If specified, output will not contain any color.]' \ +(( ${+functions[_terraform_test]} )) || _terraform_test() { + _arguments \ + '-cloud-run=[(source) If specified, Terraform will execute this test run remotely using Terraform Cloud. You must specify the source of a module registered in a private module registry as the argument to this flag. This allows Terraform to associate the cloud run with the correct Terraform Cloud module and organization.]' \ + '*-filter=[(testfile) If specified, Terraform will only execute the test files specified by this flag. You can use this option multiple times to execute more than one test file.]:testfile:_files -g "*.tftest.hcl"' \ + '-json[If specified, machine readable output will be printed in JSON format]' \ + '-no-color[If specified, machine readable output will be printed in JSON format]' \ + '-test-directory=[(path) Set the Terraform test directory, defaults to "tests".]:test_directory:_files -/' \ + '*-var=[(for=bar) Set a value for one of the input variables in the root module of the configuration. Use this option more than once to set more than one variable.]' \ + '*-var-file=[(foo) Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.]:file:_files -g "*.tfvars{,.json}"' \ + '-verbose[Print the plan or state for each test run block as it executes.]' \ +} + +(( ${+functions[_terraform_untaint]} )) || _terraform_untaint() { + _arguments \ + '-allow-missing[If specified, the command will succeed (exit code 0) even if the resource is missing.]' \ + '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -g "*.backup"' \ + '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]:statefile:_files -g "*.tfstate"' \ + '-state-out=[(path) Path to write updated state file. By default, the "-state" path will be used.]:statefile:_files -g "*.tfstate"' \ + ':name:__terraform_state_resources' +} + +(( ${+functions[_terraform_validate]} )) || _terraform_validate() { + _arguments \ '-json[Produce output in a machine-readable JSON format, suitable for use in text editor integrations and other automated systems.]' \ + '-no-color[If specified, output will not contain any color.]' \ + '-no-tests[If specified, Terraform will not validate test files.]' \ + '-test-directory=[(path) Set the Terraform test directory, defaults to "tests".]:test_directory:_files -/' \ ':dir:_files -/' } -__version() { - _arguments \ - '-json[Output the version information as a JSON object.]' +(( ${+functions[_terraform_version]} )) || _terraform_version() { + _arguments \ + '-json[Output the version information as a JSON object.]' \ + '::' } -__workspace() { - local -a __workspace_cmds - __workspace_cmds=( - 'delete:Delete a workspace' - 'list:List Workspaces' - 'new:Create a new workspace' - 'select:Select a workspace' - 'show:Show the name of the current workspace' - ) - _describe -t workspace "workspace commands" __workspace_cmds +(( ${+functions[_terraform_workspace]} )) || _terraform_workspace() { + local -a _workspace_cmds + _workspace_cmds=( + 'delete:Delete a workspace' + 'list:List Workspaces' + 'new:Create a new workspace' + 'select:Select a workspace' + 'show:Show the name of the current workspace' + ) + if [[ "${CURRENT}" -lt 3 ]]; then + _describe -t commands "terraform workspace commands" _workspace_cmds + return + fi + + local curcontext="${curcontext}" + cmd="${${_workspace_cmds[(r)$words[2]:*]%%:*}}" + curcontext="${curcontext%:*:*}:terraform-workspace-${cmd}:" + + if (( ${+functions[_terraform_workspace_$cmd]} )); then + "_terraform_workspace_${cmd}" + else + _message "no more options" + fi } -_arguments '*:: :->command' +(( ${+functions[_terraform_workspace_delete]} )) || _terraform_workspace_delete() { + _arguments \ + '-force[Remove a workspace even if it is managing resources. Terraform can no longer track or manage the workspace'\''s infrastructure.]' \ + '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '::' \ + ':name:__terraform_workspaces' +} -if (( CURRENT == 1 )); then - _describe -t commands "terraform command" _terraform_cmds - return +(( ${+functions[_terraform_workspace_list]} )) || _terraform_workspace_list() { + _arguments +} + +(( ${+functions[_terraform_workspace_new]} )) || _terraform_workspace_new() { + _arguments \ + '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-state=[(path) Copy an existing state file into the new workspace.]:statefile:_files -g "*.tfstate"' \ + '::' \ + ':name:' +} + +(( ${+functions[_terraform_workspace_select]} )) || _terraform_workspace_select() { + _arguments \ + '-or-create=[(false) Create the Terraform workspace if it doesn'\''t exist.]:or_create:(true false)' \ + '::' \ + ':name:__terraform_workspaces' +} + +(( ${+functions[_terraform_workspace_show]} )) || _terraform_workspace_show() { + _arguments +} + +(( ${+functions[__terraform_workspaces]} )) || __terraform_workspaces() { + local workspace + local -a workspaces + terraform workspace list | while read -r workspace; do + if [[ -z "${workspace}" ]]; then + continue + fi + workspaces+=( "${workspace#[ *] }" ) + done + compadd "${@}" - "${workspaces[@]}" +} + +_terraform() { + _arguments \ + '-chdir=[(DIR) Switch to a different working directory before executing the given subcommand.]:chdir:_files -/' \ + '-help[Show this help output, or the help for a specified subcommand.]' \ + '-version[An alias for the "version" subcommand.]' \ + '*::terraform command:_terraform_commands' +} + +# don't run the completion function when being source-ed or eval-ed +if [ "${funcstack[1]}" = '_terraform' ]; then + _terraform fi - -local -a _command_args -case "$words[1]" in - 0.12upgrade) - __012upgrade ;; - 0.13upgrade) - __013upgrade ;; - apply) - __apply ;; - console) - __console;; - destroy) - __destroy ;; - fmt) - __fmt;; - force-unlock) - __force_unlock;; - get) - __get ;; - graph) - __graph ;; - import) - __import;; - init) - __init ;; - login) - __login ;; - logout) - __logout ;; - output) - __output ;; - plan) - __plan ;; - providers) - test $CURRENT -lt 3 && __providers - [[ $words[2] = "mirror" ]] && __providers_mirror - [[ $words[2] = "schema" ]] && __providers_schema - ;; - refresh) - __refresh ;; - show) - __show ;; - state) - test $CURRENT -lt 3 && __state - [[ $words[2] = "list" ]] && __state_list - [[ $words[2] = "mv" ]] && __state_mv - [[ $words[2] = "push" ]] && __state_push - [[ $words[2] = "replace-provider" ]] && __state_replace_provider - [[ $words[2] = "rm" ]] && __state_rm - [[ $words[2] = "show" ]] && __state_show - ;; - taint) - __taint ;; - untaint) - __untaint ;; - validate) - __validate ;; - version) - __version ;; - workspace) - test $CURRENT -lt 3 && __workspace ;; -esac From 12cd3b3e399d39b2b458fdd8f1f6286250253476 Mon Sep 17 00:00:00 2001 From: Robert Crews Date: Sun, 3 Mar 2024 04:04:19 -0800 Subject: [PATCH 062/453] feat(python): add auto venv activation (#12248) Co-authored-by: Carlo Sala --- plugins/python/README.md | 16 +++++++++++++--- plugins/python/python.plugin.zsh | 23 +++++++++++++++++++---- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/plugins/python/README.md b/plugins/python/README.md index 7bf1b34ac..c99697b22 100644 --- a/plugins/python/README.md +++ b/plugins/python/README.md @@ -22,8 +22,18 @@ plugins=(... python) ## Virtual environments -The plugin provides two utilities to manage Python venvs: +The plugin provides three utilities to manage Python 3.3+ [venv](https://docs.python.org/3/library/venv.html) +virtual environments: -- `mkv [name]`: make a new virtual environment called `name` (default: `venv`) in current directory. +- `mkv [name]`: make a new virtual environment called `name` (default: if set `$PYTHON_VENV_NAME`, else + `venv`) in the current directory. -- `vrun [name]`: activate virtual environment called `name` (default: `venv`) in current directory. +- `vrun [name]`: Activate the virtual environment called `name` (default: if set `$PYTHON_VENV_NAME`, else + `venv`) in the current directory. + +- `auto_vrun`: Automatically activate the venv virtual environment when entering a directory containing + `/bin/activate`, and automatically deactivate it when navigating out of it (including + subdirectories!). + - To enable the feature, set `export PYTHON_AUTO_VRUN=true` before sourcing oh-my-zsh. + - The default virtual environment name is `venv`. To use a different name, set + `export PYTHON_VENV_NAME=`. For example: `export PYTHON_VENV_NAME=".venv"` diff --git a/plugins/python/python.plugin.zsh b/plugins/python/python.plugin.zsh index 77d4bf425..f6ea85027 100644 --- a/plugins/python/python.plugin.zsh +++ b/plugins/python/python.plugin.zsh @@ -51,11 +51,12 @@ alias pyserver="python3 -m http.server" ## venv utilities +: ${PYTHON_VENV_NAME:=venv} # Activate a the python virtual environment specified. -# If none specified, use 'venv'. +# If none specified, use $PYTHON_VENV_NAME, else 'venv'. function vrun() { - local name="${1:-venv}" + local name="${1:-$PYTHON_VENV_NAME}" local venvpath="${name:P}" if [[ ! -d "$venvpath" ]]; then @@ -72,12 +73,26 @@ function vrun() { echo "Activated virtual environment ${name}" } -# Create a new virtual environment, with default name 'venv'. +# Create a new virtual environment using the specified name. +# If none specfied, use $PYTHON_VENV_NAME function mkv() { - local name="${1:-venv}" + local name="${1:-$PYTHON_VENV_NAME}" local venvpath="${name:P}" python3 -m venv "${name}" || return echo >&2 "Created venv in '${venvpath}'" vrun "${name}" } + +if [[ "$PYTHON_AUTO_VRUN" == "true" ]]; then + # Automatically activate venv when changing dir + auto_vrun() { + if [[ -f "${PYTHON_VENV_NAME}/bin/activate" ]]; then + source "${PYTHON_VENV_NAME}/bin/activate" > /dev/null 2>&1 + else + (( $+functions[deactivate] )) && deactivate > /dev/null 2>&1 + fi + } + add-zsh-hook chpwd auto_vrun + auto_vrun +fi From f17aa2ffa8c12b71518f1b0233edca3a0dd7cade Mon Sep 17 00:00:00 2001 From: Maxime Brunet Date: Sun, 3 Mar 2024 20:22:41 +0000 Subject: [PATCH 063/453] fix(terraform): pass `-chdir` to completion commands (#12254) --- plugins/terraform/_terraform | 166 +++++++++++++++++++---------------- 1 file changed, 91 insertions(+), 75 deletions(-) diff --git a/plugins/terraform/_terraform b/plugins/terraform/_terraform index aad1c6096..f72f3e552 100644 --- a/plugins/terraform/_terraform +++ b/plugins/terraform/_terraform @@ -29,7 +29,7 @@ compdef _terraform terraform 'version:Show the current Terraform version' 'workspace:Workspace management' ) - if ((CURRENT == 1)); then + if (( CURRENT == 1 )); then _describe -t commands 'terraform commands' _terraform_cmds return fi @@ -38,6 +38,8 @@ compdef _terraform terraform cmd="${${_terraform_cmds[(r)$words[1]:*]%%:*}}" curcontext="${curcontext%:*:*}:terraform-${cmd}:" + local __chdir="${opt_args[-chdir]:-.}" + if (( ${+functions[_terraform_$cmd]} )); then "_terraform_${cmd}" else @@ -48,7 +50,7 @@ compdef _terraform terraform (( ${+functions[_terraform_apply]} )) || _terraform_apply() { _arguments \ '-auto-approve[Skip interactive approval of plan before applying.]' \ - '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -g "*.backup"' \ + '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -W __chdir -g "*.backup"' \ '-compact-warnings[If Terraform produces any warnings that are not accompanied by errors, show them in a more compact form that includes only the summary messages.]' \ '-destroy[Destroy Terraform-managed infrastructure. The command "terraform destroy" is a convenience alias for this option.]' \ '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ @@ -58,12 +60,12 @@ compdef _terraform terraform '-parallelism=[(10) Limit the number of parallel resource operations.]' \ '-refresh=[(true) Skip checking for external changes to remote objects while creating the plan. This can potentially make planning faster, but at the expense of possibly planning against a stale record of the remote system state.]:refresh:(true false)' \ '*-replace=[(resource) Force replacement of a particular resource instance using its resource address. If applying would'\''ve normally produced an update or no-op action for this instance, Terraform will replace it instead. You can use this option multiple times to replace more than one object.]:resource:__terraform_state_resources' \ - '-state=[(terraform.tfstate) Path to read and save state (unless state-out is specified).]:statefile:_files -g "*.tfstate"' \ - '-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]:statefile:_files -g "*.tfstate"' \ + '-state=[(terraform.tfstate) Path to read and save state (unless state-out is specified).]:statefile:_files -W __chdir -g "*.tfstate"' \ + '-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]:statefile:_files -W __chdir -g "*.tfstate"' \ '*-target=[(resource) Limit the operation to only the given module, resource, or resource instance and all of its dependencies. You can use this option multiple times to include more than one object. This is for exceptional use only.]:target:__terraform_state_resources' \ '*-var=[(for=bar) Set a value for one of the input variables in the root module of the configuration. Use this option more than once to set more than one variable.]' \ - '*-var-file=[(foo) Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.]:file:_files -g "*.tfvars{,.json}"' \ - ':plan:_files -' + '*-var-file=[(foo) Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.]:file:_files -W __chdir -g "*.tfvars{,.json}"' \ + ':plan:_files -W __chdir -' } (( ${+functions[_terraform_console]} )) || _terraform_console() { @@ -71,13 +73,13 @@ compdef _terraform terraform '-state=[(terraform.tfstate) Legacy option for the local backend only. See the local backend'\''s documentation for more information.]' \ '-plan[Create a new plan (as if running "terraform plan") and then evaluate expressions against its planned state, instead of evaluating against the current state. You can use this to inspect the effects of configuration changes that haven'\''t been applied yet.]' \ '*-var=[(for=bar) Set a variable in the Terraform configuration. This flag can be set multiple times.]' \ - '*-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]:file:_files -g "*.tfvars{,.json}"' + '*-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]:file:_files -W __chdir -g "*.tfvars{,.json}"' } (( ${+functions[_terraform_destroy]} )) || _terraform_destroy() { _arguments \ '-auto-approve[Skip interactive approval of plan before applying.]' \ - '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -g "*.backup"' \ + '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -W __chdir -g "*.backup"' \ '-compact-warnings[If Terraform produces any warnings that are not accompanied by errors, show them in a more compact form that includes only the summary messages.]' \ '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ '-lock-timeout=[(0s) Duration to retry a state lock.]' \ @@ -85,11 +87,11 @@ compdef _terraform terraform '-no-color[If specified, output won'\''t contain any color.]' \ '-parallelism=[(10) Limit the number of parallel resource operations.]' \ '-refresh=[(true) Update state prior to checking for differences. This has no effect if a plan file is given to apply.]:refresh:(true false)' \ - '-state=[(terraform.tfstate) Path to read and save state (unless state-out is specified).]:statefile:_files -g "*.tfstate"' \ - '-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]:statefile:_files -g "*.tfstate"' \ + '-state=[(terraform.tfstate) Path to read and save state (unless state-out is specified).]:statefile:_files -W __chdir -g "*.tfstate"' \ + '-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]:statefile:_files -W __chdir -g "*.tfstate"' \ '*-target=[(resource) Limit the operation to only the given module, resource, or resource instance and all of its dependencies. You can use this option multiple times to include more than one object. This is for exceptional use only.]:target:__terraform_state_resources' \ '*-var=[(for=bar) Set a value for one of the input variables in the root module of the configuration. Use this option more than once to set more than one variable.]' \ - '*-var-file=[(foo) Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.]:file:_files -g "*.tfvars{,.json}"' + '*-var-file=[(foo) Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.]:file:_files -W __chdir -g "*.tfvars{,.json}"' } (( ${+functions[_terraform_fmt]} )) || _terraform_fmt() { @@ -100,7 +102,7 @@ compdef _terraform terraform '-check[Check if the input is formatted. Exit status will be 0 if all input is properly formatted and non-zero otherwise.]' \ '-no-color[If specified, output won'\''t contain any color.]' \ '-recursive[Also process files in subdirectories. By default, only the given directory (or current directory) is processed.]' \ - '*:targets:_files -' + '*:targets:_files -W __chdir -' } (( ${+functions[_terraform_force-unlock]} )) || _terraform_force-unlock() { @@ -113,29 +115,29 @@ compdef _terraform terraform _arguments \ '-update[Check already-downloaded modules for available updates and install the newest versions available.]' \ '-no-color[Disable text coloring in the output.]' \ - '-test-directory=[(tests) Set the Terraform test directory, defaults to "tests".]:test_directory:_files -/' + '-test-directory=[(tests) Set the Terraform test directory, defaults to "tests".]:test_directory:_files -W __chdir -/' } (( ${+functions[_terraform_graph]} )) || _terraform_graph() { _arguments \ '-draw-cycles[Highlight any cycles in the graph with colored edges. This helps when diagnosing cycle errors. This option is supported only when illustrating a real evaluation graph, selected using the -type=TYPE option.]' \ '-module-depth=[(-1) (deprecated) In prior versions of Terraform, specified the depth of modules to show in the output.]' \ - '-plan=[Render graph using the specified plan file instead of the configuration in the current directory. Implies -type=apply.]:plan:_files -' \ + '-plan=[Render graph using the specified plan file instead of the configuration in the current directory. Implies -type=apply.]:plan:_files -W __chdir -' \ '-type=[(plan) Type of operation graph to output. Can be: plan, plan-refresh-only, plan-destroy, or apply. By default Terraform just summarizes the relationships between the resources in your configuration, without any particular operation in mind. Full operation graphs are more detailed but therefore often harder to read.]:type:(plan plan-refresh-only plan-destroy apply)' } (( ${+functions[_terraform_import]} )) || _terraform_import() { _arguments \ - '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -g "*.backup"' \ - '-config=[(path) Path to a directory of Terraform configuration files to use to configure the provider. Defaults to pwd. If no config files are present, they must be provided via the input prompts or env vars.]:config:_files -/' \ + '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -W __chdir -g "*.backup"' \ + '-config=[(path) Path to a directory of Terraform configuration files to use to configure the provider. Defaults to pwd. If no config files are present, they must be provided via the input prompts or env vars.]:config:_files -W __chdir -/' \ '-input=[(true) Disable interactive input prompts.]:input:(true false)' \ '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ '-lock-timeout=[(0s) Duration to retry a state lock.]' \ '-no-color[If specified, output will contain no color.]' \ - '-state=[(PATH) Path to the source state file. Defaults to the configured backend, or "terraform.tfstate"]:statefile:_files -g "*.tfstate"' \ - '-state-out=[(PATH) Path to the destination state file to write to. If this is not specified, the source state file will be used. This can be a new or existing path.]:statefile:_files -g "*.tfstate"' \ + '-state=[(PATH) Path to the source state file. Defaults to the configured backend, or "terraform.tfstate"]:statefile:_files -W __chdir -g "*.tfstate"' \ + '-state-out=[(PATH) Path to the destination state file to write to. If this is not specified, the source state file will be used. This can be a new or existing path.]:statefile:_files -W __chdir -g "*.tfstate"' \ '*-var=[(for=bar) Set a variable in the Terraform configuration. This flag can be set multiple times. This is only useful with the "-config" flag.]' \ - '*-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]:file:_files -g "*.tfvars{,.json}"' \ + '*-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]:file:_files -W __chdir -g "*.tfvars{,.json}"' \ ':addr:' \ ':id:' } @@ -143,21 +145,21 @@ compdef _terraform terraform (( ${+functions[_terraform_init]} )) || _terraform_init() { _arguments \ '-backend=[(true) Disable backend or Terraform Cloud initialization for this configuration and use what was previously initialized instead.]:backend:(true false)' \ - '-backend-config=[Configuration to be merged with what is in the configuration file'\''s '\''backend'\'' block. This can be either a path to an HCL file with key/value assignments (same format as terraform.tfvars) or a '\''key=value'\'' format, and can be specified multiple times. The backend type must be in the configuration itself.]:backend_config:_files -' \ + '-backend-config=[Configuration to be merged with what is in the configuration file'\''s '\''backend'\'' block. This can be either a path to an HCL file with key/value assignments (same format as terraform.tfvars) or a '\''key=value'\'' format, and can be specified multiple times. The backend type must be in the configuration itself.]:backend_config:_files -W __chdir -' \ '-force-copy[Suppress prompts about copying state data. This is equivalent to providing a "yes" to all confirmation prompts.]' \ - '-from-module=[Copy the contents of the given module into the target directory before initialization.]:from_module:_files -/' \ + '-from-module=[Copy the contents of the given module into the target directory before initialization.]:from_module:_files -W __chdir -/' \ '-get=[(true) Disable downloading modules for this configuration.]:get:(true false)' \ '-input=[(true) Disable interactive prompts. Note that some actions may require interactive prompts and will error if input is disabled.]:input:(true false)' \ '-lock=[(true) Don'\''t hold a state lock during backend migration. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ '-lock-timeout=[(0s) Duration to retry a state lock.]' \ '-no-color[If specified, output will contain no color.]' \ - '-plugin-dir[Directory containing plugin binaries. This overrides all default search paths for plugins, and prevents the automatic installation of plugins. This flag can be used multiple times.]:plugin_dir:_files -/' \ + '-plugin-dir[Directory containing plugin binaries. This overrides all default search paths for plugins, and prevents the automatic installation of plugins. This flag can be used multiple times.]:plugin_dir:_files -W __chdir -/' \ '-reconfigure[Reconfigure the backend, ignoring any saved configuration.]' \ '-migrate-state[Reconfigure a backend, and attempt to migrate any existing state.]' \ '-upgrade[Install the latest module and provider versions allowed within configured constraints, overriding the default behavior of selecting exactly the version recorded in the dependency lockfile.]' \ '-lockfile=[Set a dependency lockfile mode. Currently only "readonly" is valid.]:lockfile:( readonly )' \ '-ignore-remote-version[A rare option used for Terraform Cloud and the remote backend only. Set this to ignore checking that the local and remote Terraform versions use compatible state representations, making an operation proceed even when there is a potential mismatch. See the documentation on configuring Terraform with Terraform Cloud for more information.]' \ - '-test-directory=[(tests) Set the Terraform test directory, defaults to "tests".]:test_directory:_files -/' + '-test-directory=[(tests) Set the Terraform test directory, defaults to "tests".]:test_directory:_files -W __chdir -/' } (( ${+functions[_terraform_login]} )) || _terraform_login() { @@ -171,17 +173,22 @@ compdef _terraform terraform } (( ${+functions[_terraform_metadata]} )) || _terraform_metadata() { + _arguments \ + '*::terraform metadata command:_terraform_metadata_commands' +} + +(( ${+functions[_terraform_metadata_commands]} )) || _terraform_metadata_commands() { local -a _metadata_cmds _metadata_cmds=( 'functions:Show signatures and descriptions for the available functions' ) - if [[ "${CURRENT}" -lt 3 ]]; then + if (( CURRENT == 1 )); then _describe -t commands "terraform metadata commands" _metadata_cmds return fi local curcontext="${curcontext}" - cmd="${${_metadata_cmds[(r)$words[2]:*]%%:*}}" + cmd="${${_metadata_cmds[(r)$words[1]:*]%%:*}}" curcontext="${curcontext%:*:*}:terraform-metadata-${cmd}:" if (( ${+functions[_terraform_metadata_$cmd]} )); then @@ -193,13 +200,12 @@ compdef _terraform terraform (( ${+functions[_terraform_metadata_functions]} )) || _terraform_metadata_functions() { _arguments \ - '-json' \ - '::' + '-json[]' } (( ${+functions[_terraform_output]} )) || _terraform_output() { _arguments \ - '-state=[(path) Path to the state file to read. Defaults to "terraform.tfstate". Ignored when remote state is used.]:statefile:_files -g "*.tfstate"' \ + '-state=[(path) Path to the state file to read. Defaults to "terraform.tfstate". Ignored when remote state is used.]:statefile:_files -W __chdir -g "*.tfstate"' \ '-no-color[If specified, output will contain no color.]' \ '-json[If specified, machine readable output will be printed in JSON format]' \ '-raw[For value types that can be automatically converted to a string, will print the raw string directly, rather than a human-oriented representation of the value.]' \ @@ -221,31 +227,32 @@ compdef _terraform terraform '-refresh=[(true) Skip checking for external changes to remote objects while creating the plan. This can potentially make planning faster, but at the expense of possibly planning against a stale record of the remote system state.]:refresh:(true false)' \ '-refresh-only[Select the "refresh only" planning mode, which checks whether remote objects still match the outcome of the most recent Terraform apply but does not propose any actions to undo any changes made outside of Terraform.]' \ '*-replace=[(resource) Force replacement of a particular resource instance using its resource address. If the plan would'\''ve normally produced an update or no-op action for this instance, Terraform will plan to replace it instead. You can use this option multiple times to replace more than one object.]:replace:__terraform_state_resources' \ - '-state=[(statefile) Path to a Terraform state file to use to look up Terraform-managed resources. By default it will use the state "terraform.tfstate" if it exists.]:statefile:_files -g "*.tfstate"' \ + '-state=[(statefile) Path to a Terraform state file to use to look up Terraform-managed resources. By default it will use the state "terraform.tfstate" if it exists.]:statefile:_files -W __chdir -g "*.tfstate"' \ '*-target=[(resource) Limit the planning operation to only the given module, resource, or resource instance and all of its dependencies. You can use this option multiple times to include more than one object. This is for exceptional use only.]:target:__terraform_state_resources' \ '*-var=[(for=bar) Set a value for one of the input variables in the root module of the configuration. Use this option more than once to set more than one variable.]' \ - '*-var-file=[(foo) Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.]:file:_files -g "*.tfvars{,.json}"' + '*-var-file=[(foo) Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.]:file:_files -W __chdir -g "*.tfvars{,.json}"' } (( ${+functions[_terraform_providers]} )) || _terraform_providers() { + _arguments \ + '-test-directory=[(path) Set the Terraform test directory, defaults to "tests".]:test_directory:_files -W __chdir -/' \ + '*::terraform providers command:_terraform_providers_commands' +} + +(( ${+functions[_terraform_providers_commands]} )) || _terraform_providers_commands() { local -a _providers_cmds _providers_cmds=( 'lock:Write out dependency locks for the configured providers' 'mirror:Save local copies of all required provider plugins' 'schema:Show schemas for the providers used in the configuration' ) - - if [[ "${CURRENT}" -lt 3 ]]; then - _arguments \ - '-test-directory=[(path) Set the Terraform test directory, defaults to "tests".]:test_directory:_files -/' \ - '*:: :->command' - + if (( CURRENT == 1 )); then _describe -t commands "terraform providers commands" _providers_cmds return fi local curcontext="${curcontext}" - cmd="${${_providers_cmds[(r)$words[2]:*]%%:*}}" + cmd="${${_providers_cmds[(r)$words[1]:*]%%:*}}" curcontext="${curcontext%:*:*}:terraform-providers-${cmd}:" if (( ${+functions[_terraform_providers_$cmd]} )); then @@ -257,7 +264,7 @@ compdef _terraform terraform (( ${+functions[_terraform_providers_lock]} )) || _terraform_providers_lock() { _arguments \ - '-fs-mirror=[(dir) Consult the given filesystem mirror directory instead of the origin registry for each of the given providers.]:fs_mirror:_files -/' \ + '-fs-mirror=[(dir) Consult the given filesystem mirror directory instead of the origin registry for each of the given providers.]:fs_mirror:_files -W __chdir -/' \ '-net-mirror=[(url) Consult the given network mirror (given as a base URL) instead of the origin registry for each of the given providers.]' \ '*-platform=[(os_arch) Choose a target platform to request package checksums for.]' \ '*:provider:' @@ -267,39 +274,43 @@ compdef _terraform terraform _arguments \ '*-platform=[(os_arch) Choose which target platform to build a mirror for.]' \ '::' \ - ':target_dir:_files -/' + ':target_dir:_files -W __chdir -/' } (( ${+functions[_terraform_providers_schema]} )) || _terraform_providers_schema() { _arguments \ - '-json[]' \ - '::' + '-json[]' } (( ${+functions[_terraform_refresh]} )) || _terraform_refresh() { _arguments \ - '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]::backupfile:_files -g "*.backup"' \ + '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]::backupfile:_files -W __chdir -g "*.backup"' \ '-compact-warnings[If Terraform produces any warnings that are not accompanied by errors, show them in a more compact form that includes only the summary messages.]' \ '-input=[(true) Ask for input for variables if not directly set.]:input:(true false)' \ '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ '-lock-timeout=[(0s) Duration to retry a state lock.]' \ '-no-color[If specified, output will not contain any color.]' \ '-parallelism=[(10) Limit the number of parallel resource operations.]' \ - '-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]:statefile:_files -g "*.tfstate"' \ - '-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]:statefile:_files -g "*.tfstate"' \ + '-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]:statefile:_files -W __chdir -g "*.tfstate"' \ + '-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]:statefile:_files -W __chdir -g "*.tfstate"' \ '*-target=[(resource) A Resource Address to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]:target:__terraform_state_resources' \ '*-var=[(for=bar) Set a variable in the Terraform configuration. This flag can be set multiple times.]' \ - '*-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]:file:_files -g "*.tfvars{,.json}"' + '*-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]:file:_files -W __chdir -g "*.tfvars{,.json}"' } (( ${+functions[_terraform_show]} )) || _terraform_show() { _arguments \ '-json[If specified, output the Terraform plan or state in a machine-readable form.]' \ '-no-color[If specified, output will not contain any color.]' \ - ':path:_files -g "*.tfstate"' + ':path:_files -W __chdir -g "*.tfstate"' } (( ${+functions[_terraform_state]} )) || _terraform_state() { + _arguments \ + '*::terraform state command:_terraform_state_commands' +} + +(( ${+functions[_terraform_state_commands]} )) || _terraform_state_commands() { local -a _state_cmds _state_cmds=( 'list:List resources in the state' @@ -310,13 +321,13 @@ compdef _terraform terraform 'rm:Remove instances from the state' 'show:Show a resource in the state' ) - if [[ "${CURRENT}" -lt 3 ]]; then + if (( CURRENT == 1 )); then _describe -t commands "terraform state commands" _state_cmds return fi local curcontext="${curcontext}" - cmd="${${_state_cmds[(r)$words[2]:*]%%:*}}" + cmd="${${_state_cmds[(r)$words[1]:*]%%:*}}" curcontext="${curcontext%:*:*}:terraform-state-${cmd}:" if (( ${+functions[_terraform_state_$cmd]} )); then @@ -328,7 +339,7 @@ compdef _terraform terraform (( ${+functions[_terraform_state_list]} )) || _terraform_state_list() { _arguments \ - '-state=[(statefile) Path to a Terraform state file to use to look up Terraform-managed resources. By default, Terraform will consult the state of the currently-selected workspace.]:statefile:_files -g "*.tfstate"' \ + '-state=[(statefile) Path to a Terraform state file to use to look up Terraform-managed resources. By default, Terraform will consult the state of the currently-selected workspace.]:statefile:_files -W __chdir -g "*.tfstate"' \ '-id=[(id) Filters the results to include only instances whose resource types have an attribute named id whose value equals the given id string.]' \ '*:address:__terraform_state_resources' } @@ -336,13 +347,13 @@ compdef _terraform terraform (( ${+functions[_terraform_state_mv]} )) || _terraform_state_mv() { _arguments \ '-dry-run[If set, prints out what would'\''ve been moved but doesn'\''t actually move anything.]' \ - '-backup=[(PATH) Path where Terraform should write the backup for the original state. This can"t be disabled. If not set, Terraform will write it to the same path as the statefile with a ".backup" extension.]:backupfile:_files -g "*.backup"' \ - '-backup-out=[(PATH) Path where Terraform should write the backup for the destination state. This can"t be disabled. If not set, Terraform will write it to the same path as the destination state file with a backup extension. This only needs to be specified if -state-out is set to a different path than -state.]:backupfile:_files -g "*.backup"' \ + '-backup=[(PATH) Path where Terraform should write the backup for the original state. This can"t be disabled. If not set, Terraform will write it to the same path as the statefile with a ".backup" extension.]:backupfile:_files -W __chdir -g "*.backup"' \ + '-backup-out=[(PATH) Path where Terraform should write the backup for the destination state. This can"t be disabled. If not set, Terraform will write it to the same path as the destination state file with a backup extension. This only needs to be specified if -state-out is set to a different path than -state.]:backupfile:_files -W __chdir -g "*.backup"' \ '-ignore-remote-version[A rare option used for the remote backend only. See the remote backend documentation for more information.]' \ '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ '-lock-timeout=[(0s) Duration to retry a state lock.]' \ - '-state=[(path) Path to the source state file. Defaults to the configured backend, or "terraform.tfstate"]:statefile:_files -g "*.tfstate"' \ - '-state-out=[(path) Path to the destination state file to write to. If this isn"t specified, the source state file will be used. This can be a new or existing path.]:statefile:_files -g "*.tfstate"' \ + '-state=[(path) Path to the source state file. Defaults to the configured backend, or "terraform.tfstate"]:statefile:_files -W __chdir -g "*.tfstate"' \ + '-state-out=[(path) Path to the destination state file to write to. If this isn"t specified, the source state file will be used. This can be a new or existing path.]:statefile:_files -W __chdir -g "*.tfstate"' \ '::' \ ':source:__terraform_state_resources' \ ':destination: ' @@ -360,10 +371,10 @@ compdef _terraform terraform (( ${+functions[_terraform_state_replace-provider]} )) || _terraform_state_replace-provider() { _arguments \ '-auto-approve[Skip interactive approval.]' \ - '-backup=[(PATH) Path where Terraform should write the backup for the state file. This can"t be disabled. If not set, Terraform will write it to the same path as the state file with a ".backup" extension.]:backupfile:_files -g "*.backup"' \ + '-backup=[(PATH) Path where Terraform should write the backup for the state file. This can"t be disabled. If not set, Terraform will write it to the same path as the state file with a ".backup" extension.]:backupfile:_files -W __chdir -g "*.backup"' \ '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ '-lock-timeout=[(0s) Duration to retry a state lock.]' \ - '-state=[(PATH) Path to the source state file. Defaults to the configured backend, or "terraform.tfstate"]:statefile:_files -g "*.tfstate"' \ + '-state=[(PATH) Path to the source state file. Defaults to the configured backend, or "terraform.tfstate"]:statefile:_files -W __chdir -g "*.tfstate"' \ '::' \ ':from_provider_fqn:' \ ':to_provider_fqn:' @@ -372,24 +383,24 @@ compdef _terraform terraform (( ${+functions[_terraform_state_rm]} )) || _terraform_state_rm() { _arguments \ '-dry-run[If set, prints out what would'\''ve been removed but doesn'\''t actually remove anything.]' \ - '-backup=[(PATH) Path where Terraform should write the backup for the original state.]::backupfile:_files -g "*.backup"' \ + '-backup=[(PATH) Path where Terraform should write the backup for the original state.]::backupfile:_files -W __chdir -g "*.backup"' \ '-ignore-remote-version[Continue even if remote and local Terraform versions are incompatible. This may result in an unusable workspace, and should be used with extreme caution.]' \ '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ '-lock-timeout=[(0s) Duration to retry a state lock.]' \ - '-state=[(PATH) Path to the state file to update. Defaults to the current workspace state.]:statefile:_files -g "*.tfstate"' \ + '-state=[(PATH) Path to the state file to update. Defaults to the current workspace state.]:statefile:_files -W __chdir -g "*.tfstate"' \ '*:address:__terraform_state_resources' } (( ${+functions[_terraform_state_show]} )) || _terraform_state_show() { _arguments \ - '-state=[(statefile) Path to a Terraform state file to use to look up Terraform-managed resources. By default it will use the state "terraform.tfstate" if it exists.]:statefile:_files -g "*.tfstate"' \ + '-state=[(statefile) Path to a Terraform state file to use to look up Terraform-managed resources. By default it will use the state "terraform.tfstate" if it exists.]:statefile:_files -W __chdir -g "*.tfstate"' \ "*:address:__terraform_state_resources" } (( ${+functions[__terraform_state_resources]} )) || __terraform_state_resources() { local resource local -a resources - terraform state list -state="${opt_args[-state]}" 2>/dev/null | while read -r resource; do + terraform -chdir="${__chdir}" state list -state="${opt_args[-state]}" 2>/dev/null | while read -r resource; do resources+=( "${resource}" ) done compadd "${@}" - "${resources[@]}" @@ -398,35 +409,35 @@ compdef _terraform terraform (( ${+functions[_terraform_taint]} )) || _terraform_taint() { _arguments \ '-allow-missing[If specified, the command will succeed (exit code 0) even if the resource is missing.]' \ - '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -g "*.backup"' \ + '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -W __chdir -g "*.backup"' \ '-ignore-remote-version[A rare option used for the remote backend only. See the remote backend documentation for more information.]' \ '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ '-lock-timeout=[(0s) Duration to retry a state lock.]' \ - '-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]:statefile:_files -g "*.tfstate"' \ - '-state-out=[(path) Path to write updated state file. By default, the "-state" path will be used.]:statefile:_files -g "*.tfstate"' \ + '-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]:statefile:_files -W __chdir -g "*.tfstate"' \ + '-state-out=[(path) Path to write updated state file. By default, the "-state" path will be used.]:statefile:_files -W __chdir -g "*.tfstate"' \ '*:address:__terraform_state_resources' } (( ${+functions[_terraform_test]} )) || _terraform_test() { _arguments \ '-cloud-run=[(source) If specified, Terraform will execute this test run remotely using Terraform Cloud. You must specify the source of a module registered in a private module registry as the argument to this flag. This allows Terraform to associate the cloud run with the correct Terraform Cloud module and organization.]' \ - '*-filter=[(testfile) If specified, Terraform will only execute the test files specified by this flag. You can use this option multiple times to execute more than one test file.]:testfile:_files -g "*.tftest.hcl"' \ + '*-filter=[(testfile) If specified, Terraform will only execute the test files specified by this flag. You can use this option multiple times to execute more than one test file.]:testfile:_files -W __chdir -g "*.tftest.hcl"' \ '-json[If specified, machine readable output will be printed in JSON format]' \ '-no-color[If specified, machine readable output will be printed in JSON format]' \ - '-test-directory=[(path) Set the Terraform test directory, defaults to "tests".]:test_directory:_files -/' \ + '-test-directory=[(path) Set the Terraform test directory, defaults to "tests".]:test_directory:_files -W __chdir -/' \ '*-var=[(for=bar) Set a value for one of the input variables in the root module of the configuration. Use this option more than once to set more than one variable.]' \ - '*-var-file=[(foo) Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.]:file:_files -g "*.tfvars{,.json}"' \ + '*-var-file=[(foo) Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.]:file:_files -W __chdir -g "*.tfvars{,.json}"' \ '-verbose[Print the plan or state for each test run block as it executes.]' \ } (( ${+functions[_terraform_untaint]} )) || _terraform_untaint() { _arguments \ '-allow-missing[If specified, the command will succeed (exit code 0) even if the resource is missing.]' \ - '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -g "*.backup"' \ + '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -W __chdir -g "*.backup"' \ '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ '-lock-timeout=[(0s) Duration to retry a state lock.]' \ - '-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]:statefile:_files -g "*.tfstate"' \ - '-state-out=[(path) Path to write updated state file. By default, the "-state" path will be used.]:statefile:_files -g "*.tfstate"' \ + '-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]:statefile:_files -W __chdir -g "*.tfstate"' \ + '-state-out=[(path) Path to write updated state file. By default, the "-state" path will be used.]:statefile:_files -W __chdir -g "*.tfstate"' \ ':name:__terraform_state_resources' } @@ -435,8 +446,8 @@ compdef _terraform terraform '-json[Produce output in a machine-readable JSON format, suitable for use in text editor integrations and other automated systems.]' \ '-no-color[If specified, output will not contain any color.]' \ '-no-tests[If specified, Terraform will not validate test files.]' \ - '-test-directory=[(path) Set the Terraform test directory, defaults to "tests".]:test_directory:_files -/' \ - ':dir:_files -/' + '-test-directory=[(path) Set the Terraform test directory, defaults to "tests".]:test_directory:_files -W __chdir -/' \ + ':dir:_files -W __chdir -/' } (( ${+functions[_terraform_version]} )) || _terraform_version() { @@ -446,6 +457,11 @@ compdef _terraform terraform } (( ${+functions[_terraform_workspace]} )) || _terraform_workspace() { + _arguments \ + '*::terraform workspace command:_terraform_workspace_commands' +} + +(( ${+functions[_terraform_workspace_commands]} )) || _terraform_workspace_commands() { local -a _workspace_cmds _workspace_cmds=( 'delete:Delete a workspace' @@ -454,13 +470,13 @@ compdef _terraform terraform 'select:Select a workspace' 'show:Show the name of the current workspace' ) - if [[ "${CURRENT}" -lt 3 ]]; then + if (( CURRENT == 1 )); then _describe -t commands "terraform workspace commands" _workspace_cmds return fi local curcontext="${curcontext}" - cmd="${${_workspace_cmds[(r)$words[2]:*]%%:*}}" + cmd="${${_workspace_cmds[(r)$words[1]:*]%%:*}}" curcontext="${curcontext%:*:*}:terraform-workspace-${cmd}:" if (( ${+functions[_terraform_workspace_$cmd]} )); then @@ -487,7 +503,7 @@ compdef _terraform terraform _arguments \ '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ '-lock-timeout=[(0s) Duration to retry a state lock.]' \ - '-state=[(path) Copy an existing state file into the new workspace.]:statefile:_files -g "*.tfstate"' \ + '-state=[(path) Copy an existing state file into the new workspace.]:statefile:_files -W __chdir -g "*.tfstate"' \ '::' \ ':name:' } @@ -506,7 +522,7 @@ compdef _terraform terraform (( ${+functions[__terraform_workspaces]} )) || __terraform_workspaces() { local workspace local -a workspaces - terraform workspace list | while read -r workspace; do + terraform -chdir="${__chdir}" workspace list | while read -r workspace; do if [[ -z "${workspace}" ]]; then continue fi @@ -517,7 +533,7 @@ compdef _terraform terraform _terraform() { _arguments \ - '-chdir=[(DIR) Switch to a different working directory before executing the given subcommand.]:chdir:_files -/' \ + '-chdir=[(DIR) Switch to a different working directory before executing the given subcommand.]:chdir:_files -W __chdir -/' \ '-help[Show this help output, or the help for a specified subcommand.]' \ '-version[An alias for the "version" subcommand.]' \ '*::terraform command:_terraform_commands' From da16258c5c261606d56836c0fce77188515a6c0e Mon Sep 17 00:00:00 2001 From: Maxime Brunet Date: Mon, 4 Mar 2024 07:28:00 +0000 Subject: [PATCH 064/453] fix(terraform): fix completion repeating flags with value (#12256) --- plugins/terraform/_terraform | 68 ++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/plugins/terraform/_terraform b/plugins/terraform/_terraform index f72f3e552..157495814 100644 --- a/plugins/terraform/_terraform +++ b/plugins/terraform/_terraform @@ -54,25 +54,25 @@ compdef _terraform terraform '-compact-warnings[If Terraform produces any warnings that are not accompanied by errors, show them in a more compact form that includes only the summary messages.]' \ '-destroy[Destroy Terraform-managed infrastructure. The command "terraform destroy" is a convenience alias for this option.]' \ '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ - '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]:lock_timeout:' \ '-input=[(true) Ask for input for variables if not directly set.]:input:(true false)' \ '-no-color[If specified, output won'\''t contain any color.]' \ - '-parallelism=[(10) Limit the number of parallel resource operations.]' \ + '-parallelism=[(10) Limit the number of parallel resource operations.]:parallelism:' \ '-refresh=[(true) Skip checking for external changes to remote objects while creating the plan. This can potentially make planning faster, but at the expense of possibly planning against a stale record of the remote system state.]:refresh:(true false)' \ '*-replace=[(resource) Force replacement of a particular resource instance using its resource address. If applying would'\''ve normally produced an update or no-op action for this instance, Terraform will replace it instead. You can use this option multiple times to replace more than one object.]:resource:__terraform_state_resources' \ '-state=[(terraform.tfstate) Path to read and save state (unless state-out is specified).]:statefile:_files -W __chdir -g "*.tfstate"' \ '-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]:statefile:_files -W __chdir -g "*.tfstate"' \ '*-target=[(resource) Limit the operation to only the given module, resource, or resource instance and all of its dependencies. You can use this option multiple times to include more than one object. This is for exceptional use only.]:target:__terraform_state_resources' \ - '*-var=[(for=bar) Set a value for one of the input variables in the root module of the configuration. Use this option more than once to set more than one variable.]' \ + '*-var=[(for=bar) Set a value for one of the input variables in the root module of the configuration. Use this option more than once to set more than one variable.]:var:' \ '*-var-file=[(foo) Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.]:file:_files -W __chdir -g "*.tfvars{,.json}"' \ ':plan:_files -W __chdir -' } (( ${+functions[_terraform_console]} )) || _terraform_console() { _arguments \ - '-state=[(terraform.tfstate) Legacy option for the local backend only. See the local backend'\''s documentation for more information.]' \ + '-state=[(terraform.tfstate) Legacy option for the local backend only. See the local backend'\''s documentation for more information.]:statefile:_files -W __chdir -g "*.tfstate"' \ '-plan[Create a new plan (as if running "terraform plan") and then evaluate expressions against its planned state, instead of evaluating against the current state. You can use this to inspect the effects of configuration changes that haven'\''t been applied yet.]' \ - '*-var=[(for=bar) Set a variable in the Terraform configuration. This flag can be set multiple times.]' \ + '*-var=[(for=bar) Set a variable in the Terraform configuration. This flag can be set multiple times.]:var:' \ '*-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]:file:_files -W __chdir -g "*.tfvars{,.json}"' } @@ -82,15 +82,15 @@ compdef _terraform terraform '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -W __chdir -g "*.backup"' \ '-compact-warnings[If Terraform produces any warnings that are not accompanied by errors, show them in a more compact form that includes only the summary messages.]' \ '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ - '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]:lock_timeout:' \ '-input=[(true) Ask for input for variables if not directly set.]:input:(true false)' \ '-no-color[If specified, output won'\''t contain any color.]' \ - '-parallelism=[(10) Limit the number of parallel resource operations.]' \ + '-parallelism=[(10) Limit the number of parallel resource operations.]:parallelism:' \ '-refresh=[(true) Update state prior to checking for differences. This has no effect if a plan file is given to apply.]:refresh:(true false)' \ '-state=[(terraform.tfstate) Path to read and save state (unless state-out is specified).]:statefile:_files -W __chdir -g "*.tfstate"' \ '-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]:statefile:_files -W __chdir -g "*.tfstate"' \ '*-target=[(resource) Limit the operation to only the given module, resource, or resource instance and all of its dependencies. You can use this option multiple times to include more than one object. This is for exceptional use only.]:target:__terraform_state_resources' \ - '*-var=[(for=bar) Set a value for one of the input variables in the root module of the configuration. Use this option more than once to set more than one variable.]' \ + '*-var=[(for=bar) Set a value for one of the input variables in the root module of the configuration. Use this option more than once to set more than one variable.]:var:' \ '*-var-file=[(foo) Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.]:file:_files -W __chdir -g "*.tfvars{,.json}"' } @@ -121,7 +121,7 @@ compdef _terraform terraform (( ${+functions[_terraform_graph]} )) || _terraform_graph() { _arguments \ '-draw-cycles[Highlight any cycles in the graph with colored edges. This helps when diagnosing cycle errors. This option is supported only when illustrating a real evaluation graph, selected using the -type=TYPE option.]' \ - '-module-depth=[(-1) (deprecated) In prior versions of Terraform, specified the depth of modules to show in the output.]' \ + '-module-depth=[(-1) (deprecated) In prior versions of Terraform, specified the depth of modules to show in the output.]:module_depth:' \ '-plan=[Render graph using the specified plan file instead of the configuration in the current directory. Implies -type=apply.]:plan:_files -W __chdir -' \ '-type=[(plan) Type of operation graph to output. Can be: plan, plan-refresh-only, plan-destroy, or apply. By default Terraform just summarizes the relationships between the resources in your configuration, without any particular operation in mind. Full operation graphs are more detailed but therefore often harder to read.]:type:(plan plan-refresh-only plan-destroy apply)' } @@ -132,11 +132,11 @@ compdef _terraform terraform '-config=[(path) Path to a directory of Terraform configuration files to use to configure the provider. Defaults to pwd. If no config files are present, they must be provided via the input prompts or env vars.]:config:_files -W __chdir -/' \ '-input=[(true) Disable interactive input prompts.]:input:(true false)' \ '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ - '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]:lock_timeout:' \ '-no-color[If specified, output will contain no color.]' \ '-state=[(PATH) Path to the source state file. Defaults to the configured backend, or "terraform.tfstate"]:statefile:_files -W __chdir -g "*.tfstate"' \ '-state-out=[(PATH) Path to the destination state file to write to. If this is not specified, the source state file will be used. This can be a new or existing path.]:statefile:_files -W __chdir -g "*.tfstate"' \ - '*-var=[(for=bar) Set a variable in the Terraform configuration. This flag can be set multiple times. This is only useful with the "-config" flag.]' \ + '*-var=[(for=bar) Set a variable in the Terraform configuration. This flag can be set multiple times. This is only useful with the "-config" flag.]:var:' \ '*-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]:file:_files -W __chdir -g "*.tfvars{,.json}"' \ ':addr:' \ ':id:' @@ -151,7 +151,7 @@ compdef _terraform terraform '-get=[(true) Disable downloading modules for this configuration.]:get:(true false)' \ '-input=[(true) Disable interactive prompts. Note that some actions may require interactive prompts and will error if input is disabled.]:input:(true false)' \ '-lock=[(true) Don'\''t hold a state lock during backend migration. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ - '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]:lock_timeout:' \ '-no-color[If specified, output will contain no color.]' \ '-plugin-dir[Directory containing plugin binaries. This overrides all default search paths for plugins, and prevents the automatic installation of plugins. This flag can be used multiple times.]:plugin_dir:_files -W __chdir -/' \ '-reconfigure[Reconfigure the backend, ignoring any saved configuration.]' \ @@ -218,18 +218,18 @@ compdef _terraform terraform '-destroy[Select the "destroy" planning mode, which creates a plan to destroy all objects currently managed by this Terraform configuration instead of the usual behavior.]' \ '-detailed-exitcode[Return detailed exit codes when the command exits. This will change the meaning of exit codes to: 0 - Succeeded, diff is empty (no changes); 1 - Errored, 2 - Succeeded; there is a diff]' \ '-input=[(true) Ask for input for variables if not directly set.]:input:(true false)' \ - '-generate-config-out=[(path) (Experimental) If import blocks are present in configuration, instructs Terraform to generate HCL for any imported resources not already present. The configuration is written to a new file at PATH, which must not already exist. Terraform may still attempt to write configuration if the plan errors.]' \ + '-generate-config-out=[(path) (Experimental) If import blocks are present in configuration, instructs Terraform to generate HCL for any imported resources not already present. The configuration is written to a new file at PATH, which must not already exist. Terraform may still attempt to write configuration if the plan errors.]:generate_config_out:' \ '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ - '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]:lock_timeout:' \ '-no-color[If specified, output will contain no color.]' \ - '-out=[(path) Write a plan file to the given path. This can be used as input to the "apply" command.]' \ - '-parallelism=[(10) Limit the number of concurrent operations.]' \ + '-out=[(path) Write a plan file to the given path. This can be used as input to the "apply" command.]:out:' \ + '-parallelism=[(10) Limit the number of concurrent operations.]:parallelism:' \ '-refresh=[(true) Skip checking for external changes to remote objects while creating the plan. This can potentially make planning faster, but at the expense of possibly planning against a stale record of the remote system state.]:refresh:(true false)' \ '-refresh-only[Select the "refresh only" planning mode, which checks whether remote objects still match the outcome of the most recent Terraform apply but does not propose any actions to undo any changes made outside of Terraform.]' \ '*-replace=[(resource) Force replacement of a particular resource instance using its resource address. If the plan would'\''ve normally produced an update or no-op action for this instance, Terraform will plan to replace it instead. You can use this option multiple times to replace more than one object.]:replace:__terraform_state_resources' \ '-state=[(statefile) Path to a Terraform state file to use to look up Terraform-managed resources. By default it will use the state "terraform.tfstate" if it exists.]:statefile:_files -W __chdir -g "*.tfstate"' \ '*-target=[(resource) Limit the planning operation to only the given module, resource, or resource instance and all of its dependencies. You can use this option multiple times to include more than one object. This is for exceptional use only.]:target:__terraform_state_resources' \ - '*-var=[(for=bar) Set a value for one of the input variables in the root module of the configuration. Use this option more than once to set more than one variable.]' \ + '*-var=[(for=bar) Set a value for one of the input variables in the root module of the configuration. Use this option more than once to set more than one variable.]:var:' \ '*-var-file=[(foo) Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.]:file:_files -W __chdir -g "*.tfvars{,.json}"' } @@ -265,14 +265,14 @@ compdef _terraform terraform (( ${+functions[_terraform_providers_lock]} )) || _terraform_providers_lock() { _arguments \ '-fs-mirror=[(dir) Consult the given filesystem mirror directory instead of the origin registry for each of the given providers.]:fs_mirror:_files -W __chdir -/' \ - '-net-mirror=[(url) Consult the given network mirror (given as a base URL) instead of the origin registry for each of the given providers.]' \ - '*-platform=[(os_arch) Choose a target platform to request package checksums for.]' \ + '-net-mirror=[(url) Consult the given network mirror (given as a base URL) instead of the origin registry for each of the given providers.]:net_mirror:' \ + '*-platform=[(os_arch) Choose a target platform to request package checksums for.]:platform:' \ '*:provider:' } (( ${+functions[_terraform_providers_mirror]} )) || _terraform_providers_mirror() { _arguments \ - '*-platform=[(os_arch) Choose which target platform to build a mirror for.]' \ + '*-platform=[(os_arch) Choose which target platform to build a mirror for.]:platform:' \ '::' \ ':target_dir:_files -W __chdir -/' } @@ -288,13 +288,13 @@ compdef _terraform terraform '-compact-warnings[If Terraform produces any warnings that are not accompanied by errors, show them in a more compact form that includes only the summary messages.]' \ '-input=[(true) Ask for input for variables if not directly set.]:input:(true false)' \ '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ - '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]:lock_timeout:' \ '-no-color[If specified, output will not contain any color.]' \ - '-parallelism=[(10) Limit the number of parallel resource operations.]' \ + '-parallelism=[(10) Limit the number of parallel resource operations.]:parallelism:' \ '-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]:statefile:_files -W __chdir -g "*.tfstate"' \ '-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]:statefile:_files -W __chdir -g "*.tfstate"' \ '*-target=[(resource) A Resource Address to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]:target:__terraform_state_resources' \ - '*-var=[(for=bar) Set a variable in the Terraform configuration. This flag can be set multiple times.]' \ + '*-var=[(for=bar) Set a variable in the Terraform configuration. This flag can be set multiple times.]:var:' \ '*-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]:file:_files -W __chdir -g "*.tfvars{,.json}"' } @@ -340,7 +340,7 @@ compdef _terraform terraform (( ${+functions[_terraform_state_list]} )) || _terraform_state_list() { _arguments \ '-state=[(statefile) Path to a Terraform state file to use to look up Terraform-managed resources. By default, Terraform will consult the state of the currently-selected workspace.]:statefile:_files -W __chdir -g "*.tfstate"' \ - '-id=[(id) Filters the results to include only instances whose resource types have an attribute named id whose value equals the given id string.]' \ + '-id=[(id) Filters the results to include only instances whose resource types have an attribute named id whose value equals the given id string.]:id:' \ '*:address:__terraform_state_resources' } @@ -351,7 +351,7 @@ compdef _terraform terraform '-backup-out=[(PATH) Path where Terraform should write the backup for the destination state. This can"t be disabled. If not set, Terraform will write it to the same path as the destination state file with a backup extension. This only needs to be specified if -state-out is set to a different path than -state.]:backupfile:_files -W __chdir -g "*.backup"' \ '-ignore-remote-version[A rare option used for the remote backend only. See the remote backend documentation for more information.]' \ '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ - '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]:lock_timeout:' \ '-state=[(path) Path to the source state file. Defaults to the configured backend, or "terraform.tfstate"]:statefile:_files -W __chdir -g "*.tfstate"' \ '-state-out=[(path) Path to the destination state file to write to. If this isn"t specified, the source state file will be used. This can be a new or existing path.]:statefile:_files -W __chdir -g "*.tfstate"' \ '::' \ @@ -363,7 +363,7 @@ compdef _terraform terraform _arguments \ '-force[Write the state even if lineages don'\''t match or the remote serial is higher.]' \ '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ - '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]:lock_timeout:' \ '::' \ ':destination:_files' } @@ -373,7 +373,7 @@ compdef _terraform terraform '-auto-approve[Skip interactive approval.]' \ '-backup=[(PATH) Path where Terraform should write the backup for the state file. This can"t be disabled. If not set, Terraform will write it to the same path as the state file with a ".backup" extension.]:backupfile:_files -W __chdir -g "*.backup"' \ '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ - '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]:lock_timeout:' \ '-state=[(PATH) Path to the source state file. Defaults to the configured backend, or "terraform.tfstate"]:statefile:_files -W __chdir -g "*.tfstate"' \ '::' \ ':from_provider_fqn:' \ @@ -386,7 +386,7 @@ compdef _terraform terraform '-backup=[(PATH) Path where Terraform should write the backup for the original state.]::backupfile:_files -W __chdir -g "*.backup"' \ '-ignore-remote-version[Continue even if remote and local Terraform versions are incompatible. This may result in an unusable workspace, and should be used with extreme caution.]' \ '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ - '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]:lock_timeout:' \ '-state=[(PATH) Path to the state file to update. Defaults to the current workspace state.]:statefile:_files -W __chdir -g "*.tfstate"' \ '*:address:__terraform_state_resources' } @@ -412,7 +412,7 @@ compdef _terraform terraform '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -W __chdir -g "*.backup"' \ '-ignore-remote-version[A rare option used for the remote backend only. See the remote backend documentation for more information.]' \ '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ - '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]:lock_timeout:' \ '-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]:statefile:_files -W __chdir -g "*.tfstate"' \ '-state-out=[(path) Path to write updated state file. By default, the "-state" path will be used.]:statefile:_files -W __chdir -g "*.tfstate"' \ '*:address:__terraform_state_resources' @@ -420,12 +420,12 @@ compdef _terraform terraform (( ${+functions[_terraform_test]} )) || _terraform_test() { _arguments \ - '-cloud-run=[(source) If specified, Terraform will execute this test run remotely using Terraform Cloud. You must specify the source of a module registered in a private module registry as the argument to this flag. This allows Terraform to associate the cloud run with the correct Terraform Cloud module and organization.]' \ + '-cloud-run=[(source) If specified, Terraform will execute this test run remotely using Terraform Cloud. You must specify the source of a module registered in a private module registry as the argument to this flag. This allows Terraform to associate the cloud run with the correct Terraform Cloud module and organization.]:cloud_run:' \ '*-filter=[(testfile) If specified, Terraform will only execute the test files specified by this flag. You can use this option multiple times to execute more than one test file.]:testfile:_files -W __chdir -g "*.tftest.hcl"' \ '-json[If specified, machine readable output will be printed in JSON format]' \ '-no-color[If specified, machine readable output will be printed in JSON format]' \ '-test-directory=[(path) Set the Terraform test directory, defaults to "tests".]:test_directory:_files -W __chdir -/' \ - '*-var=[(for=bar) Set a value for one of the input variables in the root module of the configuration. Use this option more than once to set more than one variable.]' \ + '*-var=[(for=bar) Set a value for one of the input variables in the root module of the configuration. Use this option more than once to set more than one variable.]:var:' \ '*-var-file=[(foo) Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.]:file:_files -W __chdir -g "*.tfvars{,.json}"' \ '-verbose[Print the plan or state for each test run block as it executes.]' \ } @@ -435,7 +435,7 @@ compdef _terraform terraform '-allow-missing[If specified, the command will succeed (exit code 0) even if the resource is missing.]' \ '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -W __chdir -g "*.backup"' \ '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ - '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]:lock_timeout:' \ '-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]:statefile:_files -W __chdir -g "*.tfstate"' \ '-state-out=[(path) Path to write updated state file. By default, the "-state" path will be used.]:statefile:_files -W __chdir -g "*.tfstate"' \ ':name:__terraform_state_resources' @@ -490,7 +490,7 @@ compdef _terraform terraform _arguments \ '-force[Remove a workspace even if it is managing resources. Terraform can no longer track or manage the workspace'\''s infrastructure.]' \ '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ - '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]:lock_timeout:' \ '::' \ ':name:__terraform_workspaces' } @@ -502,7 +502,7 @@ compdef _terraform terraform (( ${+functions[_terraform_workspace_new]} )) || _terraform_workspace_new() { _arguments \ '-lock=[(true) Don'\''t hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace.]:lock:(true false)' \ - '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]:lock_timeout:' \ '-state=[(path) Copy an existing state file into the new workspace.]:statefile:_files -W __chdir -g "*.tfstate"' \ '::' \ ':name:' From 0ea0d14288d68aba026d47517009233846c7b409 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Mon, 4 Mar 2024 10:47:34 +0100 Subject: [PATCH 065/453] fix(nvm): remove zsh completion We rely on official bash completion now on. --- plugins/nvm/_nvm | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 plugins/nvm/_nvm diff --git a/plugins/nvm/_nvm b/plugins/nvm/_nvm deleted file mode 100644 index e292a8d8c..000000000 --- a/plugins/nvm/_nvm +++ /dev/null @@ -1,34 +0,0 @@ -#compdef nvm -#autoload - -[[ -f "$NVM_DIR/nvm.sh" ]] || return 0 - -local -a _1st_arguments -_1st_arguments=( - 'help:show help' - '--version:print out the latest released version of nvm' - 'install:download and install a version in ' - 'install-latest-npm:download and install the latest npm version' - 'uninstall:uninstall a version' - 'use:modify PATH to use . Uses .nvmrc if available' - 'exec:run on . Uses .nvmrc if available' - 'run:run `node` on with as arguments. Uses .nvmrc if available' - 'current:list installed versions' - 'ls:list installed versions or versions matching a given description' - 'version:resolve the given description to a single local version' - 'version-remote:resolve the given description to a single remote version' - 'ls-remote:list remote versions available for install' - 'deactivate:undo effects of `nvm` on current shell' - 'alias:show or set aliases' - 'unalias:deletes an alias' - 'reinstall-packages:reinstall global `npm` packages contained in to current version' - 'unload:unload `nvm` from shell' - 'which:display path to installed node version. Uses .nvmrc if available' -) - -_arguments -C '*:: :->subcmds' && return 0 - -if (( CURRENT == 1 )); then - _describe -t commands "nvm subcommand" _1st_arguments - return -fi From 94aa49c0b96fed98d2751107301c16f32de13383 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Mon, 4 Mar 2024 11:02:37 +0100 Subject: [PATCH 066/453] feat(nvm)!: make `lazy` and `autoload` options compatible BREAKING CHANGE: Prior to this commit, if `lazy` and `autoload` options were enabled at the same time, `lazy` was getting overriden and only `autoload` was taken into account. Now they work together and `autoload` will be enabled after `nvm` has been lazy-loaded. Closes #11690 --- plugins/nvm/README.md | 3 +- plugins/nvm/nvm.plugin.zsh | 95 +++++++++++++++++++++----------------- 2 files changed, 54 insertions(+), 44 deletions(-) diff --git a/plugins/nvm/README.md b/plugins/nvm/README.md index b5ef221d3..e88ce0158 100644 --- a/plugins/nvm/README.md +++ b/plugins/nvm/README.md @@ -43,8 +43,7 @@ zstyle ':omz:plugins:nvm' lazy-cmd eslint prettier typescript ... #### `.nvmrc` autoload -Note: _this option cannot be used at the same time as `lazy`. `autoload` will override it and load `nvm` at -startup._ +Note: _if used at the same time as `lazy`, `autoload` will start working only after nvm has been lazy-loaded_ If set, the plugin will automatically load a node version when if finds a [`.nvmrc` file](https://github.com/nvm-sh/nvm#nvmrc) in the current working directory indicating which node diff --git a/plugins/nvm/nvm.plugin.zsh b/plugins/nvm/nvm.plugin.zsh index 94b666175..084b4846f 100644 --- a/plugins/nvm/nvm.plugin.zsh +++ b/plugins/nvm/nvm.plugin.zsh @@ -1,3 +1,7 @@ +# Don't try to load nvm if command already available +# Note: nvm is a function so we need to use `which` +which nvm &>/dev/null && return + # See https://github.com/nvm-sh/nvm#installation-and-update if [[ -z "$NVM_DIR" ]]; then if [[ -d "$HOME/.nvm" ]]; then @@ -12,39 +16,34 @@ if [[ -z "$NVM_DIR" ]]; then fi fi -# Don't try to load nvm if command already available -# Note: nvm is a function so we need to use `which` -which nvm &>/dev/null && return - if [[ -z "$NVM_DIR" ]] || [[ ! -f "$NVM_DIR/nvm.sh" ]]; then return fi -if zstyle -t ':omz:plugins:nvm' lazy && \ - ! zstyle -t ':omz:plugins:nvm' autoload; then - # Call nvm when first using nvm, node, npm, pnpm, yarn or other commands in lazy-cmd - zstyle -a ':omz:plugins:nvm' lazy-cmd nvm_lazy_cmd - nvm_lazy_cmd=(nvm node npm npx pnpm yarn $nvm_lazy_cmd) # default values - eval " - function $nvm_lazy_cmd { - for func in $nvm_lazy_cmd; do - if (( \$+functions[\$func] )); then - unfunction \$func - fi - done - # Load nvm if it exists in \$NVM_DIR - [[ -f \"\$NVM_DIR/nvm.sh\" ]] && source \"\$NVM_DIR/nvm.sh\" - \"\$0\" \"\$@\" - } - " - unset nvm_lazy_cmd -else - source "$NVM_DIR/nvm.sh" -fi +function _omz_load_nvm_completion { + local _nvm_completion + # Load nvm bash completion + for _nvm_completion in "$NVM_DIR/bash_completion" "$NVM_HOMEBREW/etc/bash_completion.d/nvm"; do + if [[ -f "$_nvm_completion" ]]; then + # Load bashcompinit + autoload -U +X bashcompinit && bashcompinit + # Bypass compinit call in nvm bash completion script. See: + # https://github.com/nvm-sh/nvm/blob/4436638/bash_completion#L86-L93 + ZSH_VERSION= source "$_nvm_completion" + break + fi + done + unfunction _omz_load_nvm_completion +} -# Autoload nvm when finding a .nvmrc file in the current directory -# Adapted from: https://github.com/nvm-sh/nvm#zsh -if zstyle -t ':omz:plugins:nvm' autoload; then +function _omz_setup_autoload { + if ! zstyle -t ':omz:plugins:nvm' autoload; then + unfunction _omz_setup_autoload + return + fi + + # Autoload nvm when finding a .nvmrc file in the current directory + # Adapted from: https://github.com/nvm-sh/nvm#zsh function load-nvmrc { local node_version="$(nvm version)" local nvmrc_path="$(nvm_find_nvmrc)" @@ -72,18 +71,30 @@ if zstyle -t ':omz:plugins:nvm' autoload; then add-zsh-hook chpwd load-nvmrc load-nvmrc + unfunction _omz_setup_autoload +} + +if zstyle -t ':omz:plugins:nvm' lazy; then + # Call nvm when first using nvm, node, npm, pnpm, yarn or other commands in lazy-cmd + zstyle -a ':omz:plugins:nvm' lazy-cmd nvm_lazy_cmd + nvm_lazy_cmd=(nvm node npm npx pnpm yarn $nvm_lazy_cmd) # default values + eval " + function $nvm_lazy_cmd { + for func in $nvm_lazy_cmd; do + if (( \$+functions[\$func] )); then + unfunction \$func + fi + done + # Load nvm if it exists in \$NVM_DIR + [[ -f \"\$NVM_DIR/nvm.sh\" ]] && source \"\$NVM_DIR/nvm.sh\" + _omz_load_nvm_completion + _omz_setup_autoload + \"\$0\" \"\$@\" + } + " + unset nvm_lazy_cmd +else + source "$NVM_DIR/nvm.sh" + _omz_load_nvm_completion + _omz_setup_autoload fi - -# Load nvm bash completion -for nvm_completion in "$NVM_DIR/bash_completion" "$NVM_HOMEBREW/etc/bash_completion.d/nvm"; do - if [[ -f "$nvm_completion" ]]; then - # Load bashcompinit - autoload -U +X bashcompinit && bashcompinit - # Bypass compinit call in nvm bash completion script. See: - # https://github.com/nvm-sh/nvm/blob/4436638/bash_completion#L86-L93 - ZSH_VERSION= source "$nvm_completion" - break - fi -done - -unset NVM_HOMEBREW nvm_completion From fd01fd66ce27c669e5ffaea94460a37423d1e134 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Mon, 4 Mar 2024 11:08:49 +0100 Subject: [PATCH 067/453] perf(nvm): don't call `nvm version` on every cd Now we only call `nvm version` in case we changed directory and we are not anymore in a `.nvmrc` directory. See https://github.com/nvm-sh/nvm/pull/2874 --- plugins/nvm/nvm.plugin.zsh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/nvm/nvm.plugin.zsh b/plugins/nvm/nvm.plugin.zsh index 084b4846f..6a5afecfa 100644 --- a/plugins/nvm/nvm.plugin.zsh +++ b/plugins/nvm/nvm.plugin.zsh @@ -45,7 +45,6 @@ function _omz_setup_autoload { # Autoload nvm when finding a .nvmrc file in the current directory # Adapted from: https://github.com/nvm-sh/nvm#zsh function load-nvmrc { - local node_version="$(nvm version)" local nvmrc_path="$(nvm_find_nvmrc)" local nvm_silent="" zstyle -t ':omz:plugins:nvm' silent-autoload && nvm_silent="--silent" @@ -58,10 +57,8 @@ function _omz_setup_autoload { elif [[ "$nvmrc_node_version" != "$node_version" ]]; then nvm use $nvm_silent fi - elif [[ "$node_version" != "$(nvm version default)" ]]; then - if [[ -z $nvm_silent ]]; then - echo "Reverting to nvm default version" - fi + elif [[ -n "$(PWD=$OLDPWD nvm_find_nvmrc)" ]] && [[ "$(nvm version)" != "$(nvm version default)" ]]; then + [[ -z $nvm_silent ]] && echo "Reverting to nvm default version" nvm use default $nvm_silent fi From 2a71aa50170db6892abb3e173ba425c554744b37 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Thu, 7 Mar 2024 02:47:15 -0600 Subject: [PATCH 068/453] chore(gitfast): remove update script (#12262) Co-authored-by: Carlo Sala --- .github/dependencies.yml | 2 +- plugins/gitfast/README.md | 6 ------ plugins/gitfast/gitfast.plugin.zsh | 2 +- plugins/gitfast/update | 8 -------- 4 files changed, 2 insertions(+), 16 deletions(-) delete mode 100755 plugins/gitfast/update diff --git a/.github/dependencies.yml b/.github/dependencies.yml index 12beaecbb..d60ab2c92 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -2,7 +2,7 @@ dependencies: plugins/gitfast: repo: felipec/git-completion branch: master - version: tag:v2.0 + version: tag:v2.1 postcopy: | set -e rm -rf git-completion.plugin.zsh Makefile README.adoc t tools diff --git a/plugins/gitfast/README.md b/plugins/gitfast/README.md index fed4b120a..60b84a23c 100644 --- a/plugins/gitfast/README.md +++ b/plugins/gitfast/README.md @@ -7,9 +7,3 @@ To use it, add `gitfast` to the plugins array in your zshrc file: ```zsh plugins=(... gitfast) ``` - -## Aliases - -An earlier version of the plugin also loaded the git plugin. If you want to keep those -aliases enable the [git plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git) -as well. diff --git a/plugins/gitfast/gitfast.plugin.zsh b/plugins/gitfast/gitfast.plugin.zsh index a6db0c6bd..c456eff7f 100644 --- a/plugins/gitfast/gitfast.plugin.zsh +++ b/plugins/gitfast/gitfast.plugin.zsh @@ -1,6 +1,6 @@ # 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}}" +0="${ZERO:-${${0:#$ZSH_ARGZERO}:-${(%):-%N}}}" 0="${${(M)0:#/*}:-$PWD/$0}" source "${0:A:h}/git-prompt.sh" diff --git a/plugins/gitfast/update b/plugins/gitfast/update deleted file mode 100755 index feb13ff7e..000000000 --- a/plugins/gitfast/update +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -url="https://raw.githubusercontent.com/felipec/git-completion" -version="1.3.7" - -curl -s -o _git "${url}/v${version}/git-completion.zsh" && -curl -s -o git-completion.bash "${url}/v${version}/git-completion.bash" && -curl -s -o git-prompt.sh "${url}/v${version}/git-prompt.sh" From 4fca7ccb55eb4904f515806ffca51d27ee1cc670 Mon Sep 17 00:00:00 2001 From: Ross Williams Date: Thu, 7 Mar 2024 03:54:43 -0500 Subject: [PATCH 069/453] feat(tools): update `supports_hyperlinks` (#12258) Update to https://github.com/zkat/supports-hyperlinks/releases/tag/v3.0.0 --- tools/changelog.sh | 11 ++++++++--- tools/install.sh | 11 ++++++++--- tools/upgrade.sh | 11 ++++++++--- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/tools/changelog.sh b/tools/changelog.sh index 3ad8fe786..c4b26079e 100755 --- a/tools/changelog.sh +++ b/tools/changelog.sh @@ -221,11 +221,16 @@ supports_hyperlinks() { # If $TERM_PROGRAM is set, these terminals support hyperlinks case "$TERM_PROGRAM" in - Hyper|iTerm.app|terminology|WezTerm) return 0 ;; + Hyper|iTerm.app|terminology|WezTerm|vscode) return 0 ;; esac - # kitty supports hyperlinks - if [ "$TERM" = xterm-kitty ]; then + # These termcap entries support hyperlinks + case "$TERM" in + xterm-kitty|alacritty|alacritty-direct) return 0 ;; + esac + + # xfce4-terminal supports hyperlinks + if [ "$COLORTERM" = "xfce4-terminal" ]; then return 0 fi diff --git a/tools/install.sh b/tools/install.sh index 508fc2f77..e3613a28b 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -166,11 +166,16 @@ supports_hyperlinks() { # If $TERM_PROGRAM is set, these terminals support hyperlinks case "$TERM_PROGRAM" in - Hyper|iTerm.app|terminology|WezTerm) return 0 ;; + Hyper|iTerm.app|terminology|WezTerm|vscode) return 0 ;; esac - # kitty supports hyperlinks - if [ "$TERM" = xterm-kitty ]; then + # These termcap entries support hyperlinks + case "$TERM" in + xterm-kitty|alacritty|alacritty-direct) return 0 ;; + esac + + # xfce4-terminal supports hyperlinks + if [ "$COLORTERM" = "xfce4-terminal" ]; then return 0 fi diff --git a/tools/upgrade.sh b/tools/upgrade.sh index f7a263d66..d7016aa44 100755 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -90,11 +90,16 @@ supports_hyperlinks() { # If $TERM_PROGRAM is set, these terminals support hyperlinks case "$TERM_PROGRAM" in - Hyper|iTerm.app|terminology|WezTerm) return 0 ;; + Hyper|iTerm.app|terminology|WezTerm|vscode) return 0 ;; esac - # kitty supports hyperlinks - if [ "$TERM" = xterm-kitty ]; then + # These termcap entries support hyperlinks + case "$TERM" in + xterm-kitty|alacritty|alacritty-direct) return 0 ;; + esac + + # xfce4-terminal supports hyperlinks + if [ "$COLORTERM" = "xfce4-terminal" ]; then return 0 fi From 083cc2c8e8742bab8cce8c73a3e96f398e6b2da7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 7 Mar 2024 14:39:05 +0100 Subject: [PATCH 070/453] feat(async)!: implement async prompt API and apply to git prompt (#12257) BREAKING CHANGE: the `git_prompt_info` prompt function has been reworked by default to use the new async prompt feature. If you're experiencing issues see #12257. Co-authored-by: Carlo Sala --- lib/async_prompt.zsh | 140 +++++++++++++++++++++++++++++++++++++++++++ lib/git.zsh | 22 ++++++- 2 files changed, 160 insertions(+), 2 deletions(-) create mode 100644 lib/async_prompt.zsh diff --git a/lib/async_prompt.zsh b/lib/async_prompt.zsh new file mode 100644 index 000000000..c6d03328b --- /dev/null +++ b/lib/async_prompt.zsh @@ -0,0 +1,140 @@ +# The async code is taken from +# https://github.com/zsh-users/zsh-autosuggestions/blob/master/src/async.zsh +# https://github.com/woefe/git-prompt.zsh/blob/master/git-prompt.zsh + +zmodload zsh/system + +# For now, async prompt function handlers are set up like so: +# First, define the async function handler and add the function name +# to the _omz_async_functions array: +# +# function _git_prompt_status_async { +# # Do some expensive operation that outputs to stdout +# } +# _omz_register_handler _git_prompt_status_async +# +# Then add a stub prompt function in `$PROMPT` or similar prompt variables, +# which will show the output of "$_OMZ_ASYNC_OUTPUT[handler_name]": +# +# function git_prompt_status { +# echo -n $_OMZ_ASYNC_OUTPUT[_git_prompt_status] +# } +# +# RPROMPT='$(git_prompt_status)' +# +# This API is subject to change and optimization. Rely on it at your own risk. + +function _omz_register_handler { + setopt localoptions noksharrays + typeset -ga _omz_async_functions + # we want to do nothing if there's no $1 function or we already set it up + if [[ -z "$1" ]] || (( ! ${+functions[$1]} )) \ + || (( ${_omz_async_functions[(Ie)$1]} )); then + return + fi + _omz_async_functions+=("$1") + # let's add the hook to async_request if it's not there yet + if (( ! ${precmd_functions[(Ie)_omz_async_request]} )) \ + && (( ${+functions[_omz_async_request]})); then + autoload -Uz add-zsh-hook + add-zsh-hook precmd _omz_async_request + fi +} + +# Set up async handlers and callbacks +function _omz_async_request { + typeset -gA _OMZ_ASYNC_FDS _OMZ_ASYNC_PIDS _OMZ_ASYNC_OUTPUT + + # executor runs a subshell for all async requests based on key + local handler + for handler in ${_omz_async_functions}; do + (( ${+functions[$handler]} )) || continue + + local fd=${_OMZ_ASYNC_FDS[$handler]:--1} + local pid=${_OMZ_ASYNC_PIDS[$handler]:--1} + + # If we've got a pending request, cancel it + if (( fd != -1 && pid != -1 )) && { true <&$fd } 2>/dev/null; then + # Close the file descriptor and remove the handler + exec {fd}<&- + zle -F $fd + + # Zsh will make a new process group for the child process only if job + # control is enabled (MONITOR option) + if [[ -o MONITOR ]]; then + # Send the signal to the process group to kill any processes that may + # have been forked by the async function handler + kill -TERM -$pid 2>/dev/null + else + # Kill just the child process since it wasn't placed in a new process + # group. If the async function handler forked any child processes they may + # be orphaned and left behind. + kill -TERM $pid 2>/dev/null + fi + fi + + # Define global variables to store the file descriptor, PID and output + _OMZ_ASYNC_FDS[$handler]=-1 + _OMZ_ASYNC_PIDS[$handler]=-1 + + # Fork a process to fetch the git status and open a pipe to read from it + exec {fd}< <( + # Tell parent process our PID + builtin echo ${sysparams[pid]} + # Store handler name for callback + builtin echo $handler + # Run the async function handler + $handler + ) + + # Save FD for handler + _OMZ_ASYNC_FDS[$handler]=$fd + + # 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 + + # Save the PID from the handler child process + read pid <&$fd + _OMZ_ASYNC_PIDS[$handler]=$pid + + # When the fd is readable, call the response handler + zle -F "$fd" _omz_async_callback + done +} + +# Called when new data is ready to be read from the pipe +function _omz_async_callback() { + emulate -L zsh + + local fd=$1 # First arg will be fd ready for reading + 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 + + # 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)" + + # Repaint prompt if output has changed + if [[ "$old_output" != "${_OMZ_ASYNC_OUTPUT[$handler]}" ]]; then + zle reset-prompt + zle -R + fi + + # Close the fd + exec {fd}<&- + fi + + # Always remove the handler + zle -F "$fd" + + # Unset global FD variable to prevent closing user created FDs in the precmd hook + _OMZ_ASYNC_FDS[$handler]=-1 + _OMZ_ASYNC_PIDS[$handler]=-1 +} diff --git a/lib/git.zsh b/lib/git.zsh index f049f73c2..6f4823458 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -9,14 +9,18 @@ function __git_prompt_git() { GIT_OPTIONAL_LOCKS=0 command git "$@" } -function git_prompt_info() { +function _omz_git_prompt_status() { # 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 \ - || [[ "$(__git_prompt_git config --get oh-my-zsh.hide-info 2>/dev/null)" == 1 ]]; then + || [[ "$(__git_prompt_git config --get oh-my-zsh.hide-info 2>/dev/null)" == 1 ]]; then return 0 fi + # Get either: + # - the current branch name + # - the tag name if we are on a tag + # - the short SHA of the current commit local ref ref=$(__git_prompt_git symbolic-ref --short HEAD 2> /dev/null) \ || ref=$(__git_prompt_git describe --tags --exact-match HEAD 2> /dev/null) \ @@ -33,6 +37,20 @@ function git_prompt_info() { echo "${ZSH_THEME_GIT_PROMPT_PREFIX}${ref:gs/%/%%}${upstream:gs/%/%%}$(parse_git_dirty)${ZSH_THEME_GIT_PROMPT_SUFFIX}" } +# 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() { + _omz_register_handler _omz_git_prompt_status + if [[ -n "$_OMZ_ASYNC_OUTPUT[_omz_git_prompt_status]" ]]; then + echo -n "$_OMZ_ASYNC_OUTPUT[_omz_git_prompt_status]" + fi + } +else + function git_prompt_info() { + _omz_git_prompt_status + } +fi + # Checks if working tree is dirty function parse_git_dirty() { local STATUS From 32d4389aa6e896b27d9786d142a5c44163104056 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 7 Mar 2024 17:17:27 +0100 Subject: [PATCH 071/453] fix(git): disable temporarely async prompt --- lib/git.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git.zsh b/lib/git.zsh index 6f4823458..8fe999095 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() { _omz_register_handler _omz_git_prompt_status if [[ -n "$_OMZ_ASYNC_OUTPUT[_omz_git_prompt_status]" ]]; then From 06753e8146332aa787857fc5cc41caa2b5f753f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 9 Mar 2024 18:22:35 +0100 Subject: [PATCH 072/453] fix(async): register the git prompt async handler correctly (#12267) This fix conditionally registers the git prompt async handler only if `git_prompt_info` is used anywhere in the prompt variables. This is done in the proper order, so that the async request is processed once the handler has been registered. This fix also passes the return value of the previous command to each of the async handlers, in case they are needed. --- lib/async_prompt.zsh | 12 +++++++++--- lib/git.zsh | 20 +++++++++++++++++++- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/lib/async_prompt.zsh b/lib/async_prompt.zsh index c6d03328b..384e49d33 100644 --- a/lib/async_prompt.zsh +++ b/lib/async_prompt.zsh @@ -5,8 +5,8 @@ zmodload zsh/system # For now, async prompt function handlers are set up like so: -# First, define the async function handler and add the function name -# to the _omz_async_functions array: +# First, define the async function handler and register the handler +# with _omz_register_handler: # # function _git_prompt_status_async { # # Do some expensive operation that outputs to stdout @@ -17,7 +17,7 @@ zmodload zsh/system # which will show the output of "$_OMZ_ASYNC_OUTPUT[handler_name]": # # function git_prompt_status { -# echo -n $_OMZ_ASYNC_OUTPUT[_git_prompt_status] +# echo -n $_OMZ_ASYNC_OUTPUT[_git_prompt_status_async] # } # # RPROMPT='$(git_prompt_status)' @@ -43,6 +43,7 @@ function _omz_register_handler { # Set up async handlers and callbacks function _omz_async_request { + local -i ret=$? typeset -gA _OMZ_ASYNC_FDS _OMZ_ASYNC_PIDS _OMZ_ASYNC_OUTPUT # executor runs a subshell for all async requests based on key @@ -83,6 +84,8 @@ function _omz_async_request { builtin echo ${sysparams[pid]} # Store handler name for callback builtin echo $handler + # Set exit code for the handler if used + (exit $ret) # Run the async function handler $handler ) @@ -138,3 +141,6 @@ function _omz_async_callback() { _OMZ_ASYNC_FDS[$handler]=-1 _OMZ_ASYNC_PIDS[$handler]=-1 } + +autoload -Uz add-zsh-hook +add-zsh-hook precmd _omz_async_request diff --git a/lib/git.zsh b/lib/git.zsh index 8fe999095..96df5589d 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -40,11 +40,29 @@ 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() { - _omz_register_handler _omz_git_prompt_status if [[ -n "$_OMZ_ASYNC_OUTPUT[_omz_git_prompt_status]" ]]; then echo -n "$_OMZ_ASYNC_OUTPUT[_omz_git_prompt_status]" fi } + + # Conditionally register the async handler, only if it's needed in $PROMPT + # 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 + *(\$\(git_prompt_info\)|\`git_prompt_info\`)*) + _omz_register_handler _omz_git_prompt_status + return + ;; + esac + + add-zsh-hook -d precmd _defer_async_git_register + unset -f _defer_async_git_register + } + + # Register the async handler first. This needs to be done before + # the async request prompt is run + precmd_functions=(_defer_async_git_register $precmd_functions) else function git_prompt_info() { _omz_git_prompt_status From 4fd2af0a82e2826317d9551ecd8d5f44553828d7 Mon Sep 17 00:00:00 2001 From: Misaka Date: Sun, 10 Mar 2024 10:16:16 +0800 Subject: [PATCH 073/453] feat(fzf): add default fzf_base for msys2 (#12274) --- plugins/fzf/fzf.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh index b253a23d2..7312e3d26 100644 --- a/plugins/fzf/fzf.plugin.zsh +++ b/plugins/fzf/fzf.plugin.zsh @@ -8,6 +8,7 @@ function fzf_setup_using_base_dir() { "${HOME}/.fzf" "${HOME}/.nix-profile/share/fzf" "${XDG_DATA_HOME:-$HOME/.local/share}/fzf" + "${MSYSTEM_PREFIX}/share/fzf" "/usr/local/opt/fzf" "/opt/homebrew/opt/fzf" "/usr/share/fzf" From 1cc41576d4d2ffe2f63bb893a40ef864dc7f2c98 Mon Sep 17 00:00:00 2001 From: webstar <814566123@qq.com> Date: Tue, 12 Mar 2024 10:43:08 +0800 Subject: [PATCH 074/453] docs(readme): add contributor list (#12236) --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 98743432d..b3561a833 100644 --- a/README.md +++ b/README.md @@ -449,6 +449,10 @@ Oh My Zsh has a vibrant community of happy users and delightful contributors. Wi Thank you so much! + + + + ## Follow Us We're on social media: From 4ad09ab0b10adc90730476bd27f24f93d94728ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ing=2E=20Jan=20Kal=C3=A1b?= Date: Tue, 12 Mar 2024 18:23:08 +0100 Subject: [PATCH 075/453] feat(extract): prefer using `pbzip2` instead of `bunzip2` (#12280) --- plugins/extract/extract.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index 88d8b0740..80ca50c50 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -70,7 +70,7 @@ EOF (*.tar.lz4) lz4 -c -d "$full_path" | tar xvf - ;; (*.tar.lrz) (( $+commands[lrzuntar] )) && lrzuntar "$full_path" ;; (*.gz) (( $+commands[pigz] )) && pigz -cdk "$full_path" > "${file:t:r}" || gunzip -ck "$full_path" > "${file:t:r}" ;; - (*.bz2) bunzip2 "$full_path" ;; + (*.bz2) (( $+commands[pbzip2] )) && pbzip2 -d "$full_path" || bunzip2 "$full_path" ;; (*.xz) unxz "$full_path" ;; (*.lrz) (( $+commands[lrunzip] )) && lrunzip "$full_path" ;; (*.lz4) lz4 -d "$full_path" ;; From 6780b19329501b66bc87274928f0a65cc7e5f473 Mon Sep 17 00:00:00 2001 From: guangwu Date: Thu, 14 Mar 2024 18:37:06 +0800 Subject: [PATCH 076/453] docs(pyenv): fix typo (#12283) --- plugins/pyenv/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/pyenv/README.md b/plugins/pyenv/README.md index f1ca3d288..f18fc8cfb 100644 --- a/plugins/pyenv/README.md +++ b/plugins/pyenv/README.md @@ -10,7 +10,7 @@ To use it, add `pyenv` to the plugins array in your zshrc file: plugins=(... pyenv) ``` -If you receive a `Found pyenv, but it is badly configured.` error on startup, you may need to ensure that `pyenv` is initialized before the oh-my-zsh pyenv plugin is loaded. This can be achived by adding the following earlier in the `.zshrc` file than the `plugins=(...)` line: +If you receive a `Found pyenv, but it is badly configured.` error on startup, you may need to ensure that `pyenv` is initialized before the oh-my-zsh pyenv plugin is loaded. This can be achieved by adding the following earlier in the `.zshrc` file than the `plugins=(...)` line: ```zsh export PYENV_ROOT="$HOME/.pyenv" From c8ba08581dff43c18c1b0d9e7312ca32e6d97124 Mon Sep 17 00:00:00 2001 From: shuangcui Date: Fri, 15 Mar 2024 00:07:39 +0800 Subject: [PATCH 077/453] docs: fix typos (#12284) --- lib/cli.zsh | 2 +- plugins/catimg/README.md | 2 +- plugins/emacs/README.md | 2 +- plugins/emacs/emacs.plugin.zsh | 2 +- plugins/ipfs/_ipfs | 2 +- plugins/nomad/_nomad | 2 +- plugins/per-directory-history/per-directory-history.zsh | 2 +- plugins/ssh-agent/README.md | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/cli.zsh b/lib/cli.zsh index 561c1b98b..aa36a6ab5 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -448,7 +448,7 @@ function _omz::plugin::load { if [[ ! -f "$base/_$plugin" && ! -f "$base/$plugin.plugin.zsh" ]]; then _omz::log warn "'$plugin' is not a valid plugin" continue - # It it is a valid plugin, add its directory to $fpath unless it is already there + # It is a valid plugin, add its directory to $fpath unless it is already there elif (( ! ${fpath[(Ie)$base]} )); then fpath=("$base" $fpath) fi diff --git a/plugins/catimg/README.md b/plugins/catimg/README.md index 8f2688050..68dc33c1f 100644 --- a/plugins/catimg/README.md +++ b/plugins/catimg/README.md @@ -1,6 +1,6 @@ # catimg -Plugin for displaying images on the terminal using the the `catimg.sh` script provided by [posva](https://github.com/posva/catimg) +Plugin for displaying images on the terminal using the `catimg.sh` script provided by [posva](https://github.com/posva/catimg) To use it, add `catimg` to the plugins array in your zshrc file: diff --git a/plugins/emacs/README.md b/plugins/emacs/README.md index 8ed4a1473..47c7644ab 100644 --- a/plugins/emacs/README.md +++ b/plugins/emacs/README.md @@ -27,4 +27,4 @@ The plugin uses a custom launcher (which we'll call here `$EMACS_LAUNCHER`) that | eeval | `$EMACS_LAUNCHER --eval` | Same as `M-x eval` but from outside Emacs | | eframe | `emacsclient --alternate-editor="" --create-frame` | Create new X frame | | efile | - | Print the path to the file open in the current buffer | -| ecd | - | Print the directory of the file open in the the current buffer | +| ecd | - | Print the directory of the file open in the current buffer | diff --git a/plugins/emacs/emacs.plugin.zsh b/plugins/emacs/emacs.plugin.zsh index 4747f035b..5aa621803 100644 --- a/plugins/emacs/emacs.plugin.zsh +++ b/plugins/emacs/emacs.plugin.zsh @@ -60,7 +60,7 @@ function efile { } # Write to standard output the directory of the file -# opened in the the current buffer +# opened in the current buffer function ecd { local file file="$(efile)" || return $? diff --git a/plugins/ipfs/_ipfs b/plugins/ipfs/_ipfs index 8771bc4ba..5b8b05b98 100644 --- a/plugins/ipfs/_ipfs +++ b/plugins/ipfs/_ipfs @@ -202,7 +202,7 @@ _ipfs_subcommand(){ _arguments \ '--resolve[Check if the given path can be resolved before publishing. Default: true.]' \ '(-t --lifetime)'{-t,--lifetime}'[Time duration that the record will be valid for. Default: 24h.]' \ - '--allow-offline[When offline, save the IPNS record to the the local datastore without broadcasting to the network instead of simply failing.]' \ + '--allow-offline[When offline, save the IPNS record to the local datastore without broadcasting to the network instead of simply failing.]' \ '--ttl[Time duration this record should be cached for. Uses the same syntax as the lifetime option. (caution: experimental).]' \ '(-k --key)'{-k,--key}"[Name of the key to be used or a valid PeerID, as listed by 'ipfs key list -l'. Default: self.]" \ '(-Q --quieter)'{-Q,--quieter}'[Write only final hash.]' \ diff --git a/plugins/nomad/_nomad b/plugins/nomad/_nomad index 1c935a02e..4c6cb2fcb 100644 --- a/plugins/nomad/_nomad +++ b/plugins/nomad/_nomad @@ -97,7 +97,7 @@ __run() { '-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.]' \ - '-check-index[If set, the job is only registered or updated if the the passed job modify index matches the server side version. If a check-index value of zero is passed, the job is only registered if it does not yet exist. If a non-zero value is passed, it ensures that the job is being updated from a known state. The use of this flag is most common in conjunction with plan command.]' \ + '-check-index[If set, the job is only registered or updated if the passed job modify index matches the server side version. If a check-index value of zero is passed, the job is only registered if it does not yet exist. If a non-zero value is passed, it ensures that the job is being updated from a known state. The use of this flag is most common in conjunction with plan command.]' \ '-detach[Return immediately instead of entering monitor mode. After job submission, the evaluation ID will be printed to the screen, which can be used to examine the evaluation using the eval-status command.]' \ '-output[Output the JSON that would be submitted to the HTTP API without submitting the job.]' \ '-verbose[Show full information.]' diff --git a/plugins/per-directory-history/per-directory-history.zsh b/plugins/per-directory-history/per-directory-history.zsh index b33e0b5dd..926373ae0 100644 --- a/plugins/per-directory-history/per-directory-history.zsh +++ b/plugins/per-directory-history/per-directory-history.zsh @@ -21,7 +21,7 @@ #------------------------------------------------------------------------------- # # The idea/inspiration for a per directory history is from Stewart MacArthur[1] -# and Dieter[2], the implementation idea is from Bart Schaefer on the the zsh +# and Dieter[2], the implementation idea is from Bart Schaefer on the zsh # mailing list[3]. The implementation is by Jim Hester in September 2012. # # [1]: http://www.compbiome.com/2010/07/bash-per-directory-bash-history.html diff --git a/plugins/ssh-agent/README.md b/plugins/ssh-agent/README.md index 8c118e65b..0afa80cc8 100644 --- a/plugins/ssh-agent/README.md +++ b/plugins/ssh-agent/README.md @@ -90,7 +90,7 @@ use the `ssh-add-args` setting. You can pass multiple arguments separated by spa zstyle :omz:plugins:ssh-agent ssh-add-args -K -c -a /run/user/1000/ssh-auth ``` -These will then be passed the the `ssh-add` call as if written directly. The example +These will then be passed the `ssh-add` call as if written directly. The example above will turn into: ```zsh From fff9ab7619fc26341908f63b18341f113805967a Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Fri, 15 Mar 2024 19:49:24 +0700 Subject: [PATCH 078/453] feat(dependencies): enable gradle plugin --- .github/dependencies.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/dependencies.yml b/.github/dependencies.yml index d60ab2c92..add39f7f3 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -29,3 +29,10 @@ dependencies: postcopy: | set -e test -e dependencies/OMZ-README.md && cat dependencies/OMZ-README.md >> README.md + plugins/gradle: + repo: gradle/gradle-completion + branch: master + version: ea018400d86610d0f79f84debbb33c2d2ef5dbec + precopy: | + set -e + find . ! -name _gradle -delete From 8940fa29134e5b06bbe383e8f741dbe097244626 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Fri, 15 Mar 2024 19:53:43 +0700 Subject: [PATCH 079/453] fix(dependencies): copy gradle LICENSE --- .github/dependencies.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dependencies.yml b/.github/dependencies.yml index add39f7f3..98b52ffa9 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -35,4 +35,4 @@ dependencies: version: ea018400d86610d0f79f84debbb33c2d2ef5dbec precopy: | set -e - find . ! -name _gradle -delete + find . ! -name _gradle ! -name LICENSE -delete From d0bddee6e3703e78f588d037078606d41a4d6237 Mon Sep 17 00:00:00 2001 From: "ohmyzsh[bot]" <54982679+ohmyzsh[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 19:55:43 +0700 Subject: [PATCH 080/453] feat(gradle): update completion to version 25da917c (#12287) Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com> --- .github/dependencies.yml | 2 +- plugins/gradle/LICENSE | 19 +++++++++++++++++++ plugins/gradle/_gradle | 30 +++--------------------------- 3 files changed, 23 insertions(+), 28 deletions(-) create mode 100644 plugins/gradle/LICENSE diff --git a/.github/dependencies.yml b/.github/dependencies.yml index 98b52ffa9..f760ddcef 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -32,7 +32,7 @@ dependencies: plugins/gradle: repo: gradle/gradle-completion branch: master - version: ea018400d86610d0f79f84debbb33c2d2ef5dbec + version: 25da917cf5a88f3e58f05be3868a7b2748c8afe6 precopy: | set -e find . ! -name _gradle ! -name LICENSE -delete diff --git a/plugins/gradle/LICENSE b/plugins/gradle/LICENSE new file mode 100644 index 000000000..06edf4af2 --- /dev/null +++ b/plugins/gradle/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2017 Eric Wendelin + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/plugins/gradle/_gradle b/plugins/gradle/_gradle index f8df928b4..ca13fd0b0 100644 --- a/plugins/gradle/_gradle +++ b/plugins/gradle/_gradle @@ -1,28 +1,4 @@ #compdef gradle gradlew gw -# THE LINE ABOVE MUST BE THE FIRST LINE OF THIS FILE IN ORDER FOR COMPLETION TO WORK - -# -# Taken from https://github.com/gradle/gradle-completion -# Copyright (c) 2017 Eric Wendelin -# -# Permission is hereby granted, free of charge, to any person obtaining a copy of -# this software and associated documentation files (the "Software"), to deal in -# the Software without restriction, including without limitation the rights to -# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -# of the Software, and to permit persons to whom the Software is furnished to do -# so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# Terms __gradle-set-project-root-dir() { local dir=`pwd` @@ -38,7 +14,7 @@ __gradle-set-project-root-dir() { } __gradle-init-cache-dir() { - cache_dir="$HOME/.gradle/completion" + cache_dir="${GRADLE_USER_HOME:-$HOME/.gradle}/completion" mkdir -p $cache_dir } @@ -98,7 +74,7 @@ __gradle-generate-script-cache() { zle -R "Generating Gradle build script cache" # Cache all Gradle scripts local -a gradle_build_scripts - gradle_build_scripts=( $(find $project_root_dir -type f -name "*.gradle" -o -name "*.gradle.kts" 2>/dev/null | egrep -v "$script_exclude_pattern") ) + gradle_build_scripts=( $(find $project_root_dir -type f -name "*.gradle" -o -name "*.gradle.kts" 2>/dev/null | grep -E -v "$script_exclude_pattern") ) printf "%s\n" "${gradle_build_scripts[@]}" >| $cache_dir/$cache_name fi } @@ -125,7 +101,7 @@ __gradle-generate-tasks-cache() { local gradle_all_tasks="" root_tasks="" subproject_tasks="" output_line local -a match for output_line in ${(f)"$(printf "%s\n" "${gradle_tasks_output[@]}")"}; do - if [[ $output_line =~ ^([[:lower:]][[:alnum:][:punct:]]*)([[:space:]]-[[:space:]]([[:print:]]*))? ]]; then + if [[ $output_line =~ ^([[:alpha:]][[:alnum:][:punct:]]*)([[:space:]]-[[:space:]]([[:print:]]*))? ]]; then local task_name="${match[1]}" local task_description="${match[3]}" # Completion for subproject tasks with ':' prefix From 0fed36688f9a60d8b1f2182f27de7fdc8a1e6b72 Mon Sep 17 00:00:00 2001 From: Colin Barnabas <1637663+colin-barnabas@users.noreply.github.com> Date: Fri, 15 Mar 2024 21:26:48 -0700 Subject: [PATCH 081/453] fix(docker-compose): completion regression (#12288) --- plugins/docker-compose/_docker-compose | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/docker-compose/_docker-compose b/plugins/docker-compose/_docker-compose index c6b733500..d0ebfe515 100644 --- a/plugins/docker-compose/_docker-compose +++ b/plugins/docker-compose/_docker-compose @@ -128,7 +128,7 @@ __docker-compose_subcommand() { '--resolve-image-digests[Pin image tags to digests.]' \ '--services[Print the service names, one per line.]' \ '--volumes[Print the volume names, one per line.]' \ - '--hash[Print the service config hash, one per line. Set "service1,service2" for a list of specified services.]' \ && ret=0 + '--hash[Print the service config hash, one per line. Set "service1,service2" for a list of specified services.]' && ret=0 ;; (create) _arguments \ From d157fc60c93fa59e757921b503e9594bd23b422c Mon Sep 17 00:00:00 2001 From: Ben Woodward Date: Thu, 21 Mar 2024 19:46:40 +0000 Subject: [PATCH 082/453] fix(mise): update environment when loading the plugin (#12294) --- plugins/mise/mise.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/mise/mise.plugin.zsh b/plugins/mise/mise.plugin.zsh index 1b4d3ae81..357174d91 100644 --- a/plugins/mise/mise.plugin.zsh +++ b/plugins/mise/mise.plugin.zsh @@ -11,6 +11,9 @@ fi # Load mise hooks eval "$($__mise activate zsh)" +# Hook mise into current environment +eval "$($__mise hook-env -s zsh)" + # If the completion file doesn't exist yet, we need to autoload it and # bind it to `mise`. Otherwise, compinit will have already done that. if [[ ! -f "$ZSH_CACHE_DIR/completions/_$__mise" ]]; then 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 083/453] 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 49ad95a11..77c422ce1 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 084/453] 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 d78ea15a4..b1d8a8bc6 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 0e37b7e9d..5f7dcd09d 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 b6ee9f100..9bcf4cc7b 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 085/453] 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 135fd78ef..2b535517c 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 f66a8eac9..8ef392efd 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 086/453] 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 86e5fad4e..97ca52492 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 087/453] 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 21a8d8be7..c194f49d7 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 494d029e8..5551207f8 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 b09b283f2..2fe9d9e64 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 eaeba7d23..d67e6fab4 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 137ca3b6f..2fb20298a 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 ce21e7075..dd0e1ce03 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 071dd1f0b..0c43031df 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 a15dd22df..2b6d12d29 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 d7a28d4e2..1210897c4 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 89dd9d1ce..567a9056b 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 2baade844..c2ab192b6 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 38f1b396a..7fbd2b953 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 e67f920f0..88bda32a0 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 0ca3e4e44..970c6541f 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 40ee7efae..ed7c55024 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 f9e476ebf..f7be56cf7 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 661169a8b..b48d121dc 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 7cdf8c3f3..e3e25a742 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 f1b1dfa5c..82a4fd75e 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 32f619ffd..7291fde38 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 85889481b..848aedabf 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 7312e3d26..9e372f498 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 6023bf2b4..adc2bd3bb 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 ddc257428..e5dceb530 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 71a389535..4be744c4c 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 cf388af1b..e3913b549 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 3d11622df..86bd77f1d 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 d00232a30..03a63a70c 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 7871ddded..281332e0d 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 b1d8a8bc6..1c6930298 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 a82ebaf84..3c159da22 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 f60177dd9..483d1d68c 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 897598a46..f40f6550b 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 101343abb..2f825bc4a 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 71d287451..254e4e7ac 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 ef1b5e0d2..94183c544 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 d79aee7eb..2744ad96e 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 406870f00..f649dafc2 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 4c6cb2fcb..87f80aa84 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 23377b085..c333f76ed 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 6a5afecfa..c2e8de94b 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 8331fd02b..52ad9525b 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 faa6a3404..66320b810 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 a7d16563e..bd99d2a91 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 6a04d3c8f..c73a7b353 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 851302c68..1e977140b 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 c1db8ad92..26531c40b 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 d4b0b6735..6d785d9e1 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 3a9d9de66..bd6b08760 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 09c705d9a..484c88b84 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 ac377cd17..ffcc6d6f7 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 c5bc55d17..dd0ca363b 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 84ba30105..6e781f296 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 681648018..c2b45f1d8 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 b73f9b4da..a12b52bd5 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 e037241e4..1a3ae37b8 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 1d1980632..0ad74e805 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 8d5cf15a2..52ecb12e6 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 67a207dbb..106d8c107 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 c3dd6af89..e297fe9ca 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 c2fdbed23..cc097057f 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 aa274a5bb..bd0405efb 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 206274462..0e39d9077 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 8278661ab..d86ce1e4a 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 88134f8e6..31e24fa7f 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 ba0840950..0fea7d916 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 43d4093b1..50b3f7772 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 ea051c58e..df59280d7 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 01fae4b95..e3b746c7a 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 c059bf850..94718f8f2 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 36301cb76..c9994c0f9 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 508611830..db6170969 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 e9e9d6ef8..358891992 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 088/453] 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 8c5d9135e..fc415e64c 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 089/453] 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 cf3d650ea..fa8f884a4 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 090/453] 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 11bc8e1f8..2c0db229f 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 091/453] 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 384e49d33..ac95bcd73 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 092/453] 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 b3561a833..2ba374335 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 96df5589d..4d6681c5b 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 093/453] 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 4d6681c5b..76b3778db 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 094/453] 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 fca6548c0..e20a31156 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 095/453] 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 76b3778db..23d11db2d 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 096/453] 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 ac95bcd73..a83c57f35 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 097/453] 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 23d11db2d..c4265970b 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 098/453] 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 84333a89f..5a52e3067 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 099/453] 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 05208d72f..8f42c6842 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 From a6ce40df49e0b219372517273c4edce1d34e49a2 Mon Sep 17 00:00:00 2001 From: Matheus Richard Date: Mon, 8 Apr 2024 12:48:57 -0300 Subject: [PATCH 100/453] feat(git): introduce `gwipe` alias (#12302) `gpristine` might be too much on several occasions, given that it removes all untracked files. This might not be ideal because it will delete important things like environment files and encryption keys. With that in mind, this commit introduces `gwipe` as a way to get a "clean slate" but still have your dev environment working. --- plugins/git/git.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 692a36a73..545ccc541 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -349,6 +349,7 @@ alias grhh='git reset --hard' alias grhk='git reset --keep' alias grhs='git reset --soft' alias gpristine='git reset --hard && git clean --force -dfx' +alias gwipe='git reset --hard && git clean --force -df' alias groh='git reset origin/$(git_current_branch) --hard' alias grs='git restore' alias grss='git restore --source' From 5bff59f78e607e77f2ed924c1e93ccc09a6ccb7e Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Mon, 8 Apr 2024 22:05:23 +0200 Subject: [PATCH 101/453] docs(git): add `gwipe` alias --- plugins/git/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/git/README.md b/plugins/git/README.md index 4acb0c858..181de37fc 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -166,6 +166,7 @@ plugins=(... git) | `grhk` | `git reset --keep` | | `grhs` | `git reset --soft` | | `gpristine` | `git reset --hard && git clean --force -dfx` | +| `gwipe` | `git reset --hard && git clean --force -df` | | `groh` | `git reset origin/$(git_current_branch) --hard` | | `grs` | `git restore` | | `grss` | `git restore --source` | From 982ea721bde90c1fca233419e2c5b6e90fd10225 Mon Sep 17 00:00:00 2001 From: Reza Askari Date: Tue, 9 Apr 2024 00:06:38 +0330 Subject: [PATCH 102/453] feat(laravel): add `artisan test` alias (`pats`) (#12310) --- plugins/laravel/README.md | 1 + plugins/laravel/laravel.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/laravel/README.md b/plugins/laravel/README.md index 95f590191..a831a86b6 100644 --- a/plugins/laravel/README.md +++ b/plugins/laravel/README.md @@ -10,6 +10,7 @@ plugins=(... laravel) |:-:|:-:| | `artisan` | `php artisan` | | `pas` | `php artisan serve` | +| `pats` | `php artisan test` | ## Database diff --git a/plugins/laravel/laravel.plugin.zsh b/plugins/laravel/laravel.plugin.zsh index a8382d3c9..319946f07 100644 --- a/plugins/laravel/laravel.plugin.zsh +++ b/plugins/laravel/laravel.plugin.zsh @@ -4,6 +4,7 @@ alias bob='php artisan bob::build' # Development alias pas='php artisan serve' +alias pats='php artisan test' # Database alias pam='php artisan migrate' From 3e2a5742cdb4deae4d7f10351d59c7f2933e3555 Mon Sep 17 00:00:00 2001 From: Soo Philip Jason Kim Date: Tue, 9 Apr 2024 05:40:15 +0900 Subject: [PATCH 103/453] feat(git): add alias `gmc` for `git merge --continue` (#12326) Co-authored-by: PJ Kim --- plugins/git/README.md | 1 + plugins/git/git.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/git/README.md b/plugins/git/README.md index 181de37fc..4c005ad2f 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -111,6 +111,7 @@ plugins=(... git) | `gfg` | `git ls-files \| grep` | | `gm` | `git merge` | | `gma` | `git merge --abort` | +| `gmc` | `git merge --continue` | | `gms` | `git merge --squash` | | `gmom` | `git merge origin/$(git_main_branch)` | | `gmum` | `git merge upstream/$(git_main_branch)` | diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 545ccc541..146f4a512 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -252,6 +252,7 @@ alias gignored='git ls-files -v | grep "^[[:lower:]]"' alias gfg='git ls-files | grep' alias gm='git merge' alias gma='git merge --abort' +alias gmc='git merge --continue' alias gms="git merge --squash" alias gmom='git merge origin/$(git_main_branch)' alias gmum='git merge upstream/$(git_main_branch)' From a8f7f9f707ca5fb9ac7bedb088748b09db2fd3bd Mon Sep 17 00:00:00 2001 From: MoAlkhateeb <110918029+MoAlkhateeb@users.noreply.github.com> Date: Tue, 9 Apr 2024 09:07:57 +0300 Subject: [PATCH 104/453] fix(history)!: fix arg passing to `fc` for `history` command (#12338) BREAKING CHANGE: we have fixed a bug in the `history` wrapper for OMZ which means that running just history will now not show all the history since the 1st command, but only recent ones. To get the previous behavior, you can run `history 1` to get all the command history, or other commands such as `history -30` to get the last 30 commands. --- lib/history.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/history.zsh b/lib/history.zsh index 794076904..c39c8c866 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -12,8 +12,8 @@ function omz_history { # if -l provided, run as if calling `fc' directly builtin fc "$@" else - # unless a number is provided, show all history events (starting from 1) - [[ ${@[-1]-} = *[0-9]* ]] && builtin fc -l "$@" || builtin fc -l "$@" 1 + # otherwise, run `fc -l` with a custom format + builtin fc -l "$@" fi } From ef402864830ba2e23720e3a6ee6f6b4f0e05d692 Mon Sep 17 00:00:00 2001 From: Taekin Kim Date: Tue, 9 Apr 2024 19:18:05 +0900 Subject: [PATCH 105/453] docs: fix typo (#12339) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ba374335..dea36fda7 100644 --- a/README.md +++ b/README.md @@ -366,7 +366,7 @@ zstyle ':omz:lib:directories' aliases no 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, +issue, but if you're seeing problems with this new feature, you can turn it off by setting the following in your .zshrc file, before Oh My Zsh is sourced: ```sh From f85f501bcf3dc771c64f4b2ec7609fc542d4d031 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Tue, 9 Apr 2024 11:19:14 +0100 Subject: [PATCH 106/453] feat(macos): `ofd` now opens any directory (#12337) Co-authored-by: Carlo Sala --- plugins/macos/README.md | 2 +- plugins/macos/macos.plugin.zsh | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/plugins/macos/README.md b/plugins/macos/README.md index 1cb9b395d..2c52ec8a7 100644 --- a/plugins/macos/README.md +++ b/plugins/macos/README.md @@ -17,7 +17,7 @@ Original author: [Sorin Ionescu](https://github.com/sorin-ionescu) | `tab` | Open the current directory in a new tab | | `split_tab` | Split the current terminal tab horizontally | | `vsplit_tab` | Split the current terminal tab vertically | -| `ofd` | Open the current directory in a Finder window | +| `ofd` | Open passed directories (or $PWD by default) in Finder | | `pfd` | Return the path of the frontmost Finder window | | `pfs` | Return the current Finder selection | | `cdf` | `cd` to the current Finder directory | diff --git a/plugins/macos/macos.plugin.zsh b/plugins/macos/macos.plugin.zsh index a4347005e..2702a1901 100644 --- a/plugins/macos/macos.plugin.zsh +++ b/plugins/macos/macos.plugin.zsh @@ -3,8 +3,15 @@ 0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" 0="${${(M)0:#/*}:-$PWD/$0}" -# Open the current directory in a Finder window -alias ofd='open_command $PWD' +# Open in Finder the directories passed as arguments, or the current directory if +# no directories are passed +function ofd { + if (( ! $# )); then + open_command $PWD + else + open_command $@ + fi +} # Show/hide hidden files in the Finder alias showfiles="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder" From 605d76616aa47b2e5abe25eb26c4c9c1554f93d5 Mon Sep 17 00:00:00 2001 From: MoAlkhateeb <110918029+MoAlkhateeb@users.noreply.github.com> Date: Tue, 9 Apr 2024 19:09:26 +0300 Subject: [PATCH 107/453] fix(history): revert to old behavior when no args passed (#12341) * Fixed a bug in *omz_history* where it would automatically create a file when run with the -p flag * Reverted old history behaviour while fixing parsing bug --- lib/history.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/history.zsh b/lib/history.zsh index c39c8c866..56dda2462 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -3,7 +3,10 @@ function omz_history { local clear list zparseopts -E c=clear l=list - if [[ -n "$clear" ]]; then + if [[ $# -eq 0 ]]; then + # if no arguments provided, show full history starting from 1 + builtin fc -l 1 + elif [[ -n "$clear" ]]; then # if -c provided, clobber the history file echo -n >| "$HISTFILE" fc -p "$HISTFILE" From 53c4c4671a931d9f7a3b39fe9131c6f84fe27ca5 Mon Sep 17 00:00:00 2001 From: Ruize Tang <1466040111@qq.com> Date: Wed, 10 Apr 2024 21:39:19 +0800 Subject: [PATCH 108/453] fix(shell-proxy): support ssh-proxy using http proxy in cygwin (#12340) --- plugins/shell-proxy/ssh-proxy.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/shell-proxy/ssh-proxy.py b/plugins/shell-proxy/ssh-proxy.py index a498c84bc..4b692f9e4 100755 --- a/plugins/shell-proxy/ssh-proxy.py +++ b/plugins/shell-proxy/ssh-proxy.py @@ -22,7 +22,8 @@ if parsed.scheme not in proxy_protocols: def make_argv(): yield "nc" - if sys.platform == 'linux': + if sys.platform in {'linux', 'cygwin'}: + # caveats: the built-in netcat of most linux distributions and cygwin support proxy type # caveats: macOS built-in netcat command not supported proxy-type yield "-X" # --proxy-type # Supported protocols are 4 (SOCKS v4), 5 (SOCKS v5) and connect (HTTP proxy). From 6e9d57d5abdb33b0c22f8979dc529c1a046d7aa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jo=C3=A9l=20hawkins=20torres?= Date: Thu, 11 Apr 2024 10:27:29 -0700 Subject: [PATCH 109/453] fix(yarn): use `builtin cd` in completion (#12347) --- plugins/yarn/_yarn | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/yarn/_yarn b/plugins/yarn/_yarn index f15756ff4..9ffe5660c 100644 --- a/plugins/yarn/_yarn +++ b/plugins/yarn/_yarn @@ -86,7 +86,7 @@ _global_commands=( ) _yarn_find_package_json() { - local dir=$(cd "$1" && pwd) + local dir=$(builtin cd "$1" && pwd) while true do @@ -109,7 +109,7 @@ _yarn_commands_scripts() { if [[ -n $opt_args[--cwd] ]]; then packageJson=$(_yarn_find_package_json $opt_args[--cwd]) - binaries=($(cd $opt_args[--cwd] && echo node_modules/.bin/*(x:t))) + binaries=($(builtin cd $opt_args[--cwd] && echo node_modules/.bin/*(x:t))) else packageJson=$(_yarn_find_package_json $pwd) binaries=($(echo node_modules/.bin/*(x:t))) @@ -130,9 +130,9 @@ _yarn_scripts() { if [[ -n $_yarn_run_cwd ]]; then packageJson=$(_yarn_find_package_json $_yarn_run_cwd) if [[ -d "${_yarn_run_cwd}/node_modules" ]]; then - binaries=($(cd $_yarn_run_cwd && echo node_modules/.bin/*(x:t))) + binaries=($(builtin cd $_yarn_run_cwd && echo node_modules/.bin/*(x:t))) else - binaries=($(cd $_yarn_run_cwd && yarn bin | perl -wln -e 'm{^[^:]+: (\S+)$} and print $1')) + binaries=($(builtin cd $_yarn_run_cwd && yarn bin | perl -wln -e 'm{^[^:]+: (\S+)$} and print $1')) fi else packageJson=$(_yarn_find_package_json $pwd) From 31f2025e0fa963788655fe197e0179c47588b175 Mon Sep 17 00:00:00 2001 From: Kate Sullivan <75387802+katesullivan@users.noreply.github.com> Date: Fri, 12 Apr 2024 02:24:54 -0500 Subject: [PATCH 110/453] feat(poetry-env): support changing between two venv dirs (#12346) Co-authored-by: Carlo Sala --- plugins/poetry-env/poetry-env.plugin.zsh | 38 ++++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/plugins/poetry-env/poetry-env.plugin.zsh b/plugins/poetry-env/poetry-env.plugin.zsh index 97ca52492..f98c177b4 100644 --- a/plugins/poetry-env/poetry-env.plugin.zsh +++ b/plugins/poetry-env/poetry-env.plugin.zsh @@ -1,27 +1,27 @@ -# Automatic poetry environment activation/deactivation _togglePoetryShell() { - # deactivate environment if pyproject.toml doesn't exist and not in a subdir - if [[ ! -f "$PWD/pyproject.toml" ]] ; then - if [[ "$poetry_active" == 1 ]]; then - if [[ "$PWD" != "$poetry_dir"* ]]; then - export poetry_active=0 - deactivate - return - fi - fi + # Determine if currently in a Poetry-managed directory + local in_poetry_dir=0 + if [[ -f "$PWD/pyproject.toml" ]] && grep -q 'tool.poetry' "$PWD/pyproject.toml"; then + in_poetry_dir=1 fi - # 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" && venv_dir=$(poetry env info --path); then - export poetry_active=1 - export poetry_dir="$PWD" - source "${venv_dir}/bin/activate" - fi + # Deactivate the current environment if moving out of a Poetry directory or into a different Poetry directory + if [[ $poetry_active -eq 1 ]] && { [[ $in_poetry_dir -eq 0 ]] || [[ "$PWD" != "$poetry_dir"* ]]; }; then + export poetry_active=0 + unset poetry_dir + deactivate + fi + + # Activate the environment if in a Poetry directory and no environment is currently active + if [[ $in_poetry_dir -eq 1 ]] && [[ $poetry_active -ne 1 ]]; then + venv_dir=$(poetry env info --path 2>/dev/null) + if [[ -n "$venv_dir" ]]; then + export poetry_active=1 + export poetry_dir="$PWD" + source "${venv_dir}/bin/activate" fi fi } autoload -U add-zsh-hook add-zsh-hook chpwd _togglePoetryShell -_togglePoetryShell +_togglePoetryShell # Initial call to check the current directory at shell startup From b26000d1685fa61bddddea42e2a606b2a0d64e25 Mon Sep 17 00:00:00 2001 From: Jhon Pedroza Date: Tue, 16 Apr 2024 02:52:12 -0500 Subject: [PATCH 111/453] feat(tmux): sessions named as current dir (#12351) --- plugins/tmux/README.md | 1 + plugins/tmux/tmux.plugin.zsh | 24 ++++++++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/plugins/tmux/README.md b/plugins/tmux/README.md index 50f8b2c2f..09952a9f5 100644 --- a/plugins/tmux/README.md +++ b/plugins/tmux/README.md @@ -37,6 +37,7 @@ The plugin also supports the following: | `ZSH_TMUX_AUTOQUIT` | Automatically closes terminal once tmux exits (default: `ZSH_TMUX_AUTOSTART`) | | `ZSH_TMUX_CONFIG` | Set the configuration path (default: `$HOME/.tmux.conf`, `$XDG_CONFIG_HOME/tmux/tmux.conf`) | | `ZSH_TMUX_DEFAULT_SESSION_NAME` | Set tmux default session name when autostart is enabled | +| `ZSH_TMUX_AUTONAME_SESSION` | Automatically name new sessions based on the basename of `$PWD` (default: `false`) | | `ZSH_TMUX_DETACHED` | Set the detached mode (default: `false`) | | `ZSH_TMUX_FIXTERM` | Sets `$TERM` to 256-color term or not based on current terminal support | | `ZSH_TMUX_FIXTERM_WITHOUT_256COLOR` | `$TERM` to use for non 256-color terminals (default: `tmux` if available, `screen` otherwise) | diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 791592d8f..f65598358 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -13,6 +13,8 @@ fi : ${ZSH_TMUX_AUTOCONNECT:=true} # Automatically close the terminal when tmux exits : ${ZSH_TMUX_AUTOQUIT:=$ZSH_TMUX_AUTOSTART} +# Automatically name the new session based on the basename of PWD +: ${ZSH_TMUX_AUTONAME_SESSION:=false} # Set term to screen or screen-256color based on current terminal support : ${ZSH_TMUX_DETACHED:=false} # Set detached mode @@ -102,9 +104,22 @@ function _zsh_tmux_plugin_run() { local _detached="" [[ "$ZSH_TMUX_DETACHED" == "true" ]] && _detached="-d" + + local session_name + if [[ "$ZSH_TMUX_AUTONAME_SESSION" == "true" ]]; then + # Name the session after the basename of the current directory + session_name=${PWD##*/} + # If the current directory is the home directory, name it 'HOME' + [[ "$PWD" == "$HOME" ]] && session_name="HOME" + # If the current directory is the root directory, name it 'ROOT' + [[ "$PWD" == "/" ]] && session_name="ROOT" + else + session_name="$ZSH_TMUX_DEFAULT_SESSION_NAME" + fi + # Try to connect to an existing session. - if [[ -n "$ZSH_TMUX_DEFAULT_SESSION_NAME" ]]; then - [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] && $tmux_cmd attach $_detached -t $ZSH_TMUX_DEFAULT_SESSION_NAME + if [[ -n "$session_name" ]]; then + [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] && $tmux_cmd attach $_detached -t "$session_name" else [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] && $tmux_cmd attach $_detached fi @@ -116,8 +131,9 @@ function _zsh_tmux_plugin_run() { elif [[ -e "$ZSH_TMUX_CONFIG" ]]; then tmux_cmd+=(-f "$ZSH_TMUX_CONFIG") fi - if [[ -n "$ZSH_TMUX_DEFAULT_SESSION_NAME" ]]; then - $tmux_cmd new-session -s $ZSH_TMUX_DEFAULT_SESSION_NAME + + if [[ -n "$session_name" ]]; then + $tmux_cmd new-session -s "$session_name" else $tmux_cmd new-session fi From efa8de0b52dda6b51bded60c0b26b6dce2dfa354 Mon Sep 17 00:00:00 2001 From: Martin Hans Date: Tue, 16 Apr 2024 19:38:58 +0200 Subject: [PATCH 112/453] fix(history): fix edge cases introduced in #12341 (#12357) --- lib/history.zsh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/history.zsh b/lib/history.zsh index 56dda2462..ec89bc15e 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -1,22 +1,20 @@ ## History wrapper function omz_history { - local clear list - zparseopts -E c=clear l=list + # parse arguments and remove from $@ + local clear list stamp + zparseopts -E -D c=clear l=list f=stamp E=stamp i=stamp if [[ $# -eq 0 ]]; then # if no arguments provided, show full history starting from 1 - builtin fc -l 1 + builtin fc $stamp -l 1 elif [[ -n "$clear" ]]; then # if -c provided, clobber the history file echo -n >| "$HISTFILE" fc -p "$HISTFILE" echo >&2 History file deleted. - elif [[ -n "$list" ]]; then - # if -l provided, run as if calling `fc' directly - builtin fc "$@" else # otherwise, run `fc -l` with a custom format - builtin fc -l "$@" + builtin fc $stamp -l "$@" fi } From 7ef3f49f97ff34db3785b1cea444eb4972b1937b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 16 Apr 2024 20:04:25 +0200 Subject: [PATCH 113/453] fix(agnoster): prevent accidental alias use --- themes/agnoster.zsh-theme | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index bd0405efb..c2a542163 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -96,7 +96,7 @@ prompt_context() { # Git: branch/detached head, dirty status prompt_git() { (( $+commands[git] )) || return - if [[ "$(git config --get oh-my-zsh.hide-status 2>/dev/null)" = 1 ]]; then + if [[ "$(command git config --get oh-my-zsh.hide-status 2>/dev/null)" = 1 ]]; then return fi local PL_BRANCH_CHAR @@ -106,12 +106,12 @@ prompt_git() { } local ref dirty mode repo_path - if [[ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]]; then - repo_path=$(git rev-parse --git-dir 2>/dev/null) + if [[ "$(command git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]]; then + repo_path=$(command git rev-parse --git-dir 2>/dev/null) 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=$(command git symbolic-ref HEAD 2> /dev/null) || \ + ref="◈ $(command git describe --exact-match --tags HEAD 2> /dev/null)" || \ + ref="➦ $(command git rev-parse --short HEAD 2> /dev/null)" if [[ -n $dirty ]]; then prompt_segment yellow black else @@ -119,8 +119,8 @@ prompt_git() { fi local ahead behind - ahead=$(git log --oneline @{upstream}.. 2>/dev/null) - behind=$(git log --oneline ..@{upstream} 2>/dev/null) + ahead=$(command git log --oneline @{upstream}.. 2>/dev/null) + behind=$(command git log --oneline ..@{upstream} 2>/dev/null) if [[ -n "$ahead" ]] && [[ -n "$behind" ]]; then PL_BRANCH_CHAR=$'\u21c5' elif [[ -n "$ahead" ]]; then @@ -163,10 +163,10 @@ prompt_bzr() { done local bzr_status status_mod status_all revision - if bzr_status=$(bzr status 2>&1); then + if bzr_status=$(command bzr status 2>&1); then status_mod=$(echo -n "$bzr_status" | head -n1 | grep "modified" | wc -m) status_all=$(echo -n "$bzr_status" | head -n1 | wc -m) - revision=${$(bzr log -r-1 --log-format line | cut -d: -f1):gs/%/%%} + revision=${$(command bzr log -r-1 --log-format line | cut -d: -f1):gs/%/%%} if [[ $status_mod -gt 0 ]] ; then prompt_segment yellow black "bzr@$revision ✚" else @@ -182,13 +182,13 @@ prompt_bzr() { prompt_hg() { (( $+commands[hg] )) || return local rev st branch - if $(hg id >/dev/null 2>&1); then - if $(hg prompt >/dev/null 2>&1); then - if [[ $(hg prompt "{status|unknown}") = "?" ]]; then + if $(command hg id >/dev/null 2>&1); then + if $(command hg prompt >/dev/null 2>&1); then + if [[ $(command hg prompt "{status|unknown}") = "?" ]]; then # if files are not added prompt_segment red white st='±' - elif [[ -n $(hg prompt "{status|modified}") ]]; then + elif [[ -n $(command hg prompt "{status|modified}") ]]; then # if any modification prompt_segment yellow black st='±' @@ -196,15 +196,15 @@ prompt_hg() { # if working copy is clean prompt_segment green $CURRENT_FG fi - echo -n ${$(hg prompt "☿ {rev}@{branch}"):gs/%/%%} $st + echo -n ${$(command hg prompt "☿ {rev}@{branch}"):gs/%/%%} $st else st="" - rev=$(hg id -n 2>/dev/null | sed 's/[^-0-9]//g') - branch=$(hg id -b 2>/dev/null) - if `hg st | grep -q "^\?"`; then + rev=$(command hg id -n 2>/dev/null | sed 's/[^-0-9]//g') + branch=$(command hg id -b 2>/dev/null) + if command hg st | command grep -q "^\?"; then prompt_segment red black st='±' - elif `hg st | grep -q "^[MA]"`; then + elif command hg st | command grep -q "^[MA]"; then prompt_segment yellow black st='±' else From 1ed8d4b55530888bfa723e7dc6226a798260bdc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 17 Apr 2024 20:21:18 +0200 Subject: [PATCH 114/453] fix(git): turn off async prompt by default on zsh < 5.0.6 (#12331) See https://github.com/ohmyzsh/ohmyzsh/issues/12331#issuecomment-2059460268 --- lib/git.zsh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/git.zsh b/lib/git.zsh index c4265970b..277c0b3e8 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -1,3 +1,5 @@ +autoload -Uz is-at-least + # The git prompt's git commands are read-only and should not interfere with # other processes. This environment variable is equivalent to running with `git # --no-optional-locks`, but falls back gracefully for older versions of git. @@ -37,8 +39,10 @@ function _omz_git_prompt_info() { echo "${ZSH_THEME_GIT_PROMPT_PREFIX}${ref:gs/%/%%}${upstream:gs/%/%%}$(parse_git_dirty)${ZSH_THEME_GIT_PROMPT_SUFFIX}" } -# Enable async prompt by default unless the setting is at false / no -if zstyle -T ':omz:alpha:lib:git' async-prompt; then +# Use async version if setting is enabled, or undefined but zsh version is at least 5.0.6 +# https://github.com/ohmyzsh/ohmyzsh/issues/12331#issuecomment-2059460268 +if zstyle -t ':omz:alpha:lib:git' async-prompt \ + || { is-at-least 5.0.6 && 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 From eafa78217d836115a99f80bddfcd0a8901a15f77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 18 Apr 2024 07:12:32 +0200 Subject: [PATCH 115/453] fix(history): fix `history -c` (#12362) Fixes #12362 --- lib/history.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/history.zsh b/lib/history.zsh index ec89bc15e..aace78aa1 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -4,14 +4,14 @@ function omz_history { local clear list stamp zparseopts -E -D c=clear l=list f=stamp E=stamp i=stamp - if [[ $# -eq 0 ]]; then - # if no arguments provided, show full history starting from 1 - builtin fc $stamp -l 1 - elif [[ -n "$clear" ]]; then + if [[ -n "$clear" ]]; then # if -c provided, clobber the history file echo -n >| "$HISTFILE" fc -p "$HISTFILE" echo >&2 History file deleted. + elif [[ $# -eq 0 ]]; then + # if no arguments provided, show full history starting from 1 + builtin fc $stamp -l 1 else # otherwise, run `fc -l` with a custom format builtin fc $stamp -l "$@" From c262ffbb68e6dfc30b619e6ce6bdbd00f27b8a71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 18 Apr 2024 07:16:42 +0200 Subject: [PATCH 116/453] fix(update): define `$ZSH` if undefined (#12273) Fixes #12273 Fixes https://github.com/topgrade-rs/topgrade/issues/519 --- tools/upgrade.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/upgrade.sh b/tools/upgrade.sh index d7016aa44..5eb90ab41 100755 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -10,9 +10,14 @@ fi # Protect against unwanted sourcing case "$ZSH_EVAL_CONTEXT" in - *:file) echo "error: this file should not be sourced" && return ;; + *:file) echo "error: this file should not be sourced" && return 1 ;; esac +# Define "$ZSH" if not defined -- in theory this should be `export`ed by the calling script +if [[ -z "$ZSH" ]]; then + ZSH="${0:a:h:h}" +fi + cd "$ZSH" verbose_mode="default" From 56cfcb44e7ff730c10c5a00b58f38c33c984c52e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 18 Apr 2024 07:33:13 +0200 Subject: [PATCH 117/453] fix(updater): abort update if `$ZSH` is not a git repository Fixes #12298 --- lib/cli.zsh | 12 +++++++++++- tools/check_for_upgrade.sh | 10 ++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/lib/cli.zsh b/lib/cli.zsh index aa36a6ab5..4a8d4d127 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -773,7 +773,17 @@ function _omz::theme::use { } function _omz::update { - local last_commit=$(builtin cd -q "$ZSH"; git rev-parse HEAD) + # Check if git command is available + (( $+commands[git] )) || { + _omz::log error "git is not installed. Aborting..." + return 1 + } + + local last_commit=$(builtin cd -q "$ZSH"; git rev-parse HEAD 2>/dev/null) + [[ $? -eq 0 ]] || { + _omz::log error "\`$ZSH\` is not a git directory. Aborting..." + return 1 + } # Run update script zstyle -s ':omz:update' verbose verbose_mode || verbose_mode=default diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index 1cc193bde..a5d2112f6 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -20,14 +20,16 @@ zstyle -s ':omz:update' mode update_mode || { } # Cancel update if: -# - the automatic update is disabled. -# - the current user doesn't have write permissions nor owns the $ZSH directory. +# - the automatic update is disabled +# - the current user doesn't have write permissions nor owns the $ZSH directory # - is not run from a tty -# - git is unavailable on the system. +# - git is unavailable on the system +# - $ZSH is not a git repository if [[ "$update_mode" = disabled ]] \ || [[ ! -w "$ZSH" || ! -O "$ZSH" ]] \ || [[ ! -t 1 ]] \ - || ! command git --version 2>&1 >/dev/null; then + || ! command git --version 2>&1 >/dev/null + || (builtin cd -q "$ZSH"; ! command git rev-parse --is-inside-work-tree &>/dev/null); then unset update_mode return fi From 80a651a6dfafc40630b47ad2f173d326844d6925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 18 Apr 2024 07:48:33 +0200 Subject: [PATCH 118/453] chore(updater): small typo --- tools/check_for_upgrade.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index a5d2112f6..1ecab5c0b 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -28,7 +28,7 @@ zstyle -s ':omz:update' mode update_mode || { if [[ "$update_mode" = disabled ]] \ || [[ ! -w "$ZSH" || ! -O "$ZSH" ]] \ || [[ ! -t 1 ]] \ - || ! command git --version 2>&1 >/dev/null + || ! command git --version 2>&1 >/dev/null \ || (builtin cd -q "$ZSH"; ! command git rev-parse --is-inside-work-tree &>/dev/null); then unset update_mode return From d17ca487a4357923d8b8681b9e40c2bb2d2fadea Mon Sep 17 00:00:00 2001 From: Martin Hans Date: Thu, 18 Apr 2024 10:49:34 +0200 Subject: [PATCH 119/453] fix(history): add `t` option to history wrapper (#12365) The `t` option takes a strftime format specification as argument. This fixes cases in which $HIST_STAMPS is set to a value other than `mm/dd/yyyy|dd.mm.yyyy|yyyy-mm-dd`. --- lib/history.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/history.zsh b/lib/history.zsh index aace78aa1..a8431fd5a 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -2,7 +2,7 @@ function omz_history { # parse arguments and remove from $@ local clear list stamp - zparseopts -E -D c=clear l=list f=stamp E=stamp i=stamp + zparseopts -E -D c=clear l=list f=stamp E=stamp i=stamp t:=stamp if [[ -n "$clear" ]]; then # if -c provided, clobber the history file From 1b5503a3eefeb3e248bbc07a2f4e4b7591924307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Fri, 19 Apr 2024 21:57:46 +0200 Subject: [PATCH 120/453] feat(fzf): support fzf setup for 0.48.0 and older (#12367) Fixes #12355 --- plugins/fzf/fzf.plugin.zsh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh index 9e372f498..ac4370596 100644 --- a/plugins/fzf/fzf.plugin.zsh +++ b/plugins/fzf/fzf.plugin.zsh @@ -1,3 +1,12 @@ +function fzf_setup_using_fzf() { + (( ${+commands[fzf]} )) || return 1 + + local fzf_ver=${$(fzf --version)[1]} + is-at-least 0.48.0 $fzf_ver || return 1 + + eval "$(fzf --zsh)" +} + function fzf_setup_using_base_dir() { local fzf_base fzf_shell fzfdirs dir @@ -217,7 +226,8 @@ Please add `export FZF_BASE=/path/to/fzf/install/dir` to your .zshrc EOF } -fzf_setup_using_openbsd \ +fzf_setup_using_fzf \ + || fzf_setup_using_openbsd \ || fzf_setup_using_debian \ || fzf_setup_using_opensuse \ || fzf_setup_using_cygwin \ From f78c6b90fc18e2d0bb119ff549207463ce1d57a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 16 Apr 2024 18:07:10 +0200 Subject: [PATCH 121/453] fix(async): fix crash on zsh < 5.0.6 (#12358) --- lib/async_prompt.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/async_prompt.zsh b/lib/async_prompt.zsh index a83c57f35..db48446e7 100644 --- a/lib/async_prompt.zsh +++ b/lib/async_prompt.zsh @@ -124,7 +124,7 @@ function _omz_async_callback() { # Repaint prompt if output has changed if [[ "$old_output" != "${_OMZ_ASYNC_OUTPUT[$handler]}" ]]; then - zle reset-prompt + zle .reset-prompt zle -R fi From 0c80a063c3ad9513b83589d377c501a8d85d63a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Fri, 19 Apr 2024 18:47:21 +0200 Subject: [PATCH 122/453] chore(async): reenable async prompt by default on zsh < 5.0.6 (#12358) Fixes #12331 --- lib/git.zsh | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/git.zsh b/lib/git.zsh index 277c0b3e8..b257d01a4 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -39,21 +39,17 @@ function _omz_git_prompt_info() { echo "${ZSH_THEME_GIT_PROMPT_PREFIX}${ref:gs/%/%%}${upstream:gs/%/%%}$(parse_git_dirty)${ZSH_THEME_GIT_PROMPT_SUFFIX}" } -# Use async version if setting is enabled, or undefined but zsh version is at least 5.0.6 -# https://github.com/ohmyzsh/ohmyzsh/issues/12331#issuecomment-2059460268 -if zstyle -t ':omz:alpha:lib:git' async-prompt \ - || { is-at-least 5.0.6 && zstyle -T ':omz:alpha:lib:git' async-prompt }; then +# Use async version if setting is enabled or undefined +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]" + 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]" + if [[ -n "${_OMZ_ASYNC_OUTPUT[_omz_git_prompt_status]}" ]]; then + echo -n "${_OMZ_ASYNC_OUTPUT[_omz_git_prompt_status]}" fi } From 67581c53c6458566e174620361e84b364b9034d2 Mon Sep 17 00:00:00 2001 From: Zikoeng Xi Date: Tue, 23 Apr 2024 03:37:17 +0800 Subject: [PATCH 123/453] fix(ssh-agent): add identity only if identity exists (#12371) --- plugins/ssh-agent/ssh-agent.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index 77c422ce1..1da54d4dd 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -62,7 +62,7 @@ function _add_identities() { # if id is an absolute path, make file equal to id [[ "$id" = /* ]] && file="$id" || file="$HOME/.ssh/$id" # check for filename match, otherwise try for signature match - if [[ ${loaded_ids[(I)$file]} -le 0 ]]; then + if [[ -f $file && ${loaded_ids[(I)$file]} -le 0 ]]; then sig="$(ssh-keygen -lf "$file" | awk '{print $2}')" [[ ${loaded_sigs[(I)$sig]} -le 0 ]] && not_loaded+=("$file") fi From ee69c14beb24c652707b2f6b2a9db0fa8b238d05 Mon Sep 17 00:00:00 2001 From: John Matczak <50644033+cidrmill@users.noreply.github.com> Date: Tue, 23 Apr 2024 01:54:00 -0700 Subject: [PATCH 124/453] feat(fishy): add color to username (#12369) --- themes/fishy.zsh-theme | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/themes/fishy.zsh-theme b/themes/fishy.zsh-theme index 2b8d559e5..3b975c8f4 100644 --- a/themes/fishy.zsh-theme +++ b/themes/fishy.zsh-theme @@ -16,7 +16,8 @@ _fishy_collapsed_wd() { } local user_color='green'; [ $UID -eq 0 ] && user_color='red' -PROMPT='%n@%m %{$fg[$user_color]%}$(_fishy_collapsed_wd)%{$reset_color%}%(!.#.>) ' +local host_color='white'; [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ] && host_color='yellow' +PROMPT='%{$fg[$user_color]%}%n%{$reset_color%}@%{$fg[$host_color]%}%m %{$fg[$user_color]%}$(_fishy_collapsed_wd)%{$reset_color%}%(!.#.>) ' PROMPT2='%{$fg[red]%}\ %{$reset_color%}' local return_status="%{$fg_bold[red]%}%(?..%?)%{$reset_color%}" From 5d2d35cd1741af19553007fe0cc5324744fc58fa Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Tue, 23 Apr 2024 16:21:21 +0200 Subject: [PATCH 125/453] fix(poetry-env): do not deactivate in a subdir Closes #12377 --- plugins/poetry-env/poetry-env.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/poetry-env/poetry-env.plugin.zsh b/plugins/poetry-env/poetry-env.plugin.zsh index f98c177b4..be46717d8 100644 --- a/plugins/poetry-env/poetry-env.plugin.zsh +++ b/plugins/poetry-env/poetry-env.plugin.zsh @@ -6,7 +6,7 @@ _togglePoetryShell() { fi # Deactivate the current environment if moving out of a Poetry directory or into a different Poetry directory - if [[ $poetry_active -eq 1 ]] && { [[ $in_poetry_dir -eq 0 ]] || [[ "$PWD" != "$poetry_dir"* ]]; }; then + if [[ $poetry_active -eq 1 ]] && { [[ $in_poetry_dir -eq 0 ]] && [[ "$PWD" != "$poetry_dir"* ]]; }; then export poetry_active=0 unset poetry_dir deactivate From 803e1a784cd520f101d126b47deea3297e6a82fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 25 Apr 2024 08:04:18 +0200 Subject: [PATCH 126/453] fix(copybuffer): prevent `which` alias usage (#12379) --- plugins/copybuffer/copybuffer.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/copybuffer/copybuffer.plugin.zsh b/plugins/copybuffer/copybuffer.plugin.zsh index 88bda32a0..e636d9730 100644 --- a/plugins/copybuffer/copybuffer.plugin.zsh +++ b/plugins/copybuffer/copybuffer.plugin.zsh @@ -2,7 +2,7 @@ # onto the system clipboard copybuffer () { - if which clipcopy &>/dev/null; then + if builtin which clipcopy &>/dev/null; then printf "%s" "$BUFFER" | clipcopy else zle -M "clipcopy not found. Please make sure you have Oh My Zsh installed correctly." From 21963f4f678e69fb3154a1d43a33d531a5b3566d Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Tue, 30 Apr 2024 12:56:02 +0200 Subject: [PATCH 127/453] fix(fzf): support old `fzf` versions Closes #12387 --- plugins/fzf/fzf.plugin.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh index ac4370596..3d29f1762 100644 --- a/plugins/fzf/fzf.plugin.zsh +++ b/plugins/fzf/fzf.plugin.zsh @@ -1,8 +1,10 @@ function fzf_setup_using_fzf() { (( ${+commands[fzf]} )) || return 1 - local fzf_ver=${$(fzf --version)[1]} - is-at-least 0.48.0 $fzf_ver || return 1 + # we remove "fzf " prefix, this fixes really old fzf versions behaviour + # see https://github.com/ohmyzsh/ohmyzsh/issues/12387 + local fzf_ver=${"$(fzf --version)"#fzf } + is-at-least 0.48.0 ${${(s: :)fzf_ver}[1]} || return 1 eval "$(fzf --zsh)" } From 8581ecd462ab2714936398c54433ed1deddb2926 Mon Sep 17 00:00:00 2001 From: Antoine Date: Wed, 1 May 2024 11:04:12 +0200 Subject: [PATCH 128/453] feat(autojump): add `nix-darwin` install path (#12389) --- 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 5a52e3067..e385a2de8 100644 --- a/plugins/autojump/autojump.plugin.zsh +++ b/plugins/autojump/autojump.plugin.zsh @@ -15,6 +15,7 @@ autojump_paths=( /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 + /nix/var/nix/gcroots/current-system/sw/share/zsh/site-functions/autojump.zsh # macOS Nix, nix-darwin ) for file in $autojump_paths; do From 529f77a344de5fd53ea2235547cefd5d15d02723 Mon Sep 17 00:00:00 2001 From: stefan Date: Thu, 2 May 2024 15:11:18 +0200 Subject: [PATCH 129/453] feat(termsupport): support `alacritty*` TERM (#12392) Closes #12391 --- lib/termsupport.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index d170ffcbf..087bae9bb 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -17,7 +17,7 @@ function title { : ${2=$1} case "$TERM" in - cygwin|xterm*|putty*|rxvt*|konsole*|ansi|mlterm*|alacritty|st*|foot*|contour*) + cygwin|xterm*|putty*|rxvt*|konsole*|ansi|mlterm*|alacritty*|st*|foot*|contour*) print -Pn "\e]2;${2:q}\a" # set window name print -Pn "\e]1;${1:q}\a" # set tab name ;; @@ -129,7 +129,7 @@ fi # Don't define the function if we're in an unsupported terminal case "$TERM" in # all of these either process OSC 7 correctly or ignore entirely - xterm*|putty*|rxvt*|konsole*|mlterm*|alacritty|screen*|tmux*) ;; + xterm*|putty*|rxvt*|konsole*|mlterm*|alacritty*|screen*|tmux*) ;; contour*|foot*) ;; *) # Terminal.app and iTerm2 process OSC 7 correctly From 668ca3a32dae5ff5d164fc3be565f1e2ece248db Mon Sep 17 00:00:00 2001 From: Shai Coleman Date: Fri, 3 May 2024 20:43:53 +0100 Subject: [PATCH 130/453] fix(extract): `zst` now extracts as expected (#12395) --- plugins/extract/extract.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index 80ca50c50..1c7599195 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -87,7 +87,7 @@ EOF builtin cd -q control; extract ../control.tar.* builtin cd -q ../data; extract ../data.tar.* builtin cd -q ..; command rm *.tar.* debian-binary ;; - (*.zst) unzstd "$full_path" ;; + (*.zst) unzstd --stdout "$full_path" > "${file:t:r}" ;; (*.cab|*.exe) cabextract "$full_path" ;; (*.cpio|*.obscpio) cpio -idmvF "$full_path" ;; (*.zpaq) zpaq x "$full_path" ;; From 22bbc233e90f18ad7a02625c66d1867a5486fcbb Mon Sep 17 00:00:00 2001 From: Michael Gonzo Date: Tue, 7 May 2024 21:30:23 +0200 Subject: [PATCH 131/453] feat(python): autovenv keeps activated on subdirs (#12396) Co-authored-by: Carlo Sala --- plugins/python/README.md | 7 ++++--- plugins/python/python.plugin.zsh | 19 ++++++++++++++----- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/plugins/python/README.md b/plugins/python/README.md index c99697b22..b990a26b9 100644 --- a/plugins/python/README.md +++ b/plugins/python/README.md @@ -32,8 +32,9 @@ virtual environments: `venv`) in the current directory. - `auto_vrun`: Automatically activate the venv virtual environment when entering a directory containing - `/bin/activate`, and automatically deactivate it when navigating out of it (including - subdirectories!). + `/bin/activate`, and automatically deactivate it when navigating out of it (keeps venv activated + in subdirectories). - To enable the feature, set `export PYTHON_AUTO_VRUN=true` before sourcing oh-my-zsh. - - The default virtual environment name is `venv`. To use a different name, set + - Plugin activates first virtual environment in lexicographic order whose name begins with ``. + The default virtual environment name is `venv`. To use a different name, set `export PYTHON_VENV_NAME=`. For example: `export PYTHON_VENV_NAME=".venv"` diff --git a/plugins/python/python.plugin.zsh b/plugins/python/python.plugin.zsh index f6ea85027..7256aa04f 100644 --- a/plugins/python/python.plugin.zsh +++ b/plugins/python/python.plugin.zsh @@ -86,11 +86,20 @@ function mkv() { if [[ "$PYTHON_AUTO_VRUN" == "true" ]]; then # Automatically activate venv when changing dir - auto_vrun() { - if [[ -f "${PYTHON_VENV_NAME}/bin/activate" ]]; then - source "${PYTHON_VENV_NAME}/bin/activate" > /dev/null 2>&1 - else - (( $+functions[deactivate] )) && deactivate > /dev/null 2>&1 + function auto_vrun() { + # deactivate if we're on a different dir than VIRTUAL_ENV states + # we don't deactivate subdirectories! + if (( $+functions[deactivate] )) && [[ $PWD != ${VIRTUAL_ENV:h}* ]]; then + deactivate > /dev/null 2>&1 + fi + + if [[ $PWD != ${VIRTUAL_ENV:h} ]]; then + for _file in "${PYTHON_VENV_NAME}"*/bin/activate(N.); do + # make sure we're not in a venv already + (( $+functions[deactivate] )) && deactivate > /dev/null 2>&1 + source $_file > /dev/null 2>&1 + break + done fi } add-zsh-hook chpwd auto_vrun From 8c5f64cc2f0e75399a1e906e39713ed25b65ece1 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Mon, 6 May 2024 09:49:21 +0200 Subject: [PATCH 132/453] feat(nvm): add `corepack` to `lazy_cmd` --- plugins/nvm/README.md | 6 +++--- plugins/nvm/nvm.plugin.zsh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/nvm/README.md b/plugins/nvm/README.md index e88ce0158..eb1e236ee 100644 --- a/plugins/nvm/README.md +++ b/plugins/nvm/README.md @@ -26,9 +26,9 @@ These settings should go in your zshrc file, before Oh My Zsh is sourced: #### Lazy startup This option will help you to defer nvm's load until you use it to speed-up your zsh startup. This will source -nvm script only when using it, and will create a function for `node`, `npm`, `npx`, `pnpm`, `yarn`, and the -command(s) specified by `lazy-cmd` option, so when you call either of them, nvm will be loaded and run with -default version. To enable it, you can add this snippet to your zshrc, before Oh My Zsh is sourced: +nvm script only when using it, and will create a function for `node`, `npm`, `npx`, `pnpm`, `yarn`, `corepack` +and the command(s) specified by `lazy-cmd` option, so when you call either of them, nvm will be loaded and run +with default version. To enable it, you can add this snippet to your zshrc, before Oh My Zsh is sourced: ```zsh zstyle ':omz:plugins:nvm' lazy yes diff --git a/plugins/nvm/nvm.plugin.zsh b/plugins/nvm/nvm.plugin.zsh index c2e8de94b..95c94030a 100644 --- a/plugins/nvm/nvm.plugin.zsh +++ b/plugins/nvm/nvm.plugin.zsh @@ -72,9 +72,9 @@ function _omz_setup_autoload { } if zstyle -t ':omz:plugins:nvm' lazy; then - # Call nvm when first using nvm, node, npm, pnpm, yarn or other commands in lazy-cmd + # Call nvm when first using nvm, node, npm, pnpm, yarn, corepack or other commands in lazy-cmd zstyle -a ':omz:plugins:nvm' lazy-cmd nvm_lazy_cmd - nvm_lazy_cmd=(nvm node npm npx pnpm yarn $nvm_lazy_cmd) # default values + nvm_lazy_cmd=(nvm node npm npx pnpm yarn corepack $nvm_lazy_cmd) # default values eval " function $nvm_lazy_cmd { for func in $nvm_lazy_cmd; do From b0561d28b5a3efbbcca4700626fa32e62c23959b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 8 May 2024 22:20:42 +0200 Subject: [PATCH 133/453] fix(cli): fix edge cases in `omz plugin disable` command (#12401) Also introduces tests, which will be refactored into the proper place when a test system is finally designed. Fixes #12400 --- lib/cli.zsh | 14 +++- lib/tests/cli.test.zsh | 169 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 180 insertions(+), 3 deletions(-) create mode 100644 lib/tests/cli.test.zsh diff --git a/lib/cli.zsh b/lib/cli.zsh index 4a8d4d127..383b0cfb0 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -241,10 +241,18 @@ function _omz::plugin::disable { # Remove plugins substitution awk script local awk_subst_plugins="\ - gsub(/[ \t]+(${(j:|:)dis_plugins})/, \"\") # with spaces before - gsub(/(${(j:|:)dis_plugins})[ \t]+/, \"\") # with spaces after - gsub(/\((${(j:|:)dis_plugins})\)/, \"\") # without spaces (only plugin) + gsub(/[ \t]+(${(j:|:)dis_plugins})[ \t]+/, \" \") # with spaces before or after + gsub(/[ \t]+(${(j:|:)dis_plugins})$/, \"\") # with spaces before and EOL + gsub(/^(${(j:|:)dis_plugins})[ \t]+/, \"\") # with BOL and spaces after + + gsub(/\((${(j:|:)dis_plugins})[ \t]+/, \"(\") # with parenthesis before and spaces after + gsub(/[ \t]+(${(j:|:)dis_plugins})\)/, \")\") # with spaces before or parenthesis after + gsub(/\((${(j:|:)dis_plugins})\)/, \"()\") # with only parentheses + + gsub(/^(${(j:|:)dis_plugins})\)/, \")\") # with BOL and closing parenthesis + gsub(/\((${(j:|:)dis_plugins})$/, \"(\") # with opening parenthesis and EOL " + # Disable plugins awk script local awk_script=" # if plugins=() is in oneline form, substitute disabled plugins and go to next line diff --git a/lib/tests/cli.test.zsh b/lib/tests/cli.test.zsh new file mode 100644 index 000000000..9ee5cd219 --- /dev/null +++ b/lib/tests/cli.test.zsh @@ -0,0 +1,169 @@ +#!/usr/bin/zsh -df + +run_awk() { + local -a dis_plugins=(${=1}) + local input_text="$2" + + (( ! DEBUG )) || set -xv + + local awk_subst_plugins="\ + gsub(/[ \t]+(${(j:|:)dis_plugins})[ \t]+/, \" \") # with spaces before or after + gsub(/[ \t]+(${(j:|:)dis_plugins})$/, \"\") # with spaces before and EOL + gsub(/^(${(j:|:)dis_plugins})[ \t]+/, \"\") # with BOL and spaces after + + gsub(/\((${(j:|:)dis_plugins})[ \t]+/, \"(\") # with parenthesis before and spaces after + gsub(/[ \t]+(${(j:|:)dis_plugins})\)/, \")\") # with spaces before or parenthesis after + gsub(/\((${(j:|:)dis_plugins})\)/, \"()\") # with only parentheses + + gsub(/^(${(j:|:)dis_plugins})\)/, \")\") # with BOL and closing parenthesis + gsub(/\((${(j:|:)dis_plugins})$/, \"(\") # with opening parenthesis and EOL + " + # Disable plugins awk script + local awk_script=" + # if plugins=() is in oneline form, substitute disabled plugins and go to next line + /^[ \t]*plugins=\([^#]+\).*\$/ { + $awk_subst_plugins + print \$0 + next + } + + # if plugins=() is in multiline form, enable multi flag and disable plugins if they're there + /^[ \t]*plugins=\(/ { + multi=1 + $awk_subst_plugins + print \$0 + next + } + + # if multi flag is enabled and we find a valid closing parenthesis, remove plugins and disable multi flag + multi == 1 && /^[^#]*\)/ { + multi=0 + $awk_subst_plugins + print \$0 + next + } + + multi == 1 && length(\$0) > 0 { + $awk_subst_plugins + if (length(\$0) > 0) print \$0 + next + } + + { print \$0 } + " + + command awk "$awk_script" <<< "$input_text" + + (( ! DEBUG )) || set +xv +} + +# runs awk against stdin, checks if the resulting file is not empty and then checks if the file has valid zsh syntax +run_awk_and_test() { + local description="$1" + local plugins_to_disable="$2" + local input_text="$3" + local expected_output="$4" + + local tmpfile==(:) + + { + print -u2 "Test: $description" + DEBUG=0 run_awk "$plugins_to_disable" "$input_text" >| $tmpfile + + if [[ ! -s "$tmpfile" ]]; then + print -u2 "\e[31mError\e[0m: output file empty" + return 1 + fi + + if ! zsh -n $tmpfile; then + print -u2 "\e[31mError\e[0m: zsh syntax error" + diff -u $tmpfile <(echo "$expected_output") + return 1 + fi + + if ! diff -u --color=always $tmpfile <(echo "$expected_output"); then + if (( DEBUG )); then + print -u2 "" + DEBUG=1 run_awk "$plugins_to_disable" "$input_text" + print -u2 "" + fi + print -u2 "\e[31mError\e[0m: output file does not match expected output" + return 1 + fi + + print -u2 "\e[32mSuccess\e[0m" + } always { + print -u2 "" + command rm -f "$tmpfile" + } +} + +# These tests are for the `omz plugin disable` command +run_awk_and_test \ + "it should delete a single plugin in oneline format" \ + "git" \ + "plugins=(git)" \ + "plugins=()" + +run_awk_and_test \ + "it should delete a single plugin in multiline format" \ + "github" \ +"plugins=( + github +)" \ +"plugins=( +)" + +run_awk_and_test \ + "it should delete multiple plugins in oneline format" \ + "github git z" \ + "plugins=(github git z)" \ + "plugins=()" + +run_awk_and_test \ + "it should delete multiple plugins in multiline format" \ + "github git z" \ +"plugins=( + github + git + z +)" \ +"plugins=( +)" + +run_awk_and_test \ + "it should delete a single plugin among multiple in oneline format" \ + "git" \ + "plugins=(github git z)" \ + "plugins=(github z)" + +run_awk_and_test \ + "it should delete a single plugin among multiple in multiline format" \ + "git" \ +"plugins=( + github + git + z +)" \ +"plugins=( + github + z +)" + +run_awk_and_test \ + "it should delete multiple plugins in mixed format" \ + "git z" \ +"plugins=(github +git z)" \ +"plugins=(github +)" + +run_awk_and_test \ + "it should delete multiple plugins in mixed format 2" \ + "github z" \ +"plugins=(github + git +z)" \ +"plugins=( + git +)" From 5947c3c3c91d04fa0bff45866938027b85b56c6e Mon Sep 17 00:00:00 2001 From: Atk Date: Thu, 9 May 2024 15:57:30 +0100 Subject: [PATCH 134/453] feat(dependencies): add `wd` (#12405) Co-authored-by: Carlo Sala --- .github/dependencies.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/dependencies.yml b/.github/dependencies.yml index f760ddcef..a105f440d 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -36,3 +36,11 @@ dependencies: precopy: | set -e find . ! -name _gradle ! -name LICENSE -delete + plugins/wd: + repo: mfaerevaag/wd + branch: master + version: tag:v0.6.0 + precopy: | + set -e + rm -r test + rm install.sh tty.gif wd.1 From b1af78d64d81ade60d74f301c877d6a6394a12ab Mon Sep 17 00:00:00 2001 From: Kiran Koirala Date: Fri, 10 May 2024 13:12:47 +0545 Subject: [PATCH 135/453] fix(nvm): use `nvm version` when needed (#12409) --- plugins/nvm/nvm.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/nvm/nvm.plugin.zsh b/plugins/nvm/nvm.plugin.zsh index 95c94030a..8ca82fe83 100644 --- a/plugins/nvm/nvm.plugin.zsh +++ b/plugins/nvm/nvm.plugin.zsh @@ -54,7 +54,7 @@ function _omz_setup_autoload { if [[ "$nvmrc_node_version" = "N/A" ]]; then nvm install - elif [[ "$nvmrc_node_version" != "$node_version" ]]; then + elif [[ "$nvmrc_node_version" != "$(nvm version)" ]]; then nvm use $nvm_silent fi elif [[ -n "$(PWD=$OLDPWD nvm_find_nvmrc)" ]] && [[ "$(nvm version)" != "$(nvm version default)" ]]; then From 9af7ebcf36c20e1490a50fa5bab6319275859c17 Mon Sep 17 00:00:00 2001 From: Kiran Koirala Date: Fri, 10 May 2024 15:53:35 +0545 Subject: [PATCH 136/453] fix(nvm): use `command cat` to avoid alias (#12410) --- plugins/nvm/nvm.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/nvm/nvm.plugin.zsh b/plugins/nvm/nvm.plugin.zsh index 8ca82fe83..f36182eda 100644 --- a/plugins/nvm/nvm.plugin.zsh +++ b/plugins/nvm/nvm.plugin.zsh @@ -50,7 +50,7 @@ function _omz_setup_autoload { zstyle -t ':omz:plugins:nvm' silent-autoload && nvm_silent="--silent" if [[ -n "$nvmrc_path" ]]; then - local nvmrc_node_version=$(nvm version $(cat "$nvmrc_path" | tr -dc '[:print:]')) + local nvmrc_node_version=$(nvm version $(command cat "$nvmrc_path" | tr -dc '[:print:]')) if [[ "$nvmrc_node_version" = "N/A" ]]; then nvm install From d2cf10c29f2ebcbdbcc70ed3569aa3333d70d00d Mon Sep 17 00:00:00 2001 From: Ilya <68309482+Str1kez@users.noreply.github.com> Date: Fri, 10 May 2024 20:16:45 +0300 Subject: [PATCH 137/453] feat(procs): add completions plugin (#12406) --- plugins/procs/README.md | 9 +++++++++ plugins/procs/procs.plugin.zsh | 13 +++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 plugins/procs/README.md create mode 100644 plugins/procs/procs.plugin.zsh diff --git a/plugins/procs/README.md b/plugins/procs/README.md new file mode 100644 index 000000000..f1e663d9b --- /dev/null +++ b/plugins/procs/README.md @@ -0,0 +1,9 @@ +# procs + +This plugin provides completion for [procs](https://github.com/dalance/procs). + +To use it, add `procs` to the plugins array in your zshrc file. + +``` +plugins=(... procs) +``` diff --git a/plugins/procs/procs.plugin.zsh b/plugins/procs/procs.plugin.zsh new file mode 100644 index 000000000..332985bf9 --- /dev/null +++ b/plugins/procs/procs.plugin.zsh @@ -0,0 +1,13 @@ +if (( ! $+commands[procs] )); then + return +fi + +# If the completion file doesn't exist yet, we need to autoload it and +# bind it to `minikube`. Otherwise, compinit will have already done that. +if [[ ! -f "$ZSH_CACHE_DIR/completions/_procs" ]]; then + typeset -g -A _comps + autoload -Uz _procs + _comps[procs]=_procs +fi + +procs --gen-completion-out zsh >| "$ZSH_CACHE_DIR/completions/_procs" &| From 0fabd5f22f4e0378b09c92607789fdb17cab3c20 Mon Sep 17 00:00:00 2001 From: Francesco Ilario Date: Fri, 10 May 2024 19:17:18 +0200 Subject: [PATCH 138/453] fix(git): add checked-out branch support to `gbg*` (#12397) --- plugins/git/README.md | 4 ++-- plugins/git/git.plugin.zsh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/git/README.md b/plugins/git/README.md index 4c005ad2f..4022f8c62 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -41,8 +41,8 @@ plugins=(... git) | `gba` | `git branch --all` | | `gbd` | `git branch --delete` | | `gbD` | `git branch --delete --force` | -| `gbgd` | `LANG=C git branch --no-color -vv \| grep ": gone\]" \| awk '"'"'{print $1}'"'"' \| xargs git branch -d` | -| `gbgD` | `LANG=C git branch --no-color -vv \| grep ": gone\]" \| awk '"'"'{print $1}'"'"' \| xargs git branch -D` | +| `gbgd` | `LANG=C git branch --no-color -vv \| grep ": gone\]" \| cut -c 3- \| awk '"'"'{print $1}'"'"' \| xargs git branch -d` | +| `gbgD` | `LANG=C git branch --no-color -vv \| grep ": gone\]" \| cut -c 3- \| awk '"'"'{print $1}'"'"' \| xargs git branch -D` | | `gbm` | `git branch --move` | | `gbnm` | `git branch --no-merged` | | `gbr` | `git branch --remote` | diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 146f4a512..c48e365b5 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -147,8 +147,8 @@ function gbds() { done } -alias gbgd='LANG=C git branch --no-color -vv | grep ": gone\]" | awk '"'"'{print $1}'"'"' | xargs git branch -d' -alias gbgD='LANG=C git branch --no-color -vv | grep ": gone\]" | awk '"'"'{print $1}'"'"' | xargs git branch -D' +alias gbgd='LANG=C git branch --no-color -vv | grep ": gone\]" | cut -c 3- | awk '"'"'{print $1}'"'"' | xargs git branch -d' +alias gbgD='LANG=C git branch --no-color -vv | grep ": gone\]" | cut -c 3- | awk '"'"'{print $1}'"'"' | xargs git branch -D' alias gbm='git branch --move' alias gbnm='git branch --no-merged' alias gbr='git branch --remote' From d91f4e83efc5759a3347a2e1ae919ce0a6dda07f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 12 May 2024 09:44:11 +0200 Subject: [PATCH 139/453] fix(fzf): fix missing `is-at-least` error in setup (#12412) Fixes #12412 --- plugins/fzf/fzf.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh index 3d29f1762..48fea4f63 100644 --- a/plugins/fzf/fzf.plugin.zsh +++ b/plugins/fzf/fzf.plugin.zsh @@ -4,6 +4,8 @@ function fzf_setup_using_fzf() { # we remove "fzf " prefix, this fixes really old fzf versions behaviour # see https://github.com/ohmyzsh/ohmyzsh/issues/12387 local fzf_ver=${"$(fzf --version)"#fzf } + + autoload -Uz is-at-least is-at-least 0.48.0 ${${(s: :)fzf_ver}[1]} || return 1 eval "$(fzf --zsh)" From 83110e8ce16cd3c6bd85e7f96a920d114f598df1 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 9 May 2024 17:19:43 +0200 Subject: [PATCH 140/453] chore(dependencies): update requirements.txt --- .github/workflows/dependencies/requirements.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt index 3c4c149ea..0ef3e54ca 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -1,2 +1,6 @@ -PyYAML~=6.0.1 -requests~=2.31.0 +certifi==2024.2.2 +charset-normalizer==3.3.2 +idna==3.7 +PyYAML==6.0.1 +requests==2.31.0 +urllib3==2.2.1 From 13c8a10e39d60c078193d403b253270cdc4abc80 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 9 May 2024 17:20:09 +0200 Subject: [PATCH 141/453] style(dependencies): run `ruff` formatter --- .editorconfig | 3 + .github/workflows/dependencies/updater.py | 704 ++++++++++++---------- 2 files changed, 378 insertions(+), 329 deletions(-) diff --git a/.editorconfig b/.editorconfig index b5321de59..b349bcc42 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,3 +6,6 @@ insert_final_newline = true charset = utf-8 indent_size = 2 indent_style = space + +[*.py] +indent_size = 4 diff --git a/.github/workflows/dependencies/updater.py b/.github/workflows/dependencies/updater.py index f54d316f9..765cb26fe 100644 --- a/.github/workflows/dependencies/updater.py +++ b/.github/workflows/dependencies/updater.py @@ -1,12 +1,14 @@ import os +import shutil import subprocess import sys -import requests -import shutil -import yaml +import timeit from copy import deepcopy from typing import Optional, TypedDict +import requests +import yaml + # Get TMP_DIR variable from environment TMP_DIR = os.path.join(os.environ.get("TMP_DIR", "/tmp"), "ohmyzsh") # Relative path to dependencies.yml file @@ -14,28 +16,29 @@ DEPS_YAML_FILE = ".github/dependencies.yml" # Dry run flag DRY_RUN = os.environ.get("DRY_RUN", "0") == "1" -import timeit + class CodeTimer: - def __init__(self, name=None): - self.name = " '" + name + "'" if name else '' + def __init__(self, name=None): + self.name = " '" + name + "'" if name else "" - def __enter__(self): - self.start = timeit.default_timer() + def __enter__(self): + self.start = timeit.default_timer() - def __exit__(self, exc_type, exc_value, traceback): - self.took = (timeit.default_timer() - self.start) * 1000.0 - print('Code block' + self.name + ' took: ' + str(self.took) + ' ms') + def __exit__(self, exc_type, exc_value, traceback): + self.took = (timeit.default_timer() - self.start) * 1000.0 + print("Code block" + self.name + " took: " + str(self.took) + " ms") ### YAML representation def str_presenter(dumper, data): - """ - Configures yaml for dumping multiline strings - Ref: https://stackoverflow.com/a/33300001 - """ - if len(data.splitlines()) > 1: # check for multiline string - return dumper.represent_scalar('tag:yaml.org,2002:str', data, style='|') - return dumper.represent_scalar('tag:yaml.org,2002:str', data) + """ + Configures yaml for dumping multiline strings + Ref: https://stackoverflow.com/a/33300001 + """ + if len(data.splitlines()) > 1: # check for multiline string + return dumper.represent_scalar("tag:yaml.org,2002:str", data, style="|") + return dumper.represent_scalar("tag:yaml.org,2002:str", data) + yaml.add_representer(str, str_presenter) yaml.representer.SafeRepresenter.add_representer(str, str_presenter) @@ -43,408 +46,451 @@ yaml.representer.SafeRepresenter.add_representer(str, str_presenter) # Types class DependencyDict(TypedDict): - repo: str - branch: str - version: str - precopy: Optional[str] - postcopy: Optional[str] + repo: str + branch: str + version: str + precopy: Optional[str] + postcopy: Optional[str] + class DependencyYAML(TypedDict): - dependencies: dict[str, DependencyDict] + dependencies: dict[str, DependencyDict] + class UpdateStatus(TypedDict): - has_updates: bool - version: Optional[str] - compare_url: Optional[str] - head_ref: Optional[str] - head_url: Optional[str] + has_updates: bool + version: Optional[str] + compare_url: Optional[str] + head_ref: Optional[str] + head_url: Optional[str] class CommandRunner: - class Exception(Exception): - def __init__(self, message, returncode, stage, stdout, stderr): - super().__init__(message) - self.returncode = returncode - self.stage = stage - self.stdout = stdout - self.stderr = stderr + class Exception(Exception): + def __init__(self, message, returncode, stage, stdout, stderr): + super().__init__(message) + self.returncode = returncode + self.stage = stage + self.stdout = stdout + self.stderr = stderr - @staticmethod - def run_or_fail(command: list[str], stage: str, *args, **kwargs): - if DRY_RUN and command[0] == "gh": - command.insert(0, "echo") + @staticmethod + def run_or_fail(command: list[str], stage: str, *args, **kwargs): + if DRY_RUN and command[0] == "gh": + command.insert(0, "echo") - result = subprocess.run(command, *args, capture_output=True, **kwargs) + result = subprocess.run(command, *args, capture_output=True, **kwargs) - if result.returncode != 0: - raise CommandRunner.Exception( - f"{stage} command failed with exit code {result.returncode}", returncode=result.returncode, - stage=stage, - stdout=result.stdout.decode("utf-8"), - stderr=result.stderr.decode("utf-8") - ) + if result.returncode != 0: + raise CommandRunner.Exception( + f"{stage} command failed with exit code {result.returncode}", + returncode=result.returncode, + stage=stage, + stdout=result.stdout.decode("utf-8"), + stderr=result.stderr.decode("utf-8"), + ) - return result + return result class DependencyStore: - store: DependencyYAML = { - "dependencies": {} - } + store: DependencyYAML = {"dependencies": {}} - @staticmethod - def set(data: DependencyYAML): - DependencyStore.store = data + @staticmethod + def set(data: DependencyYAML): + DependencyStore.store = data - @staticmethod - def update_dependency_version(path: str, version: str) -> DependencyYAML: - with CodeTimer(f"store deepcopy: {path}"): - store_copy = deepcopy(DependencyStore.store) + @staticmethod + def update_dependency_version(path: str, version: str) -> DependencyYAML: + with CodeTimer(f"store deepcopy: {path}"): + store_copy = deepcopy(DependencyStore.store) - dependency = store_copy["dependencies"].get(path, {}) - dependency["version"] = version - store_copy["dependencies"][path] = dependency + dependency = store_copy["dependencies"].get(path, {}) + dependency["version"] = version + store_copy["dependencies"][path] = dependency - return store_copy + return store_copy - @staticmethod - def write_store(file: str, data: DependencyYAML): - with open(file, "w") as yaml_file: - yaml.safe_dump(data, yaml_file, sort_keys=False) + @staticmethod + def write_store(file: str, data: DependencyYAML): + with open(file, "w") as yaml_file: + yaml.safe_dump(data, yaml_file, sort_keys=False) class Dependency: - def __init__(self, path: str, values: DependencyDict): - self.path = path - self.values = values + def __init__(self, path: str, values: DependencyDict): + self.path = path + self.values = values - self.name: str = "" - self.desc: str = "" - self.kind: str = "" + self.name: str = "" + self.desc: str = "" + self.kind: str = "" - match path.split("/"): - case ["plugins", name]: - self.name = name - self.kind = "plugin" - self.desc = f"{name} plugin" - case ["themes", name]: - self.name = name.replace(".zsh-theme", "") - self.kind = "theme" - self.desc = f"{self.name} theme" - case _: - self.name = self.desc = path + match path.split("/"): + case ["plugins", name]: + self.name = name + self.kind = "plugin" + self.desc = f"{name} plugin" + case ["themes", name]: + self.name = name.replace(".zsh-theme", "") + self.kind = "theme" + self.desc = f"{self.name} theme" + case _: + self.name = self.desc = path - def __str__(self): - output: str = "" - for key in DependencyDict.__dict__['__annotations__'].keys(): - if key not in self.values: - output += f"{key}: None\n" - continue + def __str__(self): + output: str = "" + for key in DependencyDict.__dict__["__annotations__"].keys(): + if key not in self.values: + output += f"{key}: None\n" + continue - value = self.values[key] - if "\n" not in value: - output += f"{key}: {value}\n" - else: - output += f"{key}:\n " - output += value.replace("\n", "\n ", value.count("\n") - 1) - return output + value = self.values[key] + if "\n" not in value: + output += f"{key}: {value}\n" + else: + output += f"{key}:\n " + output += value.replace("\n", "\n ", value.count("\n") - 1) + return output - def update_or_notify(self): - # Print dependency settings - print(f"Processing {self.desc}...", file=sys.stderr) - print(self, file=sys.stderr) + def update_or_notify(self): + # Print dependency settings + print(f"Processing {self.desc}...", file=sys.stderr) + print(self, file=sys.stderr) - # Check for updates - repo = self.values["repo"] - remote_branch = self.values["branch"] - version = self.values["version"] - is_tag = version.startswith("tag:") - - try: - with CodeTimer(f"update check: {repo}"): - if is_tag: - status = GitHub.check_newer_tag(repo, version.replace("tag:", "")) - else: - status = GitHub.check_updates(repo, remote_branch, version) - - if status["has_updates"]: - short_sha = status["head_ref"][:8] - new_version = status["version"] if is_tag else short_sha + # Check for updates + repo = self.values["repo"] + remote_branch = self.values["branch"] + version = self.values["version"] + is_tag = version.startswith("tag:") try: - # Create new branch - branch = Git.create_branch(self.path, new_version) + with CodeTimer(f"update check: {repo}"): + if is_tag: + status = GitHub.check_newer_tag(repo, version.replace("tag:", "")) + else: + status = GitHub.check_updates(repo, remote_branch, version) - # Update dependencies.yml file - self.__update_yaml(f"tag:{new_version}" if is_tag else status["version"]) + if status["has_updates"]: + short_sha = status["head_ref"][:8] + new_version = status["version"] if is_tag else short_sha - # Update dependency files - self.__apply_upstream_changes() + try: + # Create new branch + branch = Git.create_branch(self.path, new_version) - # Add all changes and commit - Git.add_and_commit(self.name, short_sha) + # Update dependencies.yml file + self.__update_yaml( + f"tag:{new_version}" if is_tag else status["version"] + ) - # Push changes to remote - Git.push(branch) + # Update dependency files + self.__apply_upstream_changes() - # Create GitHub PR - GitHub.create_pr( - branch, - f"feat({self.name}): update to version {new_version}", - f"""## Description + # Add all changes and commit + Git.add_and_commit(self.name, short_sha) + + # Push changes to remote + Git.push(branch) + + # Create GitHub PR + GitHub.create_pr( + branch, + f"feat({self.name}): update to version {new_version}", + f"""## Description Update for **{self.desc}**: update to version [{new_version}]({status['head_url']}). Check out the [list of changes]({status['compare_url']}). -""" - ) +""", + ) - # Clean up repository - Git.clean_repo() - except (CommandRunner.Exception, shutil.Error) as e: - # Handle exception on automatic update - match type(e): - case CommandRunner.Exception: - # Print error message - print(f"Error running {e.stage} command: {e.returncode}", file=sys.stderr) - print(e.stderr, file=sys.stderr) - case shutil.Error: - print(f"Error copying files: {e}", file=sys.stderr) + # Clean up repository + Git.clean_repo() + except (CommandRunner.Exception, shutil.Error) as e: + # Handle exception on automatic update + match type(e): + case CommandRunner.Exception: + # Print error message + print( + f"Error running {e.stage} command: {e.returncode}", + file=sys.stderr, + ) + print(e.stderr, file=sys.stderr) + case shutil.Error: + print(f"Error copying files: {e}", file=sys.stderr) - try: - Git.clean_repo() - except CommandRunner.Exception as e: - print(f"Error reverting repository to clean state: {e}", file=sys.stderr) - sys.exit(1) + try: + Git.clean_repo() + except CommandRunner.Exception as e: + print( + f"Error reverting repository to clean state: {e}", + file=sys.stderr, + ) + sys.exit(1) - # Create a GitHub issue to notify maintainer - title = f"{self.path}: update to {new_version}" - body = ( - f"""## Description + # Create a GitHub issue to notify maintainer + title = f"{self.path}: update to {new_version}" + body = f"""## Description There is a new version of `{self.name}` {self.kind} available. New version: [{new_version}]({status['head_url']}) Check out the [list of changes]({status['compare_url']}). """ - ) - print(f"Creating GitHub issue", file=sys.stderr) - print(f"{title}\n\n{body}", file=sys.stderr) - GitHub.create_issue(title, body) - except Exception as e: - print(e, file=sys.stderr) + print("Creating GitHub issue", file=sys.stderr) + print(f"{title}\n\n{body}", file=sys.stderr) + GitHub.create_issue(title, body) + except Exception as e: + print(e, file=sys.stderr) - def __update_yaml(self, new_version: str) -> None: - dep_yaml = DependencyStore.update_dependency_version(self.path, new_version) - DependencyStore.write_store(DEPS_YAML_FILE, dep_yaml) + def __update_yaml(self, new_version: str) -> None: + dep_yaml = DependencyStore.update_dependency_version(self.path, new_version) + DependencyStore.write_store(DEPS_YAML_FILE, dep_yaml) - def __apply_upstream_changes(self) -> None: - # Patterns to ignore in copying files from upstream repo - GLOBAL_IGNORE = [ - ".git", - ".github", - ".gitignore" - ] + def __apply_upstream_changes(self) -> None: + # Patterns to ignore in copying files from upstream repo + GLOBAL_IGNORE = [".git", ".github", ".gitignore"] - path = os.path.abspath(self.path) - precopy = self.values.get("precopy") - postcopy = self.values.get("postcopy") + path = os.path.abspath(self.path) + precopy = self.values.get("precopy") + postcopy = self.values.get("postcopy") - repo = self.values["repo"] - branch = self.values["branch"] - remote_url = f"https://github.com/{repo}.git" - repo_dir = os.path.join(TMP_DIR, repo) + repo = self.values["repo"] + branch = self.values["branch"] + remote_url = f"https://github.com/{repo}.git" + repo_dir = os.path.join(TMP_DIR, repo) - # Clone repository - Git.clone(remote_url, branch, repo_dir, reclone=True) + # Clone repository + Git.clone(remote_url, branch, repo_dir, reclone=True) - # Run precopy on tmp repo - if precopy is not None: - print("Running precopy script:", end="\n ", file=sys.stderr) - print(precopy.replace("\n", "\n ", precopy.count("\n") - 1), file=sys.stderr) - CommandRunner.run_or_fail(["bash", "-c", precopy], cwd=repo_dir, stage="Precopy") + # Run precopy on tmp repo + if precopy is not None: + print("Running precopy script:", end="\n ", file=sys.stderr) + print( + precopy.replace("\n", "\n ", precopy.count("\n") - 1), file=sys.stderr + ) + CommandRunner.run_or_fail( + ["bash", "-c", precopy], cwd=repo_dir, stage="Precopy" + ) - # Copy files from upstream repo - print(f"Copying files from {repo_dir} to {path}", file=sys.stderr) - shutil.copytree(repo_dir, path, dirs_exist_ok=True, ignore=shutil.ignore_patterns(*GLOBAL_IGNORE)) + # Copy files from upstream repo + print(f"Copying files from {repo_dir} to {path}", file=sys.stderr) + shutil.copytree( + repo_dir, + path, + dirs_exist_ok=True, + ignore=shutil.ignore_patterns(*GLOBAL_IGNORE), + ) - # Run postcopy on our repository - if postcopy is not None: - print("Running postcopy script:", end="\n ", file=sys.stderr) - print(postcopy.replace("\n", "\n ", postcopy.count("\n") - 1), file=sys.stderr) - CommandRunner.run_or_fail(["bash", "-c", postcopy], cwd=path, stage="Postcopy") + # Run postcopy on our repository + if postcopy is not None: + print("Running postcopy script:", end="\n ", file=sys.stderr) + print( + postcopy.replace("\n", "\n ", postcopy.count("\n") - 1), + file=sys.stderr, + ) + CommandRunner.run_or_fail( + ["bash", "-c", postcopy], cwd=path, stage="Postcopy" + ) class Git: - default_branch = "master" + default_branch = "master" - @staticmethod - def clone(remote_url: str, branch: str, repo_dir: str, reclone=False): - # If repo needs to be fresh - if reclone and os.path.exists(repo_dir): - shutil.rmtree(repo_dir) + @staticmethod + def clone(remote_url: str, branch: str, repo_dir: str, reclone=False): + # If repo needs to be fresh + if reclone and os.path.exists(repo_dir): + shutil.rmtree(repo_dir) - # Clone repo in tmp directory and checkout branch - if not os.path.exists(repo_dir): - print(f"Cloning {remote_url} to {repo_dir} and checking out {branch}", file=sys.stderr) - CommandRunner.run_or_fail(["git", "clone", "--depth=1", "-b", branch, remote_url, repo_dir], stage="Clone") + # Clone repo in tmp directory and checkout branch + if not os.path.exists(repo_dir): + print( + f"Cloning {remote_url} to {repo_dir} and checking out {branch}", + file=sys.stderr, + ) + CommandRunner.run_or_fail( + ["git", "clone", "--depth=1", "-b", branch, remote_url, repo_dir], + stage="Clone", + ) - @staticmethod - def create_branch(path: str, version: str): - # Get current branch name - result = CommandRunner.run_or_fail(["git", "rev-parse", "--abbrev-ref", "HEAD"], stage="GetDefaultBranch") - Git.default_branch = result.stdout.decode("utf-8").strip() + @staticmethod + def create_branch(path: str, version: str): + # Get current branch name + result = CommandRunner.run_or_fail( + ["git", "rev-parse", "--abbrev-ref", "HEAD"], stage="GetDefaultBranch" + ) + Git.default_branch = result.stdout.decode("utf-8").strip() - # Create new branch and return created branch name - branch_name = f"update/{path}/{version}" - CommandRunner.run_or_fail(["git", "checkout", "-b", branch_name], stage="CreateBranch") - return branch_name + # Create new branch and return created branch name + branch_name = f"update/{path}/{version}" + CommandRunner.run_or_fail( + ["git", "checkout", "-b", branch_name], stage="CreateBranch" + ) + return branch_name - @staticmethod - def add_and_commit(scope: str, version: str): - user_name = os.environ.get("GIT_APP_NAME") - user_email = os.environ.get("GIT_APP_EMAIL") + @staticmethod + def add_and_commit(scope: str, version: str): + user_name = os.environ.get("GIT_APP_NAME") + user_email = os.environ.get("GIT_APP_EMAIL") - # Add all files to git staging - CommandRunner.run_or_fail(["git", "add", "-A", "-v"], stage="AddFiles") + # Add all files to git staging + CommandRunner.run_or_fail(["git", "add", "-A", "-v"], stage="AddFiles") - # Reset environment and git config - clean_env = os.environ.copy() - clean_env["LANG"]="C.UTF-8" - clean_env["GIT_CONFIG_GLOBAL"]="/dev/null" - clean_env["GIT_CONFIG_NOSYSTEM"]="1" + # Reset environment and git config + clean_env = os.environ.copy() + clean_env["LANG"] = "C.UTF-8" + clean_env["GIT_CONFIG_GLOBAL"] = "/dev/null" + clean_env["GIT_CONFIG_NOSYSTEM"] = "1" - # Commit with settings above - CommandRunner.run_or_fail([ - "git", - "-c", f"user.name={user_name}", - "-c", f"user.email={user_email}", - "commit", - "-m", f"feat({scope}): update to {version}" - ], stage="CreateCommit", env=clean_env) + # Commit with settings above + CommandRunner.run_or_fail( + [ + "git", + "-c", + f"user.name={user_name}", + "-c", + f"user.email={user_email}", + "commit", + "-m", + f"feat({scope}): update to {version}", + ], + stage="CreateCommit", + env=clean_env, + ) - @staticmethod - def push(branch: str): - CommandRunner.run_or_fail(["git", "push", "-u", "origin", branch], stage="PushBranch") + @staticmethod + def push(branch: str): + CommandRunner.run_or_fail( + ["git", "push", "-u", "origin", branch], stage="PushBranch" + ) - @staticmethod - def clean_repo(): - CommandRunner.run_or_fail(["git", "reset", "--hard", "HEAD"], stage="ResetRepository") - CommandRunner.run_or_fail(["git", "checkout", Git.default_branch], stage="CheckoutDefaultBranch") + @staticmethod + def clean_repo(): + CommandRunner.run_or_fail( + ["git", "reset", "--hard", "HEAD"], stage="ResetRepository" + ) + CommandRunner.run_or_fail( + ["git", "checkout", Git.default_branch], stage="CheckoutDefaultBranch" + ) class GitHub: - @staticmethod - def check_newer_tag(repo, current_tag) -> UpdateStatus: - # GET /repos/:owner/:repo/git/refs/tags - url = f"https://api.github.com/repos/{repo}/git/refs/tags" + @staticmethod + def check_newer_tag(repo, current_tag) -> UpdateStatus: + # GET /repos/:owner/:repo/git/refs/tags + url = f"https://api.github.com/repos/{repo}/git/refs/tags" - # Send a GET request to the GitHub API - response = requests.get(url) + # Send a GET request to the GitHub API + response = requests.get(url) - # If the request was successful - if response.status_code == 200: - # Parse the JSON response - data = response.json() + # If the request was successful + if response.status_code == 200: + # Parse the JSON response + data = response.json() - if len(data) == 0: - return { - "has_updates": False, - } + if len(data) == 0: + return { + "has_updates": False, + } - latest_ref = data[-1] - latest_tag = latest_ref["ref"].replace("refs/tags/", "") + latest_ref = data[-1] + latest_tag = latest_ref["ref"].replace("refs/tags/", "") - if latest_tag == current_tag: - return { - "has_updates": False, - } + if latest_tag == current_tag: + return { + "has_updates": False, + } - return { - "has_updates": True, - "version": latest_tag, - "compare_url": f"https://github.com/{repo}/compare/{current_tag}...{latest_tag}", - "head_ref": latest_ref["object"]["sha"], - "head_url": f"https://github.com/{repo}/releases/tag/{latest_tag}", - } - else: - # If the request was not successful, raise an exception - raise Exception(f"GitHub API request failed with status code {response.status_code}: {response.json()}") + return { + "has_updates": True, + "version": latest_tag, + "compare_url": f"https://github.com/{repo}/compare/{current_tag}...{latest_tag}", + "head_ref": latest_ref["object"]["sha"], + "head_url": f"https://github.com/{repo}/releases/tag/{latest_tag}", + } + else: + # If the request was not successful, raise an exception + raise Exception( + f"GitHub API request failed with status code {response.status_code}: {response.json()}" + ) - @staticmethod - def check_updates(repo, branch, version) -> UpdateStatus: - # TODO: add support for semver updating (based on tags) - # Check if upstream github repo has a new version - # GitHub API URL for comparing two commits - url = f"https://api.github.com/repos/{repo}/compare/{version}...{branch}" + @staticmethod + def check_updates(repo, branch, version) -> UpdateStatus: + # TODO: add support for semver updating (based on tags) + # Check if upstream github repo has a new version + # GitHub API URL for comparing two commits + url = f"https://api.github.com/repos/{repo}/compare/{version}...{branch}" - # Send a GET request to the GitHub API - response = requests.get(url) + # Send a GET request to the GitHub API + response = requests.get(url) - # If the request was successful - if response.status_code == 200: - # Parse the JSON response - data = response.json() + # If the request was successful + if response.status_code == 200: + # Parse the JSON response + data = response.json() - # If the base is behind the head, there is a newer version - has_updates = data["status"] != "identical" + # If the base is behind the head, there is a newer version + has_updates = data["status"] != "identical" - if not has_updates: - return { - "has_updates": False, - } + if not has_updates: + return { + "has_updates": False, + } - return { - "has_updates": data["status"] != "identical", - "version": data["commits"][-1]["sha"], - "compare_url": data["permalink_url"], - "head_ref": data["commits"][-1]["sha"], - "head_url": data["commits"][-1]["html_url"] - } - else: - # If the request was not successful, raise an exception - raise Exception(f"GitHub API request failed with status code {response.status_code}: {response.json()}") + return { + "has_updates": data["status"] != "identical", + "version": data["commits"][-1]["sha"], + "compare_url": data["permalink_url"], + "head_ref": data["commits"][-1]["sha"], + "head_url": data["commits"][-1]["html_url"], + } + else: + # If the request was not successful, raise an exception + raise Exception( + f"GitHub API request failed with status code {response.status_code}: {response.json()}" + ) - @staticmethod - def create_issue(title: str, body: str) -> None: - cmd = [ - "gh", - "issue", - "create", - "-t", title, - "-b", body - ] - CommandRunner.run_or_fail(cmd, stage="CreateIssue") + @staticmethod + def create_issue(title: str, body: str) -> None: + cmd = ["gh", "issue", "create", "-t", title, "-b", body] + CommandRunner.run_or_fail(cmd, stage="CreateIssue") - @staticmethod - def create_pr(branch: str, title: str, body: str) -> None: - cmd = [ - "gh", - "pr", - "create", - "-B", Git.default_branch, - "-H", branch, - "-t", title, - "-b", body - ] - CommandRunner.run_or_fail(cmd, stage="CreatePullRequest") + @staticmethod + def create_pr(branch: str, title: str, body: str) -> None: + cmd = [ + "gh", + "pr", + "create", + "-B", + Git.default_branch, + "-H", + branch, + "-t", + title, + "-b", + body, + ] + CommandRunner.run_or_fail(cmd, stage="CreatePullRequest") def main(): - # Load the YAML file - with open(DEPS_YAML_FILE, "r") as yaml_file: - data: DependencyYAML = yaml.safe_load(yaml_file) + # Load the YAML file + with open(DEPS_YAML_FILE, "r") as yaml_file: + data: DependencyYAML = yaml.safe_load(yaml_file) - if "dependencies" not in data: - raise Exception(f"dependencies.yml not properly formatted") + if "dependencies" not in data: + raise Exception("dependencies.yml not properly formatted") - # Cache YAML version - DependencyStore.set(data) + # Cache YAML version + DependencyStore.set(data) + + dependencies = data["dependencies"] + for path in dependencies: + dependency = Dependency(path, dependencies[path]) + dependency.update_or_notify() - dependencies = data["dependencies"] - for path in dependencies: - dependency = Dependency(path, dependencies[path]) - dependency.update_or_notify() if __name__ == "__main__": - main() + main() From a258eb4547e610899162526f754ce1bf88027112 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 9 May 2024 18:27:01 +0200 Subject: [PATCH 142/453] fix(dependencies): improve typing --- .github/workflows/dependencies/updater.py | 36 +++++++++++++---------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/dependencies/updater.py b/.github/workflows/dependencies/updater.py index 765cb26fe..9754cdf83 100644 --- a/.github/workflows/dependencies/updater.py +++ b/.github/workflows/dependencies/updater.py @@ -4,7 +4,7 @@ import subprocess import sys import timeit from copy import deepcopy -from typing import Optional, TypedDict +from typing import Literal, NotRequired, TypedDict import requests import yaml @@ -49,20 +49,24 @@ class DependencyDict(TypedDict): repo: str branch: str version: str - precopy: Optional[str] - postcopy: Optional[str] + precopy: NotRequired[str] + postcopy: NotRequired[str] class DependencyYAML(TypedDict): dependencies: dict[str, DependencyDict] -class UpdateStatus(TypedDict): - has_updates: bool - version: Optional[str] - compare_url: Optional[str] - head_ref: Optional[str] - head_url: Optional[str] +class UpdateStatusFalse(TypedDict): + has_updates: Literal[False] + + +class UpdateStatusTrue(TypedDict): + has_updates: Literal[True] + version: str + compare_url: str + head_ref: str + head_url: str class CommandRunner: @@ -105,7 +109,9 @@ class DependencyStore: with CodeTimer(f"store deepcopy: {path}"): store_copy = deepcopy(DependencyStore.store) - dependency = store_copy["dependencies"].get(path, {}) + dependency = store_copy["dependencies"].get(path) + if dependency is None: + raise ValueError(f"Dependency {path} {version} not found") dependency["version"] = version store_copy["dependencies"][path] = dependency @@ -171,7 +177,7 @@ class Dependency: else: status = GitHub.check_updates(repo, remote_branch, version) - if status["has_updates"]: + if status["has_updates"] is True: short_sha = status["head_ref"][:8] new_version = status["version"] if is_tag else short_sha @@ -212,10 +218,10 @@ Check out the [list of changes]({status['compare_url']}). case CommandRunner.Exception: # Print error message print( - f"Error running {e.stage} command: {e.returncode}", + f"Error running {e.stage} command: {e.returncode}", # pyright: ignore[reportAttributeAccessIssue] file=sys.stderr, ) - print(e.stderr, file=sys.stderr) + print(e.stderr, file=sys.stderr) # pyright: ignore[reportAttributeAccessIssue] case shutil.Error: print(f"Error copying files: {e}", file=sys.stderr) @@ -378,7 +384,7 @@ class Git: class GitHub: @staticmethod - def check_newer_tag(repo, current_tag) -> UpdateStatus: + def check_newer_tag(repo, current_tag) -> UpdateStatusFalse | UpdateStatusTrue: # GET /repos/:owner/:repo/git/refs/tags url = f"https://api.github.com/repos/{repo}/git/refs/tags" @@ -417,7 +423,7 @@ class GitHub: ) @staticmethod - def check_updates(repo, branch, version) -> UpdateStatus: + def check_updates(repo, branch, version) -> UpdateStatusFalse | UpdateStatusTrue: # TODO: add support for semver updating (based on tags) # Check if upstream github repo has a new version # GitHub API URL for comparing two commits From 423b9a8ded10b0d4a81d6134c4045d0b7e077eb5 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 9 May 2024 19:20:11 +0200 Subject: [PATCH 143/453] feat(dependencies): add support for semver tags --- .../workflows/dependencies/requirements.txt | 1 + .github/workflows/dependencies/updater.py | 62 +++++++++++++++++-- 2 files changed, 57 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt index 0ef3e54ca..7e840a74c 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -3,4 +3,5 @@ charset-normalizer==3.3.2 idna==3.7 PyYAML==6.0.1 requests==2.31.0 +semver==3.0.2 urllib3==2.2.1 diff --git a/.github/workflows/dependencies/updater.py b/.github/workflows/dependencies/updater.py index 9754cdf83..7e8e92ca9 100644 --- a/.github/workflows/dependencies/updater.py +++ b/.github/workflows/dependencies/updater.py @@ -1,13 +1,15 @@ import os +import re import shutil import subprocess import sys import timeit from copy import deepcopy -from typing import Literal, NotRequired, TypedDict +from typing import Literal, NotRequired, Optional, TypedDict import requests import yaml +from semver import Version # Get TMP_DIR variable from environment TMP_DIR = os.path.join(os.environ.get("TMP_DIR", "/tmp"), "ohmyzsh") @@ -16,6 +18,35 @@ DEPS_YAML_FILE = ".github/dependencies.yml" # Dry run flag DRY_RUN = os.environ.get("DRY_RUN", "0") == "1" +# utils for tag comparison +BASEVERSION = re.compile( + r"""[vV]? + (?P(0|[1-9])\d*) + (\. + (?P(0|[1-9])\d*) + (\. + (?P(0|[1-9])\d*) + )? + )? + """, + re.VERBOSE, +) + + +def coerce(version: str) -> Optional[Version]: + match = BASEVERSION.search(version) + if not match: + return None + + # BASEVERSION looks for `MAJOR.minor.patch` in the string given + # it fills with None if any of them is missing (for example `2.1`) + ver = { + key: 0 if value is None else value for key, value in match.groupdict().items() + } + # Version takes `major`, `minor`, `patch` arguments + ver = Version(**ver) # pyright: ignore[reportArgumentType] + return ver + class CodeTimer: def __init__(self, name=None): @@ -390,6 +421,11 @@ class GitHub: # Send a GET request to the GitHub API response = requests.get(url) + current_version = coerce(current_tag) + if current_version is None: + raise ValueError( + f"Stored {current_version} from {repo} does not follow semver" + ) # If the request was successful if response.status_code == 200: @@ -401,10 +437,27 @@ class GitHub: "has_updates": False, } - latest_ref = data[-1] + latest_ref = None + latest_version: Optional[Version] = None + for ref in data: + # we find the tag since GitHub returns it as plain git ref + tag_version = coerce(ref["ref"].replace("refs/tags/", "")) + if tag_version is None: + # we skip every tag that is not semver-complaint + continue + if latest_version is None or tag_version.compare(latest_version) > 0: + # if we have a "greater" semver version, set it as latest + latest_version = tag_version + latest_ref = ref + + # raise if no valid semver tag is found + if latest_ref is None or latest_version is None: + raise ValueError(f"No tags following semver found in {repo}") + + # we get the tag since GitHub returns it as plain git ref latest_tag = latest_ref["ref"].replace("refs/tags/", "") - if latest_tag == current_tag: + if latest_version.compare(current_version) <= 0: return { "has_updates": False, } @@ -424,9 +477,6 @@ class GitHub: @staticmethod def check_updates(repo, branch, version) -> UpdateStatusFalse | UpdateStatusTrue: - # TODO: add support for semver updating (based on tags) - # Check if upstream github repo has a new version - # GitHub API URL for comparing two commits url = f"https://api.github.com/repos/{repo}/compare/{version}...{branch}" # Send a GET request to the GitHub API From eb2ff84a2c8ae45b90d36e367c6bd6bc01f8464d Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 9 May 2024 19:52:50 +0200 Subject: [PATCH 144/453] fix(dependencies): avoid creating PR if it's already there --- .github/workflows/dependencies/updater.py | 42 +++++++++++++++++++---- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dependencies/updater.py b/.github/workflows/dependencies/updater.py index 7e8e92ca9..6fa32e378 100644 --- a/.github/workflows/dependencies/updater.py +++ b/.github/workflows/dependencies/updater.py @@ -1,3 +1,4 @@ +import json import os import re import shutil @@ -213,8 +214,10 @@ class Dependency: new_version = status["version"] if is_tag else short_sha try: + branch_name = f"update/{self.path}/{new_version}" + # Create new branch - branch = Git.create_branch(self.path, new_version) + branch = Git.checkout_or_create_branch(branch_name) # Update dependencies.yml file self.__update_yaml( @@ -353,7 +356,7 @@ class Git: ) @staticmethod - def create_branch(path: str, version: str): + def checkout_or_create_branch(branch_name: str): # Get current branch name result = CommandRunner.run_or_fail( ["git", "rev-parse", "--abbrev-ref", "HEAD"], stage="GetDefaultBranch" @@ -361,10 +364,16 @@ class Git: Git.default_branch = result.stdout.decode("utf-8").strip() # Create new branch and return created branch name - branch_name = f"update/{path}/{version}" - CommandRunner.run_or_fail( - ["git", "checkout", "-b", branch_name], stage="CreateBranch" - ) + try: + # try to checkout already existing branch + CommandRunner.run_or_fail( + ["git", "checkout", branch_name], stage="CreateBranch" + ) + except CommandRunner.Exception: + # otherwise create new branch + CommandRunner.run_or_fail( + ["git", "checkout", "-b", branch_name], stage="CreateBranch" + ) return branch_name @staticmethod @@ -515,6 +524,27 @@ class GitHub: @staticmethod def create_pr(branch: str, title: str, body: str) -> None: + # first of all let's check if PR is already open + check_cmd = [ + "gh", + "pr", + "list", + "--state", + "open", + "--head", + branch, + "--json", + "title", + ] + # returncode is 0 also if no PRs are found + output = json.loads( + CommandRunner.run_or_fail(check_cmd, stage="CheckPullRequestOpen") + .stdout.decode("utf-8") + .strip() + ) + # we have PR in this case! + if len(output) > 0: + return cmd = [ "gh", "pr", From eff648aab021df0407dcd86126d2ab9db950d0f2 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 9 May 2024 17:41:59 +0200 Subject: [PATCH 145/453] ci(dependencies): use `setup-python` and enable cron-based jobs --- .github/workflows/dependencies.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index 2e2217e1c..fce666e4c 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -1,8 +1,8 @@ name: Update dependencies on: workflow_dispatch: {} - # schedule: - # - cron: '34 3 * * */8' + schedule: + - cron: '34 3 * * */8' jobs: check: @@ -18,6 +18,11 @@ jobs: with: app_id: ${{ secrets.OHMYZSH_APP_ID }} private_key: ${{ secrets.OHMYZSH_APP_PRIVATE_KEY }} + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: "pip" - name: Process dependencies env: GH_TOKEN: ${{ steps.generate_token.outputs.token }} From 1d31ff603706007e69aefe2c9ca198658e35b5dc Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Sun, 12 May 2024 12:30:22 +0200 Subject: [PATCH 146/453] ci(dependencies): fetch all branches --- .github/workflows/dependencies.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index fce666e4c..6bc8dc74d 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -2,7 +2,7 @@ name: Update dependencies on: workflow_dispatch: {} schedule: - - cron: '34 3 * * */8' + - cron: "34 3 * * */8" jobs: check: @@ -12,6 +12,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Authenticate as @ohmyzsh id: generate_token uses: ohmyzsh/github-app-token@v2 From 0493eab8ce02c4988a16cbe27ad61a20ed8a89df Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Sun, 12 May 2024 12:40:45 +0200 Subject: [PATCH 147/453] fix(dependencies): check if repo is clean before committing --- .github/workflows/dependencies/updater.py | 36 +++++++++++++---------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/dependencies/updater.py b/.github/workflows/dependencies/updater.py index 6fa32e378..4533b7aeb 100644 --- a/.github/workflows/dependencies/updater.py +++ b/.github/workflows/dependencies/updater.py @@ -390,21 +390,27 @@ class Git: clean_env["GIT_CONFIG_GLOBAL"] = "/dev/null" clean_env["GIT_CONFIG_NOSYSTEM"] = "1" - # Commit with settings above - CommandRunner.run_or_fail( - [ - "git", - "-c", - f"user.name={user_name}", - "-c", - f"user.email={user_email}", - "commit", - "-m", - f"feat({scope}): update to {version}", - ], - stage="CreateCommit", - env=clean_env, - ) + # check if repo is clean (clean => no error, no commit) + try: + CommandRunner.run_or_fail( + ["git", "diff", "--exit-code"], stage="CheckRepoClean", env=clean_env + ) + except CommandRunner.Exception: + # Commit with settings above + CommandRunner.run_or_fail( + [ + "git", + "-c", + f"user.name={user_name}", + "-c", + f"user.email={user_email}", + "commit", + "-m", + f"feat({scope}): update to {version}", + ], + stage="CreateCommit", + env=clean_env, + ) @staticmethod def push(branch: str): From b1c5315a5fbc33624525e434ddbaec3bb30030e2 Mon Sep 17 00:00:00 2001 From: "ohmyzsh[bot]" <54982679+ohmyzsh[bot]@users.noreply.github.com> Date: Sun, 12 May 2024 12:42:59 +0200 Subject: [PATCH 148/453] feat(wd): update to version v0.6.1 (#12413) Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com> --- .github/dependencies.yml | 2 +- plugins/wd/README.md | 28 +++++++++++++++++++++++++++- plugins/wd/wd.plugin.zsh | 7 ++++++- plugins/wd/wd.sh | 37 +++++++++++++++++++++++++++++-------- 4 files changed, 63 insertions(+), 11 deletions(-) mode change 100644 => 100755 plugins/wd/wd.sh diff --git a/.github/dependencies.yml b/.github/dependencies.yml index a105f440d..6ae97ad4e 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -39,7 +39,7 @@ dependencies: plugins/wd: repo: mfaerevaag/wd branch: master - version: tag:v0.6.0 + version: tag:v0.6.1 precopy: | set -e rm -r test diff --git a/plugins/wd/README.md b/plugins/wd/README.md index 0ad74e805..0c71c0565 100644 --- a/plugins/wd/README.md +++ b/plugins/wd/README.md @@ -57,6 +57,24 @@ wd() { } ``` +### [Home Manager](https://github.com/nix-community/home-manager) + +Add the following to your `home.nix` then run `home-manager switch`: + +```nix +programs.zsh.plugins = [ + { + name = "wd"; + src = pkgs.fetchFromGitHub { + owner = "mfaerevaag"; + repo = "wd"; + rev = "v0.5.2"; + sha256 = "sha256-4yJ1qhqhNULbQmt6Z9G22gURfDLe30uV1ascbzqgdhg="; + }; + } +]; +``` + ### [zplug](https://github.com/zplug/zplug) ```zsh @@ -119,6 +137,14 @@ Also, you may have to force a rebuild of `zcompdump` by running: rm -f ~/.zcompdump; compinit ``` +## Browse + +If you want to make use of the `fzf`-powered browse feature to fuzzy search through all your warp points, set up a keybind in your `.zshrc`: + +```zsh +bindkey '^G' wd_browse +``` + ## Usage * Add warp point to current working directory: @@ -153,7 +179,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.plugin.zsh b/plugins/wd/wd.plugin.zsh index ca2ca7c65..9e0c7ff13 100644 --- a/plugins/wd/wd.plugin.zsh +++ b/plugins/wd/wd.plugin.zsh @@ -8,8 +8,13 @@ # @github.com/mfaerevaag/wd # Handle $0 according to the standard: -# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html +# # https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html 0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" 0="${${(M)0:#/*}:-$PWD/$0}" eval "wd() { source '${0:A:h}/wd.sh' }" +wd > /dev/null +# Register the function as a Zsh widget +zle -N wd_browse +# Bind the widget to a key combination +bindkey '^G' wd_browse diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh old mode 100644 new mode 100755 index 840e92d61..c4f422cbf --- a/plugins/wd/wd.sh +++ b/plugins/wd/wd.sh @@ -8,7 +8,7 @@ # @github.com/mfaerevaag/wd # version -readonly WD_VERSION=0.5.0 +readonly WD_VERSION=0.6.1 # colors readonly WD_BLUE="\033[96m" @@ -57,12 +57,11 @@ wd_print_msg() { if [[ -z $wd_quiet_mode ]] then - local color=$1 - local msg=$2 + local color="${1:-$WD_BLUE}" # Default to blue if no color is provided + local msg="$2" - if [[ $color == "" || $msg == "" ]] - then - print " ${WD_RED}*${WD_NOC} Could not print message. Sorry!" + if [[ -z "$msg" ]]; then + print "${WD_RED}*${WD_NOC} Could not print message. Sorry!" else print " ${color}*${WD_NOC} ${msg}" fi @@ -230,6 +229,20 @@ wd_remove() done } +wd_browse() { + if ! command -v fzf >/dev/null; then + echo "This functionality requires fzf. Please install fzf first." + return 1 + fi + local entries=("${(@f)$(sed "s:${HOME}:~:g" "$WD_CONFIG" | awk -F ':' '{print $1 " -> " $2}')}") + local selected_entry=$(printf '%s\n' "${entries[@]}" | fzf --height 40% --reverse) + if [[ -n $selected_entry ]]; then + local selected_point="${selected_entry%% ->*}" + selected_point=$(echo "$selected_point" | xargs) + wd $selected_point + fi +} + wd_list_all() { wd_print_msg "$WD_BLUE" "All warp points:" @@ -396,7 +409,9 @@ fi # disable extendedglob for the complete wd execution time setopt | grep -q extendedglob wd_extglob_is_set=$? -(( ! $wd_extglob_is_set )) && setopt noextendedglob +if (( wd_extglob_is_set == 0 )); then + setopt noextendedglob +fi # load warp points typeset -A points @@ -436,6 +451,10 @@ else wd_add "$2" "$wd_force_mode" break ;; + "-b"|"browse") + wd_browse + break + ;; "-e"|"export") wd_export_static_named_directories break @@ -484,7 +503,9 @@ fi # if not, next time warp will pick up variables from this run # remember, there's no sub shell -(( ! $wd_extglob_is_set )) && setopt extendedglob +if (( wd_extglob_is_set == 0 )); then + setopt extendedglob +fi unset wd_extglob_is_set unset wd_warp From a8a747e18abe41b26de0b892e888ad5c386abc3f Mon Sep 17 00:00:00 2001 From: Juho Kuisma Date: Wed, 15 May 2024 20:14:11 +0300 Subject: [PATCH 149/453] feat(fzf): add support for Fedora package (#12421) --- plugins/fzf/fzf.plugin.zsh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh index 48fea4f63..e244b4cfb 100644 --- a/plugins/fzf/fzf.plugin.zsh +++ b/plugins/fzf/fzf.plugin.zsh @@ -148,6 +148,27 @@ function fzf_setup_using_opensuse() { return 0 } +function fzf_setup_using_fedora() { + (( $+commands[fzf] )) || return 1 + + local completions="/usr/share/zsh/site-functions/fzf" + local key_bindings="/usr/share/fzf/shell/key-bindings.zsh" + + if [[ ! -f "$completions" || ! -f "$key_bindings" ]]; then + return 1 + fi + + if [[ -o interactive && "$DISABLE_FZF_AUTO_COMPLETION" != "true" ]]; then + source "$completions" 2>/dev/null + fi + + if [[ "$DISABLE_FZF_KEY_BINDINGS" != "true" ]]; then + source "$key_bindings" 2>/dev/null + fi + + return 0 +} + function fzf_setup_using_openbsd() { # openBSD installs fzf in /usr/local/bin/fzf if [[ "$OSTYPE" != openbsd* ]] || (( ! $+commands[fzf] )); then @@ -234,6 +255,7 @@ fzf_setup_using_fzf \ || fzf_setup_using_openbsd \ || fzf_setup_using_debian \ || fzf_setup_using_opensuse \ + || fzf_setup_using_fedora \ || fzf_setup_using_cygwin \ || fzf_setup_using_macports \ || fzf_setup_using_base_dir \ From fb91ca27a2d65b834e98a3986cfee73ad82ea412 Mon Sep 17 00:00:00 2001 From: Fritz Reichwald Date: Wed, 15 May 2024 19:27:21 +0200 Subject: [PATCH 150/453] feat(amuse): add whitespace before virtualenv (#12423) --- themes/amuse.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/amuse.zsh-theme b/themes/amuse.zsh-theme index d787fdaa4..cddbcd40d 100644 --- a/themes/amuse.zsh-theme +++ b/themes/amuse.zsh-theme @@ -17,7 +17,7 @@ $ ' RPROMPT='$(ruby_prompt_info)' VIRTUAL_ENV_DISABLE_PROMPT=0 -ZSH_THEME_VIRTUAL_ENV_PROMPT_PREFIX=" %{$fg[green]%}🐍" +ZSH_THEME_VIRTUAL_ENV_PROMPT_PREFIX=" %{$fg[green]%}🐍 " ZSH_THEME_VIRTUAL_ENV_PROMPT_SUFFIX="%{$reset_color%}" ZSH_THEME_VIRTUALENV_PREFIX=$ZSH_THEME_VIRTUAL_ENV_PROMPT_PREFIX ZSH_THEME_VIRTUALENV_SUFFIX=$ZSH_THEME_VIRTUAL_ENV_PROMPT_SUFFIX From a779d6563ffb2f0093b4b74c8d5ff0982fa3e930 Mon Sep 17 00:00:00 2001 From: Alessandro Miliucci Date: Thu, 16 May 2024 22:13:36 +0200 Subject: [PATCH 151/453] chore(template): propose add `.local/bin` to PATH (#12417) --- templates/zshrc.zsh-template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 7e1c7997c..a73d60799 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -1,5 +1,5 @@ # If you come from bash you might have to change your $PATH. -# export PATH=$HOME/bin:/usr/local/bin:$PATH +# export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH # Path to your oh-my-zsh installation. export ZSH=$HOME/.oh-my-zsh From 309129f651eeeca62c3a3b7f6817f0ac601db9f0 Mon Sep 17 00:00:00 2001 From: Daniel Ochoja <37149152+Ochoja@users.noreply.github.com> Date: Tue, 21 May 2024 19:36:07 +0100 Subject: [PATCH 152/453] feat(agnoster): add `anaconda` env information (#12434) --- themes/agnoster.zsh-theme | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index c2a542163..767a4ed50 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -227,6 +227,14 @@ prompt_virtualenv() { fi } +# Conda Virtualenv +promp_conda_virtualenv() { + if [[ -n $CONDA_PROMPT_MODIFIER ]]; then + prompt_segment black default ${CONDA_PROMPT_MODIFIER:1:-2} + fi +} + + # Status: # - was there an error # - am I root @@ -266,6 +274,7 @@ build_prompt() { prompt_bzr prompt_hg prompt_end + promp_conda_virtualenv } PROMPT='%{%f%b%k%}$(build_prompt) ' From 0621944db50aec931850806644b673e39b650163 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Tue, 21 May 2024 20:43:26 +0200 Subject: [PATCH 153/453] fix(dependencies): only open PR if there are changes --- .github/workflows/dependencies/updater.py | 78 +++++++++++++---------- 1 file changed, 44 insertions(+), 34 deletions(-) diff --git a/.github/workflows/dependencies/updater.py b/.github/workflows/dependencies/updater.py index 4533b7aeb..e64d69939 100644 --- a/.github/workflows/dependencies/updater.py +++ b/.github/workflows/dependencies/updater.py @@ -228,21 +228,22 @@ class Dependency: self.__apply_upstream_changes() # Add all changes and commit - Git.add_and_commit(self.name, short_sha) + has_new_commit = Git.add_and_commit(self.name, short_sha) - # Push changes to remote - Git.push(branch) + if has_new_commit: + # Push changes to remote + Git.push(branch) - # Create GitHub PR - GitHub.create_pr( - branch, - f"feat({self.name}): update to version {new_version}", - f"""## Description + # Create GitHub PR + GitHub.create_pr( + branch, + f"feat({self.name}): update to version {new_version}", + f"""## Description -Update for **{self.desc}**: update to version [{new_version}]({status['head_url']}). -Check out the [list of changes]({status['compare_url']}). -""", - ) + Update for **{self.desc}**: update to version [{new_version}]({status['head_url']}). + Check out the [list of changes]({status['compare_url']}). + """, + ) # Clean up repository Git.clean_repo() @@ -377,7 +378,21 @@ class Git: return branch_name @staticmethod - def add_and_commit(scope: str, version: str): + def add_and_commit(scope: str, version: str) -> bool: + """ + Returns `True` if there were changes and were indeed commited. + Returns `False` if the repo was clean and no changes were commited. + """ + # check if repo is clean (clean => no error, no commit) + try: + CommandRunner.run_or_fail( + ["git", "diff", "--exit-code"], stage="CheckRepoClean" + ) + return False + except CommandRunner.Exception: + # if it's other kind of error just throw! + pass + user_name = os.environ.get("GIT_APP_NAME") user_email = os.environ.get("GIT_APP_EMAIL") @@ -390,27 +405,22 @@ class Git: clean_env["GIT_CONFIG_GLOBAL"] = "/dev/null" clean_env["GIT_CONFIG_NOSYSTEM"] = "1" - # check if repo is clean (clean => no error, no commit) - try: - CommandRunner.run_or_fail( - ["git", "diff", "--exit-code"], stage="CheckRepoClean", env=clean_env - ) - except CommandRunner.Exception: - # Commit with settings above - CommandRunner.run_or_fail( - [ - "git", - "-c", - f"user.name={user_name}", - "-c", - f"user.email={user_email}", - "commit", - "-m", - f"feat({scope}): update to {version}", - ], - stage="CreateCommit", - env=clean_env, - ) + # Commit with settings above + CommandRunner.run_or_fail( + [ + "git", + "-c", + f"user.name={user_name}", + "-c", + f"user.email={user_email}", + "commit", + "-m", + f"feat({scope}): update to {version}", + ], + stage="CreateCommit", + env=clean_env, + ) + return True @staticmethod def push(branch: str): From 04b66b230857fb9bc28af5e7590b09ff79f888fa Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Tue, 21 May 2024 20:46:54 +0200 Subject: [PATCH 154/453] chore(dependencies): PR wording --- .github/workflows/dependencies/updater.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dependencies/updater.py b/.github/workflows/dependencies/updater.py index e64d69939..f85c9eda7 100644 --- a/.github/workflows/dependencies/updater.py +++ b/.github/workflows/dependencies/updater.py @@ -240,9 +240,9 @@ class Dependency: f"feat({self.name}): update to version {new_version}", f"""## Description - Update for **{self.desc}**: update to version [{new_version}]({status['head_url']}). - Check out the [list of changes]({status['compare_url']}). - """, +Update for **{self.desc}**: update to version [{new_version}]({status['head_url']}). +Check out the [list of changes]({status['compare_url']}). +""", ) # Clean up repository From f6b3fc84d192274f245a7322c3994767c5e68691 Mon Sep 17 00:00:00 2001 From: "ohmyzsh[bot]" <54982679+ohmyzsh[bot]@users.noreply.github.com> Date: Tue, 21 May 2024 20:48:54 +0200 Subject: [PATCH 155/453] feat(wd): update to version v0.7.0 (#12436) Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com> --- .github/dependencies.yml | 2 +- plugins/wd/README.md | 15 ++++++- plugins/wd/_wd.sh | 4 ++ plugins/wd/wd.plugin.zsh | 9 +++-- plugins/wd/wd.sh | 87 ++++++++++++++++++++++++++++++++-------- 5 files changed, 95 insertions(+), 22 deletions(-) diff --git a/.github/dependencies.yml b/.github/dependencies.yml index 6ae97ad4e..d3b269361 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -39,7 +39,7 @@ dependencies: plugins/wd: repo: mfaerevaag/wd branch: master - version: tag:v0.6.1 + version: tag:v0.7.0 precopy: | set -e rm -r test diff --git a/plugins/wd/README.md b/plugins/wd/README.md index 0c71c0565..bf19031f8 100644 --- a/plugins/wd/README.md +++ b/plugins/wd/README.md @@ -142,7 +142,7 @@ rm -f ~/.zcompdump; compinit If you want to make use of the `fzf`-powered browse feature to fuzzy search through all your warp points, set up a keybind in your `.zshrc`: ```zsh -bindkey '^G' wd_browse +bindkey ${FZF_WD_BINDKEY:-'^B'} fuzzy_wd_widget ``` ## Usage @@ -158,6 +158,19 @@ If a warp point with the same name exists, use `wd add foo --force` to overwrite **Note:** a warp point cannot contain colons, or consist of only spaces and dots. The first will conflict in how `wd` stores the warp points, and the second will conflict with other features, as below. +* Add warp point to any directory with default name: + +```zsh +wd addcd /foo/ bar +``` + +* Add warp point to any directory with a custom name: + +```zsh +wd addcd /foo/ +``` + + You can omit point name to automatically use the current directory's name instead. * From any directory, warp to `foo` with: diff --git a/plugins/wd/_wd.sh b/plugins/wd/_wd.sh index 52ecb12e6..46b032f78 100644 --- a/plugins/wd/_wd.sh +++ b/plugins/wd/_wd.sh @@ -31,6 +31,7 @@ function _wd() { commands=( 'add:Adds the current working directory to your warp points' + 'addcd:Adds a directory to your warp points' 'add!:Overwrites existing warp point' 'export:Export warp points as static named directories' 'rm:Removes the given warp point' @@ -63,6 +64,9 @@ function _wd() { add) _message 'Write the name of your warp point' && ret=0 ;; + addcd) + _message 'Write the name of your path' && ret=0 + ;; show) _describe -t points "Warp points" warp_points && ret=0 ;; diff --git a/plugins/wd/wd.plugin.zsh b/plugins/wd/wd.plugin.zsh index 9e0c7ff13..9910cb968 100644 --- a/plugins/wd/wd.plugin.zsh +++ b/plugins/wd/wd.plugin.zsh @@ -14,7 +14,8 @@ eval "wd() { source '${0:A:h}/wd.sh' }" wd > /dev/null -# Register the function as a Zsh widget -zle -N wd_browse -# Bind the widget to a key combination -bindkey '^G' wd_browse +zle -N wd_browse_widget +zle -N wd_restore_buffer +autoload -Uz add-zle-hook-widget +add-zle-hook-widget line-init wd_restore_buffer +bindkey ${FZF_WD_BINDKEY:-'^B'} wd_browse_widget diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh index c4f422cbf..160ab3be3 100755 --- a/plugins/wd/wd.sh +++ b/plugins/wd/wd.sh @@ -8,7 +8,7 @@ # @github.com/mfaerevaag/wd # version -readonly WD_VERSION=0.6.1 +readonly WD_VERSION=0.7.0 # colors readonly WD_BLUE="\033[96m" @@ -59,7 +59,7 @@ wd_print_msg() then local color="${1:-$WD_BLUE}" # Default to blue if no color is provided local msg="$2" - + if [[ -z "$msg" ]]; then print "${WD_RED}*${WD_NOC} Could not print message. Sorry!" else @@ -74,18 +74,20 @@ wd_print_usage() Usage: wd [command] [point] Commands: - Warps to the directory specified by the warp point - Warps to the directory specified by the warp point with path appended - add Adds the current working directory to your warp points - add Adds the current working directory to your warp points with current directory's name - rm Removes the given warp point - rm Removes the given warp point with current directory's name - show Print path to given warp point - show Print warp points to current directory - list Print all stored warp points - ls Show files from given warp point (ls) - path Show the path to given warp point (pwd) - clean Remove points warping to nonexistent directories (will prompt unless --force is used) + Warps to the directory specified by the warp point + Warps to the directory specified by the warp point with path appended + add Adds the current working directory to your warp points + add Adds the current working directory to your warp points with current directory's name + addcd Adds a path to your warp points with the directory's name + addcd Adds a path to your warp points with a custom name + rm Removes the given warp point + rm Removes the given warp point with current directory's name + show Print path to given warp point + show Print warp points to current directory + list Print all stored warp points + ls Show files from given warp point (ls) + path Show the path to given warp point (pwd) + clean Remove points warping to nonexistent directories (will prompt unless --force is used) -v | --version Print version -d | --debug Exit after execution with exit codes (for testing) @@ -203,6 +205,28 @@ wd_add() fi } +wd_addcd() { + local folder="$1" + local point=$2 + local force=$3 + local currentdir=$PWD + + if [[ -z "$folder" ]]; then + wd_exit_fail "You must specify a path" + return + fi + + if [[ ! -d "$folder" ]]; then + wd_exit_fail "The directory does not exist" + return + fi + + cd "$folder" || return + wd_add "$point" "$force" + cd "$currentdir" || return +} + + wd_remove() { local point_list=$1 @@ -235,7 +259,15 @@ wd_browse() { return 1 fi local entries=("${(@f)$(sed "s:${HOME}:~:g" "$WD_CONFIG" | awk -F ':' '{print $1 " -> " $2}')}") - local selected_entry=$(printf '%s\n' "${entries[@]}" | fzf --height 40% --reverse) + local script_path="${${(%):-%x}:h}" + local wd_remove_output=$(mktemp "${TMPDIR:-/tmp}/wd.XXXXXXXXXX") + local entries_with_headers=("All warp points:" "Press enter to select. Press delete to remove" "${entries[@]}") + local fzf_bind="delete:execute(echo {} | awk -F ' -> ' '{print \$1}' | xargs -I {} "$script_path/wd.sh" rm {} > "$wd_remove_output")+abort" + local fzf_command=$(printf '%s\n' "${entries_with_headers[@]}" | fzf --height 100% --reverse --header-lines=2 --bind="$fzf_bind") + if [[ -e $wd_remove_output ]]; then + cat "$wd_remove_output" + rm "$wd_remove_output" + fi if [[ -n $selected_entry ]]; then local selected_point="${selected_entry%% ->*}" selected_point=$(echo "$selected_point" | xargs) @@ -243,6 +275,24 @@ wd_browse() { fi } +wd_browse_widget() { + if [[ -e $WD_CONFIG ]]; then + wd_browse + saved_buffer=$BUFFER + saved_cursor=$CURSOR + BUFFER= + zle redisplay + zle accept-line + fi +} + +wd_restore_buffer() { + BUFFER=$saved_buffer + CURSOR=$saved_cursor + saved_buffer= + saved_cursor=1 +} + wd_list_all() { wd_print_msg "$WD_BLUE" "All warp points:" @@ -371,7 +421,7 @@ wd_export_static_named_directories() { fi } -local WD_CONFIG=${WD_CONFIG:-$HOME/.warprc} +WD_CONFIG=${WD_CONFIG:-$HOME/.warprc} local WD_QUIET=0 local WD_EXIT_CODE=0 local WD_DEBUG=0 @@ -455,6 +505,10 @@ else wd_browse break ;; + "-c"|"--addcd"|"addcd") + wd_addcd "$2" "$3" "$wd_force_mode" + break + ;; "-e"|"export") wd_export_static_named_directories break @@ -510,6 +564,7 @@ fi unset wd_extglob_is_set unset wd_warp unset wd_add +unset wd_addcd unset wd_remove unset wd_show unset wd_list_all From dfb436b54a10c84156a548dded0506d474050a43 Mon Sep 17 00:00:00 2001 From: danielwerg <35052399+danielwerg@users.noreply.github.com> Date: Tue, 21 May 2024 21:58:43 +0300 Subject: [PATCH 156/453] feat(tldr): add tldr plugin (#12429) --- plugins/tldr/README.md | 15 +++++++++++++++ plugins/tldr/tldr.plugin.zsh | 19 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 plugins/tldr/README.md create mode 100644 plugins/tldr/tldr.plugin.zsh diff --git a/plugins/tldr/README.md b/plugins/tldr/README.md new file mode 100644 index 000000000..fb91d9d1f --- /dev/null +++ b/plugins/tldr/README.md @@ -0,0 +1,15 @@ +# tldr plugin + +This plugin adds a shortcut to insert tldr before the previous command. +Heavily inspired from [Man plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/man). + +To use it, add `tldr` to the plugins array in your zshrc file: + +```zsh +plugins=(... tldr) +``` + +# Keyboard Shortcuts +| Shortcut | Description | +|------------------------------------|----------------------------------------------------------------------------| +| Esc + tldr | add tldr before the previous command to see the tldr page for this command | diff --git a/plugins/tldr/tldr.plugin.zsh b/plugins/tldr/tldr.plugin.zsh new file mode 100644 index 000000000..9f3de5f0c --- /dev/null +++ b/plugins/tldr/tldr.plugin.zsh @@ -0,0 +1,19 @@ +tldr-command-line() { + # if there is no command typed, use the last command + [[ -z "$BUFFER" ]] && zle up-history + + # if typed command begins with tldr, do nothing + [[ "$BUFFER" = tldr\ * ]] && return + + # get command and possible subcommand + # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion-Flags + local -a args + args=(${${(Az)BUFFER}[1]} ${${(Az)BUFFER}[2]}) + + BUFFER="tldr ${args[1]}" +} + +zle -N tldr-command-line +# Defined shortcut keys: [Esc]tldr +bindkey "\e"tldr tldr-command-line + From bbfb9853591312c180a0c417226e4ef899d4cf3a Mon Sep 17 00:00:00 2001 From: robinverduijn Date: Tue, 21 May 2024 22:39:12 -0700 Subject: [PATCH 157/453] chore(agnoster): typo (#12437) --- themes/agnoster.zsh-theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 767a4ed50..4445ad4a4 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -228,7 +228,7 @@ prompt_virtualenv() { } # Conda Virtualenv -promp_conda_virtualenv() { +prompt_conda_virtualenv() { if [[ -n $CONDA_PROMPT_MODIFIER ]]; then prompt_segment black default ${CONDA_PROMPT_MODIFIER:1:-2} fi @@ -274,7 +274,7 @@ build_prompt() { prompt_bzr prompt_hg prompt_end - promp_conda_virtualenv + prompt_conda_virtualenv } PROMPT='%{%f%b%k%}$(build_prompt) ' From c77a01dbe28acaa13e53c7dc78d6b798f3f42fc2 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Wed, 22 May 2024 09:15:11 +0200 Subject: [PATCH 158/453] Revert "feat(agnoster): add `anaconda` env information (#12434)" This reverts commit 309129f651eeeca62c3a3b7f6817f0ac601db9f0. --- themes/agnoster.zsh-theme | 9 --------- 1 file changed, 9 deletions(-) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 4445ad4a4..c2a542163 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -227,14 +227,6 @@ prompt_virtualenv() { fi } -# Conda Virtualenv -prompt_conda_virtualenv() { - if [[ -n $CONDA_PROMPT_MODIFIER ]]; then - prompt_segment black default ${CONDA_PROMPT_MODIFIER:1:-2} - fi -} - - # Status: # - was there an error # - am I root @@ -274,7 +266,6 @@ build_prompt() { prompt_bzr prompt_hg prompt_end - prompt_conda_virtualenv } PROMPT='%{%f%b%k%}$(build_prompt) ' From 41d2029dec256b9ef3869cb83699d88b94eb3c1d Mon Sep 17 00:00:00 2001 From: Rizky Ilham Pratama Date: Wed, 22 May 2024 15:17:06 +0800 Subject: [PATCH 159/453] feat(laravel): add aliases laravel 11 (#12354) --- plugins/laravel/README.md | 4 ++++ plugins/laravel/laravel.plugin.zsh | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/plugins/laravel/README.md b/plugins/laravel/README.md index a831a86b6..21eb89373 100644 --- a/plugins/laravel/README.md +++ b/plugins/laravel/README.md @@ -36,6 +36,10 @@ plugins=(... laravel) | `pamj` | `php artisan make:job` | | `paml` | `php artisan make:listener` | | `pamn` | `php artisan make:notification` | +| `pamcl` | `php artisan make:class` | +| `pamen` | `php artisan make:enum` | +| `pami` | `php artisan make:interface` | +| `pamtr` | `php artisan make:trait` | ## Clears diff --git a/plugins/laravel/laravel.plugin.zsh b/plugins/laravel/laravel.plugin.zsh index 319946f07..86ae27299 100644 --- a/plugins/laravel/laravel.plugin.zsh +++ b/plugins/laravel/laravel.plugin.zsh @@ -25,6 +25,10 @@ alias pamj='php artisan make:job' alias paml='php artisan make:listener' alias pamn='php artisan make:notification' alias pampp='php artisan make:provider' +alias pamcl='php artisan make:class' +alias pamen='php artisan make:enum' +alias pami='php artisan make:interface' +alias pamtr='php artisan make:trait' # Clears From 203369b0f9ec284e06b73f555a14fa5f02be5a0a Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Wed, 22 May 2024 15:36:03 +0200 Subject: [PATCH 160/453] ci(dependencies): run on sunday CET morning --- .github/workflows/dependencies.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index 6bc8dc74d..6c7387089 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -2,7 +2,7 @@ name: Update dependencies on: workflow_dispatch: {} schedule: - - cron: "34 3 * * */8" + - cron: "0 6 * * 0" jobs: check: From 1b29fd3a460e43d4a7581d6a6a7e5a1877a39068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Miguel=20Benito=20Calzada?= Date: Thu, 23 May 2024 12:51:02 +0200 Subject: [PATCH 161/453] feat(git): support `stable` in `git_main_branch` (#12447) --- plugins/git/git.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index c48e365b5..1e65a7acc 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -35,7 +35,7 @@ function git_develop_branch() { function git_main_branch() { command git rev-parse --git-dir &>/dev/null || return local ref - for ref in refs/{heads,remotes/{origin,upstream}}/{main,trunk,mainline,default,master}; do + for ref in refs/{heads,remotes/{origin,upstream}}/{main,trunk,mainline,default,stable,master}; do if command git show-ref -q --verify $ref; then echo ${ref:t} return 0 From 5e59d21e5465ec0694441f41ff0acf1ddf4de187 Mon Sep 17 00:00:00 2001 From: theredcmdcraft <57496807+theredcmdcraft@users.noreply.github.com> Date: Sun, 26 May 2024 21:53:03 +0200 Subject: [PATCH 162/453] Add Support for Tabby Terminal in Macos Plugin (#12451) * Added Support for Tabby in Macos-Plugin * Update README.md Added Supported Terminal List * chore(macos): Update README to link to terminals Linking to the supported terminals, moving reference to the original author to the Acknowledgements section --------- Co-authored-by: Robby Russell --- plugins/macos/README.md | 10 ++++++++-- plugins/macos/macos.plugin.zsh | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/plugins/macos/README.md b/plugins/macos/README.md index 2c52ec8a7..8245e211f 100644 --- a/plugins/macos/README.md +++ b/plugins/macos/README.md @@ -8,7 +8,11 @@ To start using it, add the `macos` plugin to your plugins array in `~/.zshrc`: plugins=(... macos) ``` -Original author: [Sorin Ionescu](https://github.com/sorin-ionescu) +## Supported Terminals +- [iTerm](https://iterm.sourceforge.net/) +- [iTerm2](https://iterm2.com/) +- [Hyper](https://hyper.is/) +- [Tabby](https://tabby.sh/) ## Commands @@ -37,7 +41,9 @@ Original author: [Sorin Ionescu](https://github.com/sorin-ionescu) ## Acknowledgements -This application makes use of the following third party scripts: +Original author: [Sorin Ionescu](https://github.com/sorin-ionescu) + +This application makes use of the following third-party scripts: [shpotify](https://github.com/hnarayanan/shpotify) diff --git a/plugins/macos/macos.plugin.zsh b/plugins/macos/macos.plugin.zsh index 2702a1901..b951a289f 100644 --- a/plugins/macos/macos.plugin.zsh +++ b/plugins/macos/macos.plugin.zsh @@ -79,6 +79,13 @@ EOF key code 36 #(presses enter) end tell EOF + + elif [[ "$the_app" == 'Tabby' ]]; then + osascript >/dev/null <&2 return 1 @@ -126,6 +133,12 @@ EOF delay 1 keystroke "${command} \n" end tell +EOF + elif [[ "$the_app" == 'Tabby' ]]; then + osascript >/dev/null <&2 @@ -175,6 +188,12 @@ EOF delay 1 keystroke "${command} \n" end tell +EOF + elif [[ "$the_app" == 'Tabby' ]]; then + osascript >/dev/null <&2 From 071b8f8921cb2bbb1fcabbf3d271e77af0b12a7d Mon Sep 17 00:00:00 2001 From: Ian Chesal Date: Tue, 28 May 2024 17:40:30 -0400 Subject: [PATCH 163/453] feat(kitty): add plugin for the kitty terminal (#10994) * A plugin for the Kitty terminal Provides a handful of useful aliases for anyone working in a Kitty terminal. In particular, the kssh command is handy for ensuring that terminfo is set correctly on remote hosts when you ssh to them. * Guard kitty configuration We should only load these aliases into a terminal that's identifying itself as an xterm-kitty terminal. They're not useful in any other situation. --- plugins/kitty/README.md | 23 +++++++++++++++++++++++ plugins/kitty/kitty.plugin.zsh | 16 ++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 plugins/kitty/README.md create mode 100644 plugins/kitty/kitty.plugin.zsh diff --git a/plugins/kitty/README.md b/plugins/kitty/README.md new file mode 100644 index 000000000..ec9e375de --- /dev/null +++ b/plugins/kitty/README.md @@ -0,0 +1,23 @@ +# Kitty plugin + +This plugin adds a few aliases and functions that are useful for users of the [Kitty](https://sw.kovidgoyal.net/kitty/) terminal. + +To use it, add _kitty_ to the plugins array of your zshrc file: +``` +plugins=(... kitty) +``` + +## Plugin commands + +* `kssh` + Runs a kitten ssh session that ensures your terminfo settings are copied + correctly to the remote hose. +* `kssh-slow` + A slower form of `kssh` that should always work. Use this if `kssh` fails + to set terminfo correctly for you on the remote host. +* `kitty-theme` + Browse and change the theme of your Kitty terminal. + +## Contributors + +- [Ian Chesal](https://github.com/ianchesal) diff --git a/plugins/kitty/kitty.plugin.zsh b/plugins/kitty/kitty.plugin.zsh new file mode 100644 index 000000000..1094236a7 --- /dev/null +++ b/plugins/kitty/kitty.plugin.zsh @@ -0,0 +1,16 @@ +##################################################### +# Kitty plugin for oh-my-zsh # +##################################################### + +if [[ "$TERM" == 'xterm-kitty' ]]; then + ## kssh + # Use this when your terminfo isn't recognized on remote hosts. + # See: https://sw.kovidgoyal.net/kitty/faq/#i-get-errors-about-the-terminal-being-unknown-or-opening-the-terminal-failing-when-sshing-into-a-different-computer + alias kssh="kitty +kitten ssh" + compdef kssh='ssh' + # Use this if kssh fails + alias kssh-slow="infocmp -a xterm-kitty | ssh myserver tic -x -o \~/.terminfo /dev/stdin" + + # Change the colour theme + alias kitty-theme="kitty +kitten themes" +fi From a4424dfefd68e4d23badb2f86087184f9e06fab4 Mon Sep 17 00:00:00 2001 From: Lukas Grimm Date: Thu, 30 May 2024 17:05:50 +0200 Subject: [PATCH 164/453] fix(pass): completion for multiple repositories (#12464) --- plugins/pass/_pass | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/pass/_pass b/plugins/pass/_pass index d911e122f..c66d99318 100644 --- a/plugins/pass/_pass +++ b/plugins/pass/_pass @@ -20,6 +20,8 @@ _pass () { local cmd + local rootcontext + rootcontext=$curcontext if (( CURRENT > 2)); then cmd=${words[2]} # Set the context for the subcommand. @@ -123,8 +125,9 @@ _pass_cmd_show () { _pass_complete_entries_helper () { local IFS=$'\n' local prefix - zstyle -s ":completion:${curcontext}:" prefix prefix || prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}" - _values -C 'passwords' ${$(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print 2>/dev/null | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' -e 's#\\#\\\\#g' -e 's#:#\\:#g' | sort):-""} + zstyle -s ":completion:${rootcontext}:" prefix prefix || +prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}" + _values -C 'passwords' ${$(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print 2>/dev/null | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' -e 's#\\#\\\\#g' -e 's#:#\\:#g' | sort):-""} } _pass_complete_entries_with_subdirs () { From 2c08d2b8423d6fc38d4d6e3be3aaebc3522b1555 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 30 May 2024 20:21:17 +0200 Subject: [PATCH 165/453] fix(kubectl): load completion properly in functions Closes #12427 --- plugins/kubectl/kubectl.plugin.zsh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index 0dd4e691a..a96e409c6 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -180,13 +180,11 @@ alias kej='kubectl edit job' alias kdj='kubectl describe job' alias kdelj='kubectl delete job' -# Only run if the user actually has kubectl installed -if (( ${+_comps[kubectl]} )); then - function kj() { kubectl "$@" -o json | jq; } - function kjx() { kubectl "$@" -o json | fx; } - function ky() { kubectl "$@" -o yaml | yh; } - - compdef kj=kubectl - compdef kjx=kubectl - compdef ky=kubectl +function kj() { kubectl "$@" -o json | jq; } +function kjx() { kubectl "$@" -o json | fx; } +function ky() { kubectl "$@" -o yaml | yh; } +if (( ${+functions[compdef]} )); then + compdef _kubectl kj + compdef _kubectl kjx + compdef _kubectl ky fi From 189774c5d0d989ab45c0765f646803926e08e013 Mon Sep 17 00:00:00 2001 From: Jeroen Claassens Date: Thu, 30 May 2024 20:31:39 +0200 Subject: [PATCH 166/453] feat(yarn)!: add optional support for yarn berry (#12374) BREAKING CHANGE: some `yarn` aliases changed . Please see README for further information. Co-authored-by: Carlo Sala --- plugins/yarn/README.md | 96 +++++++++++++++++++++--------------- plugins/yarn/yarn.plugin.zsh | 36 +++++++++++--- 2 files changed, 84 insertions(+), 48 deletions(-) diff --git a/plugins/yarn/README.md b/plugins/yarn/README.md index 5c7c7f323..f1d089b1f 100644 --- a/plugins/yarn/README.md +++ b/plugins/yarn/README.md @@ -1,7 +1,7 @@ # Yarn plugin -This plugin adds completion for the [Yarn package manager](https://yarnpkg.com/en/), -as well as some aliases for common Yarn commands. +This plugin adds completion for the [Yarn package manager](https://yarnpkg.com/en/), as well as some aliases +for common Yarn commands. To use it, add `yarn` to the plugins array in your zshrc file: @@ -11,48 +11,64 @@ plugins=(... yarn) ## Global scripts directory -It also adds `yarn` global scripts dir (commonly `~/.yarn/bin`) to the `$PATH`. -To disable this feature, set the following style in your `.zshrc`: +It also adds `yarn` global scripts dir (commonly `~/.yarn/bin`) to the `$PATH`. To disable this feature, set +the following style in your `.zshrc`: ```zsh zstyle ':omz:plugins:yarn' global-path no ``` +## Yarn Berry + +If you are using Yarn berry (a.k.a. Yarn version 2 or higher) as your global Yarn version you should configure +this plugin to configure its aliases accordingly, set the following style in your `.zshrc`: + +```zsh +zstyle ':omz:plugins:yarn' berry yes +``` + ## Aliases -| Alias | Command | Description | -| ----- | ----------------------------------------- | ----------------------------------------------------------------------------- | -| y | `yarn` | The Yarn command | -| ya | `yarn add` | Install a package in dependencies (`package.json`) | -| yad | `yarn add --dev` | Install a package in devDependencies (`package.json`) | -| yap | `yarn add --peer` | Install a package in peerDependencies (`package.json`) | -| yb | `yarn build` | Run the build script defined in `package.json` | -| ycc | `yarn cache clean` | Clean yarn's global cache of packages | -| yd | `yarn dev` | Run the dev script defined in `package.json` | -| yf | `yarn format` | Run the dev script defined in `package.json` | -| yga | `yarn global add` | Install packages globally on your operating system | -| ygls | `yarn global list` | Lists global installed packages | -| ygrm | `yarn global remove` | Remove global installed packages from your OS | -| ygu | `yarn global upgrade` | Upgrade packages installed globally to their latest version | -| yh | `yarn help` | Show help for a yarn command | -| yi | `yarn init` | Interactively creates or updates a package.json file | -| yin | `yarn install` | Install dependencies defined in `package.json` | -| yln | `yarn lint` | Run the lint script defined in `package.json` | -| ylnf | `yarn lint --fix` | Run the lint script defined in `package.json`to automatically fix problems | -| yls | `yarn list` | List installed packages | -| yout | `yarn outdated` | Check for outdated package dependencies | -| yp | `yarn pack` | Create a compressed gzip archive of package dependencies | -| yrm | `yarn remove` | Remove installed packages | -| yrun | `yarn run` | Run a defined package script | -| ys | `yarn serve` | Start the dev server | -| yst | `yarn start` | Run the start script defined in `package.json` | -| yt | `yarn test` | Run the test script defined in `package.json` | -| ytc | `yarn test --coverage` | Run the test script defined in `package.json` with coverage | -| yuc | `yarn global upgrade && yarn cache clean` | Upgrade global packages and clean yarn's global cache | -| yui | `yarn upgrade-interactive` | Prompt for which outdated packages to upgrade | -| yuil | `yarn upgrade-interactive --latest` | Prompt for which outdated packages to upgrade to the latest available version | -| yup | `yarn upgrade` | Upgrade packages to their latest version | -| yv | `yarn version` | Update the version of your package | -| yw | `yarn workspace` | Run a command within a single workspace. | -| yws | `yarn workspaces` | Run a command within all defined workspaces. | -| yy | `yarn why` | Show why a package has been installed, detailing which other packages depend on it | +- Aliases marked with `*` are only available when using Yarn v1 (non-berry) +- Aliases marked with `b` are only available when using Yarn berry + +| Alias | Command | Description | +| ------------------ | ----------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| y | `yarn` | The Yarn command | +| ya | `yarn add` | Install a package in dependencies (`package.json`) | +| yad | `yarn add --dev` | Install a package in devDependencies (`package.json`) | +| yap | `yarn add --peer` | Install a package in peerDependencies (`package.json`) | +| yb | `yarn build` | Run the build script defined in `package.json` | +| ycc | `yarn cache clean` | Clean yarn's global cache of packages | +| yd | `yarn dev` | Run the dev script defined in `package.json` | +| yf | `yarn format` | Run the dev script defined in `package.json` | +| yh | `yarn help` | Show help for a yarn command | +| yi | `yarn init` | Interactively creates or updates a package.json file | +| yin | `yarn install` | Install dependencies defined in `package.json` | +| yln | `yarn lint` | Run the lint script defined in `package.json` | +| ylnf | `yarn lint --fix` | Run the lint script defined in `package.json`to automatically fix problems | +| yp | `yarn pack` | Create a compressed gzip archive of package dependencies | +| yrm | `yarn remove` | Remove installed packages | +| yrun | `yarn run` | Run a defined package script | +| ys | `yarn serve` | Start the dev server | +| yst | `yarn start` | Run the start script defined in `package.json` | +| yt | `yarn test` | Run the test script defined in `package.json` | +| ytc | `yarn test --coverage` | Run the test script defined in `package.json` with coverage | +| yui | `yarn upgrade-interactive` | Prompt for which outdated packages to upgrade | +| yuil | `yarn upgrade-interactive --latest` (or see `yui` when using [yarn berry](#yarn-berry)) | Prompt for which outdated packages to upgrade to the latest available version | +| yii | `yarn install --frozen-lockfile` (or `yarn install --immutable` when using [yarn berry](#yarn-berry)) | Install dependencies and abort if the lockfile was to be modified | +| yifl | `yii` | Install dependencies and abort if the lockfile was to be modified | +| yup | `yarn upgrade` | Upgrade packages to their latest version | +| yv | `yarn version` | Update the version of your package | +| yw | `yarn workspace` | Run a command within a single workspace. | +| yws | `yarn workspaces` | Run a command within all defined workspaces. | +| yy | `yarn why` | Show why a package has been installed, detailing which other packages depend on it | +| yga`*` | `yarn global add` | Install packages globally on your operating system | +| ygls`*` | `yarn global list` | Lists global installed packages | +| ygrm`*` | `yarn global remove` | Remove global installed packages from your OS | +| ygu`*` | `yarn global upgrade` | Upgrade packages installed globally to their latest version | +| yls`*` | `yarn list` | List installed packages | +| yout`*` | `yarn outdated` | Check for outdated package dependencies | +| yuca`*` | `yarn global upgrade && yarn cache clean` | Upgrade global packages and clean yarn's global cache | +| ydlx`b` | `yarn dlx` | Run a package in a temporary environment. | +| yn`b` | `yarn node` | Run node with the hook already setup. | diff --git a/plugins/yarn/yarn.plugin.zsh b/plugins/yarn/yarn.plugin.zsh index 157044d71..b7d64770d 100644 --- a/plugins/yarn/yarn.plugin.zsh +++ b/plugins/yarn/yarn.plugin.zsh @@ -18,17 +18,11 @@ alias yb="yarn build" alias ycc="yarn cache clean" alias yd="yarn dev" alias yf="yarn format" -alias yga="yarn global add" -alias ygls="yarn global list" -alias ygrm="yarn global remove" -alias ygu="yarn global upgrade" alias yh="yarn help" alias yi="yarn init" alias yin="yarn install" alias yln="yarn lint" alias ylnf="yarn lint --fix" -alias yls="yarn list" -alias yout="yarn outdated" alias yp="yarn pack" alias yrm="yarn remove" alias yrun="yarn run" @@ -36,11 +30,37 @@ alias ys="yarn serve" alias yst="yarn start" alias yt="yarn test" alias ytc="yarn test --coverage" -alias yuc="yarn global upgrade && yarn cache clean" alias yui="yarn upgrade-interactive" -alias yuil="yarn upgrade-interactive --latest" alias yup="yarn upgrade" alias yv="yarn version" alias yw="yarn workspace" alias yws="yarn workspaces" alias yy="yarn why" + +# Commands that are specific to the yarn version being used +if zstyle -t ':omz:plugins:yarn' berry; then + # aliases that differ + alias yuil='yui' # --latest flag was removed in yarn berry + alias yii='yarn install --immutable' + alias yifl='yarn install --immutable' + + # unique aliases + alias ydlx="yarn dlx" + alias yn="yarn node" +else + # aliases that differ + alias yuil='yarn upgrade-interactive --latest' + alias yii='yarn install --frozen-lockfile' + alias yifl='yarn install --frozen-lockfile' + + # unique aliases + alias yga="yarn global add" + alias ygls="yarn global list" + alias ygrm="yarn global remove" + alias ygu="yarn global upgrade" + alias yls="yarn list" + alias yout="yarn outdated" + alias yuca="yarn global upgrade && yarn cache clean" +fi + +unset is_yarn_berry From e0c6cb147030350c8e27dbdeda6e8a4d367d1e66 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Fri, 31 May 2024 08:55:53 +0200 Subject: [PATCH 167/453] chore(yarn): remove unneeded line --- plugins/yarn/yarn.plugin.zsh | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugins/yarn/yarn.plugin.zsh b/plugins/yarn/yarn.plugin.zsh index b7d64770d..5dd329698 100644 --- a/plugins/yarn/yarn.plugin.zsh +++ b/plugins/yarn/yarn.plugin.zsh @@ -62,5 +62,3 @@ else alias yout="yarn outdated" alias yuca="yarn global upgrade && yarn cache clean" fi - -unset is_yarn_berry From 56afe7b3685be8a1ddef25a742016dc76c0a5f8f Mon Sep 17 00:00:00 2001 From: MoetaYuko Date: Mon, 3 Jun 2024 18:53:27 +0800 Subject: [PATCH 168/453] fix(tmux): add completion for alias functions (#12468) --- plugins/tmux/tmux.plugin.zsh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index f65598358..399de1ccc 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -57,6 +57,19 @@ function _build_tmux_alias { tmux $2 $3 \"\$@\" fi }" + + local f s + f="_omz_tmux_alias_${1}" + s=(${(z)2}) + + eval "function ${f}() { + shift words; + words=(tmux ${@:2} \$words); + ((CURRENT+=${#s[@]}+1)) + _tmux + }" + + compdef "$f" "$1" } alias tksv='tmux kill-server' From 695c7456d1a84697e9b86e11e839d5178cae743a Mon Sep 17 00:00:00 2001 From: Albert <87888006+MustCodeAl@users.noreply.github.com> Date: Mon, 3 Jun 2024 05:59:01 -0500 Subject: [PATCH 169/453] docs(stripe): fix typo (#12470) --- plugins/stripe/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/stripe/README.md b/plugins/stripe/README.md index 9f0f32bc2..7e7944d63 100644 --- a/plugins/stripe/README.md +++ b/plugins/stripe/README.md @@ -1,4 +1,4 @@ -# Struoe +# Stripe This plugin provides completion for the [Stripe CLI](https://stripe.com/docs/stripe-cli). From 228d44d55d812725c3c0c26655b28c72eddb4ba6 Mon Sep 17 00:00:00 2001 From: EraPartner <152506497+EraPartner@users.noreply.github.com> Date: Tue, 4 Jun 2024 13:54:42 +0000 Subject: [PATCH 170/453] feat(eza): add icons option (#12469) Co-authored-by: Computer --- plugins/eza/README.md | 10 ++++++++++ plugins/eza/eza.plugin.zsh | 3 +++ 2 files changed, 13 insertions(+) diff --git a/plugins/eza/README.md b/plugins/eza/README.md index 5de935c2c..6fc113eba 100644 --- a/plugins/eza/README.md +++ b/plugins/eza/README.md @@ -55,6 +55,16 @@ If `yes` (default), always add `-g` flag to show the group ownership. Default: `yes` +### `icons` + +```zsh +zstyle ':omz:plugins:eza' 'icons' yes|no +``` + +If `yes`, sets the `--icons` option of `eza`, adding icons for files and folders. + +Default: `no` + ### `size-prefix` ```zsh diff --git a/plugins/eza/eza.plugin.zsh b/plugins/eza/eza.plugin.zsh index 6d7f720bd..79f5a0f71 100644 --- a/plugins/eza/eza.plugin.zsh +++ b/plugins/eza/eza.plugin.zsh @@ -31,6 +31,9 @@ function _configure_eza() { if zstyle -t ':omz:plugins:eza' 'git-status'; then _EZA_TAIL+=("--git") fi + if zstyle -t ':omz:plugins:eza' 'icons'; then + _EZA_TAIL+=("--icons") + fi zstyle -s ':omz:plugins:eza' 'time-style' _val if [[ $_val ]]; then _EZA_TAIL+=("--time-style='$_val'") From e53edd712f28170a0843ce1d2a61efe335484ad4 Mon Sep 17 00:00:00 2001 From: David LJ Date: Tue, 4 Jun 2024 15:55:08 +0200 Subject: [PATCH 171/453] fix(bgnotify): use terminal-notifier args properly (#12467) --- plugins/bgnotify/bgnotify.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bgnotify/bgnotify.plugin.zsh b/plugins/bgnotify/bgnotify.plugin.zsh index 0e3f2c640..7de6f9a91 100644 --- a/plugins/bgnotify/bgnotify.plugin.zsh +++ b/plugins/bgnotify/bgnotify.plugin.zsh @@ -117,7 +117,7 @@ function bgnotify { local icon="$3" if (( ${+commands[terminal-notifier]} )); then # macOS local term_id=$(bgnotify_programid) - terminal-notifier -message "$message" -title "$title" ${=icon:+-appIcon "$icon"} ${=term_id:+-activate "$term_id" -sender "$term_id"} &>/dev/null + terminal-notifier -message "$message" -title "$title" ${=icon:+-appIcon "$icon"} ${=term_id:+-activate "$term_id"} &>/dev/null elif (( ${+commands[growlnotify]} )); then # macOS growl growlnotify -m "$title" "$message" elif (( ${+commands[notify-send]} )); then From de2e3d9cd3840a1052132d502868aca263debc26 Mon Sep 17 00:00:00 2001 From: "K.B.Dharun Krishna" Date: Tue, 4 Jun 2024 19:26:34 +0530 Subject: [PATCH 172/453] docs: reword alternative installer mirror (#12474) --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index dea36fda7..2d873c514 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ Oh My Zsh is installed by running one of the following commands in your terminal | **wget** | `sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"` | | **fetch** | `sh -c "$(fetch -o - https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"` | -Alternatively, the installer is also mirrored outside GitHub. Using this URL instead may be required if you're in a country like India or China, that blocks `raw.githubusercontent.com`: +Alternatively, the installer is also mirrored outside GitHub. Using this URL instead may be required if you're in a country like China or India (for certain ISPs), that blocks `raw.githubusercontent.com`: | Method | Command | | :-------- | :------------------------------------------------------------------------------------------------ | @@ -235,7 +235,7 @@ If you're in China, India, or another country that blocks `raw.githubusercontent #### Installing From A Forked Repository -The install script also accepts these variables to allow installation of a different repository: +The install script also accepts these variables to allow the installation of a different repository: - `REPO` (default: `ohmyzsh/ohmyzsh`): this takes the form of `owner/repository`. If you set this variable, the installer will look for a repository at `https://github.com/{owner}/{repository}`. @@ -309,7 +309,7 @@ If you would like to override the functionality of a plugin distributed with Oh -The default behaviour in Oh My Zsh is to use BSD `ls` in macOS and freeBSD systems. If GNU `ls` is installed +The default behaviour in Oh My Zsh is to use BSD `ls` in macOS and FreeBSD systems. If GNU `ls` is installed (as `gls` command), you can choose to use it instead. To do it, you can use zstyle-based config before sourcing `oh-my-zsh.sh`: @@ -342,7 +342,7 @@ zstyle ':omz:plugins:*' aliases no zstyle ':omz:plugins:git' aliases no ``` -You can combine these in other ways taking into account that more specific scopes takes precedence: +You can combine these in other ways taking into account that more specific scopes take precedence: ```sh # Skip all plugin aliases, except for the git plugin @@ -365,7 +365,7 @@ 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 +asynchronously. 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 off by setting the following in your .zshrc file, before Oh My Zsh is sourced: From efdfe2f29ac57a9de76391b4e5548edab6a43241 Mon Sep 17 00:00:00 2001 From: "K.B.Dharun Krishna" Date: Tue, 4 Jun 2024 19:27:08 +0530 Subject: [PATCH 173/453] feat(golang): add alias for `go mod tidy` (#12473) --- plugins/golang/README.md | 1 + plugins/golang/golang.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/golang/README.md b/plugins/golang/README.md index 128cc7fbb..80f8cf3b5 100644 --- a/plugins/golang/README.md +++ b/plugins/golang/README.md @@ -25,6 +25,7 @@ plugins=(... golang) | goi | `go install` | Compiles and installs packages to $GOPATH | | gol | `go list` | Lists Go packages | | gom | `go mod` | Access to operations on modules | +| gomt | `go mod tidy` | Tidies up the go.mod file | | gopa | `cd $GOPATH` | Takes you to `$GOPATH` | | gopb | `cd $GOPATH/bin` | Takes you to `$GOPATH/bin` | | gops | `cd $GOPATH/src` | Takes you to `$GOPATH/src` | diff --git a/plugins/golang/golang.plugin.zsh b/plugins/golang/golang.plugin.zsh index 45ccd3a1c..dc4d91845 100644 --- a/plugins/golang/golang.plugin.zsh +++ b/plugins/golang/golang.plugin.zsh @@ -22,6 +22,7 @@ alias goga='go get ./...' alias goi='go install' alias gol='go list' alias gom='go mod' +alias gomt='go mod tidy' alias gopa='cd $GOPATH' alias gopb='cd $GOPATH/bin' alias gops='cd $GOPATH/src' From e898de066473eb725d582a10483d9a2570d221f8 Mon Sep 17 00:00:00 2001 From: Martin Bjeldbak Madsen Date: Sat, 8 Jun 2024 18:47:51 +1000 Subject: [PATCH 174/453] fix(eza): icons tab completion (#12483) --- plugins/eza/eza.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/eza/eza.plugin.zsh b/plugins/eza/eza.plugin.zsh index 79f5a0f71..e95b14749 100644 --- a/plugins/eza/eza.plugin.zsh +++ b/plugins/eza/eza.plugin.zsh @@ -32,7 +32,7 @@ function _configure_eza() { _EZA_TAIL+=("--git") fi if zstyle -t ':omz:plugins:eza' 'icons'; then - _EZA_TAIL+=("--icons") + _EZA_TAIL+=("--icons=auto") fi zstyle -s ':omz:plugins:eza' 'time-style' _val if [[ $_val ]]; then From 4e8099175ef2559f00e8ab5954adccd940a8fd4a Mon Sep 17 00:00:00 2001 From: vincent Date: Sat, 8 Jun 2024 16:48:33 +0800 Subject: [PATCH 175/453] feat(extract): add support for multi-part 7z (#12484) --- plugins/extract/extract.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index 1c7599195..e2b3111d5 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -80,7 +80,7 @@ EOF (*.rar) unrar x -ad "$full_path" ;; (*.rpm) rpm2cpio "$full_path" | cpio --quiet -id ;; - (*.7z) 7za x "$full_path" ;; + (*.7z | *.7z.[0-9]*) 7za x "$full_path" ;; (*.deb) command mkdir -p "control" "data" ar vx "$full_path" > /dev/null From 8510847ff38a142850e4a065dc3cf09555260ff7 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Sat, 8 Jun 2024 13:32:27 +0200 Subject: [PATCH 176/453] fix(bundler): add completion for `bundler` bin as well Closes #12482 --- plugins/bundler/_bundler | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler/_bundler b/plugins/bundler/_bundler index 51678dd7c..6613cc68a 100644 --- a/plugins/bundler/_bundler +++ b/plugins/bundler/_bundler @@ -1,4 +1,4 @@ -#compdef bundle +#compdef bundle bundler local curcontext="$curcontext" state line _gems _opts ret=1 From cedbb9e22846eb4b1fff0c47c3c4dbafb73601f0 Mon Sep 17 00:00:00 2001 From: "ohmyzsh[bot]" <54982679+ohmyzsh[bot]@users.noreply.github.com> Date: Sun, 9 Jun 2024 08:43:02 +0200 Subject: [PATCH 177/453] feat(history-substring-search): update to 87ce96b1 (#12486) Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com> --- .github/dependencies.yml | 2 +- plugins/history-substring-search/README.md | 8 ++++---- .../history-substring-search/history-substring-search.zsh | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/dependencies.yml b/.github/dependencies.yml index d3b269361..ce28e34c9 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -21,7 +21,7 @@ dependencies: plugins/history-substring-search: repo: zsh-users/zsh-history-substring-search branch: master - version: 8dd05bfcc12b0cd1ee9ea64be725b3d9f713cf64 + version: 87ce96b1862928d84b1afe7c173316614b30e301 precopy: | set -e rm -f zsh-history-substring-search.plugin.zsh diff --git a/plugins/history-substring-search/README.md b/plugins/history-substring-search/README.md index 4be744c4c..71a389535 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/history-substring-search/history-substring-search.zsh b/plugins/history-substring-search/history-substring-search.zsh index 471cc9ad1..2137b7950 100644 --- a/plugins/history-substring-search/history-substring-search.zsh +++ b/plugins/history-substring-search/history-substring-search.zsh @@ -406,7 +406,7 @@ _history-substring-search-end() { # For debugging purposes: # zle -R "mn: "$_history_substring_search_match_index" m#: "${#_history_substring_search_matches} - # read -k -t 200 && zle -U $REPLY + # read -k -t 200 && zle -U -- "$REPLY" # # When this function returns, z-sy-h runs its line-pre-redraw hook. It has no @@ -421,7 +421,7 @@ _history-substring-search-end() { # before removing search highlight and exiting. This ensures no highlights # are left lingering after search is finished. # - read -k -t ${HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_TIMEOUT:-1} && zle -U $REPLY + read -k -t ${HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_TIMEOUT:-1} && zle -U -- "$REPLY" region_highlight=( "${(@)region_highlight:#*${highlight_memo}*}" ) fi From 5a5d5eb85b245e0c6bc561134fdb0fd0bf9bbe10 Mon Sep 17 00:00:00 2001 From: Michal Szymanski <55950820+misiektoja@users.noreply.github.com> Date: Tue, 11 Jun 2024 01:25:53 +0200 Subject: [PATCH 178/453] feat(forklift): add support for ForkLift 4 (#12490) (#12491) --- plugins/forklift/forklift.plugin.zsh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/forklift/forklift.plugin.zsh b/plugins/forklift/forklift.plugin.zsh index 848aedabf..4bc74958d 100644 --- a/plugins/forklift/forklift.plugin.zsh +++ b/plugins/forklift/forklift.plugin.zsh @@ -2,6 +2,7 @@ # Author: Adam Strzelecki nanoant.com, modified by Bodo Tasche bitboxer.de # Updated to support ForkLift 2 and ForkLift 3 by Johan Kaving # Updated to support ForkLift from Setapp by Paul Rudkin +# Updated to support ForkLift 4 by Michal Szymanski (misiektoja) # # Usage: # fl [] @@ -110,6 +111,11 @@ function fl { tell pop over of list of group of splitter group of splitter group of topWindow set value of text field 1 to "$PWD" end tell + else if forkLiftVersion starts with "4" then + tell pop over of list of group of splitter group of splitter group of topWindow + keystroke "$PWD" + delay 0.1 + end tell else tell sheet 1 of topWindow set value of text field 1 to "$PWD" From 37f5203abe6b0f603172d86530f0e65029f4ac9c Mon Sep 17 00:00:00 2001 From: nitrocode <7775707+nitrocode@users.noreply.github.com> Date: Tue, 11 Jun 2024 04:59:57 +0530 Subject: [PATCH 179/453] feat(terraform): add workspace aliases (#12171) * feat(terraform): add workspace aliases * chore: rm aliases in separate pending pr * docs: show tfiu alias in readme --------- Co-authored-by: Robby Russell --- plugins/terraform/README.md | 29 +++++++++++++------------- plugins/terraform/terraform.plugin.zsh | 1 + 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/plugins/terraform/README.md b/plugins/terraform/README.md index 2b535517c..b5158b4e9 100644 --- a/plugins/terraform/README.md +++ b/plugins/terraform/README.md @@ -15,20 +15,21 @@ 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` | -| `tft` | `terraform test` | -| `tfsh` | `terraform show` | +| Alias | Command | +| ------ | ------------------------- | +| `tf` | `terraform` | +| `tfa` | `terraform apply` | +| `tfc` | `terraform console` | +| `tfd` | `terraform destroy` | +| `tff` | `terraform fmt` | +| `tfi` | `terraform init` | +| `tfiu` | `terraform init -upgrade` | +| `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 8ef392efd..71a58b939 100644 --- a/plugins/terraform/terraform.plugin.zsh +++ b/plugins/terraform/terraform.plugin.zsh @@ -21,6 +21,7 @@ alias tfc='terraform console' alias tfd='terraform destroy' alias tff='terraform fmt' alias tfi='terraform init' +alias tfiu='terraform init -upgrade' alias tfo='terraform output' alias tfp='terraform plan' alias tfv='terraform validate' From a4304dd7e5826a2aeabb910a3966158897d55271 Mon Sep 17 00:00:00 2001 From: Sergey Karpuk Date: Tue, 11 Jun 2024 02:31:26 +0300 Subject: [PATCH 180/453] feat(docker): add aliases for `docker ps` and `docker ps -a` (#12488) --- plugins/docker/README.md | 2 ++ plugins/docker/docker.plugin.zsh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/plugins/docker/README.md b/plugins/docker/README.md index 0ab2e41fb..72ebbcb1e 100644 --- a/plugins/docker/README.md +++ b/plugins/docker/README.md @@ -61,6 +61,8 @@ zstyle ':omz:plugins:docker' legacy-completion yes | dnls | `docker network ls` | List all networks the engine daemon knows about, including those spanning multiple hosts | | dnrm | `docker network rm` | Remove one or more networks | | dpo | `docker container port` | List port mappings or a specific mapping for the container | +| dps | `docker ps` | List all the running docker containers | +| dpsa | `docker ps -a` | List all running and stopped containers | | dpu | `docker pull` | Pull an image or a repository from a registry | | dr | `docker container run` | Create a new container and start it using the specified command | | drit | `docker container run -it` | Create a new container and start it in an interactive shell | diff --git a/plugins/docker/docker.plugin.zsh b/plugins/docker/docker.plugin.zsh index b429ae211..56dbc6b80 100644 --- a/plugins/docker/docker.plugin.zsh +++ b/plugins/docker/docker.plugin.zsh @@ -16,6 +16,8 @@ alias dni='docker network inspect' alias dnls='docker network ls' alias dnrm='docker network rm' alias dpo='docker container port' +alias dps='docker ps' +alias dpsa='docker ps -a' alias dpu='docker pull' alias dr='docker container run' alias drit='docker container run -it' From 6ffdf8e008bb1bb052afdb56684917075424a056 Mon Sep 17 00:00:00 2001 From: Marco Eidinger Date: Mon, 10 Jun 2024 16:40:03 -0700 Subject: [PATCH 181/453] feat(swiftpm): update completion for Swift 5.9 (#12044) --- plugins/swiftpm/README.md | 2 +- plugins/swiftpm/_swift | 258 +++++++++++++++++--------------------- 2 files changed, 114 insertions(+), 146 deletions(-) diff --git a/plugins/swiftpm/README.md b/plugins/swiftpm/README.md index 223a607c1..e5b4752e4 100644 --- a/plugins/swiftpm/README.md +++ b/plugins/swiftpm/README.md @@ -2,7 +2,7 @@ ## Description -This plugin provides a few utilities that make you faster on your daily work with the [Swift Package Manager](https://github.com/apple/swift-package-manager), as well as autocompletion for Swift 5.7. +This plugin provides a few utilities that make you faster on your daily work with the [Swift Package Manager](https://github.com/apple/swift-package-manager), as well as autocompletion for Swift 5.9. To start using it, add the `swiftpm` plugin to your `plugins` array in `~/.zshrc`: diff --git a/plugins/swiftpm/_swift b/plugins/swiftpm/_swift index 51c9fffa0..f9a603f58 100644 --- a/plugins/swiftpm/_swift +++ b/plugins/swiftpm/_swift @@ -57,6 +57,8 @@ _swift_run() { '--config-path[Specify the shared configuration directory path]:config-path:_files -/' '--security-path[Specify the shared security directory path]:security-path:_files -/' '--scratch-path[Specify a custom scratch directory path (default .build)]:scratch-path:_files -/' + '--pkg-config-path[Specify alternative path to search for pkg-config `.pc` files. Use the option multiple times to + specify more than one path.]:pkg-config-path:_files -/' '--enable-dependency-cache[Use a shared cache when fetching dependencies]' '--disable-dependency-cache[Use a shared cache when fetching dependencies]' '--enable-build-manifest-caching' @@ -64,13 +66,18 @@ _swift_run() { '--manifest-cache[Caching mode of Package.swift manifests (shared: shared cache, local: package'"'"'s build directory, none: disabled]:manifest-cache:' '(--verbose -v)'{--verbose,-v}'[Increase verbosity to include informational output]' '(--very-verbose --vv)'{--very-verbose,--vv}'[Increase verbosity to include debug output]' + '(--quiet -q)'{--quiet,-q}'[Decrease verbosity to only include error output.]' '--disable-sandbox[Disable using the sandbox when executing subprocesses]' - '--enable-netrc[Load credentials from a .netrc file]' - '--disable-netrc[Load credentials from a .netrc file]' - '--netrc-file[Specify the .netrc file path.]:netrc-file:_files' + '--netrc[Use netrc file even in cases where other credential stores are preferred]' + '--enable-netrc[Load credentials from a netrc file]' + '--disable-netrc[Load credentials from a netrc file]' + '--netrc-file[Specify the netrc file path]:netrc-file:_files' '--enable-keychain[Search credentials in macOS keychain]' '--disable-keychain[Search credentials in macOS keychain]' '--resolver-fingerprint-checking:resolver-fingerprint-checking:' + '--resolver-signing-entity-checking:resolver-signing-entity-checking:' + '--enable-signature-validation[Validate signature of a signed package release downloaded from registry]' + '--disable-signature-validation[Validate signature of a signed package release downloaded from registry]' '--enable-prefetching' '--disable-prefetching' '(--force-resolved-versions --disable-automatic-resolution --only-use-versions-from-resolved-file)'{--force-resolved-versions,--disable-automatic-resolution,--only-use-versions-from-resolved-file}'[Only use versions from the Package.resolved file and fail resolution if it is out-of-date]' @@ -78,6 +85,7 @@ _swift_run() { '--disable-scm-to-registry-transformation[disable source control to registry transformation]' '--use-registry-identity-for-scm[look up source control dependencies in the registry and use their registry identity when possible to help deduplicate across the two origins]' '--replace-scm-with-registry[look up source control dependencies in the registry and use the registry to retrieve them instead of source control when possible]' + '--default-registry-url[Default registry URL to use, instead of the registries.json configuration file]:default-registry-url:' '(--configuration -c)'{--configuration,-c}'[Build with configuration]:configuration:(debug release)' '-Xcc[Pass flag through to all C compiler invocations]:Xcc:' '-Xswiftc[Pass flag through to all Swift compiler invocations]:Xswiftc:' @@ -86,7 +94,7 @@ _swift_run() { '--triple:triple:' '--sdk:sdk:_files -/' '--toolchain:toolchain:_files -/' - '--sanitize[Turn on runtime checks for erroneous behavior, possible values: address, thread, undefined, scudo]:sanitize:' + '--sanitize[Turn on runtime checks for erroneous behavior, possible values: address, thread, undefined, scudo]:sanitize:(address thread undefined scudo)' '--auto-index-store[Enable or disable indexing-while-building feature]' '--enable-index-store[Enable or disable indexing-while-building feature]' '--disable-index-store[Enable or disable indexing-while-building feature]' @@ -94,8 +102,8 @@ _swift_run() { '(--jobs -j)'{--jobs,-j}'[The number of jobs to spawn in parallel during the build process]:jobs:' '--emit-swift-module-separately' '--use-integrated-swift-driver' + '--explicit-target-dependency-import-check:explicit-target-dependency-import-check:' '--experimental-explicit-module-build' - '--print-manifest-job-graph[Write the command graph for the build manifest as a graphviz file]' '--build-system:build-system:(native xcode)' '--enable-dead-strip[Disable/enable dead code stripping by the linker]' '--disable-dead-strip[Disable/enable dead code stripping by the linker]' @@ -125,6 +133,8 @@ _swift_build() { '--config-path[Specify the shared configuration directory path]:config-path:_files -/' '--security-path[Specify the shared security directory path]:security-path:_files -/' '--scratch-path[Specify a custom scratch directory path (default .build)]:scratch-path:_files -/' + '--pkg-config-path[Specify alternative path to search for pkg-config `.pc` files. Use the option multiple times to + specify more than one path.]:pkg-config-path:_files -/' '--enable-dependency-cache[Use a shared cache when fetching dependencies]' '--disable-dependency-cache[Use a shared cache when fetching dependencies]' '--enable-build-manifest-caching' @@ -132,13 +142,18 @@ _swift_build() { '--manifest-cache[Caching mode of Package.swift manifests (shared: shared cache, local: package'"'"'s build directory, none: disabled]:manifest-cache:' '(--verbose -v)'{--verbose,-v}'[Increase verbosity to include informational output]' '(--very-verbose --vv)'{--very-verbose,--vv}'[Increase verbosity to include debug output]' + '(--quiet -q)'{--quiet,-q}'[Decrease verbosity to only include error output.]' '--disable-sandbox[Disable using the sandbox when executing subprocesses]' - '--enable-netrc[Load credentials from a .netrc file]' - '--disable-netrc[Load credentials from a .netrc file]' - '--netrc-file[Specify the .netrc file path.]:netrc-file:_files' + '--netrc[Use netrc file even in cases where other credential stores are preferred]' + '--enable-netrc[Load credentials from a netrc file]' + '--disable-netrc[Load credentials from a netrc file]' + '--netrc-file[Specify the netrc file path]:netrc-file:_files' '--enable-keychain[Search credentials in macOS keychain]' '--disable-keychain[Search credentials in macOS keychain]' '--resolver-fingerprint-checking:resolver-fingerprint-checking:' + '--resolver-signing-entity-checking:resolver-signing-entity-checking:' + '--enable-signature-validation[Validate signature of a signed package release downloaded from registry]' + '--disable-signature-validation[Validate signature of a signed package release downloaded from registry]' '--enable-prefetching' '--disable-prefetching' '(--force-resolved-versions --disable-automatic-resolution --only-use-versions-from-resolved-file)'{--force-resolved-versions,--disable-automatic-resolution,--only-use-versions-from-resolved-file}'[Only use versions from the Package.resolved file and fail resolution if it is out-of-date]' @@ -146,6 +161,7 @@ _swift_build() { '--disable-scm-to-registry-transformation[disable source control to registry transformation]' '--use-registry-identity-for-scm[look up source control dependencies in the registry and use their registry identity when possible to help deduplicate across the two origins]' '--replace-scm-with-registry[look up source control dependencies in the registry and use the registry to retrieve them instead of source control when possible]' + '--default-registry-url[Default registry URL to use, instead of the registries.json configuration file]:default-registry-url:' '(--configuration -c)'{--configuration,-c}'[Build with configuration]:configuration:(debug release)' '-Xcc[Pass flag through to all C compiler invocations]:Xcc:' '-Xswiftc[Pass flag through to all Swift compiler invocations]:Xswiftc:' @@ -154,7 +170,7 @@ _swift_build() { '--triple:triple:' '--sdk:sdk:_files -/' '--toolchain:toolchain:_files -/' - '--sanitize[Turn on runtime checks for erroneous behavior, possible values: address, thread, undefined, scudo]:sanitize:' + '--sanitize[Turn on runtime checks for erroneous behavior, possible values: address, thread, undefined, scudo]:sanitize:(address thread undefined scudo)' '--auto-index-store[Enable or disable indexing-while-building feature]' '--enable-index-store[Enable or disable indexing-while-building feature]' '--disable-index-store[Enable or disable indexing-while-building feature]' @@ -162,8 +178,8 @@ _swift_build() { '(--jobs -j)'{--jobs,-j}'[The number of jobs to spawn in parallel during the build process]:jobs:' '--emit-swift-module-separately' '--use-integrated-swift-driver' + '--explicit-target-dependency-import-check:explicit-target-dependency-import-check:' '--experimental-explicit-module-build' - '--print-manifest-job-graph[Write the command graph for the build manifest as a graphviz file]' '--build-system:build-system:(native xcode)' '--enable-dead-strip[Disable/enable dead code stripping by the linker]' '--disable-dead-strip[Disable/enable dead code stripping by the linker]' @@ -171,6 +187,7 @@ _swift_build() { '--no-static-swift-stdlib[Link Swift stdlib statically]' '--build-tests[Build both source and test targets]' '--show-bin-path[Print the binary output path]' + '--print-manifest-job-graph[Write the command graph for the build manifest as a graphviz file]' '--target[Build the specified target]:target:' '--product[Build the specified product]:product:' '--version[Show the version.]' @@ -190,6 +207,8 @@ _swift_test() { '--config-path[Specify the shared configuration directory path]:config-path:_files -/' '--security-path[Specify the shared security directory path]:security-path:_files -/' '--scratch-path[Specify a custom scratch directory path (default .build)]:scratch-path:_files -/' + '--pkg-config-path[Specify alternative path to search for pkg-config `.pc` files. Use the option multiple times to + specify more than one path.]:pkg-config-path:_files -/' '--enable-dependency-cache[Use a shared cache when fetching dependencies]' '--disable-dependency-cache[Use a shared cache when fetching dependencies]' '--enable-build-manifest-caching' @@ -197,13 +216,18 @@ _swift_test() { '--manifest-cache[Caching mode of Package.swift manifests (shared: shared cache, local: package'"'"'s build directory, none: disabled]:manifest-cache:' '(--verbose -v)'{--verbose,-v}'[Increase verbosity to include informational output]' '(--very-verbose --vv)'{--very-verbose,--vv}'[Increase verbosity to include debug output]' + '(--quiet -q)'{--quiet,-q}'[Decrease verbosity to only include error output.]' '--disable-sandbox[Disable using the sandbox when executing subprocesses]' - '--enable-netrc[Load credentials from a .netrc file]' - '--disable-netrc[Load credentials from a .netrc file]' - '--netrc-file[Specify the .netrc file path.]:netrc-file:_files' + '--netrc[Use netrc file even in cases where other credential stores are preferred]' + '--enable-netrc[Load credentials from a netrc file]' + '--disable-netrc[Load credentials from a netrc file]' + '--netrc-file[Specify the netrc file path]:netrc-file:_files' '--enable-keychain[Search credentials in macOS keychain]' '--disable-keychain[Search credentials in macOS keychain]' '--resolver-fingerprint-checking:resolver-fingerprint-checking:' + '--resolver-signing-entity-checking:resolver-signing-entity-checking:' + '--enable-signature-validation[Validate signature of a signed package release downloaded from registry]' + '--disable-signature-validation[Validate signature of a signed package release downloaded from registry]' '--enable-prefetching' '--disable-prefetching' '(--force-resolved-versions --disable-automatic-resolution --only-use-versions-from-resolved-file)'{--force-resolved-versions,--disable-automatic-resolution,--only-use-versions-from-resolved-file}'[Only use versions from the Package.resolved file and fail resolution if it is out-of-date]' @@ -211,6 +235,7 @@ _swift_test() { '--disable-scm-to-registry-transformation[disable source control to registry transformation]' '--use-registry-identity-for-scm[look up source control dependencies in the registry and use their registry identity when possible to help deduplicate across the two origins]' '--replace-scm-with-registry[look up source control dependencies in the registry and use the registry to retrieve them instead of source control when possible]' + '--default-registry-url[Default registry URL to use, instead of the registries.json configuration file]:default-registry-url:' '(--configuration -c)'{--configuration,-c}'[Build with configuration]:configuration:(debug release)' '-Xcc[Pass flag through to all C compiler invocations]:Xcc:' '-Xswiftc[Pass flag through to all Swift compiler invocations]:Xswiftc:' @@ -219,7 +244,7 @@ _swift_test() { '--triple:triple:' '--sdk:sdk:_files -/' '--toolchain:toolchain:_files -/' - '--sanitize[Turn on runtime checks for erroneous behavior, possible values: address, thread, undefined, scudo]:sanitize:' + '--sanitize[Turn on runtime checks for erroneous behavior, possible values: address, thread, undefined, scudo]:sanitize:(address thread undefined scudo)' '--auto-index-store[Enable or disable indexing-while-building feature]' '--enable-index-store[Enable or disable indexing-while-building feature]' '--disable-index-store[Enable or disable indexing-while-building feature]' @@ -227,29 +252,77 @@ _swift_test() { '(--jobs -j)'{--jobs,-j}'[The number of jobs to spawn in parallel during the build process]:jobs:' '--emit-swift-module-separately' '--use-integrated-swift-driver' + '--explicit-target-dependency-import-check:explicit-target-dependency-import-check:' '--experimental-explicit-module-build' - '--print-manifest-job-graph[Write the command graph for the build manifest as a graphviz file]' '--build-system:build-system:(native xcode)' '--enable-dead-strip[Disable/enable dead code stripping by the linker]' '--disable-dead-strip[Disable/enable dead code stripping by the linker]' '--static-swift-stdlib[Link Swift stdlib statically]' '--no-static-swift-stdlib[Link Swift stdlib statically]' '--skip-build[Skip building the test target]' + '--test-product[Test the specified product.]:test-product:' '--parallel[Run the tests in parallel.]' '--num-workers[Number of tests to execute in parallel.]:num-workers:' '(--list-tests -l)'{--list-tests,-l}'[Lists test methods in specifier format]' - '--show-codecov-path[Print the path of the exported code coverage JSON file]' + '(--show-codecov-path --show-code-coverage-path --show-coverage-path)'{--show-codecov-path,--show-code-coverage-path,--show-coverage-path}'[Print the path of the exported code coverage JSON file]' '(-s --specifier)'{-s,--specifier}':specifier:' '--filter[Run test cases matching regular expression, Format: . or ./]:filter:' '--skip[Skip test cases matching regular expression, Example: --skip PerformanceTests]:skip:' '--xunit-output[Path where the xUnit xml file should be generated.]:xunit-output:_files -/' - '--test-product[Test the specified product.]:test-product:' '--enable-testable-imports[Enable or disable testable imports. Enabled by default.]' '--disable-testable-imports[Enable or disable testable imports. Enabled by default.]' '--enable-code-coverage[Enable code coverage]' '--disable-code-coverage[Enable code coverage]' '--version[Show the version.]' '(-help -h --help)'{-help,-h,--help}'[Show help information.]' + '(-): :->command' + '(-)*:: :->arg' + ) + _arguments -w -s -S $args[@] && ret=0 + case $state in + (command) + local subcommands + subcommands=( + 'list:Lists test methods in specifier format' + 'generate-linuxmain:Generate LinuxMain.swift (deprecated)' + ) + _describe "subcommand" subcommands + ;; + (arg) + case ${words[1]} in + (list) + _swift_test_list + ;; + (generate-linuxmain) + _swift_test_generate-linuxmain + ;; + esac + ;; + esac + + return ret +} + +_swift_test_list() { + integer ret=1 + local -a args + args+=( + '--skip-build[Skip building the test target]' + '--test-product[Test the specified product.]:test-product:' + '--version[Show the version.]' + '(-help -h --help)'{-help,-h,--help}'[Show help information.]' + ) + _arguments -w -s -S $args[@] && ret=0 + + return ret +} + +_swift_test_generate-linuxmain() { + integer ret=1 + local -a args + args+=( + '--version[Show the version.]' + '(-help -h --help)'{-help,-h,--help}'[Show help information.]' ) _arguments -w -s -S $args[@] && ret=0 @@ -265,6 +338,8 @@ _swift_package() { '--config-path[Specify the shared configuration directory path]:config-path:_files -/' '--security-path[Specify the shared security directory path]:security-path:_files -/' '--scratch-path[Specify a custom scratch directory path (default .build)]:scratch-path:_files -/' + '--pkg-config-path[Specify alternative path to search for pkg-config `.pc` files. Use the option multiple times to + specify more than one path.]:pkg-config-path:_files -/' '--enable-dependency-cache[Use a shared cache when fetching dependencies]' '--disable-dependency-cache[Use a shared cache when fetching dependencies]' '--enable-build-manifest-caching' @@ -272,13 +347,18 @@ _swift_package() { '--manifest-cache[Caching mode of Package.swift manifests (shared: shared cache, local: package'"'"'s build directory, none: disabled]:manifest-cache:' '(--verbose -v)'{--verbose,-v}'[Increase verbosity to include informational output]' '(--very-verbose --vv)'{--very-verbose,--vv}'[Increase verbosity to include debug output]' + '(--quiet -q)'{--quiet,-q}'[Decrease verbosity to only include error output.]' '--disable-sandbox[Disable using the sandbox when executing subprocesses]' - '--enable-netrc[Load credentials from a .netrc file]' - '--disable-netrc[Load credentials from a .netrc file]' - '--netrc-file[Specify the .netrc file path.]:netrc-file:_files' + '--netrc[Use netrc file even in cases where other credential stores are preferred]' + '--enable-netrc[Load credentials from a netrc file]' + '--disable-netrc[Load credentials from a netrc file]' + '--netrc-file[Specify the netrc file path]:netrc-file:_files' '--enable-keychain[Search credentials in macOS keychain]' '--disable-keychain[Search credentials in macOS keychain]' '--resolver-fingerprint-checking:resolver-fingerprint-checking:' + '--resolver-signing-entity-checking:resolver-signing-entity-checking:' + '--enable-signature-validation[Validate signature of a signed package release downloaded from registry]' + '--disable-signature-validation[Validate signature of a signed package release downloaded from registry]' '--enable-prefetching' '--disable-prefetching' '(--force-resolved-versions --disable-automatic-resolution --only-use-versions-from-resolved-file)'{--force-resolved-versions,--disable-automatic-resolution,--only-use-versions-from-resolved-file}'[Only use versions from the Package.resolved file and fail resolution if it is out-of-date]' @@ -286,6 +366,7 @@ _swift_package() { '--disable-scm-to-registry-transformation[disable source control to registry transformation]' '--use-registry-identity-for-scm[look up source control dependencies in the registry and use their registry identity when possible to help deduplicate across the two origins]' '--replace-scm-with-registry[look up source control dependencies in the registry and use the registry to retrieve them instead of source control when possible]' + '--default-registry-url[Default registry URL to use, instead of the registries.json configuration file]:default-registry-url:' '(--configuration -c)'{--configuration,-c}'[Build with configuration]:configuration:(debug release)' '-Xcc[Pass flag through to all C compiler invocations]:Xcc:' '-Xswiftc[Pass flag through to all Swift compiler invocations]:Xswiftc:' @@ -294,7 +375,7 @@ _swift_package() { '--triple:triple:' '--sdk:sdk:_files -/' '--toolchain:toolchain:_files -/' - '--sanitize[Turn on runtime checks for erroneous behavior, possible values: address, thread, undefined, scudo]:sanitize:' + '--sanitize[Turn on runtime checks for erroneous behavior, possible values: address, thread, undefined, scudo]:sanitize:(address thread undefined scudo)' '--auto-index-store[Enable or disable indexing-while-building feature]' '--enable-index-store[Enable or disable indexing-while-building feature]' '--disable-index-store[Enable or disable indexing-while-building feature]' @@ -302,8 +383,8 @@ _swift_package() { '(--jobs -j)'{--jobs,-j}'[The number of jobs to spawn in parallel during the build process]:jobs:' '--emit-swift-module-separately' '--use-integrated-swift-driver' + '--explicit-target-dependency-import-check:explicit-target-dependency-import-check:' '--experimental-explicit-module-build' - '--print-manifest-job-graph[Write the command graph for the build manifest as a graphviz file]' '--build-system:build-system:(native xcode)' '--enable-dead-strip[Disable/enable dead code stripping by the linker]' '--disable-dead-strip[Disable/enable dead code stripping by the linker]' @@ -325,25 +406,19 @@ _swift_package() { 'update:Update package dependencies' 'describe:Describe the current package' 'init:Initialize a new package' - '_format:' 'diagnose-api-breaking-changes:Diagnose API-breaking changes to Swift modules in a package' - 'experimental-api-diff:Deprecated - use `swift package diagnose-api-breaking-changes` instead' 'dump-symbol-graph:Dump Symbol Graph' - 'dump-pif:' 'dump-package:Print parsed Package.swift as JSON' 'edit:Put a package in editable mode' 'unedit:Remove a package from editable mode' 'config:Manipulate configuration of the package' 'resolve:Resolve package dependencies' - 'fetch:' 'show-dependencies:Print the resolved dependency graph' 'tools-version:Manipulate tools version of the current package' - 'generate-xcodeproj:Generates an Xcode project. This command will be deprecated soon.' 'compute-checksum:Compute the checksum for a binary artifact.' 'archive-source:Create a source archive for the package' 'completion-tool:Completion tool (for shell completions)' 'plugin:Invoke a command plugin or perform other actions on command plugins' - 'default-command:' ) _describe "subcommand" subcommands ;; @@ -367,21 +442,12 @@ _swift_package() { (init) _swift_package_init ;; - (_format) - _swift_package__format - ;; (diagnose-api-breaking-changes) _swift_package_diagnose-api-breaking-changes ;; - (experimental-api-diff) - _swift_package_experimental-api-diff - ;; (dump-symbol-graph) _swift_package_dump-symbol-graph ;; - (dump-pif) - _swift_package_dump-pif - ;; (dump-package) _swift_package_dump-package ;; @@ -397,18 +463,12 @@ _swift_package() { (resolve) _swift_package_resolve ;; - (fetch) - _swift_package_fetch - ;; (show-dependencies) _swift_package_show-dependencies ;; (tools-version) _swift_package_tools-version ;; - (generate-xcodeproj) - _swift_package_generate-xcodeproj - ;; (compute-checksum) _swift_package_compute-checksum ;; @@ -421,9 +481,6 @@ _swift_package() { (plugin) _swift_package_plugin ;; - (default-command) - _swift_package_default-command - ;; esac ;; esac @@ -498,7 +555,7 @@ _swift_package_init() { integer ret=1 local -a args args+=( - '--type[Package type: empty | library | executable | system-module | manifest]:type:' + '--type[Package type:]:type:' '--name[Provide custom package name]:name:' '--version[Show the version.]' '(-help -h --help)'{-help,-h,--help}'[Show help information.]' @@ -508,19 +565,6 @@ _swift_package_init() { return ret } -_swift_package__format() { - integer ret=1 - local -a args - args+=( - ':swift-format-flags:' - '--version[Show the version.]' - '(-help -h --help)'{-help,-h,--help}'[Show help information.]' - ) - _arguments -w -s -S $args[@] && ret=0 - - return ret -} - _swift_package_diagnose-api-breaking-changes() { integer ret=1 local -a args @@ -539,19 +583,6 @@ _swift_package_diagnose-api-breaking-changes() { return ret } -_swift_package_experimental-api-diff() { - integer ret=1 - local -a args - args+=( - ':args:' - '--version[Show the version.]' - '(-help -h --help)'{-help,-h,--help}'[Show help information.]' - ) - _arguments -w -s -S $args[@] && ret=0 - - return ret -} - _swift_package_dump-symbol-graph() { integer ret=1 local -a args @@ -561,19 +592,8 @@ _swift_package_dump-symbol-graph() { '--minimum-access-level[Include symbols with this access level or more. Possible values: private | fileprivate | internal | public | open]:minimum-access-level:(private fileprivate internal public open)' '--skip-inherited-docs[Skip emitting doc comments for members inherited through classes or default implementations.]' '--include-spi-symbols[Add symbols with SPI information to the symbol graph.]' - '--version[Show the version.]' - '(-help -h --help)'{-help,-h,--help}'[Show help information.]' - ) - _arguments -w -s -S $args[@] && ret=0 - - return ret -} - -_swift_package_dump-pif() { - integer ret=1 - local -a args - args+=( - '--preserve-structure[Preserve the internal structure of PIF]' + '--emit-extension-block-symbols[Emit extension block symbols for extensions to external types or directly associate members and conformances with the extended nominal.]' + '--omit-extension-block-symbols[Emit extension block symbols for extensions to external types or directly associate members and conformances with the extended nominal.]' '--version[Show the version.]' '(-help -h --help)'{-help,-h,--help}'[Show help information.]' ) @@ -614,7 +634,7 @@ _swift_package_unedit() { integer ret=1 local -a args args+=( - '--force[Unedit the package even if it has uncommitted and unpushed changes]' + '--force[Unedit the package even if it has uncommited and unpushed changes]' ':package-name:' '--version[Show the version.]' '(-help -h --help)'{-help,-h,--help}'[Show help information.]' @@ -666,9 +686,8 @@ _swift_package_config_set-mirror() { integer ret=1 local -a args args+=( - '--package-url[The package dependency url]:package-url:' - '--original-url[The original url]:original-url:' - '--mirror-url[The mirror url]:mirror-url:' + '--original[The original url or identity]:original:' + '--mirror[The mirror url or identity]:mirror:' '--version[Show the version.]' '(-help -h --help)'{-help,-h,--help}'[Show help information.]' ) @@ -681,9 +700,8 @@ _swift_package_config_unset-mirror() { integer ret=1 local -a args args+=( - '--package-url[The package dependency url]:package-url:' - '--original-url[The original url]:original-url:' - '--mirror-url[The mirror url]:mirror-url:' + '--original[The original url or identity]:original:' + '--mirror[The mirror url or identity]:mirror:' '--version[Show the version.]' '(-help -h --help)'{-help,-h,--help}'[Show help information.]' ) @@ -696,8 +714,7 @@ _swift_package_config_get-mirror() { integer ret=1 local -a args args+=( - '--package-url[The package dependency url]:package-url:' - '--original-url[The original url]:original-url:' + '--original[The original url or identity]:original:' '--version[Show the version.]' '(-help -h --help)'{-help,-h,--help}'[Show help information.]' ) @@ -722,22 +739,6 @@ _swift_package_resolve() { return ret } -_swift_package_fetch() { - integer ret=1 - local -a args - args+=( - '--version[The version to resolve at]:version:' - '--branch[The branch to resolve at]:branch:' - '--revision[The revision to resolve at]:revision:' - ':package-name:' - '--version[Show the version.]' - '(-help -h --help)'{-help,-h,--help}'[Show help information.]' - ) - _arguments -w -s -S $args[@] && ret=0 - - return ret -} - _swift_package_show-dependencies() { integer ret=1 local -a args @@ -766,25 +767,6 @@ _swift_package_tools-version() { return ret } -_swift_package_generate-xcodeproj() { - integer ret=1 - local -a args - args+=( - '--xcconfig-overrides[Path to xcconfig file]:xcconfig-overrides:_files' - '--output[Path where the Xcode project should be generated]:output:_files -/' - '--legacy-scheme-generator[Use the legacy scheme generator]' - '--watch[Watch for changes to the Package manifest to regenerate the Xcode project]' - '--skip-extra-files[Do not add file references for extra files to the generated Xcode project]' - '--enable-code-coverage[Enable code coverage]' - '--disable-code-coverage[Enable code coverage]' - '--version[Show the version.]' - '(-help -h --help)'{-help,-h,--help}'[Show help information.]' - ) - _arguments -w -s -S $args[@] && ret=0 - - return ret -} - _swift_package_compute-checksum() { integer ret=1 local -a args @@ -831,6 +813,7 @@ _swift_package_plugin() { '--list[List the available command plugins]' '--allow-writing-to-package-directory[Allow the plugin to write to the package directory]' '--allow-writing-to-directory[Allow the plugin to write to an additional directory]:allow-writing-to-directory:' + '--allow-network-connections:allow-network-connections:(none local all docker unixDomainSocket)' ':command:' ':arguments:' '--version[Show the version.]' @@ -841,21 +824,6 @@ _swift_package_plugin() { return ret } -_swift_package_default-command() { - integer ret=1 - local -a args - args+=( - '--allow-writing-to-package-directory[Allow the plugin to write to the package directory]' - '--allow-writing-to-directory[Allow the plugin to write to an additional directory]:allow-writing-to-directory:' - ':remaining:' - '--version[Show the version.]' - '(-help -h --help)'{-help,-h,--help}'[Show help information.]' - ) - _arguments -w -s -S $args[@] && ret=0 - - return ret -} - _swift_help() { integer ret=1 local -a args From b7e05f136640678539f90e0fa32475bd12c8d930 Mon Sep 17 00:00:00 2001 From: baltic-tea <97766478+baltic-tea@users.noreply.github.com> Date: Tue, 11 Jun 2024 02:45:09 +0300 Subject: [PATCH 182/453] feat(poetry): add aliases (#11858) --- plugins/poetry/README.md | 33 ++++++++++++++++++++++++++++++++ plugins/poetry/poetry.plugin.zsh | 28 +++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/plugins/poetry/README.md b/plugins/poetry/README.md index 51780cbed..7b7905a41 100644 --- a/plugins/poetry/README.md +++ b/plugins/poetry/README.md @@ -7,3 +7,36 @@ To use it, add `poetry` to the plugins array in your zshrc file: ```zsh plugins=(... poetry) ``` + +## Aliases + +| Alias | Command | Description +|:----- |--------------------------------------------------- |:--------------------------------------------------------------------------------------- | +| pad | `poetry add` | Add packages to `pyproject.toml` and install them | +| pbld | `poetry build` | Build the source and wheels archives | +| pch | `poetry check` | Validate the content of the `pyproject.toml` and its consistency with the `poetry.lock` | +| pcmd | `poetry list` | Display all the available Poetry commands | +| pconf | `poetry config --list` | Allow you to edit poetry config settings and repositories | +| pexp | `poetry export --without-hashes > requirements.txt | Export the lock file to `requirements.txt` | +| pin | `poetry init` | Create a `pyproject.toml` interactively | +| pinst | `poetry install` | Read the `pyproject.toml`, resolve the dependencies, and install them | +| plck | `poetry lock` | Lock the dependencies in `pyproject.toml` without installing | +| pnew | `poetry new` | Create a directory structure suitable for most Python projects | +| ppath | `poetry env info --path` | Get the path of the currently activated virtualenv` | +| pplug | `poetry self show plugins` | List all the installed Poetry plugins | +| ppub | `poetry publish` | Publish the builded (`poetry build` command) package to the remote repository | +| prm | `poetry remove` | Remove packages from `pyproject.toml` and uninstall them | +| prun | `poetry run` | Executes the given command inside the project’s virtualenv | +| psad | `poetry self add` | Add the Poetry plugin and install dependencies to make it work | +| psh | `poetry shell` | Spawns a shell within the virtual environment. If one doesn’t exist, it will be created | +| pshw | `poetry show` | List all the available dependencies | +| pslt | `poetry show --latest` | List lastest version of the dependencies | +| psup | `poetry self update` | Update Poetry to the latest version (default) or to the specified version | +| psync | `poetry install --sync` | Synchronize your environment with the `poetry.lock` | +| ptree | `poetry show --tree` | List the dependencies as tree | +| pup | `poetry update` | Get the latest versions of the dependencies and to update the `poetry.lock` | +| pvinf | `poetry env info` | Get basic information about the currently activated virtualenv | +| pvoff | `poetry config virtualenvs.create false` | Disable automatic virtualenv creation | +| pvrm | `poetry env remove` | Delete existing virtualenvs | +| pvrma | `poetry env remove --all` | Delete all existing virtualenvs | +| pvu | `poetry env use` | Switch between existing virtualenvs | diff --git a/plugins/poetry/poetry.plugin.zsh b/plugins/poetry/poetry.plugin.zsh index cebcb46c4..fe6a0f7ed 100644 --- a/plugins/poetry/poetry.plugin.zsh +++ b/plugins/poetry/poetry.plugin.zsh @@ -1,3 +1,31 @@ +alias pad='poetry add' +alias pbld='poetry build' +alias pch='poetry check' +alias pcmd='poetry list' +alias pconf='poetry config --list' +alias pexp='poetry export --without-hashes > requirements.txt' +alias pin='poetry init' +alias pinst='poetry install' +alias plck='poetry lock' +alias pnew='poetry new' +alias ppath='poetry env info --path' +alias pplug='poetry self show plugins' +alias ppub='poetry publish' +alias prm='poetry remove' +alias prun='poetry run' +alias psad='poetry self add' +alias psh='poetry shell' +alias pshw='poetry show' +alias pslt='poetry show --latest' +alias psup='poetry self update' +alias psync='poetry install --sync' +alias ptree='poetry show --tree' +alias pup='poetry update' +alias pvinf='poetry env info' +alias pvoff='poetry config virtualenvs.create false' +alias pvrm='poetry env remove' +alias pvu='poetry env use' + # Return immediately if poetry is not found if (( ! $+commands[poetry] )); then return From 166b9dcfdc32c5ce3a2060c0c221e2df0b49fa37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20Schl=C3=BCter?= Date: Tue, 11 Jun 2024 01:46:33 +0200 Subject: [PATCH 183/453] Add plugin for native autocompletion from Symfony 6 (#11999) --- plugins/symfony6/README.md | 9 +++ plugins/symfony6/symfony6.plugin.zsh | 82 ++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 plugins/symfony6/README.md create mode 100644 plugins/symfony6/symfony6.plugin.zsh diff --git a/plugins/symfony6/README.md b/plugins/symfony6/README.md new file mode 100644 index 000000000..54611bcee --- /dev/null +++ b/plugins/symfony6/README.md @@ -0,0 +1,9 @@ +# Symfony + +This plugin provides native completion for [Symfony](https://symfony.com/), but requires at least Symfony 6.2. + +To use it add `symfony6` to the plugins array in your zshrc file. + +```bash +plugins=(... symfony6) +``` diff --git a/plugins/symfony6/symfony6.plugin.zsh b/plugins/symfony6/symfony6.plugin.zsh new file mode 100644 index 000000000..ed7dbe60e --- /dev/null +++ b/plugins/symfony6/symfony6.plugin.zsh @@ -0,0 +1,82 @@ +#compdef console + +# This file is part of the Symfony package. +# +# (c) Fabien Potencier +# +# For the full copyright and license information, please view +# https://symfony.com/doc/current/contributing/code/license.html + +# +# zsh completions for console +# +# References: +# - https://github.com/spf13/cobra/blob/master/zsh_completions.go +# - https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/Console/Resources/completion.bash +# +_sf_console() { + local lastParam flagPrefix requestComp out comp + local -a completions + + # The user could have moved the cursor backwards on the command-line. + # We need to trigger completion from the $CURRENT location, so we need + # to truncate the command-line ($words) up to the $CURRENT location. + # (We cannot use $CURSOR as its value does not work when a command is an alias.) + words=("${=words[1,CURRENT]}") lastParam=${words[-1]} + + # For zsh, when completing a flag with an = (e.g., console -n=) + # completions must be prefixed with the flag + setopt local_options BASH_REMATCH + if [[ "${lastParam}" =~ '-.*=' ]]; then + # We are dealing with a flag with an = + flagPrefix="-P ${BASH_REMATCH}" + fi + + # Prepare the command to obtain completions + requestComp="${words[0]} ${words[1]} _complete --no-interaction -szsh -a1 -c$((CURRENT-1))" i="" + for w in ${words[@]}; do + w=$(printf -- '%b' "$w") + # remove quotes from typed values + quote="${w:0:1}" + if [ "$quote" = \' ]; then + w="${w%\'}" + w="${w#\'}" + elif [ "$quote" = \" ]; then + w="${w%\"}" + w="${w#\"}" + fi + # empty values are ignored + if [ ! -z "$w" ]; then + i="${i}-i${w} " + fi + done + + # Ensure at least 1 input + if [ "${i}" = "" ]; then + requestComp="${requestComp} -i\" \"" + else + requestComp="${requestComp} ${i}" + fi + + # Use eval to handle any environment variables and such + out=$(eval ${requestComp} 2>/dev/null) + + while IFS='\n' read -r comp; do + if [ -n "$comp" ]; then + # If requested, completions are returned with a description. + # The description is preceded by a TAB character. + # For zsh's _describe, we need to use a : instead of a TAB. + # We first need to escape any : as part of the completion itself. + comp=${comp//:/\\:} + local tab=$(printf '\t') + comp=${comp//$tab/:} + completions+=${comp} + fi + done < <(printf "%s\n" "${out[@]}") + + # Let inbuilt _describe handle completions + eval _describe "completions" completions $flagPrefix + return $? +} + +compdef _sf_console console From 83014bd9458b870c93fd18642484b305d7e5340b Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Mon, 10 Jun 2024 16:47:55 -0700 Subject: [PATCH 184/453] Revert "Add plugin for native autocompletion from Symfony 6 (#11999)" (#12493) This reverts commit 166b9dcfdc32c5ce3a2060c0c221e2df0b49fa37. --- plugins/symfony6/README.md | 9 --- plugins/symfony6/symfony6.plugin.zsh | 82 ---------------------------- 2 files changed, 91 deletions(-) delete mode 100644 plugins/symfony6/README.md delete mode 100644 plugins/symfony6/symfony6.plugin.zsh diff --git a/plugins/symfony6/README.md b/plugins/symfony6/README.md deleted file mode 100644 index 54611bcee..000000000 --- a/plugins/symfony6/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Symfony - -This plugin provides native completion for [Symfony](https://symfony.com/), but requires at least Symfony 6.2. - -To use it add `symfony6` to the plugins array in your zshrc file. - -```bash -plugins=(... symfony6) -``` diff --git a/plugins/symfony6/symfony6.plugin.zsh b/plugins/symfony6/symfony6.plugin.zsh deleted file mode 100644 index ed7dbe60e..000000000 --- a/plugins/symfony6/symfony6.plugin.zsh +++ /dev/null @@ -1,82 +0,0 @@ -#compdef console - -# This file is part of the Symfony package. -# -# (c) Fabien Potencier -# -# For the full copyright and license information, please view -# https://symfony.com/doc/current/contributing/code/license.html - -# -# zsh completions for console -# -# References: -# - https://github.com/spf13/cobra/blob/master/zsh_completions.go -# - https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/Console/Resources/completion.bash -# -_sf_console() { - local lastParam flagPrefix requestComp out comp - local -a completions - - # The user could have moved the cursor backwards on the command-line. - # We need to trigger completion from the $CURRENT location, so we need - # to truncate the command-line ($words) up to the $CURRENT location. - # (We cannot use $CURSOR as its value does not work when a command is an alias.) - words=("${=words[1,CURRENT]}") lastParam=${words[-1]} - - # For zsh, when completing a flag with an = (e.g., console -n=) - # completions must be prefixed with the flag - setopt local_options BASH_REMATCH - if [[ "${lastParam}" =~ '-.*=' ]]; then - # We are dealing with a flag with an = - flagPrefix="-P ${BASH_REMATCH}" - fi - - # Prepare the command to obtain completions - requestComp="${words[0]} ${words[1]} _complete --no-interaction -szsh -a1 -c$((CURRENT-1))" i="" - for w in ${words[@]}; do - w=$(printf -- '%b' "$w") - # remove quotes from typed values - quote="${w:0:1}" - if [ "$quote" = \' ]; then - w="${w%\'}" - w="${w#\'}" - elif [ "$quote" = \" ]; then - w="${w%\"}" - w="${w#\"}" - fi - # empty values are ignored - if [ ! -z "$w" ]; then - i="${i}-i${w} " - fi - done - - # Ensure at least 1 input - if [ "${i}" = "" ]; then - requestComp="${requestComp} -i\" \"" - else - requestComp="${requestComp} ${i}" - fi - - # Use eval to handle any environment variables and such - out=$(eval ${requestComp} 2>/dev/null) - - while IFS='\n' read -r comp; do - if [ -n "$comp" ]; then - # If requested, completions are returned with a description. - # The description is preceded by a TAB character. - # For zsh's _describe, we need to use a : instead of a TAB. - # We first need to escape any : as part of the completion itself. - comp=${comp//:/\\:} - local tab=$(printf '\t') - comp=${comp//$tab/:} - completions+=${comp} - fi - done < <(printf "%s\n" "${out[@]}") - - # Let inbuilt _describe handle completions - eval _describe "completions" completions $flagPrefix - return $? -} - -compdef _sf_console console From 4295aed17b4b1180b7e42bd7debd7685686c1307 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Mon, 10 Jun 2024 16:49:59 -0700 Subject: [PATCH 185/453] feat(symfony6): Add plugin for native autocompletion from Symfony 6 This reverts commit 83014bd9458b870c93fd18642484b305d7e5340b. --- plugins/symfony6/README.md | 9 +++ plugins/symfony6/symfony6.plugin.zsh | 82 ++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 plugins/symfony6/README.md create mode 100644 plugins/symfony6/symfony6.plugin.zsh diff --git a/plugins/symfony6/README.md b/plugins/symfony6/README.md new file mode 100644 index 000000000..54611bcee --- /dev/null +++ b/plugins/symfony6/README.md @@ -0,0 +1,9 @@ +# Symfony + +This plugin provides native completion for [Symfony](https://symfony.com/), but requires at least Symfony 6.2. + +To use it add `symfony6` to the plugins array in your zshrc file. + +```bash +plugins=(... symfony6) +``` diff --git a/plugins/symfony6/symfony6.plugin.zsh b/plugins/symfony6/symfony6.plugin.zsh new file mode 100644 index 000000000..ed7dbe60e --- /dev/null +++ b/plugins/symfony6/symfony6.plugin.zsh @@ -0,0 +1,82 @@ +#compdef console + +# This file is part of the Symfony package. +# +# (c) Fabien Potencier +# +# For the full copyright and license information, please view +# https://symfony.com/doc/current/contributing/code/license.html + +# +# zsh completions for console +# +# References: +# - https://github.com/spf13/cobra/blob/master/zsh_completions.go +# - https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/Console/Resources/completion.bash +# +_sf_console() { + local lastParam flagPrefix requestComp out comp + local -a completions + + # The user could have moved the cursor backwards on the command-line. + # We need to trigger completion from the $CURRENT location, so we need + # to truncate the command-line ($words) up to the $CURRENT location. + # (We cannot use $CURSOR as its value does not work when a command is an alias.) + words=("${=words[1,CURRENT]}") lastParam=${words[-1]} + + # For zsh, when completing a flag with an = (e.g., console -n=) + # completions must be prefixed with the flag + setopt local_options BASH_REMATCH + if [[ "${lastParam}" =~ '-.*=' ]]; then + # We are dealing with a flag with an = + flagPrefix="-P ${BASH_REMATCH}" + fi + + # Prepare the command to obtain completions + requestComp="${words[0]} ${words[1]} _complete --no-interaction -szsh -a1 -c$((CURRENT-1))" i="" + for w in ${words[@]}; do + w=$(printf -- '%b' "$w") + # remove quotes from typed values + quote="${w:0:1}" + if [ "$quote" = \' ]; then + w="${w%\'}" + w="${w#\'}" + elif [ "$quote" = \" ]; then + w="${w%\"}" + w="${w#\"}" + fi + # empty values are ignored + if [ ! -z "$w" ]; then + i="${i}-i${w} " + fi + done + + # Ensure at least 1 input + if [ "${i}" = "" ]; then + requestComp="${requestComp} -i\" \"" + else + requestComp="${requestComp} ${i}" + fi + + # Use eval to handle any environment variables and such + out=$(eval ${requestComp} 2>/dev/null) + + while IFS='\n' read -r comp; do + if [ -n "$comp" ]; then + # If requested, completions are returned with a description. + # The description is preceded by a TAB character. + # For zsh's _describe, we need to use a : instead of a TAB. + # We first need to escape any : as part of the completion itself. + comp=${comp//:/\\:} + local tab=$(printf '\t') + comp=${comp//$tab/:} + completions+=${comp} + fi + done < <(printf "%s\n" "${out[@]}") + + # Let inbuilt _describe handle completions + eval _describe "completions" completions $flagPrefix + return $? +} + +compdef _sf_console console From 59e8e028e179fc126d46254900946953072048e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 12 Jun 2024 10:32:30 +0200 Subject: [PATCH 186/453] fix(lib/git): turn off async prompt for zsh < 5.0.6 We removed this mitigation in 0c80a063 because of an assumption that the issue had been fixed, but it looks like zsh < 5.0.6 has other issues (see #12360), so we need to disable it for real. Fixes #12360 --- lib/git.zsh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/git.zsh b/lib/git.zsh index b257d01a4..db6c9174c 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -39,8 +39,13 @@ function _omz_git_prompt_info() { echo "${ZSH_THEME_GIT_PROMPT_PREFIX}${ref:gs/%/%%}${upstream:gs/%/%%}$(parse_git_dirty)${ZSH_THEME_GIT_PROMPT_SUFFIX}" } -# Use async version if setting is enabled or undefined -if zstyle -T ':omz:alpha:lib:git' async-prompt; then +# Use async version if setting is enabled, or unset but zsh version is at least 5.0.6. +# This avoids async prompt issues caused by previous zsh versions: +# - https://github.com/ohmyzsh/ohmyzsh/issues/12331 +# - https://github.com/ohmyzsh/ohmyzsh/issues/12360 +# TODO(2024-06-12): @mcornella remove workaround when CentOS 7 reaches EOL +if zstyle -t ':omz:alpha:lib:git' async-prompt \ + || { is-at-least 5.0.6 && 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]}" From 35a6725970167278254ab11a996bf04d2186b009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 12 Jun 2024 11:04:05 +0200 Subject: [PATCH 187/453] fix(history): add warning before deleting command history in `history -c` (#12472) --- lib/history.zsh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/history.zsh b/lib/history.zsh index a8431fd5a..b13e1807f 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -1,14 +1,22 @@ ## History wrapper function omz_history { # parse arguments and remove from $@ - local clear list stamp + local clear list stamp REPLY zparseopts -E -D c=clear l=list f=stamp E=stamp i=stamp t:=stamp if [[ -n "$clear" ]]; then # if -c provided, clobber the history file - echo -n >| "$HISTFILE" + + # confirm action before deleting history + print -nu2 "This action will irreversibly delete your command history. Are you sure? [y/N] " + builtin read -k1 + [[ "$REPLY" = $'\n' ]] || print -u2 + [[ "$REPLY" != ([nN]|$'\n') ]] || return 0 + + print -nu2 >| "$HISTFILE" fc -p "$HISTFILE" - echo >&2 History file deleted. + + print -u2 History file deleted. elif [[ $# -eq 0 ]]; then # if no arguments provided, show full history starting from 1 builtin fc $stamp -l 1 From fee61a7c4731a1835dfc13f4e6ddc8482d5f1d01 Mon Sep 17 00:00:00 2001 From: Manuel Faux Date: Wed, 12 Jun 2024 12:19:48 +0200 Subject: [PATCH 188/453] fix(screen): Prevent title being overwritten (#4633) lib/termsupport.zsh creates titles for screen which take precedence over titles set by the screen plugin. Unsetting the title() function within the screen plugin prevent this "race-condition". --- plugins/screen/screen.plugin.zsh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/screen/screen.plugin.zsh b/plugins/screen/screen.plugin.zsh index 26531c40b..375d8750a 100644 --- a/plugins/screen/screen.plugin.zsh +++ b/plugins/screen/screen.plugin.zsh @@ -1,6 +1,10 @@ # if using GNU screen, let the zsh tell screen what the title and hardstatus # of the tab window should be. if [[ "$TERM" == screen* ]]; then + # Unset title() function defined in lib/termsupport.zsh to prevent + # overwriting our screen titles + title(){} + if [[ $_GET_PATH == '' ]]; then _GET_PATH='echo $PWD | sed "s/^\/Users\//~/;s/^\/home\//~/;s/^~$USERNAME/~/"' fi From 6754b7e67b71511c8c06b75be6d4d06a386acbda Mon Sep 17 00:00:00 2001 From: Mayu Laierlence Date: Wed, 12 Jun 2024 12:28:13 +0200 Subject: [PATCH 189/453] feat(init): add custom functions and completions to `$fpath` (#5644) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #5644 Co-authored-by: Marc Cornellà --- oh-my-zsh.sh | 2 +- .../history-substring-search.plugin.zsh | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 2fb20298a..9660f93c9 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -71,7 +71,7 @@ source "$ZSH/tools/check_for_upgrade.sh" # Initializes Oh My Zsh # add a function path -fpath=("$ZSH/functions" "$ZSH/completions" $fpath) +fpath=($ZSH/{functions,completions} $ZSH_CUSTOM/{functions,completions} $fpath) # Load all stock functions (from $fpath files) called below. autoload -U compaudit compinit zrecompile diff --git a/plugins/history-substring-search/history-substring-search.plugin.zsh b/plugins/history-substring-search/history-substring-search.plugin.zsh index 63f0bdd42..077105ea3 100644 --- a/plugins/history-substring-search/history-substring-search.plugin.zsh +++ b/plugins/history-substring-search/history-substring-search.plugin.zsh @@ -16,4 +16,3 @@ if [[ -n "$terminfo[kcud1]" ]]; then bindkey -M emacs "$terminfo[kcud1]" history-substring-search-down bindkey -M viins "$terminfo[kcud1]" history-substring-search-down fi - From 11e84bf4f783100c162f2273d72fccc22eb2756d Mon Sep 17 00:00:00 2001 From: Gabriel Charland <76267249+gcharland1@users.noreply.github.com> Date: Wed, 12 Jun 2024 12:52:54 -0400 Subject: [PATCH 190/453] feat(shrink-path): allow for showing `N` last-full elements (#12481) This commit allows specifying a number of last segments to be fully shown, either via `-l N` or with `zstyle`. --- plugins/shrink-path/shrink-path.plugin.zsh | 25 +++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/plugins/shrink-path/shrink-path.plugin.zsh b/plugins/shrink-path/shrink-path.plugin.zsh index 373fd5b05..1739f9234 100644 --- a/plugins/shrink-path/shrink-path.plugin.zsh +++ b/plugins/shrink-path/shrink-path.plugin.zsh @@ -56,7 +56,16 @@ shrink_path () { tilde=1 named=1 fi - zstyle -t ':prompt:shrink_path' last && lastfull=1 + + local last + zstyle -s ':prompt:shrink_path' last last + case "$last" in + (false|no|off|0) lastfull=0 ;; + (true|yes|on|1) lastfull=1 ;; + (""|*[^0-9]*) lastfull=0 ;; + (*) lastfull=$last ;; + esac + zstyle -t ':prompt:shrink_path' short && short=1 zstyle -t ':prompt:shrink_path' tilde && tilde=1 zstyle -t ':prompt:shrink_path' glob && ellipsis='*' @@ -78,7 +87,7 @@ shrink_path () { print 'Usage: shrink_path [-f -l -s -t] [directory]' print ' -f, --fish fish-simulation, like -l -s -t' print ' -g, --glob Add asterisk to allow globbing of shrunk path (equivalent to -e "*")' - print ' -l, --last Print the last directory''s full name' + print ' -l, --last [#] Print the last n directory''s full name (default 1).' print ' -s, --short Truncate directory names to the number of characters given by -#. Without' print ' -s, names are truncated without making them ambiguous.' print ' -t, --tilde Substitute ~ for the home directory' @@ -93,7 +102,13 @@ shrink_path () { print ' zstyle :prompt:shrink_path fish yes' return 0 ;; - -l|--last) lastfull=1 ;; + -l|--last) + lastfull=1 + if [[ -n "$2" && "$2" != *[^0-9]* ]]; then + shift + lastfull=$1 + fi + ;; -s|--short) short=1 ;; -t|--tilde) tilde=1 ;; -T|--nameddirs) @@ -148,8 +163,8 @@ shrink_path () { cd -q / } for dir in $tree; { - if (( lastfull && $#tree == 1 )) { - result+="/$tree" + if (( lastfull && $#tree <= lastfull )) { + result+="/${(j:/:)tree[@]}" break } expn=(a b) From 6c021fd432aae13ef594342f9b3739ccaca4fcdc Mon Sep 17 00:00:00 2001 From: "Nathaniel.Belles" <36868971+Nbelles@users.noreply.github.com> Date: Wed, 12 Jun 2024 13:07:01 -0400 Subject: [PATCH 191/453] fix(timer): skip timer after running `clear` (#12370) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marc Cornellà --- plugins/timer/timer.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh index b261f71c5..d21d59989 100644 --- a/plugins/timer/timer.plugin.zsh +++ b/plugins/timer/timer.plugin.zsh @@ -23,9 +23,12 @@ __timer_display_timer_precmd() { local tdiff=$((cmd_end_time - __timer_cmd_start_time)) unset __timer_cmd_start_time if [[ -z "${TIMER_THRESHOLD}" || ${tdiff} -ge "${TIMER_THRESHOLD}" ]]; then + local last_cmd="${history[$((HISTCMD - 1))]%% *}" + if [[ "$last_cmd" != clear ]]; then local tdiffstr=$(__timer_format_duration ${tdiff}) local cols=$((COLUMNS - ${#tdiffstr} - 1)) echo -e "\033[1A\033[${cols}C ${tdiffstr}" + fi fi fi } From 8908e6d7207223d876b9a74f0be0f0ebb01b361f Mon Sep 17 00:00:00 2001 From: Nick Glenn <78454343+Sargates@users.noreply.github.com> Date: Thu, 13 Jun 2024 02:26:17 -0500 Subject: [PATCH 192/453] fix(history): fix logic error in prompt for `history -c` (#12500) Logic error in `history -c` when prompting for confirmation caused history to be deleted when typing anything but explicitly `n`, `N`, or sending `\n`. New logic prevents deletion by pressing wrong key and only deletes history when sending `y` or `Y`. Co-authored-by: Sargates --- lib/history.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/history.zsh b/lib/history.zsh index b13e1807f..1093ea80f 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -11,7 +11,7 @@ function omz_history { print -nu2 "This action will irreversibly delete your command history. Are you sure? [y/N] " builtin read -k1 [[ "$REPLY" = $'\n' ]] || print -u2 - [[ "$REPLY" != ([nN]|$'\n') ]] || return 0 + [[ "$REPLY" != ([yY]) ]] && return 0 print -nu2 >| "$HISTFILE" fc -p "$HISTFILE" From 0c9b42a863778d67aee22bbd43f296110fe1f047 Mon Sep 17 00:00:00 2001 From: Tim Abell Date: Thu, 13 Jun 2024 17:08:14 +0100 Subject: [PATCH 193/453] docs(alias-finder): add some examples (#12502) --- plugins/alias-finder/README.md | 37 +++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/plugins/alias-finder/README.md b/plugins/alias-finder/README.md index 6c87c723a..a9bbd0838 100644 --- a/plugins/alias-finder/README.md +++ b/plugins/alias-finder/README.md @@ -2,7 +2,7 @@ This plugin searches the defined aliases and outputs any that match the command inputted. This makes learning new aliases easier. -## Usage +## Setup To use it, add `alias-finder` to the `plugins` array of your zshrc file: ``` @@ -22,6 +22,41 @@ zstyle ':omz:plugins:alias-finder' cheaper yes # disabled by default As you can see, options are also available with zstyle. +## Usage + +When you execute a command alias finder will look at your defined aliases and suggest shorter aliases you could have used, for example: + +Running the un-aliased `git status` command: +```sh +╭─tim@fox ~/repo/gitopolis ‹main› +╰─$ git status + +gst='git status' # <=== shorter suggestion from alias-finder + +On branch main +Your branch is up-to-date with 'origin/main'. +nothing to commit, working tree clean +``` + +Running a shorter `git st` alias from `.gitconfig` that it suggested : +```sh +╭─tim@fox ~/repo/gitopolis ‹main› +╰─$ git st +gs='git st' # <=== shorter suggestion from alias-finder +## main...origin/main +``` + +Running the shortest `gs` shell alias that it found: +```sh +╭─tim@fox ~/repo/gitopolis ‹main› +╰─$ gs + # <=== no suggestions alias-finder because this is the shortest +## main...origin/main +``` + +![image](https://github.com/ohmyzsh/ohmyzsh/assets/19378/39642750-fb10-4f1a-b7f9-f36789eeb01b) + + ### Options > In order to clarify, let's say `alias a=abc` has source 'abc' and destination 'a'. From 6fe78e06291bdf6fc62b805b0171e16a6b71eee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 15 Jun 2024 17:39:32 +0200 Subject: [PATCH 194/453] chore: better document top-level custom files for aliases (#12504) See discussion in https://github.com/ohmyzsh/ohmyzsh/discussions/12504 --- templates/zshrc.zsh-template | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index a73d60799..89fd0780e 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -1,11 +1,11 @@ # If you come from bash you might have to change your $PATH. # export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH -# Path to your oh-my-zsh installation. +# Path to your Oh My Zsh installation. export ZSH=$HOME/.oh-my-zsh # Set name of the theme to load --- if set to "random", it will -# load a random theme each time oh-my-zsh is loaded, in which case, +# load a random theme each time Oh My Zsh is loaded, in which case, # to know which specific one was loaded, run: echo $RANDOM_THEME # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes ZSH_THEME="robbyrussell" @@ -91,9 +91,12 @@ source $ZSH/oh-my-zsh.sh # Compilation flags # export ARCHFLAGS="-arch x86_64" -# Set personal aliases, overriding those provided by oh-my-zsh libs, -# plugins, and themes. Aliases can be placed here, though oh-my-zsh -# users are encouraged to define aliases within the ZSH_CUSTOM folder. +# Set personal aliases, overriding those provided by Oh My Zsh libs, +# plugins, and themes. Aliases can be placed here, though Oh My Zsh +# users are encouraged to define aliases within a top-level file in +# the $ZSH_CUSTOM folder, with .zsh extension. Examples: +# - $ZSH_CUSTOM/aliases.zsh +# - $ZSH_CUSTOM/macos.zsh # For a full list of active aliases, run `alias`. # # Example aliases From 677f5010daf226509cc19d7244a689df82820c82 Mon Sep 17 00:00:00 2001 From: "ohmyzsh[bot]" <54982679+ohmyzsh[bot]@users.noreply.github.com> Date: Sun, 16 Jun 2024 08:44:44 +0200 Subject: [PATCH 195/453] feat(wd): update to 498695ff (#12507) Closes #12489 Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com> --- .github/dependencies.yml | 2 +- plugins/wd/wd.sh | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/dependencies.yml b/.github/dependencies.yml index ce28e34c9..43ec92fb7 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -39,7 +39,7 @@ dependencies: plugins/wd: repo: mfaerevaag/wd branch: master - version: tag:v0.7.0 + version: tag:v0.7.1 precopy: | set -e rm -r test diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh index 160ab3be3..34f887a0e 100755 --- a/plugins/wd/wd.sh +++ b/plugins/wd/wd.sh @@ -261,9 +261,9 @@ wd_browse() { local entries=("${(@f)$(sed "s:${HOME}:~:g" "$WD_CONFIG" | awk -F ':' '{print $1 " -> " $2}')}") local script_path="${${(%):-%x}:h}" local wd_remove_output=$(mktemp "${TMPDIR:-/tmp}/wd.XXXXXXXXXX") - local entries_with_headers=("All warp points:" "Press enter to select. Press delete to remove" "${entries[@]}") + entries=("All warp points:" "Press enter to select. Press delete to remove" "${entries[@]}") local fzf_bind="delete:execute(echo {} | awk -F ' -> ' '{print \$1}' | xargs -I {} "$script_path/wd.sh" rm {} > "$wd_remove_output")+abort" - local fzf_command=$(printf '%s\n' "${entries_with_headers[@]}" | fzf --height 100% --reverse --header-lines=2 --bind="$fzf_bind") + local selected_entry=$(printf '%s\n' "${entries[@]}" | fzf --height 100% --reverse --header-lines=2 --bind="$fzf_bind") if [[ -e $wd_remove_output ]]; then cat "$wd_remove_output" rm "$wd_remove_output" @@ -287,8 +287,10 @@ wd_browse_widget() { } wd_restore_buffer() { - BUFFER=$saved_buffer - CURSOR=$saved_cursor + if [[ -n $saved_buffer ]]; then + BUFFER=$saved_buffer + CURSOR=$saved_cursor + fi saved_buffer= saved_cursor=1 } From 7e4ee3a3cd9b8bb287ad334035002b4ce1cd332c Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Mon, 17 Jun 2024 20:37:21 +0200 Subject: [PATCH 196/453] fix(encode64): use proper encode file flags Fixes #12509 --- plugins/encode64/encode64.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/encode64/encode64.plugin.zsh b/plugins/encode64/encode64.plugin.zsh index 6927f5216..8e6fdb169 100644 --- a/plugins/encode64/encode64.plugin.zsh +++ b/plugins/encode64/encode64.plugin.zsh @@ -10,7 +10,7 @@ encodefile64() { if [[ $# -eq 0 ]]; then echo "You must provide a filename" else - base64 -i $1 -o $1.txt + base64 $1 > $1.txt echo "${1}'s content encoded in base64 and saved as ${1}.txt" fi } From 373a1fd585a09b680fec0fc3a3c22901d86c0a4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20MB?= Date: Mon, 17 Jun 2024 21:38:21 +0200 Subject: [PATCH 197/453] fix(essembeh): use async prompt (#12512) --- themes/essembeh.zsh-theme | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/themes/essembeh.zsh-theme b/themes/essembeh.zsh-theme index 50b3f7772..65abe3a83 100644 --- a/themes/essembeh.zsh-theme +++ b/themes/essembeh.zsh-theme @@ -11,21 +11,7 @@ # git plugin ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[cyan]%}(" ZSH_THEME_GIT_PROMPT_SUFFIX=") %{$reset_color%}" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%%" -ZSH_THEME_GIT_PROMPT_ADDED="+" -ZSH_THEME_GIT_PROMPT_MODIFIED="*" -ZSH_THEME_GIT_PROMPT_RENAMED="~" -ZSH_THEME_GIT_PROMPT_DELETED="!" -ZSH_THEME_GIT_PROMPT_UNMERGED="?" -function zsh_essembeh_gitstatus { - ref=$(git symbolic-ref HEAD 2> /dev/null) || return - GIT_STATUS=$(git_prompt_status) - if [[ -n $GIT_STATUS ]]; then - GIT_STATUS=" $GIT_STATUS" - fi - echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$GIT_STATUS$ZSH_THEME_GIT_PROMPT_SUFFIX" -} # by default, use green for user@host and no prefix local ZSH_ESSEMBEH_COLOR="green" @@ -46,5 +32,5 @@ if [[ $UID = 0 ]]; then # always use magenta for root sessions, even in ssh ZSH_ESSEMBEH_COLOR="magenta" fi -PROMPT='${ZSH_ESSEMBEH_PREFIX}%{$fg[$ZSH_ESSEMBEH_COLOR]%}%n@%M%{$reset_color%}:%{%B$fg[yellow]%}%~%{$reset_color%b%} $(zsh_essembeh_gitstatus)%(!.#.$) ' +PROMPT='${ZSH_ESSEMBEH_PREFIX}%{$fg[$ZSH_ESSEMBEH_COLOR]%}%n@%M%{$reset_color%}:%{%B$fg[yellow]%}%~%{$reset_color%b%} $(git_prompt_info)%(!.#.$) ' RPROMPT="%(?..%{$fg[red]%}%?%{$reset_color%})" From c83ca51b1b2fce89c5eae0b0bc9600ee4df28e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 18 Jun 2024 07:26:38 +0200 Subject: [PATCH 198/453] fix(history): fix confirmation prompt to allow bypass See https://github.com/ohmyzsh/ohmyzsh/issues/12472#issuecomment-2171461005 --- lib/history.zsh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/history.zsh b/lib/history.zsh index 1093ea80f..fa3db927e 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -9,9 +9,8 @@ function omz_history { # confirm action before deleting history print -nu2 "This action will irreversibly delete your command history. Are you sure? [y/N] " - builtin read -k1 - [[ "$REPLY" = $'\n' ]] || print -u2 - [[ "$REPLY" != ([yY]) ]] && return 0 + builtin read + [[ "$REPLY" = [yY] ]] || return 0 print -nu2 >| "$HISTFILE" fc -p "$HISTFILE" From f2769acdfa283c663bb1bf2b98890766622e410c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 18 Jun 2024 13:32:22 +0200 Subject: [PATCH 199/453] chore(history): show input in confirmation prompt Fixes https://github.com/ohmyzsh/ohmyzsh/issues/12472#issuecomment-2175868971 --- lib/history.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/history.zsh b/lib/history.zsh index fa3db927e..35da57de2 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -9,7 +9,7 @@ function omz_history { # confirm action before deleting history print -nu2 "This action will irreversibly delete your command history. Are you sure? [y/N] " - builtin read + builtin read -E [[ "$REPLY" = [yY] ]] || return 0 print -nu2 >| "$HISTFILE" From c432ca09932bb0c2f2f7f8862b949b0875615724 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 13:40:27 +0200 Subject: [PATCH 200/453] chore(deps): bump `urllib3` to 2.2.2 in `dependencies` workflow (#12516) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependencies/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt index 7e840a74c..743d838b5 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -4,4 +4,4 @@ idna==3.7 PyYAML==6.0.1 requests==2.31.0 semver==3.0.2 -urllib3==2.2.1 +urllib3==2.2.2 From a87e9c715b2d3249681f9cc8f8d9718030674d50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 20 Jun 2024 19:51:51 +0200 Subject: [PATCH 201/453] fix(init): fix definition order for `$ZSH_CUSTOM` Tipped about this in https://github.com/ohmyzsh/ohmyzsh/commit/6754b7e67#commitcomment-143280115 --- oh-my-zsh.sh | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 9660f93c9..694095afa 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -48,13 +48,15 @@ omz_f() { unset -f omz_f # If ZSH is not defined, use the current script's directory. -[[ -z "$ZSH" ]] && export ZSH="${${(%):-%x}:a:h}" +[[ -n "$ZSH" ]] || export ZSH="${${(%):-%x}:a:h}" + +# Set ZSH_CUSTOM to the path where your custom config files +# and plugins exists, or else we will use the default custom/ +[[ -n "$ZSH_CUSTOM" ]] || ZSH_CUSTOM="$ZSH/custom" # Set ZSH_CACHE_DIR to the path where cache files should be created # or else we will use the default cache/ -if [[ -z "$ZSH_CACHE_DIR" ]]; then - ZSH_CACHE_DIR="$ZSH/cache" -fi +[[ -n "$ZSH_CACHE_DIR" ]] || ZSH_CACHE_DIR="$ZSH/cache" # Make sure $ZSH_CACHE_DIR is writable, otherwise use a directory in $HOME if [[ ! -w "$ZSH_CACHE_DIR" ]]; then @@ -76,12 +78,6 @@ fpath=($ZSH/{functions,completions} $ZSH_CUSTOM/{functions,completions} $fpath) # Load all stock functions (from $fpath files) called below. autoload -U compaudit compinit zrecompile -# Set ZSH_CUSTOM to the path where your custom config files -# and plugins exists, or else we will use the default custom/ -if [[ -z "$ZSH_CUSTOM" ]]; then - ZSH_CUSTOM="$ZSH/custom" -fi - is_plugin() { local base_dir=$1 local name=$2 From a4313db16ab76cfb059d1ca716dae00278672c25 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 11:52:47 +0200 Subject: [PATCH 202/453] chore(deps): bump certifi from 2024.2.2 to 2024.6.2 in /.github/workflows/dependencies (#12519) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependencies/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt index 743d838b5..8c80c60a2 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -1,4 +1,4 @@ -certifi==2024.2.2 +certifi==2024.6.2 charset-normalizer==3.3.2 idna==3.7 PyYAML==6.0.1 From dd4be1b6fb9973d63eba334d8bd92b3da30b3e72 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 11:53:03 +0200 Subject: [PATCH 203/453] chore(deps): bump requests from 2.31.0 to 2.32.3 in /.github/workflows/dependencies (#12518) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependencies/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt index 8c80c60a2..f8d8d4289 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -2,6 +2,6 @@ certifi==2024.6.2 charset-normalizer==3.3.2 idna==3.7 PyYAML==6.0.1 -requests==2.31.0 +requests==2.32.3 semver==3.0.2 urllib3==2.2.2 From 5233759206b447ffbce50847dcb032d7ebc3b31b Mon Sep 17 00:00:00 2001 From: Turiiya <34311583+ttytm@users.noreply.github.com> Date: Tue, 2 Jul 2024 13:30:39 +0200 Subject: [PATCH 204/453] feat(git): add `gclf` alias (#12508) --- plugins/git/README.md | 3 ++- plugins/git/git.plugin.zsh | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/git/README.md b/plugins/git/README.md index 4022f8c62..c10f1d88e 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -59,6 +59,7 @@ plugins=(... git) | `gcpc` | `git cherry-pick --continue` | | `gclean` | `git clean --interactive -d` | | `gcl` | `git clone --recurse-submodules` | +| `gclf` | `git clone --recursive --shallow-submodules --filter=blob:none --also-filter-submodules` | | `gccd` | `git clone --recurse-submodules "$@" && cd "$(basename $\_ .git)"` | | `gcam` | `git commit --all --message` | | `gcas` | `git commit --all --signoff` | @@ -111,7 +112,7 @@ plugins=(... git) | `gfg` | `git ls-files \| grep` | | `gm` | `git merge` | | `gma` | `git merge --abort` | -| `gmc` | `git merge --continue` | +| `gmc` | `git merge --continue` | | `gms` | `git merge --squash` | | `gmom` | `git merge origin/$(git_main_branch)` | | `gmum` | `git merge upstream/$(git_main_branch)` | diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 1e65a7acc..99fcc4d07 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -165,6 +165,7 @@ alias gcpa='git cherry-pick --abort' alias gcpc='git cherry-pick --continue' alias gclean='git clean --interactive -d' alias gcl='git clone --recurse-submodules' +alias gclf='git clone --recursive --shallow-submodules --filter=blob:none --also-filter-submodules' function gccd() { setopt localoptions extendedglob From 80ec8cd5295b923bf65671e249115dbff8dd4b30 Mon Sep 17 00:00:00 2001 From: Pedro Barbiero Date: Tue, 2 Jul 2024 12:14:17 -0300 Subject: [PATCH 205/453] fix(bun): set `SHELL` when generating completions (#12533) --- plugins/bun/bun.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bun/bun.plugin.zsh b/plugins/bun/bun.plugin.zsh index 9924faa84..576dbbfeb 100644 --- a/plugins/bun/bun.plugin.zsh +++ b/plugins/bun/bun.plugin.zsh @@ -11,4 +11,4 @@ if [[ ! -f "$ZSH_CACHE_DIR/completions/_bun" ]]; then _comps[bun]=_bun fi -bun completions >| "$ZSH_CACHE_DIR/completions/_bun" &| +SHELL=zsh bun completions >| "$ZSH_CACHE_DIR/completions/_bun" &| From 35f1d362c1c3169aaaf3600886382661af1fc647 Mon Sep 17 00:00:00 2001 From: Ihor Date: Tue, 2 Jul 2024 17:15:22 +0200 Subject: [PATCH 206/453] docs: rename twitter to X, fix link (#12532) --- README.md | 2 +- tools/upgrade.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2d873c514..105c5db89 100644 --- a/README.md +++ b/README.md @@ -486,4 +486,4 @@ Oh My Zsh is released under the [MIT license](LICENSE.txt). ![Planet Argon](https://pa-github-assets.s3.amazonaws.com/PARGON_logo_digital_COL-small.jpg) -Oh My Zsh was started by the team at [Planet Argon](https://www.planetargon.com/?utm_source=github), a [Ruby on Rails development agency](http://www.planetargon.com/services/ruby-on-rails-development?utm_source=github). Check out our [other open source projects](https://www.planetargon.com/open-source?utm_source=github). +Oh My Zsh was started by the team at [Planet Argon](https://www.planetargon.com/?utm_source=github), a [Ruby on Rails development agency](https://www.planetargon.com/services/ruby-on-rails-development?utm_source=github). Check out our [other open source projects](https://www.planetargon.com/open-source?utm_source=github). diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 5eb90ab41..c586610c4 100755 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -271,7 +271,7 @@ if LANG= git pull --quiet --rebase $remote $branch; then printf '%s %s %s %s /____/ %s %s %s %s\n' $RAINBOW $RESET printf '\n' printf "${BLUE}%s${RESET}\n\n" "$message" - printf "${BLUE}${BOLD}%s %s${RESET}\n" "To keep up with the latest news and updates, follow us on Twitter:" "$(fmt_link @ohmyzsh https://twitter.com/ohmyzsh)" + printf "${BLUE}${BOLD}%s %s${RESET}\n" "To keep up with the latest news and updates, follow us on X:" "$(fmt_link @ohmyzsh https://x.com/ohmyzsh)" printf "${BLUE}${BOLD}%s %s${RESET}\n" "Want to get involved in the community? Join our Discord:" "$(fmt_link "Discord server" https://discord.gg/ohmyzsh)" printf "${BLUE}${BOLD}%s %s${RESET}\n" "Get your Oh My Zsh swag at:" "$(fmt_link "Planet Argon Shop" https://shop.planetargon.com/collections/oh-my-zsh)" elif [[ $verbose_mode == minimal ]]; then From bdd9ee3687ffcf2e6ba725a9ab1be62487b8d7e2 Mon Sep 17 00:00:00 2001 From: Luke Date: Tue, 2 Jul 2024 08:21:21 -0700 Subject: [PATCH 207/453] docs(command-not-found): mention gentoo support (#12530) --- plugins/command-not-found/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/command-not-found/README.md b/plugins/command-not-found/README.md index 5a373c537..88761bb88 100644 --- a/plugins/command-not-found/README.md +++ b/plugins/command-not-found/README.md @@ -30,5 +30,6 @@ It works out of the box with the command-not-found packages for: - [NixOS](https://github.com/NixOS/nixpkgs/tree/master/nixos/modules/programs/command-not-found) - [Termux](https://github.com/termux/command-not-found) - [SUSE](https://www.unix.com/man-page/suse/1/command-not-found/) +- [Gentoo](https://github.com/AndrewAmmerlaan/command-not-found-gentoo/tree/main) You can add support for other platforms by submitting a Pull Request. From 5acaa240d3dde98f2bc2354ad6201e6954254b2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=96=B0=E4=BC=9F?= Date: Tue, 2 Jul 2024 23:22:58 +0800 Subject: [PATCH 208/453] feat(battery): support custom AC indicator (#12528) --- plugins/battery/README.md | 7 +++++++ plugins/battery/battery.plugin.zsh | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/battery/README.md b/plugins/battery/README.md index 18e5bd882..73fcb693e 100644 --- a/plugins/battery/README.md +++ b/plugins/battery/README.md @@ -12,6 +12,13 @@ Then, add the `battery_pct_prompt` function to your custom theme. For example: RPROMPT='$(battery_pct_prompt) ...' ``` +Also, you set the `BATTERY_CHARGING` variable to your favor. +For example: + +```zsh +BATTERY_CHARGING="⚡️" +``` + ## Requirements - On Linux, you must have the `acpi` or `acpitool` commands installed on your operating system. diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh index 1d3d529a3..7977e4d04 100644 --- a/plugins/battery/battery.plugin.zsh +++ b/plugins/battery/battery.plugin.zsh @@ -58,7 +58,7 @@ if [[ "$OSTYPE" = darwin* ]]; then fi echo "%{$fg[$color]%}[${battery_pct}%%]%{$reset_color%}" else - echo "∞" + echo "${BATTERY_CHARGING-⚡️}" fi } From 057f3ec67e65661d3c01b757ec5cad0a3718453e Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Wed, 3 Jul 2024 08:51:19 +0200 Subject: [PATCH 209/453] chore: replace all instances of twitter with X Closes #12536 --- README.md | 4 ++-- tools/install.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 105c5db89..e9a571a37 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Once installed, your terminal shell will become the talk of the town _or your mo Finally, you'll begin to get the sort of attention that you have always felt you deserved. ...or maybe you'll use the time that you're saving to start flossing more often. 😬 -To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter, and join us on [Discord](https://discord.gg/ohmyzsh). +To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://x.com/ohmyzsh) on X (formerly Twitter), and join us on [Discord](https://discord.gg/ohmyzsh). [![CI](https://github.com/ohmyzsh/ohmyzsh/workflows/CI/badge.svg)](https://github.com/ohmyzsh/ohmyzsh/actions?query=workflow%3ACI) [![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/ohmyzsh?label=%40ohmyzsh&logo=x&style=flat)](https://twitter.com/intent/follow?screen_name=ohmyzsh) @@ -469,7 +469,7 @@ Thank you so much! We're on social media: -- [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter. You should follow it. +- [@ohmyzsh](https://x.com/ohmyzsh) on X (formerly Twitter). You should follow it. - [Facebook](https://www.facebook.com/Oh-My-Zsh-296616263819290/) poke us. - [Instagram](https://www.instagram.com/_ohmyzsh/) tag us in your post showing Oh My Zsh! - [Discord](https://discord.gg/ohmyzsh) to chat with us! diff --git a/tools/install.sh b/tools/install.sh index e3613a28b..e5f126915 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -482,7 +482,7 @@ print_success() { "$(fmt_code "$(fmt_link ".zshrc" "file://$zdot/.zshrc" --text)")" \ "file to select plugins, themes, and options." printf '\n' - printf '%s\n' "• Follow us on Twitter: $(fmt_link @ohmyzsh https://twitter.com/ohmyzsh)" + printf '%s\n' "• Follow us on X: $(fmt_link @ohmyzsh https://x.com/ohmyzsh)" printf '%s\n' "• Join our Discord community: $(fmt_link "Discord server" https://discord.gg/ohmyzsh)" printf '%s\n' "• Get stickers, t-shirts, coffee mugs and more: $(fmt_link "Planet Argon Shop" https://shop.planetargon.com/collections/oh-my-zsh)" printf '%s\n' $FMT_RESET From 608d62b2a5ee7f3af62dd8f31d47c167bf04547f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 6 Jul 2024 20:51:57 +0200 Subject: [PATCH 210/453] chore(deps): bump certifi in `dependencies` workflow (#12543) Bumps [certifi](https://github.com/certifi/python-certifi) from 2024.6.2 to 2024.7.4. - [Commits](https://github.com/certifi/python-certifi/compare/2024.06.02...2024.07.04) --- updated-dependencies: - dependency-name: certifi dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependencies/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt index f8d8d4289..f125da542 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -1,4 +1,4 @@ -certifi==2024.6.2 +certifi==2024.7.4 charset-normalizer==3.3.2 idna==3.7 PyYAML==6.0.1 From 5b37e218e5275c11cb5fecc61f943e6cea3e64bf Mon Sep 17 00:00:00 2001 From: Benedikt Volkmer <7070761+bvolkmer@users.noreply.github.com> Date: Mon, 8 Jul 2024 20:19:15 +0200 Subject: [PATCH 211/453] feat(eza): add hyperlink option (#12545) --- plugins/eza/README.md | 10 ++++++++++ plugins/eza/eza.plugin.zsh | 3 +++ 2 files changed, 13 insertions(+) diff --git a/plugins/eza/README.md b/plugins/eza/README.md index 6fc113eba..0d79145c0 100644 --- a/plugins/eza/README.md +++ b/plugins/eza/README.md @@ -90,6 +90,16 @@ Sets the `--time-style` option of `eza`. (See `man eza` for the options) Default: Not set, which means the default behavior of `eza` will take place. +### `hyperlink` + +```zsh +zstyle ':omz:plugins:eza' 'header' yes|no +``` + +If `yes`, always add `--hyperlink` flag to create hyperlink with escape codes. + +Default: `no` + ## Aliases **Notes:** diff --git a/plugins/eza/eza.plugin.zsh b/plugins/eza/eza.plugin.zsh index e95b14749..f25f1c30b 100644 --- a/plugins/eza/eza.plugin.zsh +++ b/plugins/eza/eza.plugin.zsh @@ -38,6 +38,9 @@ function _configure_eza() { if [[ $_val ]]; then _EZA_TAIL+=("--time-style='$_val'") fi + if zstyle -t ":omz:plugins:eza" "hyperlink"; then + _EZA_TAIL+=("--hyperlink") + fi } _configure_eza From fa583cfb87b80e3f7d7577c8b62b7d1385c01337 Mon Sep 17 00:00:00 2001 From: Marc Khouri Date: Fri, 12 Jul 2024 12:18:20 -0400 Subject: [PATCH 212/453] refactor(pygmalion): simplify theme logic and prompt sequences (#12550) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Simplify Pygmalion Theme The Pygmalion theme previously had some logic for counting line length and taking action based on line length. The action was removed in c52441b624c0b1fa075bc6110032bd4e75311909, but the counting still needlessly happens. This commit removes the code to count line length, and simplifies the Pygmalion theme by moving the "precmd" into the setup. As a bonus unintended side effect, this makes the Pygmalion theme compatible with the current async prompting logic (i.e. after this change, Pygmalion is no longer affected by https://github.com/ohmyzsh/ohmyzsh/issues/12328) * refactor(pygmalion): redo and simplify prompt sequences With this commit we put the minimal needed color resets, i.e. only when we don't control the previous text we need to do a full reset. Otherwise we can just use %F{} to change only the foreground color. Co-authored-by: Marc Cornellà --- themes/pygmalion.zsh-theme | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/themes/pygmalion.zsh-theme b/themes/pygmalion.zsh-theme index be9ca3889..14fe6c469 100644 --- a/themes/pygmalion.zsh-theme +++ b/themes/pygmalion.zsh-theme @@ -1,32 +1,12 @@ # Yay! High voltage and arrows! -prompt_setup_pygmalion(){ - setopt localoptions extendedglob +ZSH_THEME_GIT_PROMPT_PREFIX="%{${reset_color}%}%F{green}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{${reset_color}%} " +ZSH_THEME_GIT_PROMPT_DIRTY="%F{yellow}⚡%f" +ZSH_THEME_GIT_PROMPT_CLEAN="" - ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" - ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " - ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}" - ZSH_THEME_GIT_PROMPT_CLEAN="" +base_prompt="%{${reset_color}%}%F{magenta}%n%F{cyan}@%F{yellow}%m%F{red}:%F{cyan}%0~%F{red}|%f" +post_prompt="%{${reset_color}%}%F{cyan}⇒%f " - base_prompt='%{$fg[magenta]%}%n%{$reset_color%}%{$fg[cyan]%}@%{$reset_color%}%{$fg[yellow]%}%m%{$reset_color%}%{$fg[red]%}:%{$reset_color%}%{$fg[cyan]%}%0~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}' - post_prompt='%{$fg[cyan]%}⇒%{$reset_color%} ' - - base_prompt_nocolor=${base_prompt//\%\{[^\}]##\}} - post_prompt_nocolor=${post_prompt//\%\{[^\}]##\}} - - autoload -U add-zsh-hook - add-zsh-hook precmd prompt_pygmalion_precmd -} - -prompt_pygmalion_precmd(){ - setopt localoptions nopromptsubst extendedglob - - local gitinfo=$(git_prompt_info) - local gitinfo_nocolor=${gitinfo//\%\{[^\}]##\}} - local exp_nocolor="$(print -P \"${base_prompt_nocolor}${gitinfo_nocolor}${post_prompt_nocolor}\")" - local prompt_length=${#exp_nocolor} - - PROMPT="${base_prompt}\$(git_prompt_info)${post_prompt}" -} - -prompt_setup_pygmalion +PROMPT="${base_prompt}\$(git_prompt_info)${post_prompt}" +unset base_prompt post_prompt From 11ca9e2ac7c70b4682e6b7d1e50a1a1cb7c1a5d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 13 Jul 2024 18:22:06 +0200 Subject: [PATCH 213/453] fix(init): add cached completions directory only once (#12551) Double quotes within the subscript test are interpreted literally, making the test never match. On subsequent runs, the `$ZSH_CACHE_DIR/completions` directory is always prepended to `$fpath`, even if it is already there. This commit fixes that. Fixes #12551 Co-authored-by: Adem Simsek --- oh-my-zsh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 694095afa..906d19a45 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -65,7 +65,7 @@ fi # Create cache and completions dir and add to $fpath mkdir -p "$ZSH_CACHE_DIR/completions" -(( ${fpath[(Ie)"$ZSH_CACHE_DIR/completions"]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath) +(( ${fpath[(ie)$ZSH_CACHE_DIR/completions]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath) # Check for updates on initial load... source "$ZSH/tools/check_for_upgrade.sh" From 0b27b15d0b08645bd995e13b8d69fcbe2ef7e8eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 13 Jul 2024 18:32:22 +0200 Subject: [PATCH 214/453] fix(init): fix subscript flag in 11ca9e2a --- oh-my-zsh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 906d19a45..b1032841c 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -65,7 +65,7 @@ fi # Create cache and completions dir and add to $fpath mkdir -p "$ZSH_CACHE_DIR/completions" -(( ${fpath[(ie)$ZSH_CACHE_DIR/completions]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath) +(( ${fpath[(Ie)$ZSH_CACHE_DIR/completions]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath) # Check for updates on initial load... source "$ZSH/tools/check_for_upgrade.sh" From fd8f72b27614d48ec06421fb80aff2eb10674a69 Mon Sep 17 00:00:00 2001 From: chenzj Date: Sun, 14 Jul 2024 01:31:32 +0800 Subject: [PATCH 215/453] feat(opentofu): add plugin for OpenTofu (#12285) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Adds aliases - Sets up autocompletion - Adds promp functions to show workspace and `tofu` version Co-authored-by: Marc Cornellà --- plugins/opentofu/README.md | 58 ++++++++++++++++++++++++++++ plugins/opentofu/opentofu.plugin.zsh | 43 +++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 plugins/opentofu/README.md create mode 100644 plugins/opentofu/opentofu.plugin.zsh diff --git a/plugins/opentofu/README.md b/plugins/opentofu/README.md new file mode 100644 index 000000000..9c19501aa --- /dev/null +++ b/plugins/opentofu/README.md @@ -0,0 +1,58 @@ +# OpenTofu plugin + +Plugin for OpenTofu, a fork of Terraform that is open-source, community-driven, and managed by the Linux Foundation. It adds +completion for `tofu` command, as well as aliases and a prompt function. + +To use it, add `opentofu` to the plugins array of your `~/.zshrc` file: + +```shell +plugins=(... opentofu) +``` + +## Requirements + +- [OpenTofu](https://opentofu.org/) + +## Aliases + +| Alias | Command | +| ----- | --------------- | +| `tt` | `tofu` | +| `tta` | `tofu apply` | +| `ttc` | `tofu console` | +| `ttd` | `tofu destroy` | +| `ttf` | `tofu fmt` | +| `tti` | `tofu init` | +| `tto` | `tofu output` | +| `ttp` | `tofu plan` | +| `ttv` | `tofu validate` | +| `tts` | `tofu state` | +| `ttsh`| `tofu show` | +| `ttr` | `tofu refresh` | +| `ttt` | `tofu test` | +| `ttws`| `tofu workspace`| + + +## Prompt functions + +- `tofu_prompt_info`: shows the current workspace when in an OpenTofu project directory. + +- `tofu_version_prompt_info`: shows the current version of the `tofu` commmand. + +To use them, add them to a `PROMPT` variable in your theme or `.zshrc` file: + +```sh +PROMPT='$(tofu_prompt_info)' +RPROMPT='$(tofu_version_prompt_info)' +``` + +You can also specify the PREFIX and SUFFIX strings for both functions, with the following variables: + +```sh +# for tofu_prompt_info +ZSH_THEME_TOFU_PROMPT_PREFIX="%{$fg[white]%}" +ZSH_THEME_TOFU_PROMPT_SUFFIX="%{$reset_color%}" +# for tofu_version_prompt_info +ZSH_THEME_TOFU_VERSION_PROMPT_PREFIX="%{$fg[white]%}" +ZSH_THEME_TOFU_VERSION_PROMPT_SUFFIX="%{$reset_color%}" +``` diff --git a/plugins/opentofu/opentofu.plugin.zsh b/plugins/opentofu/opentofu.plugin.zsh new file mode 100644 index 000000000..c6844c84a --- /dev/null +++ b/plugins/opentofu/opentofu.plugin.zsh @@ -0,0 +1,43 @@ +# set up the tofu completion (compatible for zsh) +autoload -Uz bashcompinit && bashcompinit +complete -C tofu tofu + +# tofu workspace prompt function +function tofu_prompt_info() { + # only show the workspace name if we're in an opentofu project + # i.e. if a .terraform directory exists within the hierarchy + local dir="$PWD" + while [[ ! -d "${dir}/.terraform" ]]; do + [[ "$dir" != / ]] || return 0 # stop at the root directory + dir="${dir:h}" # get the parent directory + done + + # workspace might be different than the .terraform/environment file + # for example, if set with the TF_WORKSPACE environment variable + local workspace="$(tofu workspace show)" + # make sure to escape % signs in the workspace name to prevent command injection + echo "${ZSH_THEME_TOFU_PROMPT_PREFIX-[}${workspace:gs/%/%%}${ZSH_THEME_TOFU_PROMPT_SUFFIX-]}" +} + +# tofu version prompt function +function tofu_version_prompt_info() { + # get the output of `tofu --version` in a single line, and get the second word after splitting by a space + local tofu_version=${${(s: :)$(tofu --version)}[2]} + # make sure to escape % signs in the version string to prevent command injection + echo "${ZSH_THEME_TOFU_VERSION_PROMPT_PREFIX-[}${tofu_version:gs/%/%%}${ZSH_THEME_TOFU_VERSION_PROMPT_SUFFIX-]}" +} + +alias tt='tofu' +alias tta='tofu apply' +alias ttc='tofu console' +alias ttd='tofu destroy' +alias ttf='tofu fmt' +alias tti='tofu init' +alias tto='tofu output' +alias ttp='tofu plan' +alias ttv='tofu validate' +alias tts='tofu state' +alias ttsh='tofu show' +alias ttr='tofu refresh' +alias ttt='tofu test' +alias ttws='tofu workspace' From 4146c6be217fb3c57c60d74263808f85b1591a0a Mon Sep 17 00:00:00 2001 From: Denis Iskandarov Date: Mon, 15 Jul 2024 20:36:07 +0400 Subject: [PATCH 216/453] fix(docker-compose): fix test for `docker-compose` executable (#12555) --- plugins/docker-compose/docker-compose.plugin.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/docker-compose/docker-compose.plugin.zsh b/plugins/docker-compose/docker-compose.plugin.zsh index d1823f535..7863c4f39 100644 --- a/plugins/docker-compose/docker-compose.plugin.zsh +++ b/plugins/docker-compose/docker-compose.plugin.zsh @@ -1,5 +1,8 @@ -# support Compose v2 as docker CLI plugin -(( ${+commands[docker-compose]} )) && dccmd='docker-compose' || dccmd='docker compose' +# Support Compose v2 as docker CLI plugin +# +# This tests that the (old) docker-compose command is in $PATH and that +# it resolves to an existing executable file if it's a symlink. +[[ -x "${commands[docker-compose]:A}" ]] && dccmd='docker-compose' || dccmd='docker compose' alias dco="$dccmd" alias dcb="$dccmd build" From 379e974d2b54bcc7de0f1787a592957031616559 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Mon, 15 Jul 2024 18:45:46 +0200 Subject: [PATCH 217/453] fix(tmux): do not conflict with `rcExpandParam` Closes #12506 --- plugins/tmux/tmux.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 399de1ccc..51cc7d6a5 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -50,6 +50,7 @@ fi # ALIASES function _build_tmux_alias { + setopt localoptions no_rc_expand_param eval "function $1 { if [[ -z \$1 ]] || [[ \${1:0:1} == '-' ]]; then tmux $2 \"\$@\" From 70cfff448d15933882526d3b12411b6a6b16abf0 Mon Sep 17 00:00:00 2001 From: Jeonguk Choi <91456421+cjeonguk@users.noreply.github.com> Date: Tue, 16 Jul 2024 01:56:44 +0900 Subject: [PATCH 218/453] feat(conda-env): add plugin for conda prompt display (#10619) Co-authored-by: Jeonguk Choi <91456421+devj121@users.noreply.github.com> --- lib/prompt_info_functions.zsh | 1 + plugins/conda-env/README.md | 44 ++++++++++++++++++++++++++ plugins/conda-env/conda-env.plugin.zsh | 9 ++++++ 3 files changed, 54 insertions(+) create mode 100644 plugins/conda-env/README.md create mode 100644 plugins/conda-env/conda-env.plugin.zsh diff --git a/lib/prompt_info_functions.zsh b/lib/prompt_info_functions.zsh index 29aca9b48..722ae58c0 100644 --- a/lib/prompt_info_functions.zsh +++ b/lib/prompt_info_functions.zsh @@ -20,6 +20,7 @@ function chruby_prompt_info \ jenv_prompt_info \ azure_prompt_info \ tf_prompt_info \ + conda_prompt_info \ { return 1 } diff --git a/plugins/conda-env/README.md b/plugins/conda-env/README.md new file mode 100644 index 000000000..ccf48a392 --- /dev/null +++ b/plugins/conda-env/README.md @@ -0,0 +1,44 @@ +# conda-env + +The plugin displays information of the created virtual container of conda and allows background theming. + +To use it, add `conda-env` to the plugins array of your zshrc file: +``` +plugins=(... conda-env) +``` + +The plugin creates a `conda_prompt_info` function that you can use in your theme, which displays the +basename of the current `$CONDA_DEFAULT_ENV`. + +You can use this prompt function in your themes, by adding it to the `PROMPT` or `RPROMPT` variables. See [Example](#example) for more information. + +## Settings + +It uses two variables to control how the information is shown: + +- `ZSH_THEME_CONDA_PREFIX`: sets the prefix of the CONDA_DEFAULT_ENV. +Defaults to `[`. + +- `ZSH_THEME_CONDA_SUFFIX`: sets the suffix of the CONDA_DEFAULT_ENV. +Defaults to `]`. + +## Example + +```sh +ZSH_THEME_CONDA_PREFIX='conda:%F{green}' +ZSH_THEME_CONDA_SUFFIX='%f' +RPROMPT='$(conda_prompt_info)' +``` + +## `CONDA_CHANGEPS1` + +This plugin also automatically sets the `CONDA_CHANGEPS1` variable to `false` to avoid conda changing the prompt +automatically. This has the same effect as running `conda config --set changeps1 false`. + +You can override this behavior by adding `unset CONDA_CHANGEPS1` in your `.zshrc` file, after Oh My Zsh has been +sourced. + +References: + +- https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#determining-your-current-environment +- https://conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html#precedence diff --git a/plugins/conda-env/conda-env.plugin.zsh b/plugins/conda-env/conda-env.plugin.zsh new file mode 100644 index 000000000..c710c952f --- /dev/null +++ b/plugins/conda-env/conda-env.plugin.zsh @@ -0,0 +1,9 @@ +function conda_prompt_info(){ + [[ -n ${CONDA_DEFAULT_ENV} ]] || return + echo "${ZSH_THEME_CONDA_PREFIX=[}${CONDA_DEFAULT_ENV:t:gs/%/%%}${ZSH_THEME_CONDA_SUFFIX=]}" +} + +# Has the same effect as `conda config --set changeps1 false` +# - https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#determining-your-current-environment +# - https://conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html#precedence +export CONDA_CHANGEPS1=false From 6b8f72e528c6bb648dcc8acb7268ac5dadd8edaa Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Mon, 15 Jul 2024 19:01:58 +0200 Subject: [PATCH 219/453] fix(python): avoid local packages load Closes #12535 --- plugins/python/python.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/python/python.plugin.zsh b/plugins/python/python.plugin.zsh index 7256aa04f..6d7f440aa 100644 --- a/plugins/python/python.plugin.zsh +++ b/plugins/python/python.plugin.zsh @@ -44,7 +44,7 @@ function pyuserpaths() { alias pygrep='grep -nr --include="*.py"' # Run proper IPython regarding current virtualenv (if any) -alias ipython='python3 -c "import IPython, sys; sys.exit(IPython.start_ipython())"' +alias ipython='python3 -c "import sys; del sys.path[0]; import IPython; sys.exit(IPython.start_ipython())"' # Share local directory as a HTTP server alias pyserver="python3 -m http.server" From 3012c257bc2eaf4d330b43a4a16ff9bcf2efb0e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 15 Jul 2024 19:04:06 +0200 Subject: [PATCH 220/453] refactor(rtx): remove deprecated `rtx` plugin in favor of `mise` --- plugins/mise/mise.plugin.zsh | 1 + plugins/rtx/rtx.plugin.zsh | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 plugins/rtx/rtx.plugin.zsh diff --git a/plugins/mise/mise.plugin.zsh b/plugins/mise/mise.plugin.zsh index 357174d91..96686f6aa 100644 --- a/plugins/mise/mise.plugin.zsh +++ b/plugins/mise/mise.plugin.zsh @@ -24,3 +24,4 @@ fi # Generate and load mise completion $__mise completion zsh >| "$ZSH_CACHE_DIR/completions/_$__mise" &| +unset __mise diff --git a/plugins/rtx/rtx.plugin.zsh b/plugins/rtx/rtx.plugin.zsh deleted file mode 100644 index 43127a25f..000000000 --- a/plugins/rtx/rtx.plugin.zsh +++ /dev/null @@ -1,2 +0,0 @@ -# TODO: 2024-01-03 remove rtx support -echo "[oh-my-zsh] 'rtx' plugin has been renamed to 'mise'" From be10a9127731e7c6a9a57f8c8c1789e233117ae9 Mon Sep 17 00:00:00 2001 From: Teddy Masters Date: Mon, 8 Jul 2024 10:23:29 -0400 Subject: [PATCH 221/453] feat(bira): add `conda` env information (requires `conda-env` plugin) (#12546) Closes #10274 Closes #12546 Co-authored-by: elfisworking Signed-off-by: elfisworking --- themes/bira.zsh-theme | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/themes/bira.zsh-theme b/themes/bira.zsh-theme index f909afa62..acfe6dc82 100644 --- a/themes/bira.zsh-theme +++ b/themes/bira.zsh-theme @@ -2,6 +2,7 @@ local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" local user_host="%B%(!.%{$fg[red]%}.%{$fg[green]%})%n@%m%{$reset_color%} " local user_symbol='%(!.#.$)' local current_dir="%B%{$fg[blue]%}%~ %{$reset_color%}" +local conda_prompt='$(conda_prompt_info)' local vcs_branch='$(git_prompt_info)$(hg_prompt_info)' local rvm_ruby='$(ruby_prompt_info)' @@ -14,7 +15,7 @@ fi ZSH_THEME_RVM_PROMPT_OPTIONS="i v g" -PROMPT="╭─${user_host}${current_dir}${rvm_ruby}${vcs_branch}${venv_prompt}${kube_prompt} +PROMPT="╭─${conda_prompt}${user_host}${current_dir}${rvm_ruby}${vcs_branch}${venv_prompt}${kube_prompt} ╰─%B${user_symbol}%b " RPROMPT="%B${return_code}%b" From b1e3a82bb5a2545b495c667f8bf838c3e6033ce4 Mon Sep 17 00:00:00 2001 From: Thomas Krisch <8754535+kriths@users.noreply.github.com> Date: Wed, 17 Jul 2024 15:51:37 +0200 Subject: [PATCH 222/453] docs(eza): typo in hyperlink variable (#12561) --- plugins/eza/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/eza/README.md b/plugins/eza/README.md index 0d79145c0..90e549994 100644 --- a/plugins/eza/README.md +++ b/plugins/eza/README.md @@ -93,7 +93,7 @@ Default: Not set, which means the default behavior of `eza` will take place. ### `hyperlink` ```zsh -zstyle ':omz:plugins:eza' 'header' yes|no +zstyle ':omz:plugins:eza' 'hyperlink' yes|no ``` If `yes`, always add `--hyperlink` flag to create hyperlink with escape codes. From 8127e5838c24a7fbfaac5b9a02609e033cb3c5e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 21 Jul 2024 10:16:30 +0200 Subject: [PATCH 223/453] fix(kubectl): fix kubectl completion for `kj`, `kjx` and `ky` aliases (#12566) --- plugins/kubectl/kubectl.plugin.zsh | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index a96e409c6..ad78fedeb 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -180,11 +180,23 @@ alias kej='kubectl edit job' alias kdj='kubectl describe job' alias kdelj='kubectl delete job' -function kj() { kubectl "$@" -o json | jq; } -function kjx() { kubectl "$@" -o json | fx; } -function ky() { kubectl "$@" -o yaml | yh; } -if (( ${+functions[compdef]} )); then - compdef _kubectl kj - compdef _kubectl kjx - compdef _kubectl ky -fi +# Utility print functions (json / yaml) +function _build_kubectl_out_alias { + setopt localoptions norcexpandparam + + # alias function + eval "function $1 { $2 }" + + # completion function + eval "function _$1 { + words=(kubectl \"\${words[@]:1}\") + _kubectl + }" + + compdef _$1 $1 +} + +_build_kubectl_out_alias "kj" 'kubectl "$@" -o json | jq' +_build_kubectl_out_alias "kjx" 'kubectl "$@" -o json | fx' +_build_kubectl_out_alias "ky" 'kubectl "$@" -o yaml | yh' +unfunction _build_kubectl_out_alias From 25836e227c58f98af3136d0721ae8ee78271e1c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 22 Jul 2024 13:08:29 +0200 Subject: [PATCH 224/453] refactor(adb): remove outdated completion plugin `adb` (#12576) BREAKING CHANGE: the `adb` plugin has been removed in favor of the completion provided out-of-the-box by zsh since 4.3.14. This commit removes plugin `adb`, which bundles custom completion for the `adb` tool for Android. `adb` completion is already supported out of the box in zsh 4.3.14 and older. Reference: https://github.com/zsh-users/zsh/commit/d1a557d008b7fa7881327acbd6decdb50631cc9c --- plugins/adb/README.md | 8 ------ plugins/adb/_adb | 67 ------------------------------------------- 2 files changed, 75 deletions(-) delete mode 100644 plugins/adb/README.md delete mode 100644 plugins/adb/_adb diff --git a/plugins/adb/README.md b/plugins/adb/README.md deleted file mode 100644 index 83dcc7288..000000000 --- a/plugins/adb/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# adb autocomplete plugin - -* Adds autocomplete options for all adb commands. -* Add autocomplete for `adb -s` - -## Requirements - -In order to make this work, you will need to have the Android adb tools set up in your path. diff --git a/plugins/adb/_adb b/plugins/adb/_adb deleted file mode 100644 index 78c457746..000000000 --- a/plugins/adb/_adb +++ /dev/null @@ -1,67 +0,0 @@ -#compdef adb -#autoload - -# in order to make this work, you will need to have the android adb tools - -# adb zsh completion, based on homebrew completion - -local -a _1st_arguments -_1st_arguments=( -'bugreport:return all information from the device that should be included in a bug report.' -'connect:connect to a device via TCP/IP Port 5555 is default.' -'devices:list all connected devices' -'disconnect:disconnect from a TCP/IP device. Port 5555 is default.' -'emu:run emulator console command' -'forward:forward socket connections' -'get-devpath:print the device path' -'get-serialno:print the serial number of the device' -'get-state:print the current state of the device: offline | bootloader | device' -'help:show the help message' -'install:push this package file to the device and install it' -'jdwp:list PIDs of processes hosting a JDWP transport' -'keygen:generate adb public/private key' -'kill-server:kill the server if it is running' -'logcat:view device log' -'pull:copy file/dir from device' -'push:copy file/dir to device' -'reboot:reboots the device, optionally into the bootloader or recovery program' -'reboot-bootloader:reboots the device into the bootloader' -'remount:remounts the partitions on the device read-write' -'root:restarts the adbd daemon with root permissions' -'sideload:push a ZIP to device and install it' -'shell:run remote shell interactively' -'sync:copy host->device only if changed (-l means list but dont copy)' -'start-server:ensure that there is a server running' -'tcpip:restart host adb in tcpip mode' -'uninstall:remove this app package from the device' -'usb:restart the adbd daemon listing on USB' -'version:show version num' -'wait-for-device:block until device is online' -) - -local expl -local -a pkgs installed_pkgs - -_arguments \ - '-s[devices]:specify device:->specify_device' \ - '*:: :->subcmds' && return 0 - -case "$state" in - specify_device) - _values -C 'devices' ${$(adb devices -l|awk 'NR>1&& $1 \ - {sub(/ +/," ",$0); \ - gsub(":","\\:",$1); \ - for(i=1;i<=NF;i++) { - if($i ~ /model:/) { split($i,m,":") } \ - else if($i ~ /product:/) { split($i,p,":") } } \ - printf "%s[%s(%s)] ",$1, p[2], m[2]}'):-""} - return - ;; -esac - -if (( CURRENT == 1 )); then - _describe -t commands "adb subcommand" _1st_arguments - return -fi - -_files From a2bf5c7b99ef1c10d335ed79236dacbb78dd0639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 23 Jul 2024 15:59:38 +0200 Subject: [PATCH 225/453] refactor(gem): favor built-in zsh completion for `gem` (#12576) Completion for `gem` was included in zsh 5.5 and newer. This change only uses the Oh My Zsh one if running an older version. Reference: https://github.com/zsh-users/zsh/commit/9881778d48caf842f794d986bc9befebf0fb01c2 --- plugins/gem/{ => completions}/_gem | 0 plugins/gem/gem.plugin.zsh | 27 ++++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) rename plugins/gem/{ => completions}/_gem (100%) diff --git a/plugins/gem/_gem b/plugins/gem/completions/_gem similarity index 100% rename from plugins/gem/_gem rename to plugins/gem/completions/_gem diff --git a/plugins/gem/gem.plugin.zsh b/plugins/gem/gem.plugin.zsh index 938f5c993..b8a49fb56 100644 --- a/plugins/gem/gem.plugin.zsh +++ b/plugins/gem/gem.plugin.zsh @@ -4,4 +4,29 @@ alias gemp="gem push *.gem" # gemy GEM 0.0.0 = gem yank GEM -v 0.0.0 function gemy { gem yank $1 -v $2 -} \ No newline at end of file +} + +# If the completion file doesn't exist yet, we need to autoload it and +# bind it to `gem`. Otherwise, compinit will have already done that. +if [[ ! -f "$ZSH_CACHE_DIR/completions/_gem" ]]; then + typeset -g -A _comps + autoload -Uz _gem + _comps[docker]=_gem +fi + +# zsh 5.5 already provides completion for `_gem`. With this we ensure that +# our provided completion (which is not optimal but is enough in most cases) +# is used for older versions +autoload -Uz is-at-least +if is-at-least 5.5; then + return 0 +fi + +{ + # Standarized $0 handling + # https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html + 0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" + 0="${${(M)0:#/*}:-$PWD/$0}" + + command cp -f "${0:h}/completions/_gem" "$ZSH_CACHE_DIR/completions/_gem" +} &| From 3476148b19dc0771ec8df75fc29c3364bc90d013 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 23 Jul 2024 16:16:19 +0200 Subject: [PATCH 226/453] chore(dependencies): sort dependencies.yml --- .github/dependencies.yml | 30 +++++++++++------------ .github/workflows/dependencies/.gitignore | 1 + 2 files changed, 16 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/dependencies/.gitignore diff --git a/.github/dependencies.yml b/.github/dependencies.yml index 43ec92fb7..be2d02cd8 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -7,17 +7,13 @@ dependencies: set -e rm -rf git-completion.plugin.zsh Makefile README.adoc t tools test -e git-completion.zsh && mv -f git-completion.zsh _git - plugins/z: + plugins/gradle: + repo: gradle/gradle-completion branch: master - repo: agkozak/zsh-z - version: afaf2965b41fdc6ca66066e09382726aa0b6aa04 + version: 25da917cf5a88f3e58f05be3868a7b2748c8afe6 precopy: | set -e - test -e README.md && mv -f README.md MANUAL.md - postcopy: | - set -e - test -e _zshz && mv -f _zshz _z - test -e zsh-z.plugin.zsh && mv -f zsh-z.plugin.zsh z.plugin.zsh + find . ! -name _gradle ! -name LICENSE -delete plugins/history-substring-search: repo: zsh-users/zsh-history-substring-search branch: master @@ -29,13 +25,6 @@ dependencies: postcopy: | set -e test -e dependencies/OMZ-README.md && cat dependencies/OMZ-README.md >> README.md - plugins/gradle: - repo: gradle/gradle-completion - branch: master - version: 25da917cf5a88f3e58f05be3868a7b2748c8afe6 - precopy: | - set -e - find . ! -name _gradle ! -name LICENSE -delete plugins/wd: repo: mfaerevaag/wd branch: master @@ -44,3 +33,14 @@ dependencies: set -e rm -r test rm install.sh tty.gif wd.1 + plugins/z: + branch: master + repo: agkozak/zsh-z + version: afaf2965b41fdc6ca66066e09382726aa0b6aa04 + precopy: | + set -e + test -e README.md && mv -f README.md MANUAL.md + postcopy: | + set -e + test -e _zshz && mv -f _zshz _z + test -e zsh-z.plugin.zsh && mv -f zsh-z.plugin.zsh z.plugin.zsh diff --git a/.github/workflows/dependencies/.gitignore b/.github/workflows/dependencies/.gitignore new file mode 100644 index 000000000..1d17dae13 --- /dev/null +++ b/.github/workflows/dependencies/.gitignore @@ -0,0 +1 @@ +.venv From 18b86f2b72a9386739fac09b159369fa76e909ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 23 Jul 2024 16:38:01 +0200 Subject: [PATCH 227/453] refactor(ag): remove `ag` completion plugin (#12576) BREAKING CHANGE: the `ag` "The Silver Searcher" plugin has been removed, as it only shipped its completion, which is now already included in all the usual package managers. --- plugins/ag/README.md | 13 --------- plugins/ag/_ag | 66 -------------------------------------------- 2 files changed, 79 deletions(-) delete mode 100644 plugins/ag/README.md delete mode 100644 plugins/ag/_ag diff --git a/plugins/ag/README.md b/plugins/ag/README.md deleted file mode 100644 index 1983aaa41..000000000 --- a/plugins/ag/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# The Silver Searcher - -This plugin provides completion support for [`ag`](https://github.com/ggreer/the_silver_searcher). - -To use it, add ag to the plugins array in your zshrc file. - -```zsh -plugins=(... ag) -``` - -## INSTALLATION NOTES - -Besides oh-my-zsh, `ag` needs to be installed by following these steps: https://github.com/ggreer/the_silver_searcher#installing. diff --git a/plugins/ag/_ag b/plugins/ag/_ag deleted file mode 100644 index 25b0c27a7..000000000 --- a/plugins/ag/_ag +++ /dev/null @@ -1,66 +0,0 @@ -#compdef ag -#autoload - -typeset -A opt_args - -# Took the liberty of not listing every option… specially aliases and -D -_ag () { - local -a _1st_arguments - _1st_arguments=( - '--ackmate:Print results in AckMate-parseable format' - {'-A','--after'}':[LINES] Print lines after match (Default: 2)' - {'-B','--before'}':[LINES] Print lines before match (Default: 2)' - '--break:Print newlines between matches in different files' - '--nobreak:Do not print newlines between matches in different files' - {'-c','--count'}':Only print the number of matches in each file' - '--color:Print color codes in results (Default: On)' - '--nocolor:Do not print color codes in results' - '--color-line-number:Color codes for line numbers (Default: 1;33)' - '--color-match:Color codes for result match numbers (Default: 30;43)' - '--color-path:Color codes for path names (Default: 1;32)' - '--column:Print column numbers in results' - {'-H','--heading'}':Print file names (On unless searching a single file)' - '--noheading:Do not print file names (On unless searching a single file)' - '--line-numbers:Print line numbers even for streams' - {'-C','--context'}':[LINES] Print lines before and after matches (Default: 2)' - '-g:[PATTERN] Print filenames matching PATTERN' - {'-l','--files-with-matches'}':Only print filenames that contain matches' - {'-L','--files-without-matches'}':Only print filenames that do not contain matches' - '--no-numbers:Do not print line numbers' - {'-o','--only-matching'}':Prints only the matching part of the lines' - '--print-long-lines:Print matches on very long lines (Default: 2k characters)' - '--passthrough:When searching a stream, print all lines even if they do not match' - '--silent:Suppress all log messages, including errors' - '--stats:Print stats (files scanned, time taken, etc.)' - '--vimgrep:Print results like vim :vimgrep /pattern/g would' - {'-0','--null'}':Separate filenames with null (for "xargs -0")' - - {'-a','--all-types'}':Search all files (does not include hidden files / .gitignore)' - '--depth:[NUM] Search up to NUM directories deep (Default: 25)' - {'-f','--follow'}':Follow symlinks' - {'-G','--file-search-regex'}':[PATTERN] Limit search to filenames matching PATTERN' - '--hidden:Search hidden files (obeys .*ignore files)' - {'-i','--ignore-case'}':Match case insensitively' - '--ignore:[PATTERN] Ignore files/directories matching PATTERN' - {'-m','--max-count'}':[NUM] Skip the rest of a file after NUM matches (Default: 10k)' - {'-p','--path-to-agignore'}':[PATH] Use .agignore file at PATH' - {'-Q','--literal'}':Do not parse PATTERN as a regular expression' - {'-s','--case-sensitive'}':Match case' - {'-S','--smart-case'}':Insensitive match unless PATTERN has uppercase (Default: On)' - '--search-binary:Search binary files for matches' - {'-t','--all-text'}':Search all text files (Hidden files not included)' - {'-u','--unrestricted'}':Search all files (ignore .agignore and _all_)' - {'-U','--skip-vcs-ignores'}':Ignore VCS files (stil obey .agignore)' - {'-v','--invert-match'}':Invert match' - {'-w','--word-regexp'}':Only match whole words' - {'-z','--search-zip'}':Search contents of compressed (e.g., gzip) files' - - '--list-file-types:list of supported file types' - ) - - if [[ $words[-1] =~ "^-" ]]; then - _describe -t commands "ag options" _1st_arguments && ret=0 - else - _files && ret=0 - fi -} From 09a3eb69bbd16198fc4eb4f89b216f232ba15460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 23 Jul 2024 16:40:42 +0200 Subject: [PATCH 228/453] refactor(ripgrep): remove `ripgrep` completion plugin (#12576) BREAKING CHANGE: the `ripgrep` plugin has been removed, as it only shipped its completion, which is now already included in all the usual package managers. --- plugins/ripgrep/README.md | 9 - plugins/ripgrep/_ripgrep | 640 -------------------------------------- 2 files changed, 649 deletions(-) delete mode 100644 plugins/ripgrep/README.md delete mode 100644 plugins/ripgrep/_ripgrep diff --git a/plugins/ripgrep/README.md b/plugins/ripgrep/README.md deleted file mode 100644 index ab9d04116..000000000 --- a/plugins/ripgrep/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# ripgrep - -This plugin adds completion for the text search tool [`ripgrep`](https://github.com/BurntSushi/ripgrep), also known as `rg`. - -To use it, add `ripgrep` to the plugins array in your zshrc file: - -```zsh -plugins=(... ripgrep) -``` diff --git a/plugins/ripgrep/_ripgrep b/plugins/ripgrep/_ripgrep deleted file mode 100644 index a93a8b8eb..000000000 --- a/plugins/ripgrep/_ripgrep +++ /dev/null @@ -1,640 +0,0 @@ -#compdef rg - -## -# zsh completion function for ripgrep -# -# Run ci/test-complete after building to ensure that the options supported by -# this function stay in synch with the `rg` binary. -# -# For convenience, a completion reference guide is included at the bottom of -# this file. -# -# Originally based on code from the zsh-users project — see copyright notice -# below. - -_rg() { - local curcontext=$curcontext no='!' descr ret=1 - local -a context line state state_descr args tmp suf - local -A opt_args - - # ripgrep has many options which negate the effect of a more common one — for - # example, `--no-column` to negate `--column`, and `--messages` to negate - # `--no-messages`. There are so many of these, and they're so infrequently - # used, that some users will probably find it irritating if they're completed - # indiscriminately, so let's not do that unless either the current prefix - # matches one of those negation options or the user has the `complete-all` - # style set. Note that this prefix check has to be updated manually to account - # for all of the potential negation options listed below! - if - # We also want to list all of these options during testing - [[ $_RG_COMPLETE_LIST_ARGS == (1|t*|y*) ]] || - # (--[imnp]* => --ignore*, --messages, --no-*, --pcre2-unicode) - [[ $PREFIX$SUFFIX == --[imnp]* ]] || - zstyle -t ":complete:$curcontext:*" complete-all - then - no= - fi - - # We make heavy use of argument groups here to prevent the option specs from - # growing unwieldy. These aren't supported in zsh <5.4, though, so we'll strip - # them out below if necessary. This makes the exclusions inaccurate on those - # older versions, but oh well — it's not that big a deal - args=( - + '(exclusive)' # Misc. fully exclusive options - '(: * -)'{-h,--help}'[display help information]' - '(: * -)'{-V,--version}'[display version information]' - '(: * -)'--pcre2-version'[print the version of PCRE2 used by ripgrep, if available]' - - + '(buffered)' # buffering options - '--line-buffered[force line buffering]' - $no"--no-line-buffered[don't force line buffering]" - '--block-buffered[force block buffering]' - $no"--no-block-buffered[don't force block buffering]" - - + '(case)' # Case-sensitivity options - {-i,--ignore-case}'[search case-insensitively]' - {-s,--case-sensitive}'[search case-sensitively]' - {-S,--smart-case}'[search case-insensitively if pattern is all lowercase]' - - + '(context-a)' # Context (after) options - '(context-c)'{-A+,--after-context=}'[specify lines to show after each match]:number of lines' - - + '(context-b)' # Context (before) options - '(context-c)'{-B+,--before-context=}'[specify lines to show before each match]:number of lines' - - + '(context-c)' # Context (combined) options - '(context-a context-b)'{-C+,--context=}'[specify lines to show before and after each match]:number of lines' - - + '(column)' # Column options - '--column[show column numbers for matches]' - $no"--no-column[don't show column numbers for matches]" - - + '(count)' # Counting options - {-c,--count}'[only show count of matching lines for each file]' - '--count-matches[only show count of individual matches for each file]' - '--include-zero[include files with zero matches in summary]' - - + '(encoding)' # Encoding options - {-E+,--encoding=}'[specify text encoding of files to search]: :_rg_encodings' - $no'--no-encoding[use default text encoding]' - - + '(engine)' # Engine choice options - '--engine=[select which regex engine to use]:when:(( - default\:"use default engine" - pcre2\:"identical to --pcre2" - auto\:"identical to --auto-hybrid-regex" - ))' - - + file # File-input options - '(1)*'{-f+,--file=}'[specify file containing patterns to search for]: :_files' - - + '(file-match)' # Files with/without match options - '(stats)'{-l,--files-with-matches}'[only show names of files with matches]' - '(stats)--files-without-match[only show names of files without matches]' - - + '(file-name)' # File-name options - {-H,--with-filename}'[show file name for matches]' - {-I,--no-filename}"[don't show file name for matches]" - - + '(file-system)' # File system options - "--one-file-system[don't descend into directories on other file systems]" - $no'--no-one-file-system[descend into directories on other file systems]' - - + '(fixed)' # Fixed-string options - {-F,--fixed-strings}'[treat pattern as literal string instead of regular expression]' - $no"--no-fixed-strings[don't treat pattern as literal string]" - - + '(follow)' # Symlink-following options - {-L,--follow}'[follow symlinks]' - $no"--no-follow[don't follow symlinks]" - - + glob # File-glob options - '*'{-g+,--glob=}'[include/exclude files matching specified glob]:glob' - '*--iglob=[include/exclude files matching specified case-insensitive glob]:glob' - - + '(glob-case-insensitive)' # File-glob case sensitivity options - '--glob-case-insensitive[treat -g/--glob patterns case insensitively]' - $no'--no-glob-case-insensitive[treat -g/--glob patterns case sensitively]' - - + '(heading)' # Heading options - '(pretty-vimgrep)--heading[show matches grouped by file name]' - "(pretty-vimgrep)--no-heading[don't show matches grouped by file name]" - - + '(hidden)' # Hidden-file options - {-.,--hidden}'[search hidden files and directories]' - $no"--no-hidden[don't search hidden files and directories]" - - + '(hybrid)' # hybrid regex options - '--auto-hybrid-regex[dynamically use PCRE2 if necessary]' - $no"--no-auto-hybrid-regex[don't dynamically use PCRE2 if necessary]" - - + '(ignore)' # Ignore-file options - "(--no-ignore-global --no-ignore-parent --no-ignore-vcs --no-ignore-dot)--no-ignore[don't respect ignore files]" - $no'(--ignore-global --ignore-parent --ignore-vcs --ignore-dot)--ignore[respect ignore files]' - - + '(ignore-file-case-insensitive)' # Ignore-file case sensitivity options - '--ignore-file-case-insensitive[process ignore files case insensitively]' - $no'--no-ignore-file-case-insensitive[process ignore files case sensitively]' - - + '(ignore-exclude)' # Local exclude (ignore)-file options - "--no-ignore-exclude[don't respect local exclude (ignore) files]" - $no'--ignore-exclude[respect local exclude (ignore) files]' - - + '(ignore-global)' # Global ignore-file options - "--no-ignore-global[don't respect global ignore files]" - $no'--ignore-global[respect global ignore files]' - - + '(ignore-parent)' # Parent ignore-file options - "--no-ignore-parent[don't respect ignore files in parent directories]" - $no'--ignore-parent[respect ignore files in parent directories]' - - + '(ignore-vcs)' # VCS ignore-file options - "--no-ignore-vcs[don't respect version control ignore files]" - $no'--ignore-vcs[respect version control ignore files]' - - + '(require-git)' # git specific settings - "--no-require-git[don't require git repository to respect gitignore rules]" - $no'--require-git[require git repository to respect gitignore rules]' - - + '(ignore-dot)' # .ignore options - "--no-ignore-dot[don't respect .ignore files]" - $no'--ignore-dot[respect .ignore files]' - - + '(ignore-files)' # custom global ignore file options - "--no-ignore-files[don't respect --ignore-file flags]" - $no'--ignore-files[respect --ignore-file files]' - - + '(json)' # JSON options - '--json[output results in JSON Lines format]' - $no"--no-json[don't output results in JSON Lines format]" - - + '(line-number)' # Line-number options - {-n,--line-number}'[show line numbers for matches]' - {-N,--no-line-number}"[don't show line numbers for matches]" - - + '(line-terminator)' # Line-terminator options - '--crlf[use CRLF as line terminator]' - $no"--no-crlf[don't use CRLF as line terminator]" - '(text)--null-data[use NUL as line terminator]' - - + '(max-columns-preview)' # max column preview options - '--max-columns-preview[show preview for long lines (with -M)]' - $no"--no-max-columns-preview[don't show preview for long lines (with -M)]" - - + '(max-depth)' # Directory-depth options - '--max-depth=[specify max number of directories to descend]:number of directories' - '!--maxdepth=:number of directories' - - + '(messages)' # Error-message options - '(--no-ignore-messages)--no-messages[suppress some error messages]' - $no"--messages[don't suppress error messages affected by --no-messages]" - - + '(messages-ignore)' # Ignore-error message options - "--no-ignore-messages[don't show ignore-file parse error messages]" - $no'--ignore-messages[show ignore-file parse error messages]' - - + '(mmap)' # mmap options - '--mmap[search using memory maps when possible]' - "--no-mmap[don't search using memory maps]" - - + '(multiline)' # Multiline options - {-U,--multiline}'[permit matching across multiple lines]' - $no'(multiline-dotall)--no-multiline[restrict matches to at most one line each]' - - + '(multiline-dotall)' # Multiline DOTALL options - '(--no-multiline)--multiline-dotall[allow "." to match newline (with -U)]' - $no"(--no-multiline)--no-multiline-dotall[don't allow \".\" to match newline (with -U)]" - - + '(only)' # Only-match options - {-o,--only-matching}'[show only matching part of each line]' - - + '(passthru)' # Pass-through options - '(--vimgrep)--passthru[show both matching and non-matching lines]' - '!(--vimgrep)--passthrough' - - + '(pcre2)' # PCRE2 options - {-P,--pcre2}'[enable matching with PCRE2]' - $no'(pcre2-unicode)--no-pcre2[disable matching with PCRE2]' - - + '(pcre2-unicode)' # PCRE2 Unicode options - $no'(--no-pcre2 --no-pcre2-unicode)--pcre2-unicode[enable PCRE2 Unicode mode (with -P)]' - '(--no-pcre2 --pcre2-unicode)--no-pcre2-unicode[disable PCRE2 Unicode mode (with -P)]' - - + '(pre)' # Preprocessing options - '(-z --search-zip)--pre=[specify preprocessor utility]:preprocessor utility:_command_names -e' - $no'--no-pre[disable preprocessor utility]' - - + pre-glob # Preprocessing glob options - '*--pre-glob[include/exclude files for preprocessing with --pre]' - - + '(pretty-vimgrep)' # Pretty/vimgrep display options - '(heading)'{-p,--pretty}'[alias for --color=always --heading -n]' - '(heading passthru)--vimgrep[show results in vim-compatible format]' - - + regexp # Explicit pattern options - '(1 file)*'{-e+,--regexp=}'[specify pattern]:pattern' - - + '(replace)' # Replacement options - {-r+,--replace=}'[specify string used to replace matches]:replace string' - - + '(sort)' # File-sorting options - '(threads)--sort=[sort results in ascending order (disables parallelism)]:sort method:(( - none\:"no sorting" - path\:"sort by file path" - modified\:"sort by last modified time" - accessed\:"sort by last accessed time" - created\:"sort by creation time" - ))' - '(threads)--sortr=[sort results in descending order (disables parallelism)]:sort method:(( - none\:"no sorting" - path\:"sort by file path" - modified\:"sort by last modified time" - accessed\:"sort by last accessed time" - created\:"sort by creation time" - ))' - '!(threads)--sort-files[sort results by file path (disables parallelism)]' - - + '(stats)' # Statistics options - '(--files file-match)--stats[show search statistics]' - $no"--no-stats[don't show search statistics]" - - + '(text)' # Binary-search options - {-a,--text}'[search binary files as if they were text]' - "--binary[search binary files, don't print binary data]" - $no"--no-binary[don't search binary files]" - $no"(--null-data)--no-text[don't search binary files as if they were text]" - - + '(threads)' # Thread-count options - '(sort)'{-j+,--threads=}'[specify approximate number of threads to use]:number of threads' - - + '(trim)' # Trim options - '--trim[trim any ASCII whitespace prefix from each line]' - $no"--no-trim[don't trim ASCII whitespace prefix from each line]" - - + type # Type options - '*'{-t+,--type=}'[only search files matching specified type]: :_rg_types' - '*--type-add=[add new glob for specified file type]: :->typespec' - '*--type-clear=[clear globs previously defined for specified file type]: :_rg_types' - # This should actually be exclusive with everything but other type options - '(: *)--type-list[show all supported file types and their associated globs]' - '*'{-T+,--type-not=}"[don't search files matching specified file type]: :_rg_types" - - + '(word-line)' # Whole-word/line match options - {-w,--word-regexp}'[only show matches surrounded by word boundaries]' - {-x,--line-regexp}'[only show matches surrounded by line boundaries]' - - + '(unicode)' # Unicode options - $no'--unicode[enable Unicode mode]' - '--no-unicode[disable Unicode mode]' - - + '(zip)' # Compression options - '(--pre)'{-z,--search-zip}'[search in compressed files]' - $no"--no-search-zip[don't search in compressed files]" - - + misc # Other options — no need to separate these at the moment - '(-b --byte-offset)'{-b,--byte-offset}'[show 0-based byte offset for each matching line]' - '--color=[specify when to use colors in output]:when:(( - never\:"never use colors" - auto\:"use colors or not based on stdout, TERM, etc." - always\:"always use colors" - ansi\:"always use ANSI colors (even on Windows)" - ))' - '*--colors=[specify color and style settings]: :->colorspec' - '--context-separator=[specify string used to separate non-continuous context lines in output]:separator' - $no"--no-context-separator[don't print context separators]" - '--debug[show debug messages]' - '--field-context-separator[set string to delimit fields in context lines]' - '--field-match-separator[set string to delimit fields in matching lines]' - '--trace[show more verbose debug messages]' - '--dfa-size-limit=[specify upper size limit of generated DFA]:DFA size (bytes)' - "(1 stats)--files[show each file that would be searched (but don't search)]" - '*--ignore-file=[specify additional ignore file]:ignore file:_files' - '(-v --invert-match)'{-v,--invert-match}'[invert matching]' - '(-M --max-columns)'{-M+,--max-columns=}'[specify max length of lines to print]:number of bytes' - '(-m --max-count)'{-m+,--max-count=}'[specify max number of matches per file]:number of matches' - '--max-filesize=[specify size above which files should be ignored]:file size (bytes)' - "--no-config[don't load configuration files]" - '(-0 --null)'{-0,--null}'[print NUL byte after file names]' - '--path-separator=[specify path separator to use when printing file names]:separator' - '(-q --quiet)'{-q,--quiet}'[suppress normal output]' - '--regex-size-limit=[specify upper size limit of compiled regex]:regex size (bytes)' - '*'{-u,--unrestricted}'[reduce level of "smart" searching]' - - + operand # Operands - '(--files --type-list file regexp)1: :_guard "^-*" pattern' - '(--type-list)*: :_files' - ) - - # This is used with test-complete to verify that there are no options - # listed in the help output that aren't also defined here - [[ $_RG_COMPLETE_LIST_ARGS == (1|t*|y*) ]] && { - print -rl - $args - return 0 - } - - # Strip out argument groups where unsupported (see above) - [[ $ZSH_VERSION == (4|5.<0-3>)(.*)# ]] && - args=( ${(@)args:#(#i)(+|[a-z0-9][a-z0-9_-]#|\([a-z0-9][a-z0-9_-]#\))} ) - - _arguments -C -s -S : $args && ret=0 - - case $state in - colorspec) - if [[ ${IPREFIX#--*=}$PREFIX == [^:]# ]]; then - suf=( -qS: ) - tmp=( - 'column:specify coloring for column numbers' - 'line:specify coloring for line numbers' - 'match:specify coloring for match text' - 'path:specify coloring for file names' - ) - descr='color/style type' - elif [[ ${IPREFIX#--*=}$PREFIX == (column|line|match|path):[^:]# ]]; then - suf=( -qS: ) - tmp=( - 'none:clear color/style for type' - 'bg:specify background color' - 'fg:specify foreground color' - 'style:specify text style' - ) - descr='color/style attribute' - elif [[ ${IPREFIX#--*=}$PREFIX == [^:]##:(bg|fg):[^:]# ]]; then - tmp=( black blue green red cyan magenta yellow white ) - descr='color name or r,g,b' - elif [[ ${IPREFIX#--*=}$PREFIX == [^:]##:style:[^:]# ]]; then - tmp=( {,no}bold {,no}intense {,no}underline ) - descr='style name' - else - _message -e colorspec 'no more arguments' - fi - - (( $#tmp )) && { - compset -P '*:' - _describe -t colorspec $descr tmp $suf && ret=0 - } - ;; - - typespec) - if compset -P '[^:]##:include:'; then - _sequence -s , _rg_types && ret=0 - # @todo This bit in particular could be better, but it's a little - # complex, and attempting to solve it seems to run us up against a crash - # bug — zsh # 40362 - elif compset -P '[^:]##:'; then - _message 'glob or include directive' && ret=1 - elif [[ ! -prefix *:* ]]; then - _rg_types -qS : && ret=0 - fi - ;; - esac - - return ret -} - -# Complete encodings -_rg_encodings() { - local -a expl - local -aU _encodings - - # This is impossible to read, but these encodings rarely if ever change, so it - # probably doesn't matter. They are derived from the list given here: - # https://encoding.spec.whatwg.org/#concept-encoding-get - _encodings=( - {{,us-}ascii,arabic,chinese,cyrillic,greek{,8},hebrew,korean} - logical visual mac {,cs}macintosh x-mac-{cyrillic,roman,ukrainian} - 866 ibm{819,866} csibm866 - big5{,-hkscs} {cn-,cs}big5 x-x-big5 - cp{819,866,125{0..8}} x-cp125{0..8} - csiso2022{jp,kr} csiso8859{6,8}{e,i} - csisolatin{{1..6},9} csisolatin{arabic,cyrillic,greek,hebrew} - ecma-{114,118} asmo-708 elot_928 sun_eu_greek - euc-{jp,kr} x-euc-jp cseuckr cseucpkdfmtjapanese - {,x-}gbk csiso58gb231280 gb18030 {,cs}gb2312 gb_2312{,-80} hz-gb-2312 - iso-2022-{cn,cn-ext,jp,kr} - iso8859{,-}{{1..11},13,14,15} - iso-8859-{{1..11},{6,8}-{e,i},13,14,15,16} iso_8859-{{1..9},15} - iso_8859-{1,2,6,7}:1987 iso_8859-{3,4,5,8}:1988 iso_8859-9:1989 - iso-ir-{58,100,101,109,110,126,127,138,144,148,149,157} - koi{,8,8-r,8-ru,8-u,8_r} cskoi8r - ks_c_5601-{1987,1989} ksc{,_}5691 csksc56011987 - latin{1..6} l{{1..6},9} - shift{-,_}jis csshiftjis {,x-}sjis ms_kanji ms932 - utf{,-}8 utf-16{,be,le} unicode-1-1-utf-8 - windows-{31j,874,949,125{0..8}} dos-874 tis-620 ansi_x3.4-1968 - x-user-defined auto none - ) - - _wanted encodings expl encoding compadd -a "$@" - _encodings -} - -# Complete file types -_rg_types() { - local -a expl - local -aU _types - - _types=( ${(@)${(f)"$( _call_program types rg --type-list )"}%%:*} ) - - _wanted types expl 'file type' compadd -a "$@" - _types -} - -_rg "$@" - -################################################################################ -# ZSH COMPLETION REFERENCE -# -# For the convenience of developers who aren't especially familiar with zsh -# completion functions, a brief reference guide follows. This is in no way -# comprehensive; it covers just enough of the basic structure, syntax, and -# conventions to help someone make simple changes like adding new options. For -# more complete documentation regarding zsh completion functions, please see the -# following: -# -# * http://zsh.sourceforge.net/Doc/Release/Completion-System.html -# * https://github.com/zsh-users/zsh/blob/master/Etc/completion-style-guide -# -# OVERVIEW -# -# Most zsh completion functions are defined in terms of `_arguments`, which is a -# shell function that takes a series of argument specifications. The specs for -# `rg` are stored in an array, which is common for more complex functions; the -# elements of the array are passed to `_arguments` on invocation. -# -# ARGUMENT-SPECIFICATION SYNTAX -# -# The following is a contrived example of the argument specs for a simple tool: -# -# '(: * -)'{-h,--help}'[display help information]' -# '(-q -v --quiet --verbose)'{-q,--quiet}'[decrease output verbosity]' -# '!(-q -v --quiet --verbose)--silent' -# '(-q -v --quiet --verbose)'{-v,--verbose}'[increase output verbosity]' -# '--color=[specify when to use colors]:when:(always never auto)' -# '*:example file:_files' -# -# Although there may appear to be six specs here, there are actually nine; we -# use brace expansion to combine specs for options that go by multiple names, -# like `-q` and `--quiet`. This is customary, and ties in with the fact that zsh -# merges completion possibilities together when they have the same description. -# -# The first line defines the option `-h`/`--help`. With most tools, it isn't -# useful to complete anything after `--help` because it effectively overrides -# all others; the `(: * -)` at the beginning of the spec tells zsh not to -# complete any other operands (`:` and `*`) or options (`-`) after this one has -# been used. The `[...]` at the end associates a description with `-h`/`--help`; -# as mentioned, zsh will see the identical descriptions and merge these options -# together when offering completion possibilities. -# -# The next line defines `-q`/`--quiet`. Here we don't want to suppress further -# completions entirely, but we don't want to offer `-q` if `--quiet` has been -# given (since they do the same thing), nor do we want to offer `-v` (since it -# doesn't make sense to be quiet and verbose at the same time). We don't need to -# tell zsh not to offer `--quiet` a second time, since that's the default -# behaviour, but since this line expands to two specs describing `-q` *and* -# `--quiet` we do need to explicitly list all of them here. -# -# The next line defines a hidden option `--silent` — maybe it's a deprecated -# synonym for `--quiet`. The leading `!` indicates that zsh shouldn't offer this -# option during completion. The benefit of providing a spec for an option that -# shouldn't be completed is that, if someone *does* use it, we can correctly -# suppress completion of other options afterwards. -# -# The next line defines `-v`/`--verbose`; this works just like `-q`/`--quiet`. -# -# The next line defines `--color`. In this example, `--color` doesn't have a -# corresponding short option, so we don't need to use brace expansion. Further, -# there are no other options it's exclusive with (just itself), so we don't need -# to define those at the beginning. However, it does take a mandatory argument. -# The `=` at the end of `--color=` indicates that the argument may appear either -# like `--color always` or like `--color=always`; this is how most GNU-style -# command-line tools work. The corresponding short option would normally use `+` -# — for example, `-c+` would allow either `-c always` or `-calways`. For this -# option, the arguments are known ahead of time, so we can simply list them in -# parentheses at the end (`when` is used as the description for the argument). -# -# The last line defines an operand (a non-option argument). In this example, the -# operand can be used any number of times (the leading `*`), and it should be a -# file path, so we tell zsh to call the `_files` function to complete it. The -# `example file` in the middle is the description to use for this operand; we -# could use a space instead to accept the default provided by `_files`. -# -# GROUPING ARGUMENT SPECIFICATIONS -# -# Newer versions of zsh support grouping argument specs together. All specs -# following a `+` and then a group name are considered to be members of the -# named group. Grouping is useful mostly for organisational purposes; it makes -# the relationship between different options more obvious, and makes it easier -# to specify exclusions. -# -# We could rewrite our example above using grouping as follows: -# -# '(: * -)'{-h,--help}'[display help information]' -# '--color=[specify when to use colors]:when:(always never auto)' -# '*:example file:_files' -# + '(verbosity)' -# {-q,--quiet}'[decrease output verbosity]' -# '!--silent' -# {-v,--verbose}'[increase output verbosity]' -# -# Here we take advantage of a useful feature of spec grouping — when the group -# name is surrounded by parentheses, as in `(verbosity)`, it tells zsh that all -# of the options in that group are exclusive with each other. As a result, we -# don't need to manually list out the exclusions at the beginning of each -# option. -# -# Groups can also be referred to by name in other argument specs; for example: -# -# '(xyz)--aaa' '*: :_files' -# + xyz --xxx --yyy --zzz -# -# Here we use the group name `xyz` to tell zsh that `--xxx`, `--yyy`, and -# `--zzz` are not to be completed after `--aaa`. This makes the exclusion list -# much more compact and reusable. -# -# CONVENTIONS -# -# zsh completion functions generally adhere to the following conventions: -# -# * Use two spaces for indentation -# * Combine specs for options with different names using brace expansion -# * In combined specs, list the short option first (as in `{-a,--text}`) -# * Use `+` or `=` as described above for options that take arguments -# * Provide a description for all options, option-arguments, and operands -# * Capitalise/punctuate argument descriptions as phrases, not complete -# sentences — 'display help information', never 'Display help information.' -# (but still capitalise acronyms and proper names) -# * Write argument descriptions as verb phrases — 'display x', 'enable y', -# 'use z' -# * Word descriptions to make it clear when an option expects an argument; -# usually this is done with the word 'specify', as in 'specify x' or -# 'use specified x') -# * Write argument descriptions as tersely as possible — for example, articles -# like 'a' and 'the' should be omitted unless it would be confusing -# -# Other conventions currently used by this function: -# -# * Order argument specs alphabetically by group name, then option name -# * Group options that are directly related, mutually exclusive, or frequently -# referenced by other argument specs -# * Use only characters in the set [a-z0-9_-] in group names -# * Order exclusion lists as follows: short options, long options, groups -# * Use American English in descriptions -# * Use 'don't' in descriptions instead of 'do not' -# * Word descriptions for related options as similarly as possible. For example, -# `--foo[enable foo]` and `--no-foo[disable foo]`, or `--foo[use foo]` and -# `--no-foo[don't use foo]` -# * Word descriptions to make it clear when an option only makes sense with -# another option, usually by adding '(with -x)' to the end -# * Don't quote strings or variables unnecessarily. When quotes are required, -# prefer single-quotes to double-quotes -# * Prefix option specs with `$no` when the option serves only to negate the -# behaviour of another option that must be provided explicitly by the user. -# This prevents rarely used options from cluttering up the completion menu -################################################################################ - -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 GitHub zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for ripgrep -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * arcizan -# * MaskRay -# -# ------------------------------------------------------------------------------ - -# Local Variables: -# mode: shell-script -# coding: utf-8-unix -# indent-tabs-mode: nil -# sh-indentation: 2 -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et From c7c11e110a738bbd34dc022fabe73f47c0f42b78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 23 Jul 2024 16:41:50 +0200 Subject: [PATCH 229/453] refactor(fd): remove `fd` completion plugin (#12576) BREAKING CHANGE: the `fd` plugin has been removed, as it only shipped its completion, which is now already included in all the usual package managers. --- plugins/fd/README.md | 9 -- plugins/fd/_fd | 273 ------------------------------------------- 2 files changed, 282 deletions(-) delete mode 100644 plugins/fd/README.md delete mode 100644 plugins/fd/_fd diff --git a/plugins/fd/README.md b/plugins/fd/README.md deleted file mode 100644 index f3341612f..000000000 --- a/plugins/fd/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# fd - -This plugin adds completion for the file search tool [`fd`](https://github.com/sharkdp/fd), also known as `fd-find`. - -To use it, add `fd` to the plugins array in your zshrc file: - -```zsh -plugins=(... fd) -``` diff --git a/plugins/fd/_fd b/plugins/fd/_fd deleted file mode 100644 index 45b8ca477..000000000 --- a/plugins/fd/_fd +++ /dev/null @@ -1,273 +0,0 @@ -#compdef fd - -## -# zsh completion function for fd -# -# Based on ripgrep completion function. -# Originally based on code from the zsh-users project — see copyright notice -# below. - -autoload -U is-at-least - -_fd() { - local curcontext="$curcontext" no='!' ret=1 - local -a context line state state_descr _arguments_options fd_types fd_args - local -A opt_args - - if is-at-least 5.2; then - _arguments_options=( -s -S ) - else - _arguments_options=( -s ) - fi - - fd_types=( - {f,file}'\:"regular files"' - {d,directory}'\:"directories"' - {l,symlink}'\:"symbolic links"' - {e,empty}'\:"empty files or directories"' - {x,executable}'\:"executable (files)"' - {s,socket}'\:"sockets"' - {p,pipe}'\:"named pipes (FIFOs)"' - ) - - # Do not complete rare options unless either the current prefix - # matches one of those options or the user has the `complete-all` - # style set. Note that this prefix check has to be updated manually to account - # for all of the potential negation options listed below! - if - # (--[bpsu]* => match all options marked with '$no') - [[ $PREFIX$SUFFIX == --[bopsu]* ]] || - zstyle -t ":complete:$curcontext:*" complete-all - then - no= - fi - - # We make heavy use of argument groups here to prevent the option specs from - # growing unwieldy. These aren't supported in zsh <5.4, though, so we'll strip - # them out below if necessary. This makes the exclusions inaccurate on those - # older versions, but oh well — it's not that big a deal - fd_args=( - + '(hidden)' # hidden files - {-H,--hidden}'[search hidden files/directories]' - - + '(no-ignore-full)' # all ignore files - '(no-ignore-partial)'{-I,--no-ignore}"[don't respect .(git|fd)ignore and global ignore files]" - $no'(no-ignore-partial)*'{-u,--unrestricted}'[alias for --no-ignore, when repeated also alias for --hidden]' - - + no-ignore-partial # some ignore files - "(no-ignore-full --no-ignore-vcs)--no-ignore-vcs[don't respect .gitignore files]" - "!(no-ignore-full --no-global-ignore-file)--no-global-ignore-file[don't respect the global ignore file]" - $no'(no-ignore-full --no-ignore-parent)--no-ignore-parent[]' - - + '(case)' # case-sensitivity - {-s,--case-sensitive}'[perform a case-sensitive search]' - {-i,--ignore-case}'[perform a case-insensitive search]' - - + '(regex-pattern)' # regex-based search pattern - '(no-regex-pattern)--regex[perform a regex-based search (default)]' - - + '(no-regex-pattern)' # non-regex-based search pattern - {-g,--glob}'[perform a glob-based search]' - {-F,--fixed-strings}'[treat pattern as literal string instead of a regex]' - - + '(match-full)' # match against full path - {-p,--full-path}'[match the pattern against the full path instead of the basename]' - - + '(follow)' # follow symlinks - {-L,--follow}'[follow symbolic links to directories]' - - + '(abs-path)' # show absolute paths - '(long-listing)'{-a,--absolute-path}'[show absolute paths instead of relative paths]' - - + '(null-sep)' # use null separator for output - '(long-listing)'{-0,--print0}'[separate search results by the null character]' - - + '(long-listing)' # long-listing output - '(abs-path null-sep max-results exec-cmds)'{-l,--list-details}'[use a long listing format with file metadata]' - - + '(max-results)' # max number of results - '(long-listing exec-cmds)--max-results=[limit number of search results to given count and quit]:count' - '(long-listing exec-cmds)-1[limit to a single search result and quit]' - - + '(fs-errors)' # file-system errors - $no'--show-errors[enable the display of filesystem errors]' - - + '(fs-traversal)' # file-system traversal - $no"--one-file-system[don't descend into directories on other file systems]" - '!--mount' - '!--xdev' - - + dir-depth # directory depth - '(--exact-depth -d --max-depth)'{-d+,--max-depth=}'[set max directory depth to descend when searching]:depth' - '!(--exact-depth -d --max-depth)--maxdepth:depth' - '(--exact-depth --min-depth)--min-depth=[set directory depth to descend before start searching]:depth' - '(--exact-depth -d --max-depth --maxdepth --min-depth)--exact-depth=[only search at the exact given directory depth]:depth' - - + prune # pruning - "--prune[don't traverse into matching directories]" - - + filter-misc # filter search - '*'{-t+,--type=}"[filter search by type]:type:(($fd_types))" - '*'{-e+,--extension=}'[filter search by file extension]:extension' - '*'{-E+,--exclude=}'[exclude files/directories that match the given glob pattern]:glob pattern' - '*'{-S+,--size=}'[limit search by file size]:size limit:->size' - '(-o --owner)'{-o+,--owner=}'[filter by owning user and/or group]:owner and/or group:->owner' - - + ignore-file # extra ignore files - '*--ignore-file=[add a custom, low-precedence ignore-file with .gitignore format]: :_files' - - + '(filter-mtime-newer)' # filter by files modified after than - '--changed-within=[limit search to files/directories modified within the given date/duration]:date or duration' - '!--change-newer-than=:date/duration' - '!--newer=:date/duration' - - + '(filter-mtime-older)' # filter by files modified before than - '--changed-before=[limit search to files/directories modified before the given date/duration]:date or duration' - '!--change-older-than=:date/duration' - '!--older=:date/duration' - - + '(color)' # colorize output - {-c+,--color=}'[declare when to colorize search results]:when to colorize:(( - auto\:"show colors if the output goes to an interactive console (default)" - never\:"do not use colorized output" - always\:"always use colorized output" - ))' - - + '(threads)' - {-j+,--threads=}'[set the number of threads for searching and executing]:number of threads' - - + '(exec-cmds)' # execute command - '(long-listing max-results)'{-x+,--exec=}'[execute command for each search result]:command: _command_names -e:*\;::program arguments: _normal' - '(long-listing max-results)'{-X+,--exec-batch=}'[execute command for all search results at once]:command: _command_names -e:*\;::program arguments: _normal' - '(long-listing max-results)--batch-size=[max number of args for each -X call]:size' - - + other - '!(--max-buffer-time)--max-buffer-time=[set amount of time to buffer before showing output]:time (ms)' - - + '(about)' # about flags - '(: * -)'{-h,--help}'[display help message]' - '(: * -)'{-v,--version}'[display version information]' - - + path-sep # set path separator for output - $no'(--path-separator)--path-separator=[set the path separator to use when printing file paths]:path separator' - - + search-path - $no'(--base-directory)--base-directory=[change the current working directory to the given path]:directory:_files -/' - $no'(*)*--search-path=[set search path (instead of positional arguments)]:directory:_files -/' - - + strip-cwd-prefix - $no'(strip-cwd-prefix exec-cmds)--strip-cwd-prefix[Strip ./ prefix when output is redirected]' - - + args # positional arguments - '1: :_guard "^-*" pattern' - '(--search-path)*:directory:_files -/' - ) - - # Strip out argument groups where unsupported (see above) - is-at-least 5.4 || - fd_args=( ${(@)args:#(#i)(+|[a-z0-9][a-z0-9_-]#|\([a-z0-9][a-z0-9_-]#\))} ) - - _arguments $_arguments_options : $fd_args && ret=0 - - case ${state} in - owner) - compset -P '(\\|)\!' - if compset -P '*:'; then - _groups && ret=0 - else - if - compset -S ':*' || - # Do not add the colon suffix when completing "!user - # (with a starting double-quote) otherwise pressing tab again - # after the inserted colon "!user: will complete history modifiers - [[ $IPREFIX == (\\|\!)* && ($QIPREFIX == \"* && -z $QISUFFIX) ]] - then - _users && ret=0 - else - local q - # Since quotes are needed when using the negation prefix !, - # automatically remove the colon suffix also when closing the quote - if [[ $QIPREFIX == [\'\"]* ]]; then - q=${QIPREFIX:0:1} - fi - _users -r ": \t\n\-$q" -S : && ret=0 - fi - fi - ;; - - size) - if compset -P '[-+][0-9]##'; then - local -a suff=( - 'B:bytes' - 'K:kilobytes (10^3 = 1000 bytes)' - 'M:megabytes (10^6 = 1000^2 bytes)' - 'G:gigabytes (10^9 = 1000^3 bytes)' - 'T:terabytes (10^12 = 1000^4 bytes)' - 'Ki:kibibytes ( 2^10 = 1024 bytes)' - 'Mi:mebibytes ( 2^20 = 1024^2 bytes)' - 'Gi:gigibytes ( 2^30 = 1024^3 bytes)' - 'Ti:tebibytes ( 2^40 = 1024^4 bytes)' - ) - _describe -t units 'size limit units' suff -V 'units' - elif compset -P '[-+]'; then - _message -e 'size limit number (full format: <+->)' - else - _values 'size limit prefix (full format: )' \ - '\+[file size must be greater or equal to]'\ - '-[file size must be less than or equal to]' && ret=0 - fi - ;; - esac - - return ret -} - -_fd "$@" - -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 GitHub zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for fd -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * smancill (https://github.com/smancill) -# -# ------------------------------------------------------------------------------ - -# Local Variables: -# mode: shell-script -# coding: utf-8-unix -# indent-tabs-mode: nil -# sh-indentation: 2 -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et From 27ca0c915b4a6b29282502b2b36c7ffb4c56e32b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 23 Jul 2024 19:55:14 +0200 Subject: [PATCH 230/453] chore(dependabot): remove automatic labels --- .github/dependabot.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 4dc9f3854..ebdb80423 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,8 +5,10 @@ updates: schedule: interval: "weekly" day: "sunday" + labels: [] - package-ecosystem: "pip" directory: "/.github/workflows/dependencies" schedule: interval: "weekly" day: "sunday" + labels: [] From 51d71e650c369a5c3805a629c1efd314b5628921 Mon Sep 17 00:00:00 2001 From: Katrin Leinweber <9948149+katrinleinweber@users.noreply.github.com> Date: Sun, 29 Dec 2019 17:53:50 +0100 Subject: [PATCH 231/453] feat(brew)!: add `brew upgrade` alias (#7536) BREAKING CHANGE: the `bubc` alias has been removed, as `brew cleanup` is performed automatically. Instead, the `bup` alias is added to just run `brew upgrade`. See https://brew.sh/2019/02/02/homebrew-2.0.0 Closes #7536 --- plugins/brew/README.md | 3 ++- plugins/brew/brew.plugin.zsh | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/brew/README.md b/plugins/brew/README.md index 299393b28..9cd9c249d 100644 --- a/plugins/brew/README.md +++ b/plugins/brew/README.md @@ -26,10 +26,11 @@ the `brew` binary before sourcing `oh-my-zsh.sh` and it'll set up the environmen | `brewp` | `brew pin` | Pin a specified formula so that it's not upgraded. | | `brews` | `brew list -1` | List installed formulae or the installed files for a given formula. | | `brewsp` | `brew list --pinned` | List pinned formulae, or show the version of a given formula. | +| `bup` | `brew upgrade` | Upgrade outdated, unpinned brews (with existing install options). | | `bubc` | `brew upgrade && brew cleanup` | Upgrade outdated formulae and casks, then run cleanup. | | `bugbc` | `brew upgrade --greedy && brew cleanup` | Upgrade outdated formulae and casks (greedy), then run cleanup. | | `bubo` | `brew update && brew outdated` | Update Homebrew data, then list outdated formulae and casks. | -| `bubu` | `bubo && bubc` | Do the last two operations above. | +| `bubu` | `bubo && bup` | Do the last two operations above. | | `bfu` | `brew upgrade --formula` | Upgrade only formulas (not casks). | | `buz` | `brew uninstall --zap` | Remove all files associated with a cask. | diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh index b15137e0f..f2e7e6cff 100644 --- a/plugins/brew/brew.plugin.zsh +++ b/plugins/brew/brew.plugin.zsh @@ -38,10 +38,10 @@ alias bcubc='brew upgrade --cask && brew cleanup' alias bcubo='brew update && brew outdated --cask' alias brewp='brew pin' alias brewsp='brew list --pinned' -alias bubc='brew upgrade && brew cleanup' +alias bup='brew upgrade' alias bugbc='brew upgrade --greedy && brew cleanup' alias bubo='brew update && brew outdated' -alias bubu='bubo && bubc' +alias bubu='bubo && bup' alias bubug='bubo && bugbc' alias bfu='brew upgrade --formula' alias buz='brew uninstall --zap' From 944203aee3705c94dd6e0fa3469ed33009b1891e Mon Sep 17 00:00:00 2001 From: Alessandro Agnelli Date: Mon, 4 May 2020 15:46:27 +0200 Subject: [PATCH 232/453] feat(brew): add aliases for cask and other commands (#8882) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #8871 Co-authored-by: Marc Cornellà --- plugins/brew/README.md | 18 ++++++++++++++---- plugins/brew/brew.plugin.zsh | 17 ++++++++++++++--- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/plugins/brew/README.md b/plugins/brew/README.md index 9cd9c249d..2d099d742 100644 --- a/plugins/brew/README.md +++ b/plugins/brew/README.md @@ -21,17 +21,27 @@ the `brew` binary before sourcing `oh-my-zsh.sh` and it'll set up the environmen | Alias | Command | Description | | -------- | --------------------------------------- | ------------------------------------------------------------------- | -| `bcubc` | `brew upgrade --cask && brew cleanup` | Update outdated casks, then run cleanup. | +| `bc` | `brew cleanup` | Run cleanup. | +| `bci` | `brew info --cask` | Display information about the given cask. | +| `bcin` | `brew install --cask` | Install the given cask. | +| `bcl` | `brew list --cask` | List installed casks. | +| `bco` | `brew outdated --cask` | Report all outdated casks. | +| `bcrin` | `brew reinstall --cask` | Reinstall the given cask. | +| `bcubc` | `brew upgrade --cask && brew cleanup` | Upgrade outdated casks, then run cleanup. | | `bcubo` | `brew update && brew outdated --cask` | Update Homebrew data, then list outdated casks. | +| `bcup` | `brew upgrade --cask` | Upgrade all outdated casks. | +| `bfu` | `brew upgrade --formula` | Upgrade only formulas (not casks). | +| `bl` | `brew list` | List all installed formulae. | +| `bo` | `brew outdated` | List installed formulae that have an updated version available. | | `brewp` | `brew pin` | Pin a specified formula so that it's not upgraded. | | `brews` | `brew list -1` | List installed formulae or the installed files for a given formula. | | `brewsp` | `brew list --pinned` | List pinned formulae, or show the version of a given formula. | -| `bup` | `brew upgrade` | Upgrade outdated, unpinned brews (with existing install options). | +| `bu` | `brew update` | Update brew and all installed formulae. | | `bubc` | `brew upgrade && brew cleanup` | Upgrade outdated formulae and casks, then run cleanup. | -| `bugbc` | `brew upgrade --greedy && brew cleanup` | Upgrade outdated formulae and casks (greedy), then run cleanup. | | `bubo` | `brew update && brew outdated` | Update Homebrew data, then list outdated formulae and casks. | | `bubu` | `bubo && bup` | Do the last two operations above. | -| `bfu` | `brew upgrade --formula` | Upgrade only formulas (not casks). | +| `bugbc` | `brew upgrade --greedy && brew cleanup` | Upgrade outdated formulae and casks (greedy), then run cleanup. | +| `bup` | `brew upgrade` | Upgrade outdated, unpinned brews. | | `buz` | `brew uninstall --zap` | Remove all files associated with a cask. | ## Completion diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh index f2e7e6cff..717a2d82a 100644 --- a/plugins/brew/brew.plugin.zsh +++ b/plugins/brew/brew.plugin.zsh @@ -34,16 +34,27 @@ if [[ -d "$HOMEBREW_PREFIX/share/zsh/site-functions" ]]; then fpath+=("$HOMEBREW_PREFIX/share/zsh/site-functions") fi +alias bc='brew cleanup' +alias bci='brew info --cask' +alias bcin='brew install --cask' +alias bcl='brew list --cask' +alias bco='brew outdated --cask' +alias bcrin='brew reinstall --cask' alias bcubc='brew upgrade --cask && brew cleanup' alias bcubo='brew update && brew outdated --cask' +alias bcup='brew upgrade --cask' +alias bfu='brew upgrade --formula' +alias bl='brew list' +alias bo='brew outdated' alias brewp='brew pin' alias brewsp='brew list --pinned' -alias bup='brew upgrade' -alias bugbc='brew upgrade --greedy && brew cleanup' +alias bu='brew update' alias bubo='brew update && brew outdated' alias bubu='bubo && bup' alias bubug='bubo && bugbc' -alias bfu='brew upgrade --formula' +alias bugbc='brew upgrade --greedy && brew cleanup' +alias bup='brew upgrade' +alias bup='brew upgrade' alias buz='brew uninstall --zap' function brews() { From 8b6f0b1dfbe2634c5b35f8c03f88edf2fdf20b36 Mon Sep 17 00:00:00 2001 From: Celestino Gomes Date: Fri, 24 Sep 2021 17:12:45 -0300 Subject: [PATCH 233/453] feat(brew): add aliases for `brew services` (#10215) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #10215 Co-authored-by: Marc Cornellà --- plugins/brew/README.md | 55 ++++++++++++++++++++---------------- plugins/brew/brew.plugin.zsh | 7 +++++ 2 files changed, 38 insertions(+), 24 deletions(-) diff --git a/plugins/brew/README.md b/plugins/brew/README.md index 2d099d742..d70fe5842 100644 --- a/plugins/brew/README.md +++ b/plugins/brew/README.md @@ -19,30 +19,37 @@ the `brew` binary before sourcing `oh-my-zsh.sh` and it'll set up the environmen ## Aliases -| Alias | Command | Description | -| -------- | --------------------------------------- | ------------------------------------------------------------------- | -| `bc` | `brew cleanup` | Run cleanup. | -| `bci` | `brew info --cask` | Display information about the given cask. | -| `bcin` | `brew install --cask` | Install the given cask. | -| `bcl` | `brew list --cask` | List installed casks. | -| `bco` | `brew outdated --cask` | Report all outdated casks. | -| `bcrin` | `brew reinstall --cask` | Reinstall the given cask. | -| `bcubc` | `brew upgrade --cask && brew cleanup` | Upgrade outdated casks, then run cleanup. | -| `bcubo` | `brew update && brew outdated --cask` | Update Homebrew data, then list outdated casks. | -| `bcup` | `brew upgrade --cask` | Upgrade all outdated casks. | -| `bfu` | `brew upgrade --formula` | Upgrade only formulas (not casks). | -| `bl` | `brew list` | List all installed formulae. | -| `bo` | `brew outdated` | List installed formulae that have an updated version available. | -| `brewp` | `brew pin` | Pin a specified formula so that it's not upgraded. | -| `brews` | `brew list -1` | List installed formulae or the installed files for a given formula. | -| `brewsp` | `brew list --pinned` | List pinned formulae, or show the version of a given formula. | -| `bu` | `brew update` | Update brew and all installed formulae. | -| `bubc` | `brew upgrade && brew cleanup` | Upgrade outdated formulae and casks, then run cleanup. | -| `bubo` | `brew update && brew outdated` | Update Homebrew data, then list outdated formulae and casks. | -| `bubu` | `bubo && bup` | Do the last two operations above. | -| `bugbc` | `brew upgrade --greedy && brew cleanup` | Upgrade outdated formulae and casks (greedy), then run cleanup. | -| `bup` | `brew upgrade` | Upgrade outdated, unpinned brews. | -| `buz` | `brew uninstall --zap` | Remove all files associated with a cask. | +| Alias | Command | Description | +| -------- | --------------------------------------- | --------------------------------------------------------------------- | +| `bc` | `brew cleanup` | Run cleanup. | +| `bci` | `brew info --cask` | Display information about the given cask. | +| `bcin` | `brew install --cask` | Install the given cask. | +| `bcl` | `brew list --cask` | List installed casks. | +| `bco` | `brew outdated --cask` | Report all outdated casks. | +| `bcrin` | `brew reinstall --cask` | Reinstall the given cask. | +| `bcubc` | `brew upgrade --cask && brew cleanup` | Upgrade outdated casks, then run cleanup. | +| `bcubo` | `brew update && brew outdated --cask` | Update Homebrew data, then list outdated casks. | +| `bcup` | `brew upgrade --cask` | Upgrade all outdated casks. | +| `bfu` | `brew upgrade --formula` | Upgrade only formulas (not casks). | +| `bl` | `brew list` | List all installed formulae. | +| `bo` | `brew outdated` | List installed formulae that have an updated version available. | +| `brewp` | `brew pin` | Pin a specified formula so that it's not upgraded. | +| `brews` | `brew list -1` | List installed formulae or the installed files for a given formula. | +| `brewsp` | `brew list --pinned` | List pinned formulae, or show the version of a given formula. | +| `bsl` | `brew services list` | List all running services. | +| `bsoff` | `brew services stop` | Stop the service and unregister it from launching at login (or boot). | +| `bsoffa` | `bsoff --all` | Stop all started services. | +| `bson` | `brew services start` | Start the service and register it to launch at login (or boot). | +| `bsona` | `bson --all` | Start all stopped services. | +| `bsr` | `brew services run` | Run the service without registering to launch at login (or boot). | +| `bsra` | `bsr --all` | Run all stopped services. | +| `bu` | `brew update` | Update brew and all installed formulae. | +| `bubc` | `brew upgrade && brew cleanup` | Upgrade outdated formulae and casks, then run cleanup. | +| `bubo` | `brew update && brew outdated` | Update Homebrew data, then list outdated formulae and casks. | +| `bubu` | `bubo && bup` | Do the last two operations above. | +| `bugbc` | `brew upgrade --greedy && brew cleanup` | Upgrade outdated formulae and casks (greedy), then run cleanup. | +| `bup` | `brew upgrade` | Upgrade outdated, unpinned brews. | +| `buz` | `brew uninstall --zap` | Remove all files associated with a cask. | ## Completion diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh index 717a2d82a..416c56bb0 100644 --- a/plugins/brew/brew.plugin.zsh +++ b/plugins/brew/brew.plugin.zsh @@ -48,6 +48,13 @@ alias bl='brew list' alias bo='brew outdated' alias brewp='brew pin' alias brewsp='brew list --pinned' +alias bsl='brew services list' +alias bsoff='brew services stop' +alias bsoffa='bsoff --all' +alias bson='brew services start' +alias bsona='bson --all' +alias bsr='brew services run' +alias bsra='bsr --all' alias bu='brew update' alias bubo='brew update && brew outdated' alias bubu='bubo && bup' From 9a0e4f0acabbe3562e0ff1a33c4ac0064f3d196c Mon Sep 17 00:00:00 2001 From: Martin Beentjes Date: Mon, 7 Feb 2022 09:26:12 +0100 Subject: [PATCH 234/453] feat(brew): add `brew install` alias (#10660) Closes #10660 --- plugins/brew/README.md | 1 + plugins/brew/brew.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/brew/README.md b/plugins/brew/README.md index d70fe5842..347bf3546 100644 --- a/plugins/brew/README.md +++ b/plugins/brew/README.md @@ -31,6 +31,7 @@ the `brew` binary before sourcing `oh-my-zsh.sh` and it'll set up the environmen | `bcubo` | `brew update && brew outdated --cask` | Update Homebrew data, then list outdated casks. | | `bcup` | `brew upgrade --cask` | Upgrade all outdated casks. | | `bfu` | `brew upgrade --formula` | Upgrade only formulas (not casks). | +| `bi` | `brew install` | Install a formula. | | `bl` | `brew list` | List all installed formulae. | | `bo` | `brew outdated` | List installed formulae that have an updated version available. | | `brewp` | `brew pin` | Pin a specified formula so that it's not upgraded. | diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh index 416c56bb0..155330c35 100644 --- a/plugins/brew/brew.plugin.zsh +++ b/plugins/brew/brew.plugin.zsh @@ -44,6 +44,7 @@ alias bcubc='brew upgrade --cask && brew cleanup' alias bcubo='brew update && brew outdated --cask' alias bcup='brew upgrade --cask' alias bfu='brew upgrade --formula' +alias bi='brew install' alias bl='brew list' alias bo='brew outdated' alias brewp='brew pin' From 64c2c049aaa7b33673b4d15a69b02ec87b8dd9b8 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Mon, 22 Jul 2024 23:21:02 +0200 Subject: [PATCH 235/453] feat(brew): add `brew autoremove` alias (#12574) Closes #12574 --- plugins/brew/README.md | 3 ++- plugins/brew/brew.plugin.zsh | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/brew/README.md b/plugins/brew/README.md index 347bf3546..fb07ebe10 100644 --- a/plugins/brew/README.md +++ b/plugins/brew/README.md @@ -21,6 +21,7 @@ the `brew` binary before sourcing `oh-my-zsh.sh` and it'll set up the environmen | Alias | Command | Description | | -------- | --------------------------------------- | --------------------------------------------------------------------- | +| `ba` | `brew autoremove` | Uninstall unnecessary formulae. | | `bc` | `brew cleanup` | Run cleanup. | | `bci` | `brew info --cask` | Display information about the given cask. | | `bcin` | `brew install --cask` | Install the given cask. | @@ -30,7 +31,7 @@ the `brew` binary before sourcing `oh-my-zsh.sh` and it'll set up the environmen | `bcubc` | `brew upgrade --cask && brew cleanup` | Upgrade outdated casks, then run cleanup. | | `bcubo` | `brew update && brew outdated --cask` | Update Homebrew data, then list outdated casks. | | `bcup` | `brew upgrade --cask` | Upgrade all outdated casks. | -| `bfu` | `brew upgrade --formula` | Upgrade only formulas (not casks). | +| `bfu` | `brew upgrade --formula` | Upgrade only formulae (not casks). | | `bi` | `brew install` | Install a formula. | | `bl` | `brew list` | List all installed formulae. | | `bo` | `brew outdated` | List installed formulae that have an updated version available. | diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh index 155330c35..52ef3fd57 100644 --- a/plugins/brew/brew.plugin.zsh +++ b/plugins/brew/brew.plugin.zsh @@ -34,6 +34,7 @@ if [[ -d "$HOMEBREW_PREFIX/share/zsh/site-functions" ]]; then fpath+=("$HOMEBREW_PREFIX/share/zsh/site-functions") fi +alias ba='brew autoremove' alias bc='brew cleanup' alias bci='brew info --cask' alias bcin='brew install --cask' From 7303385b1fc7030bef90589c32120f90eb57c3e1 Mon Sep 17 00:00:00 2001 From: Adam Katz <6454774+adamhotep@users.noreply.github.com> Date: Wed, 24 Jul 2024 08:36:08 -0400 Subject: [PATCH 236/453] fix(safe-paste): properly test Zsh version number (#12565) --- plugins/safe-paste/safe-paste.plugin.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/safe-paste/safe-paste.plugin.zsh b/plugins/safe-paste/safe-paste.plugin.zsh index d443ae8a2..c7079059b 100644 --- a/plugins/safe-paste/safe-paste.plugin.zsh +++ b/plugins/safe-paste/safe-paste.plugin.zsh @@ -9,7 +9,8 @@ # https://github.com/zsh-users/zsh/blob/f702e17b14d75aa21bff014168fa9048124db286/Functions/Zle/bracketed-paste-magic#L9-L12 # Load bracketed-paste-magic if zsh version is >= 5.1 -if [[ ${ZSH_VERSION:0:3} -ge 5.1 ]]; then +autoload -Uz is-at-least +if is-at-least 5.1; then set zle_bracketed_paste # Explicitly restore this zsh default autoload -Uz bracketed-paste-magic zle -N bracketed-paste bracketed-paste-magic From 5e957cdc1653dbdc15d48ef316917d80778da4e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 24 Jul 2024 19:47:18 +0200 Subject: [PATCH 237/453] chore: clarify order of preference for reporting vulnerabilities --- SECURITY.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index ae7458ee2..f8235840f 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -17,7 +17,7 @@ In the near future we will introduce versioning, so expect this section to chang **Do not submit an issue or pull request**: this might reveal the vulnerability. -Instead, you should email the maintainers directly at: [**security@ohmyz.sh**](mailto:security@ohmyz.sh), -or using the link to [privately report a vulnerability with GitHub](https://github.com/ohmyzsh/ohmyzsh/security/advisories/new). +Instead, you should use the form to [privately report a vulnerability to us via GitHub](https://github.com/ohmyzsh/ohmyzsh/security/advisories/new) +or email the maintainers directly at: [**security@ohmyz.sh**](mailto:security@ohmyz.sh). We will deal with the vulnerability privately and submit a patch as soon as possible. From f70e6916a1c9aca77e7bd1b976a3f6100752f0a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 27 Jul 2024 14:28:24 +0200 Subject: [PATCH 238/453] fix(lib): turn off `rematchpcre` option in `omz_urlencode` (#12388) Fixes #12388 --- lib/functions.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/functions.zsh b/lib/functions.zsh index f5c671f9c..2e667332e 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -160,6 +160,8 @@ zmodload zsh/langinfo # -P causes spaces to be encoded as '%20' instead of '+' function omz_urlencode() { emulate -L zsh + setopt norematchpcre + local -a opts zparseopts -D -E -a opts r m P From 06ced8274de7c2edd19cd5be4642bb0ec0772437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kayhan=20G=C3=BCltekin?= Date: Sat, 27 Jul 2024 10:38:11 -0400 Subject: [PATCH 239/453] feat(dircycle): add bindings to go up or down in hierarchy (#12291) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marc Cornellà --- plugins/dircycle/README.md | 22 ++++++++------ plugins/dircycle/dircycle.plugin.zsh | 45 ++++++++++++++++++++++++---- 2 files changed, 52 insertions(+), 15 deletions(-) diff --git a/plugins/dircycle/README.md b/plugins/dircycle/README.md index 3c9b3a96f..c4105558d 100644 --- a/plugins/dircycle/README.md +++ b/plugins/dircycle/README.md @@ -37,13 +37,13 @@ Say you opened these directories on the terminal: 3 ~ ``` -By pressing Ctrl + Shift + Left, the current working directory or `$CWD` will be from `oh-my-zsh` to `Hacktoberfest`. Press it again and it will be at `Projects`. +By pressing Ctrl + Shift + Left, the current working directory or `$PWD` will be from `oh-my-zsh` to `Hacktoberfest`. Press it again and it will be at `Projects`. -And by pressing Ctrl + Shift + Right, the `$CWD` will be from `Projects` to `Hacktoberfest`. Press it again and it will be at `oh-my-zsh`. +And by pressing Ctrl + Shift + Right, the `$PWD` will be from `Projects` to `Hacktoberfest`. Press it again and it will be at `oh-my-zsh`. Here's a example history table with the same accessed directories like above: -| Current `$CWD` | Key press | New `$CWD` | +| Current `$PWD` | Key press | New `$PWD` | | --------------- | ----------------------------------------------------- | --------------- | | `oh-my-zsh` | Ctrl + Shift + Left | `Hacktoberfest` | | `Hacktoberfest` | Ctrl + Shift + Left | `Projects` | @@ -53,7 +53,7 @@ Here's a example history table with the same accessed directories like above: | `Hacktoberfest` | Ctrl + Shift + Right | `oh-my-zsh` | | `oh-my-zsh` | Ctrl + Shift + Right | `~` | -Note the last traversal, when pressing Ctrl + Shift + Right on a last known `$CWD`, it will change back to the first known `$CWD`, which in the example is `~`. +Note the last traversal, when pressing Ctrl + Shift + Right on a last known `$PWD`, it will change back to the first known `$PWD`, which in the example is `~`. Here's an asciinema cast demonstrating the example above: @@ -61,18 +61,22 @@ Here's an asciinema cast demonstrating the example above: ## Functions -| Function | Description | -| -------------------- | --------------------------------------------------------------------------------------------------------- | -| `insert-cycledleft` | Change `$CWD` to the previous known stack, binded on Ctrl + Shift + Left | -| `insert-cycledright` | Change `$CWD` to the next known stack, binded on Ctrl + Shift + Right | +| Function | Description | +| -------------------- | ------------------------------------------------------------------------------------------------------------------- | +| `insert-cycledleft` | Change `$PWD` to the previous known stack, bound to Ctrl + Shift + Left | +| `insert-cycledright` | Change `$PWD` to the next known stack, bound to Ctrl + Shift + Right | +| `insert-cycledup` | Change `$PWD` to the parent folder, bound to Ctrl + Shift + Up | +| `insert-cycleddown` | Change `$PWD` to the first alphabetical child folder, bound to Ctrl + Shift + Down | ## Rebinding keys -You can bind these functions to other key sequences, as long as you know the bindkey sequence. For example, these commands bind to Alt + Shift + Left / Right in `xterm-256color`: +You can bind these functions to other key sequences, as long as you know the bindkey sequence. For example, these commands bind to Alt + Shift + key in `xterm-256color`: ```zsh bindkey '^[[1;4D' insert-cycledleft bindkey '^[[1;4C' insert-cycledright +bindkey "\e[1;4A" insert-cycledup +bindkey "\e[1;4B" insert-cycleddown ``` You can get the bindkey sequence by pressing Ctrl + V, then pressing the keyboard shortcut you want to use. diff --git a/plugins/dircycle/dircycle.plugin.zsh b/plugins/dircycle/dircycle.plugin.zsh index bb69f6b3f..8c03594ba 100644 --- a/plugins/dircycle/dircycle.plugin.zsh +++ b/plugins/dircycle/dircycle.plugin.zsh @@ -8,7 +8,16 @@ # pushd +N: start counting from left of `dirs' output # pushd -N: start counting from right of `dirs' output +# Either switch to a directory from dirstack, using +N or -N syntax +# or switch to a directory by path, using `switch-to-dir -- ` switch-to-dir () { + # If $1 is --, then treat $2 as a directory path + if [[ $1 == -- ]]; then + # We use `-q` because we don't want chpwd to run, we'll do it manually + [[ -d "$2" ]] && builtin pushd -q "$2" &>/dev/null + return $? + fi + setopt localoptions nopushdminus [[ ${#dirstack} -eq 0 ]] && return 1 @@ -22,10 +31,10 @@ switch-to-dir () { } insert-cycledleft () { - switch-to-dir +1 || return + switch-to-dir +1 || return $? local fn - for fn (chpwd $chpwd_functions precmd $precmd_functions); do + for fn in chpwd $chpwd_functions precmd $precmd_functions; do (( $+functions[$fn] )) && $fn done zle reset-prompt @@ -33,22 +42,46 @@ insert-cycledleft () { zle -N insert-cycledleft insert-cycledright () { - switch-to-dir -0 || return + switch-to-dir -0 || return $? local fn - for fn (chpwd $chpwd_functions precmd $precmd_functions); do + for fn in chpwd $chpwd_functions precmd $precmd_functions; do (( $+functions[$fn] )) && $fn done zle reset-prompt } zle -N insert-cycledright +insert-cycledup () { + switch-to-dir -- .. || return $? + + local fn + for fn in chpwd $chpwd_functions precmd $precmd_functions; do + (( $+functions[$fn] )) && $fn + done + zle reset-prompt +} +zle -N insert-cycledup + +insert-cycleddown () { + switch-to-dir -- "$(find . -mindepth 1 -maxdepth 1 -type d | sort -n | head -n 1)" || return $? + + local fn + for fn in chpwd $chpwd_functions precmd $precmd_functions; do + (( $+functions[$fn] )) && $fn + done + zle reset-prompt +} +zle -N insert-cycleddown # These sequences work for xterm, Apple Terminal.app, and probably others. # Not for rxvt-unicode, but it doesn't seem differentiate Ctrl-Shift-Arrow # from plain Shift-Arrow, at least by default. +# # iTerm2 does not have these key combinations defined by default; you will need # to add them under "Keys" in your profile if you want to use this. You can do # this conveniently by loading the "xterm with Numeric Keypad" preset. -bindkey "\e[1;6D" insert-cycledleft -bindkey "\e[1;6C" insert-cycledright +bindkey "\e[1;6D" insert-cycledleft # Ctrl+Shift+Left +bindkey "\e[1;6C" insert-cycledright # Ctrl+Shift+Right +bindkey "\e[1;6A" insert-cycledup # Ctrl+Shift+Up +bindkey "\e[1;6B" insert-cycleddown # Ctrl+Shift+Down From 0a9a80a524ca277ed6573e233204806f800a9292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 27 Jul 2024 16:44:20 +0200 Subject: [PATCH 240/453] fix(brew): rename `bc` alias to `bcn` to avoid conflict with command (#12582) Fixes #12582 --- plugins/brew/README.md | 2 +- plugins/brew/brew.plugin.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/brew/README.md b/plugins/brew/README.md index fb07ebe10..c952bfdb9 100644 --- a/plugins/brew/README.md +++ b/plugins/brew/README.md @@ -22,10 +22,10 @@ the `brew` binary before sourcing `oh-my-zsh.sh` and it'll set up the environmen | Alias | Command | Description | | -------- | --------------------------------------- | --------------------------------------------------------------------- | | `ba` | `brew autoremove` | Uninstall unnecessary formulae. | -| `bc` | `brew cleanup` | Run cleanup. | | `bci` | `brew info --cask` | Display information about the given cask. | | `bcin` | `brew install --cask` | Install the given cask. | | `bcl` | `brew list --cask` | List installed casks. | +| `bcn` | `brew cleanup` | Run cleanup. | | `bco` | `brew outdated --cask` | Report all outdated casks. | | `bcrin` | `brew reinstall --cask` | Reinstall the given cask. | | `bcubc` | `brew upgrade --cask && brew cleanup` | Upgrade outdated casks, then run cleanup. | diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh index 52ef3fd57..9a9b58d85 100644 --- a/plugins/brew/brew.plugin.zsh +++ b/plugins/brew/brew.plugin.zsh @@ -35,10 +35,10 @@ if [[ -d "$HOMEBREW_PREFIX/share/zsh/site-functions" ]]; then fi alias ba='brew autoremove' -alias bc='brew cleanup' alias bci='brew info --cask' alias bcin='brew install --cask' alias bcl='brew list --cask' +alias bcn='brew cleanup' alias bco='brew outdated --cask' alias bcrin='brew reinstall --cask' alias bcubc='brew upgrade --cask && brew cleanup' From 01a955657408c8396fc947075a912ee868d5e2a7 Mon Sep 17 00:00:00 2001 From: 0x07CB <83157348+0x07CB@users.noreply.github.com> Date: Sun, 28 Jul 2024 11:06:44 +0200 Subject: [PATCH 241/453] chore: use `uname` in ARCHFLAGS in .zshrc template (#12563) --- templates/zshrc.zsh-template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 89fd0780e..930015798 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -89,7 +89,7 @@ source $ZSH/oh-my-zsh.sh # fi # Compilation flags -# export ARCHFLAGS="-arch x86_64" +# export ARCHFLAGS="-arch $(uname -m)" # Set personal aliases, overriding those provided by Oh My Zsh libs, # plugins, and themes. Aliases can be placed here, though Oh My Zsh From d525e80355597d752f941edfe0415b3ae881a774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 30 Jul 2024 23:21:42 +0200 Subject: [PATCH 242/453] chore: fix ordering of sections in README --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index e9a571a37..dc4f36864 100644 --- a/README.md +++ b/README.md @@ -362,6 +362,15 @@ Instead, you can now use the following: zstyle ':omz:lib:directories' aliases no ``` +#### Notice + +> This feature is currently in a testing phase and it may be subject to change in the future. +> It is also not currently compatible with plugin managers such as zpm or zinit, which don't +> source the init script (`oh-my-zsh.sh`) where this feature is implemented in. + +> It is also not currently aware of "aliases" that are defined as functions. Example of such +> are `gccd`, `ggf`, or `ggl` functions from the git plugin. + ### 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 @@ -373,15 +382,6 @@ before Oh My Zsh is sourced: 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. -> It is also not currently compatible with plugin managers such as zpm or zinit, which don't -> source the init script (`oh-my-zsh.sh`) where this feature is implemented in. - -> It is also not currently aware of "aliases" that are defined as functions. Example of such -> are `gccd`, `ggf`, or `ggl` functions from the git plugin. - ## Getting Updates By default, you will be prompted to check for updates every 2 weeks. You can choose other update modes by adding a line to your `~/.zshrc` file, **before Oh My Zsh is loaded**: From 44ea99e7b9536a94da60397a2b0fc1a0c8457f96 Mon Sep 17 00:00:00 2001 From: Jonas Geiregat <288105+jonas-grgt@users.noreply.github.com> Date: Thu, 1 Aug 2024 09:01:34 +0200 Subject: [PATCH 243/453] feat(git): fetch tags in `gfa` alias (#12558) --- plugins/git/README.md | 2 +- plugins/git/git.plugin.zsh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/git/README.md b/plugins/git/README.md index c10f1d88e..bcd9aca96 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -89,7 +89,7 @@ plugins=(... git) | `gdnolock` | `git diff $@ ":(exclude)package-lock.json" ":(exclude)\*.lock"` | | `gdt` | `git diff-tree --no-commit-id --name-only -r` | | `gf` | `git fetch` | -| `gfa` | `git fetch --all --prune` | +| `gfa` | `git fetch --all --tags --prune` | | `gfo` | `git fetch origin` | | `gg` | `git gui citool` | | `gga` | `git gui citool --amend` | diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 99fcc4d07..0a26399a2 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -220,8 +220,8 @@ alias gdt='git diff-tree --no-commit-id --name-only -r' alias gf='git fetch' # --jobs= was added in git 2.8 is-at-least 2.8 "$git_version" \ - && alias gfa='git fetch --all --prune --jobs=10' \ - || alias gfa='git fetch --all --prune' + && alias gfa='git fetch --all --tags --prune --jobs=10' \ + || alias gfa='git fetch --all --tags --prune' alias gfo='git fetch origin' alias gg='git gui citool' alias gga='git gui citool --amend' From 22bda7799b1e1500a701e1a55a189c77119e9e5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 1 Aug 2024 10:00:58 +0200 Subject: [PATCH 244/453] fix(kubectx): fix display of k8s contexts without double quotes (#12534) BREAKING CHANGE: the `kubectx` plugin now properly displays contexts from the kubectx_mapping array, without using double quotes. Please refer to the plugin README to see how to use it properly. Closes #12534 Co-authored-by: Ken Kelly --- plugins/kubectx/README.md | 48 ++++++++++++++++++++++++------ plugins/kubectx/kubectx.plugin.zsh | 8 +++-- 2 files changed, 44 insertions(+), 12 deletions(-) diff --git a/plugins/kubectx/README.md b/plugins/kubectx/README.md index d924e745c..e3987b42f 100644 --- a/plugins/kubectx/README.md +++ b/plugins/kubectx/README.md @@ -1,25 +1,55 @@ # kubectx - show active kubectl context -This plugins adds ```kubectx_prompt_info()``` function. It shows name of the -active kubectl context (```kubectl config current-context```). +This plugins adds `kubectx_prompt_info()` function. It shows name of the active +kubectl context (`kubectl config current-context`). You can use it to customize prompt and know if You are on prod cluster ;) -_Example_. Add to **.zshrc**: +To use this plugin, add `kubectx` to the plugins array in your zshrc file: +```zsh +plugins=(... kubectx) ``` + +### Usage + +Add to **.zshrc**: + +```zsh +# right prompt RPS1='$(kubectx_prompt_info)' +# left prompt +PROMPT="$PROMPT"'$(kubectx_prompt_info)' ``` -### custom ctx names +### Custom context names -One can rename default context name for better readability. +You can rename the default context name for better readability or additional formatting. +These values accept [prompt expansion sequences](http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html) +such as `%F{color}`, `%f`, `%K{color}`, `%k`, `%B`, `%b`, `%U`, `%u`, `%S`, `%s`, `%{...%}`. -_Example_. Add to **.zshrc**: +**Example**: add this to your .zshrc file: + +```zsh +kubectx_mapping[minikube]="mini" +kubectx_mapping[context_name_from_kubeconfig]="$emoji[wolf_face]" +kubectx_mapping[production_cluster]="%{$fg[yellow]%}prod!%{$reset_color%}" +# contexts with spaces +kubectx_mapping[context\ with\ spaces]="%F{red}spaces%f" +# don't use quotes as it will break the prompt +kubectx_mapping["context with spaces"]="%F{red}spaces%f" # ti ``` -kubectx_mapping["minikube"]="mini" -kubectx_mapping["context_name_from_kubeconfig"]="$emoji[wolf_face]" -kubectx_mapping["production_cluster"]="%{$fg[yellow]%}prod!%{$reset_color%}" + +You can also define the whole mapping array at once: + +```zsh +typeset -A kubectx_mapping +kubectx_mapping=( + minikube "mini" + context_name_from_kubeconfig "$emoji[wolf_face]" + production_cluster "%{$fg[yellow]%}prod!%{$reset_color%}" + "context with spaces" "%F{red}spaces%f" +) ``` ![staging](stage.png) diff --git a/plugins/kubectx/kubectx.plugin.zsh b/plugins/kubectx/kubectx.plugin.zsh index a3210facc..f1ca990ad 100644 --- a/plugins/kubectx/kubectx.plugin.zsh +++ b/plugins/kubectx/kubectx.plugin.zsh @@ -7,7 +7,9 @@ function kubectx_prompt_info() { [[ -n "$current_ctx" ]] || return - # use value in associative array if it exists - # otherwise fall back to the context name - echo "${kubectx_mapping[\"$current_ctx\"]:-${current_ctx:gs/%/%%}}" + # Use value in associative array if it exists, otherwise fall back to the context name + # + # Note: we need to escape the % character in the prompt string when coming directly from + # the context name, as it could contain a % character. + echo "${kubectx_mapping[$current_ctx]:-${current_ctx:gs/%/%%}}" } From bc337e9a9e45d35d58d11c7ac2429ffc19cfbdd6 Mon Sep 17 00:00:00 2001 From: 13steinj <13steinj@users.noreply.github.com> Date: Thu, 1 Aug 2024 10:17:57 -0500 Subject: [PATCH 245/453] docs(brew): remove reference to bubc (#12592) --- plugins/brew/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/brew/README.md b/plugins/brew/README.md index c952bfdb9..fccda65b9 100644 --- a/plugins/brew/README.md +++ b/plugins/brew/README.md @@ -46,7 +46,6 @@ the `brew` binary before sourcing `oh-my-zsh.sh` and it'll set up the environmen | `bsr` | `brew services run` | Run the service without registering to launch at login (or boot). | | `bsra` | `bsr --all` | Run all stopped services. | | `bu` | `brew update` | Update brew and all installed formulae. | -| `bubc` | `brew upgrade && brew cleanup` | Upgrade outdated formulae and casks, then run cleanup. | | `bubo` | `brew update && brew outdated` | Update Homebrew data, then list outdated formulae and casks. | | `bubu` | `bubo && bup` | Do the last two operations above. | | `bugbc` | `brew upgrade --greedy && brew cleanup` | Upgrade outdated formulae and casks (greedy), then run cleanup. | From 2527959e79432bb28269840e5b8b81ef3acf187a Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 1 Aug 2024 19:55:05 +0200 Subject: [PATCH 246/453] fix(vi-mode): don't overwrite settings Closes #11673 --- plugins/vi-mode/vi-mode.plugin.zsh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh index 5c104f7bb..85208cfc9 100644 --- a/plugins/vi-mode/vi-mode.plugin.zsh +++ b/plugins/vi-mode/vi-mode.plugin.zsh @@ -18,12 +18,12 @@ typeset -g VI_MODE_SET_CURSOR # if $VI_MODE_SET_CURSOR=true. # # See https://vt100.net/docs/vt510-rm/DECSCUSR for cursor styles -typeset -g VI_MODE_CURSOR_NORMAL=2 -typeset -g VI_MODE_CURSOR_VISUAL=6 -typeset -g VI_MODE_CURSOR_INSERT=6 -typeset -g VI_MODE_CURSOR_OPPEND=0 +typeset -g VI_MODE_CURSOR_NORMAL=${VI_MODE_CURSOR_NORMAL:=2} +typeset -g VI_MODE_CURSOR_VISUAL=${VI_MODE_CURSOR_VISUAL:=6} +typeset -g VI_MODE_CURSOR_INSERT=${VI_MODE_CURSOR_INSERT:=6} +typeset -g VI_MODE_CURSOR_OPPEND=${VI_MODE_CURSOR_OPPEND:=0} -typeset -g VI_KEYMAP=main +typeset -g VI_KEYMAP=${VI_KEYMAP:=main} function _vi-mode-set-cursor-shape-for-keymap() { [[ "$VI_MODE_SET_CURSOR" = true ]] || return @@ -162,9 +162,7 @@ if [[ -z "${VI_MODE_DISABLE_CLIPBOARD:-}" ]]; then fi # if mode indicator wasn't setup by theme, define default, we'll leave INSERT_MODE_INDICATOR empty by default -if [[ -z "$MODE_INDICATOR" ]]; then - MODE_INDICATOR='%B%F{red}<%b<<%f' -fi +typeset -g MODE_INDICATOR=${MODE_INDICATOR:='%B%F{red}<%b<<%f'} function vi_mode_prompt_info() { echo "${${VI_KEYMAP/vicmd/$MODE_INDICATOR}/(main|viins)/$INSERT_MODE_INDICATOR}" From 5c532a85cf7c4f1d5bf6b9fd35e964b4545c8de3 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 1 Aug 2024 20:07:55 +0200 Subject: [PATCH 247/453] fix(pyenv)!: do not load if a virtualenv is present BREAKING CHANGE: `pyenv` will not be loaded at startup anymore if a virtual env if found to avoid overwriting the expected python version. Closes #12589 --- plugins/pyenv/README.md | 2 +- plugins/pyenv/pyenv.plugin.zsh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/pyenv/README.md b/plugins/pyenv/README.md index f18fc8cfb..95d79cb52 100644 --- a/plugins/pyenv/README.md +++ b/plugins/pyenv/README.md @@ -2,7 +2,7 @@ This plugin looks for [pyenv](https://github.com/pyenv/pyenv), a Simple Python version management system, and loads it if it's found. It also loads pyenv-virtualenv, a pyenv -plugin to manage virtualenv, if it's found. +plugin to manage virtualenv, if it's found. If a venv is found pyenv won't load. To use it, add `pyenv` to the plugins array in your zshrc file: diff --git a/plugins/pyenv/pyenv.plugin.zsh b/plugins/pyenv/pyenv.plugin.zsh index 48c8ffaf5..b5c9a7bd3 100644 --- a/plugins/pyenv/pyenv.plugin.zsh +++ b/plugins/pyenv/pyenv.plugin.zsh @@ -1,3 +1,7 @@ +# if there is a virtualenv already loaded pyenv should not be loaded +# see https://github.com/ohmyzsh/ohmyzsh/issues/12589 +[[ -n ${VIRTUAL_ENV:-} ]] && return + pyenv_config_warning() { [[ "$ZSH_PYENV_QUIET" != true ]] || return 0 From 432596e9918dd0fea65af8c1788a54130a4fca6e Mon Sep 17 00:00:00 2001 From: Alessio Perugini Date: Thu, 1 Aug 2024 20:30:25 +0200 Subject: [PATCH 248/453] feat(arduino-cli): add completion plugin (#12522) --- plugins/arduino-cli/README.md | 8 ++++++++ plugins/arduino-cli/arduino-cli.plugin.zsh | 14 ++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 plugins/arduino-cli/README.md create mode 100644 plugins/arduino-cli/arduino-cli.plugin.zsh diff --git a/plugins/arduino-cli/README.md b/plugins/arduino-cli/README.md new file mode 100644 index 000000000..91bda9067 --- /dev/null +++ b/plugins/arduino-cli/README.md @@ -0,0 +1,8 @@ +# Arduino CLI plugin + +This plugin adds completion for the [arduino-cli](https://github.com/arduino/arduino-cli) tool. +To use it, add `arduino-cli` to the plugins array in your zshrc file: + +```zsh +plugins=(... arduino-cli) +``` diff --git a/plugins/arduino-cli/arduino-cli.plugin.zsh b/plugins/arduino-cli/arduino-cli.plugin.zsh new file mode 100644 index 000000000..e4fdcf9fe --- /dev/null +++ b/plugins/arduino-cli/arduino-cli.plugin.zsh @@ -0,0 +1,14 @@ +if (( ! $+commands[arduino-cli] )); then + return +fi + +# If the completion file doesn't exist yet, we need to autoload it and +# bind it to `arduino-cli`. Otherwise, compinit will have already done that. +if [[ ! -f "$ZSH_CACHE_DIR/completions/_arduino-cli" ]]; then + typeset -g -A _comps + autoload -Uz _arduino-cli + _comps[arduino-cli]=_arduino-cli +fi + +# Generate and load arduino-cli completion +arduino-cli completion zsh >! "$ZSH_CACHE_DIR/completions/_arduino-cli" &| From 0f752036988f7acc25c3ac87e1f6e268bb15e742 Mon Sep 17 00:00:00 2001 From: Alvin Crespo Date: Thu, 1 Aug 2024 14:35:49 -0400 Subject: [PATCH 249/453] feat(docker): add image prune alias (#12520) Co-authored-by: Carlo Sala --- plugins/docker/README.md | 1 + plugins/docker/docker.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/docker/README.md b/plugins/docker/README.md index 72ebbcb1e..8619125a2 100644 --- a/plugins/docker/README.md +++ b/plugins/docker/README.md @@ -51,6 +51,7 @@ zstyle ':omz:plugins:docker' legacy-completion yes | dii | `docker image inspect` | Display detailed information on one or more images | | dils | `docker image ls` | List docker images | | dipu | `docker image push` | Push an image or repository to a remote registry | +| dipru | `docker image prune -a` | Remove all images not referenced by any container | | dirm | `docker image rm` | Remove one or more images | | dit | `docker image tag` | Add a name and tag to a particular image | | dlo | `docker container logs` | Fetch the logs of a docker container | diff --git a/plugins/docker/docker.plugin.zsh b/plugins/docker/docker.plugin.zsh index 56dbc6b80..19269427e 100644 --- a/plugins/docker/docker.plugin.zsh +++ b/plugins/docker/docker.plugin.zsh @@ -6,6 +6,7 @@ alias dib='docker image build' alias dii='docker image inspect' alias dils='docker image ls' alias dipu='docker image push' +alias dipru='docker image prune -a' alias dirm='docker image rm' alias dit='docker image tag' alias dlo='docker container logs' From 2cb403e89f618548b340181b5690639768305aad Mon Sep 17 00:00:00 2001 From: SpeakinTelnet <105018871+SpeakinTelnet@users.noreply.github.com> Date: Fri, 2 Aug 2024 10:37:00 -0400 Subject: [PATCH 250/453] feat(toolbox): add function to show toolbox name (#12594) Co-authored-by: Carlo Sala --- plugins/toolbox/README.md | 13 ++++++++----- plugins/toolbox/toolbox.plugin.zsh | 4 ++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/plugins/toolbox/README.md b/plugins/toolbox/README.md index bc04a906b..d957d9bc4 100644 --- a/plugins/toolbox/README.md +++ b/plugins/toolbox/README.md @@ -10,7 +10,8 @@ plugins=(... toolbox) ## Prompt function -This plugins adds `toolbox_prompt_info()` function. Using it in your prompt, it will show the toolbox indicator ⬢ (if you are running in a toolbox container), and nothing if not. +This plugins adds `toolbox_prompt_info()` function. Using it in your prompt, it will show the toolbox +indicator ⬢ (if you are running in a toolbox container), and nothing if not. You can use it by adding `$(toolbox_prompt_info)` to your `PROMPT` or `RPROMPT` variable: @@ -18,9 +19,11 @@ You can use it by adding `$(toolbox_prompt_info)` to your `PROMPT` or `RPROMPT` RPROMPT='$(toolbox_prompt_info)' ``` +In the same way, it adds `toolbox_prompt_name()`, showing the name of the containerized environment. + ## Aliases -| Alias | Command | Description | -|-------|----------------------|----------------------------------------| -| tbe | `toolbox enter` | Enters the toolbox environment | -| tbr | `toolbox run` | Run a command in an existing toolbox | +| Alias | Command | Description | +| ----- | --------------- | ------------------------------------ | +| tbe | `toolbox enter` | Enters the toolbox environment | +| tbr | `toolbox run` | Run a command in an existing toolbox | diff --git a/plugins/toolbox/toolbox.plugin.zsh b/plugins/toolbox/toolbox.plugin.zsh index 377e498cd..031c0f754 100644 --- a/plugins/toolbox/toolbox.plugin.zsh +++ b/plugins/toolbox/toolbox.plugin.zsh @@ -2,5 +2,9 @@ function toolbox_prompt_info() { [[ -f /run/.toolboxenv ]] && echo "⬢" } +function toolbox_prompt_name() { + [[ -f /run/.containerenv ]] && cat /run/.containerenv | awk -F\" '/name/ { print$2 }' +} + alias tbe="toolbox enter" alias tbr="toolbox run" From 3b5f018f7025a347e4888408b566caeaef2fabd7 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Fri, 2 Aug 2024 17:00:55 +0200 Subject: [PATCH 251/453] fix(toolbox): avoid prompt injection --- plugins/toolbox/toolbox.plugin.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/toolbox/toolbox.plugin.zsh b/plugins/toolbox/toolbox.plugin.zsh index 031c0f754..b9a594c09 100644 --- a/plugins/toolbox/toolbox.plugin.zsh +++ b/plugins/toolbox/toolbox.plugin.zsh @@ -3,7 +3,9 @@ function toolbox_prompt_info() { } function toolbox_prompt_name() { - [[ -f /run/.containerenv ]] && cat /run/.containerenv | awk -F\" '/name/ { print$2 }' + [[ -f /run/.containerenv ]] || return + local _to_print="$(cat /run/.containerenv | awk -F\" '/name/ { print$2 }')" + echo ${_to_print:gs/%/%%} } alias tbe="toolbox enter" From e83c10e0a0737921b0ed26ce1ad64f366a6200b0 Mon Sep 17 00:00:00 2001 From: "Philip H." <47042125+pheiduck@users.noreply.github.com> Date: Sun, 4 Aug 2024 12:58:43 +0200 Subject: [PATCH 252/453] chore(brew): duplicated alias (#12596) --- plugins/brew/brew.plugin.zsh | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh index 9a9b58d85..a138a4827 100644 --- a/plugins/brew/brew.plugin.zsh +++ b/plugins/brew/brew.plugin.zsh @@ -63,7 +63,6 @@ alias bubu='bubo && bup' alias bubug='bubo && bugbc' alias bugbc='brew upgrade --greedy && brew cleanup' alias bup='brew upgrade' -alias bup='brew upgrade' alias buz='brew uninstall --zap' function brews() { From 0ffcc3b68a1196e9164ff42fac8a5fdd4804abd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 4 Aug 2024 18:59:42 +0200 Subject: [PATCH 253/453] style(toolbox): use oneliner to extract and quote container name --- plugins/toolbox/toolbox.plugin.zsh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/toolbox/toolbox.plugin.zsh b/plugins/toolbox/toolbox.plugin.zsh index b9a594c09..efe3836f7 100644 --- a/plugins/toolbox/toolbox.plugin.zsh +++ b/plugins/toolbox/toolbox.plugin.zsh @@ -4,8 +4,12 @@ function toolbox_prompt_info() { function toolbox_prompt_name() { [[ -f /run/.containerenv ]] || return - local _to_print="$(cat /run/.containerenv | awk -F\" '/name/ { print$2 }')" - echo ${_to_print:gs/%/%%} + + # This command reads the /run/.containerenv file line by line and extracts the + # container name from it by looking for the `name="..."` line, and uses -F\" to + # split the line by double quotes. Then all % characters are replaced with %% + # to escape them for the prompt. + awk -F\" '/name/ { gsub(/%/, "%%", $2); print $2 }' /run/.containerenv } alias tbe="toolbox enter" From f91dd252838ceceaa54da95ff6d335e07d335e3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 8 Aug 2024 20:40:13 +0200 Subject: [PATCH 254/453] refactor(vault)!: remove deprecated `vault` plugin in favor of official completion BREAKING CHANGE: the `vault` plugin added completion for the `vault` CLI. Since a while back there is already official completion. This change removes the deprecated plugin. --- plugins/vault/README.md | 15 -- plugins/vault/_vault | 400 ---------------------------------------- 2 files changed, 415 deletions(-) delete mode 100644 plugins/vault/README.md delete mode 100644 plugins/vault/_vault diff --git a/plugins/vault/README.md b/plugins/vault/README.md deleted file mode 100644 index 69051d2b2..000000000 --- a/plugins/vault/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Vault plugin - -Note: this plugin is deprecated. Use the [official autocompletion](https://www.vaultproject.io/docs/commands/index.html#autocompletion) instead. - -------- - -Adds autocomplete options for all [vault](https://www.vaultproject.io) commands. - -To use it, add `vault` to the plugins array in your zshrc file: - -```zsh -plugins=(... vault) -``` - -Crafted with <3 by Valentin Bud ([@valentinbud](https://twitter.com/valentinbud)) diff --git a/plugins/vault/_vault b/plugins/vault/_vault deleted file mode 100644 index f6bd3517e..000000000 --- a/plugins/vault/_vault +++ /dev/null @@ -1,400 +0,0 @@ -#compdef vault - -typeset -a main_args -main_args=( - '(-version)-version[Prints the Vault version]' - '(-help)-help[Prints Vault Help]' -) - -typeset -a general_args -general_args=( - '(-help)-help[Prints Help]' - '(-address)-address=-[The address of the Vault server. Overrides the VAULT_ADDR environment variable if set.]:address:' - '(-ca-cert)-ca-cert=-[Path to a PEM encoded CA cert file to use to verify the Vault server SSL certificate. Overrides the VAULT_CACERT environment variable if set.]:file:_files -g "*.pem"' - '(-ca-path)-ca-path=-[Path to a directory of PEM encoded CA cert files to verify the Vault server SSL certificate. If both -ca-cert and -ca-path are specified, -ca-path is used.Overrides the VAULT_CAPATH environment variable if set.]:directory:_directories' - '(-client-cert)-client-cert=-[Path to a PEM encoded client certificate for TLS authentication to the Vault server. Must also specify -client-key. Overrides the VAULT_CLIENT_CERT environment variable if set.]:file:_files -g "*.pem"' - '(-client-key)-client-key=-[Path to an unencrypted PEM encoded private key matching the client certificate from -client-cert. Overrides the VAULT_CLIENT_KEY environment variable if set.]:file:_files -g "*.pem"' - '(-tls-skip-verify)-tls-skip-verify[Do not verify TLS certificate. This is highly not recommended. Verification will also be skipped if VAULT_SKIP_VERIFY is set.]' -) - -typeset -a audit_enable_args -audit_enable_args=( - '(-description)-description=-[A human-friendly description for the backend. This shows up only when querying the enabled backends.]:description:' - '(-id)-id=-[Specify a unique ID for this audit backend. This is purely for referencing this audit backend. By default this will be the backend type.]:id:' -) - -typeset -a auth_args -auth_args=( - '(-method)-method=-[Outputs help for the authentication method with the given name for the remote server. If this authentication method is not available, exit with code 1.]:method:(cert ldap github userpass app-id)' - '(-method-help)-method-help[If set, the help for the selected method will be shown.]' - '(-methods)-methods[List the available auth methods.]' - '(-no-verify)-no-verify[Do not verify the token after creation; avoids a use count]' -) - -typeset -a auth_enable_args -auth_enable_args=( - '(-description)-description=-[Human-friendly description of the purpose for the auth provider. This shows up in the auth-list command.]:description:' - '(-path)-path=-[Mount point for the auth provider. This defaults to the type of the mount. This will make the auth provider available at "/auth/"]:path:' -) - -typeset -a init_args -init_args=( - '(-key-shares)-key-shares=-[(default: 5) The number of key shares to split the master key into.]:keyshares:' - '(-key-threshold)-key-threshold=-[(default: 3) The number of key shares required to reconstruct the master key.]:keythreshold:' - '(-pgp-keys)-pgp-keys[If provided, must be a comma-separated list of files on disk containing binary- or base64-format public PGP keys. The number of files must match "key-shares". The output unseal keys will encrypted and hex-encoded, in order, with the given public keys. If you want to use them with the "vault unseal" command, you will need to hex decode and decrypt; this will be the plaintext unseal key.]:pgpkeys:_files' -) - -typeset -a mount_tune_args -mount_tune_args=( - '(-default-lease-ttl)-default-lease-ttl=-[Default lease time-to-live for this backend. If not specified, uses the system default, or the previously set value. Set to "system" to explicitly set it to use the system default.]:defaultleasettl:' - '(-max-lease-ttl)-max-lease-ttl=-[Max lease time-to-live for this backend. If not specified, uses the system default, or the previously set value. Set to "system" to explicitly set it to use the system default.]:maxleasettl:' -) - -typeset -a mount_args -mount_args=( - $mount_tune_args - '(-path)-path=-[Mount point for the logical backend. This defaults to the type of the mount.]:path:' - '(-description)-description=-[Human-friendly description of the purpose for the mount. This shows up in the mounts command.]:description:' -) - -typeset -a rekey_args -rekey_args=( - $init_args - '(-init)-init[Initialize the rekey operation by setting the desired number of shares and the key threshold. This can only be done if no rekey is already initiated.]:init:' - '(-cancel)-cancel[Reset the rekey process by throwing away prior keys and the rekey configuration.]:cancel:' - '(-status)-status[Prints the status of the current rekey operation. This can be used to see the status without attempting to provide an unseal key.]:status:' -) - -typeset -a ssh_args -ssh_args=( - '(-role)-role[Role to be used to create the key. ]:role:' - '(-no-exec)-no-exec[Shows the credentials but does not establish connection.]:noexec:' - '(-mount-point)-mount-point[Mount point of SSH backend. If the backend is mounted at "ssh", which is the default as well, this parameter can be skipped.]:mountpoint:' - '(-format)-format[If no-exec option is enabled, then the credentials will be printed out and SSH connection will not be established. The format of the output can be "json" or "table". JSON output is useful when writing scripts. Default is "table".]:format:(json table)' -) - -typeset -a token_create_args -token_create_args=( - '(-id)-id=-[The token value that clients will use to authenticate with vault. If not provided this defaults to a 36 character UUID. A root token is required to specify the ID of a token.]:id:' - '(-display-name)-display-name=-[A display name to associate with this token. This is a non-security sensitive value used to help identify created secrets, i.e. prefixes.]:displayname:' - '(-ttl)-ttl=-[TTL to associate with the token. This option enables the tokens to be renewable.]:ttl:' - '*-metadata=-[Metadata to associate with the token. This shows up in the audit log. This can be specified multiple times.]:metadata:' - '(-orphan)-orphan[If specified, the token will have no parent. Only root tokens can create orphan tokens. This prevents the new token from being revoked with your token.]:orphan:' - '(-no-default-policy)-no-default-policy[If specified, the token will not have the "default" policy included in its policy set.]:nodefaultpolicy:' - '*-policy=-[Policy to associate with this token. This can be specified multiple times.]:policy:__vault_policies' - '(-use-limit)-use-limit=-[The number of times this token can be used until it is automatically revoked.]:uselimit:' - '(-format)-format=-[The format for output. By default it is a whitespace-delimited table. This can also be json.]:format:(json table)' -) - -typeset -a server_args -server_args=( - '*-config=-[Path to the configuration file or directory. This can be specified multiple times. If it is a directory, all files with a ".hcl" or ".json" suffix will be loaded.]:config:_files' - '-dev[Enables Dev mode. In this mode, Vault is completely in-memory and unsealed. Do not run the Dev server in production!]:dev:' - '-log-level=-[Log verbosity. Defaults to "info", will be outputtedto stderr. Supported values: "trace", "debug", "info", "warn", "err"]:loglevel:(trace debug info warn err)' -) - -_vault_audit-list() { - _arguments : \ - ${general_args[@]} && ret=0 -} - -_vault_audit-disable() { - # vault audit-list doesn't print the backend id so for now - # no *smart* autocompletion for this subcommand. - _arguments : \ - ${general_args[@]} \ - ':::(file syslog)' && ret=0 -} - -_vault_audit-enable() { - _arguments : \ - ${general_args[@]} \ - ${audit_enable_args[@]} \ - ': :->backends' \ - '*:: :->backendconfig' && ret=0 - - case $state in - backends) - local -a backends - backends=( - 'file:The "file" audit backend writes audit logs to a file.' - 'syslog:The "syslog" audit backend writes audit logs to syslog.' - ) - _describe -t backends 'vault audit backends' backends && ret=0 - ;; - backendconfig) - case ${line[1]} in - file) - _values -w "Audit Backend File" \ - 'path[(required) - The path to where the file will be written. If this path exists, the audit backend will append to it.]:file:_files' \ - 'log_raw[(optional) Should security sensitive information be logged raw. Defaults to "false".]:log_raw:(true false)' && ret=0 - ;; - syslog) - _values -w "Audit Backend Syslog" \ - 'facility[(optional) - The syslog facility to use. Defaults to "AUTH".]:facility:(kern user mail daemon auth syslog lpr news uucp authpriv ftp cron local0 local1 local2 local3 local4 local5 local6 local7)' \ - 'tag[(optional) - The syslog tag to use. Defaults to "vault".]:tag:' \ - 'log_raw[(optional) Should security sensitive information be logged raw.]:log_raw:(true false)' && ret=0 - ;; - esac - ;; - esac -} - -_vault_auth() { - _arguments : \ - ${general_args[@]} \ - ${auth_args[@]} && ret=0 -} - -_vault_auth-enable() { - _arguments : \ - ${general_args[@]} \ - ${auth_enable_args[@]} \ - ':::(cert ldap github userpass app-id)' && ret=0 -} - -__vault_auth_methods() { - local -a authmethods - authmethods=($(vault auth -methods | awk 'NR>1{split ($1,a,"/"); print a[1]":["$2"]"}')) - _describe -t authmethods 'authmethods' authmethods && ret=0 -} - -_vault_auth-disable() { - _arguments : \ - ${general_args[@]} \ - ':::__vault_auth_methods' && ret=0 - -} - -_vault_init() { - _arguments : \ - ${general_args[@]} \ - ${init_args[@]} && ret=0 -} - -_vault_key-status() { - _arguments : \ - ${general_args[@]} && ret=0 -} - -__vault_mounts() { - local -a mounts - mounts=($(vault mounts | awk 'NR>1{split ($1,a,"/"); print a[1]":["$2"]"}')) - _describe -t mounts 'mounts' mounts && ret=0 -} - -_vault_mounts() { - _arguments : \ - ${general_args[@]} && ret=0 -} - -_vault_mount() { - # to find out how many types of backends are there - _arguments : \ - ${general_args[@]} \ - ${mount_args[@]} \ - ':::(generic ssh)' && ret=0 -} - -_vault_mount-tune() { - _arguments : \ - ${general_args[@]} \ - ${mount_tune_args[@]} \ - ':::__vault_mounts' && ret=0 -} - -_vault_unmount() { - _arguments : \ - ${general_args[@]} \ - ':::__vault_mounts' && ret=0 -} - -_vault_remount() { - _arguments : \ - ${general_args[@]} \ - ':::__vault_mounts' \ - ':::' && ret=0 -} - -__vault_policies() { - local -a policies - policies=($(vault policies | awk '{print $1":["$1"]"}')) - _describe -t policies 'policies' policies && ret=0 -} - -_vault_policies() { - _arguments : \ - ${general_args[@]} \ - ':::__vault_policies' && ret=0 -} - -_vault_policy-delete() { - _arguments : \ - ${general_args[@]} \ - ':::__vault_policies' && ret=0 -} - -_vault_policy-write() { - _arguments : \ - ${general_args[@]} \ - ': ::' \ - '::policy:_files' && ret=0 -} - -_vault_status() { - _arguments : \ - ${general_args[@]} && ret=0 -} - -_vault_rekey() { - _arguments : \ - ${general_args[@]} \ - ${rekey_args[@]} \ - ': ::' && ret=0 -} - -_vault_rotate() { - _arguments : \ - ${general_args[@]} && ret=0 -} - -_vault_seal() { - _arguments : \ - ${general_args[@]} && ret=0 -} - -_vault_ssh() { - _arguments : \ - ${general_args[@]} \ - ${ssh_args[@]} \ - ': ::' && ret=0 -} - -_vault_token-create() { - _arguments : \ - ${general_args[@]} \ - ${token_create_args[@]} && ret=0 -} - -_vault_token-renew() { - _arguments : \ - ${general_args[@]} \ - '(-format)-format=-[The format for output. By default it is a whitespace-delimited table. This can also be json.]:format:(json table)' \ - ': ::' \ - ': ::' && ret=0 -} - -_vault_token-revoke() { - _arguments : \ - ${general_args[@]} \ - '(-mode)-mode=-[The type of revocation to do. See the documentation above for more information.]:mode:( orphan path)' \ - ': ::' && ret=0 -} - -_vault_unseal() { - _arguments : \ - ${general_args[@]} \ - '(-reset)-reset[Reset the unsealing process by throwing away prior keys in process to unseal the vault.]:reset:' \ - ': ::' && ret=0 -} - -_vault_version() { - # no args -} - -_vault_delete() { - _arguments : \ - ${general_args[@]} \ - ': ::' && ret=0 -} - -_vault_path-help() { - _arguments : \ - ${general_args[@]} \ - ': ::' && ret=0 -} - -_vault_revoke() { - _arguments : \ - ${general_args[@]} \ - '(-format)-format=-[The format for output. By default it is a whitespace-delimited table. This can also be json.]:format:(json table)' \ - ': ::' \ - ': ::' && ret=0 -} - -_vault_server() { - _arguments : \ - ${server_args[@]} && ret=0 - -} - -_vault_write() { - _arguments : \ - ${general_args[@]} \ - '(-f -force)'{-f,-force}'[Force the write to continue without any data values specified. This allows writing to keys that do not need or expect any fields to be specified.]:force:' \ - ': ::' \ - ': ::' && ret=0 -} - -_vault_read() { - _arguments : \ - ${general_args[@]} \ - '(-format)-format=-[The format for output. By default it is a whitespace-delimited table. This can also be json.]:format:(json table)' \ - '(-field)-field=-[If included, the raw value of the specified field will be output raw to stdout.]:field:' \ - ': ::' && ret=0 -} - -_vault_commands() { - local -a commands - - commands=( - "delete":"Delete operation on secrets in Vault" - "path-help":"Look up the help for a path" - "read":"Read data or secrets from Vault" - "renew":"Renew the lease of a secret" - "revoke":"Revoke a secret" - "server":"Start a Vault server" - "status":"Outputs status of whether Vault is sealed and if HA mode is enabled" - "write":"Write secrets or configuration into Vault" - "audit-disable":"Disable an audit backend" - "audit-enable":"Enable an audit backend" - "audit-list":"Lists enabled audit backends in Vault" - "auth":"Prints information about how to authenticate with Vault" - "auth-disable":"Disable an auth provider" - "auth-enable":"Enable a new auth provider" - "init":"Initialize a new Vault server" - "key-status":"Provides information about the active encryption key" - "mount":"Mount a logical backend" - "mount-tune":"Tune mount configuration parameters" - "mounts":"Lists mounted backends in Vault" - "policies":"List the policies on the server" - "policy-delete":"Delete a policy from the server" - "policy-write":"Write a policy to the server" - "rekey":"Rekeys Vault to generate new unseal keys" - "remount":"Remount a secret backend to a new path" - "rotate":"Rotates the backend encryption key used to persist data" - "seal":"Seals the vault server" - "ssh":"Initiate a SSH session" - "token-create":"Create a new auth token" - "token-renew":"Renew an auth token if there is an associated lease" - "token-revoke":"Revoke one or more auth tokens" - "unmount":"Unmount a secret backend" - "unseal":"Unseals the vault server" - "version":"Prints the Vault version" - ) - - _describe -t commands 'vault command' commands && ret=0 -} - -local curcontext=$curcontext ret=1 -_arguments : \ - ${main_args[@]} \ - '*:: :->subcommands' && ret=0 -if ((CURRENT == 1 )); then - _vault_commands && ret=0 -fi -if [[ $state == subcommands ]]; then - # (( CURRENT -- )) - curcontext="${curcontext%:*:*}:vault-$words[1]:" - _call_function ret _vault_$words[1] -fi From ff62d39f023fbe2872078ce82ea9704b1bf09ea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 8 Aug 2024 20:41:36 +0200 Subject: [PATCH 255/453] refactor(docker-machine)!: remove plugin for unsupported Docker Machine BREAKING CHANGE: the `docker-machine` plugin is removed as it was deprecated and unsupported years ago. Use Docker Desktop instead. --- plugins/docker-machine/README.md | 19 - plugins/docker-machine/_docker-machine | 359 ------------------ .../docker-machine/docker-machine.plugin.zsh | 33 -- 3 files changed, 411 deletions(-) delete mode 100644 plugins/docker-machine/README.md delete mode 100644 plugins/docker-machine/_docker-machine delete mode 100644 plugins/docker-machine/docker-machine.plugin.zsh diff --git a/plugins/docker-machine/README.md b/plugins/docker-machine/README.md deleted file mode 100644 index 308a6cfdb..000000000 --- a/plugins/docker-machine/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# docker-machine plugin for oh my zsh - -### Usage - -#### docker-vm -Will create a docker-machine with the name "dev" (required only once) -To create a second machine call "docker-vm foobar" or pass any other name - -#### docker-up -This will start your "dev" docker-machine (if necessary) and set it as the active one -To start a named machine use "docker-up foobar" - -#### docker-switch dev -Use this to activate a running docker-machine (or to switch between multiple machines) -You need to call either this or docker-up when opening a new terminal - -#### docker-stop -This will stop your "dev" docker-machine -To stop a named machine use "docker-stop foobar" \ No newline at end of file diff --git a/plugins/docker-machine/_docker-machine b/plugins/docker-machine/_docker-machine deleted file mode 100644 index 17bcd3598..000000000 --- a/plugins/docker-machine/_docker-machine +++ /dev/null @@ -1,359 +0,0 @@ -#compdef docker-machine -# Description -# ----------- -# zsh completion for docker-machine -# https://github.com/leonhartX/docker-machine-zsh-completion -# ------------------------------------------------------------------------- -# Version -# ------- -# 0.1.1 -# ------------------------------------------------------------------------- -# Authors -# ------- -# * Ke Xu -# ------------------------------------------------------------------------- -# Inspiration -# ----------- -# * @sdurrheimer docker-compose-zsh-completion https://github.com/sdurrheimer/docker-compose-zsh-completion -# * @ilkka _docker-machine - - -__docker-machine_get_hosts() { - [[ $PREFIX = -* ]] && return 1 - local state - declare -a hosts - state=$1; shift - if [[ $state != all ]]; then - hosts=(${(f)"$(_call_program commands docker-machine ls -q --filter state=$state)"}) - else - hosts=(${(f)"$(_call_program commands docker-machine ls -q)"}) - fi - _describe 'host' hosts "$@" && ret=0 - return ret -} - -__docker-machine_hosts_with_state() { - declare -a hosts - hosts=(${(f)"$(_call_program commands docker-machine ls -f '{{.Name}}\:{{.DriverName}}\({{.State}}\)\ {{.URL}}')"}) - _describe 'host' hosts -} - -__docker-machine_hosts_all() { - __docker-machine_get_hosts all "$@" -} - -__docker-machine_hosts_running() { - __docker-machine_get_hosts Running "$@" -} - -__docker-machine_get_swarm() { - declare -a swarms - swarms=(${(f)"$(_call_program commands docker-machine ls -f {{.Swarm}} | awk '{print $1}')"}) - _describe 'swarm' swarms -} - -__docker-machine_hosts_and_files() { - _alternative "hosts:host:__docker-machine_hosts_all -qS ':'" 'files:files:_path_files' -} - -__docker-machine_filters() { - [[ $PREFIX = -* ]] && return 1 - integer ret=1 - - if compset -P '*='; then - case "${${words[-1]%=*}#*=}" in - (driver) - _describe -t driver-filter-opts "driver filter" opts_driver && ret=0 - ;; - (swarm) - __docker-machine_get_swarm && ret=0 - ;; - (state) - opts_state=('Running' 'Paused' 'Saved' 'Stopped' 'Stopping' 'Starting' 'Error') - _describe -t state-filter-opts "state filter" opts_state && ret=0 - ;; - (name) - __docker-machine_hosts_all && ret=0 - ;; - (label) - _message 'label' && ret=0 - ;; - *) - _message 'value' && ret=0 - ;; - esac - else - opts=('driver' 'swarm' 'state' 'name' 'label') - _describe -t filter-opts "filter" opts -qS "=" && ret=0 - fi - return ret -} - -__get_swarm_discovery() { - declare -a masters services - local service - services=() - masters=($(docker-machine ls -f {{.Swarm}} |grep '(master)' |awk '{print $1}')) - for master in $masters; do - service=${${${(f)"$(_call_program commands docker-machine inspect -f '{{.HostOptions.SwarmOptions.Discovery}}:{{.Name}}' $master)"}/:/\\:}} - services=($services $service) - done - _describe -t services "swarm service" services && ret=0 - return ret -} - -__get_create_argument() { - typeset -g docker_machine_driver - if [[ CURRENT -le 2 ]]; then - docker_machine_driver="none" - elif [[ CURRENT > 2 && $words[CURRENT-2] = '-d' || $words[CURRENT-2] = '--driver' ]]; then - docker_machine_driver=$words[CURRENT-1] - elif [[ $words[CURRENT-1] =~ '^(-d|--driver)=' ]]; then - docker_machine_driver=${${words[CURRENT-1]}/*=/} - fi - local driver_opt_cmd - local -a opts_provider opts_common opts_read_argument - opts_read_argument=( - ": :->argument" - ) - opts_common=( - $opts_help \ - '(--driver -d)'{--driver=,-d=}'[Driver to create machine with]:dirver:->driver-option' \ - '--engine-install-url=[Custom URL to use for engine installation]:url' \ - '*--engine-opt=[Specify arbitrary flags to include with the created engine in the form flag=value]:flag' \ - '*--engine-insecure-registry=[Specify insecure registries to allow with the created engine]:registry' \ - '*--engine-registry-mirror=[Specify registry mirrors to use]:mirror' \ - '*--engine-label=[Specify labels for the created engine]:label' \ - '--engine-storage-driver=[Specify a storage driver to use with the engine]:storage-driver:->storage-driver-option' \ - '*--engine-env=[Specify environment variables to set in the engine]:environment' \ - '--swarm[Configure Machine with Swarm]' \ - '--swarm-image=[Specify Docker image to use for Swarm]:image' \ - '--swarm-master[Configure Machine to be a Swarm master]' \ - '--swarm-discovery=[Discovery service to use with Swarm]:service:->swarm-service' \ - '--swarm-strategy=[Define a default scheduling strategy for Swarm]:strategy:(spread binpack random)' \ - '*--swarm-opt=[Define arbitrary flags for swarm]:flag' \ - '*--swarm-join-opt=[Define arbitrary flags for Swarm join]:flag' \ - '--swarm-host=[ip/socket to listen on for Swarm master]:host' \ - '--swarm-addr=[addr to advertise for Swarm (default: detect and use the machine IP)]:address' \ - '--swarm-experimental[Enable Swarm experimental features]' \ - '*--tls-san=[Support extra SANs for TLS certs]:option' - ) - driver_opt_cmd="docker-machine create -d $docker_machine_driver | grep $docker_machine_driver | sed -e 's/\(--.*\)\ *\[\1[^]]*\]/*\1/g' -e 's/\(\[[^]]*\)/\\\\\\1\\\\/g' -e 's/\".*\"\(.*\)/\1/g' | awk '{printf \"%s[\", \$1; for(i=2;i<=NF;i++) {printf \"%s \", \$i}; print \"]\"}'" - if [[ $docker_machine_driver != "none" ]]; then - opts_provider=(${(f)"$(_call_program commands $driver_opt_cmd)"}) - _arguments \ - $opts_provider \ - $opts_read_argument \ - $opts_common && ret=0 - else - _arguments $opts_common && ret=0 - fi - case $state in - (driver-option) - _describe -t driver-option "driver" opts_driver && ret=0 - ;; - (storage-driver-option) - _describe -t storage-driver-option "storage driver" opts_storage_driver && ret=0 - ;; - (swarm-service) - __get_swarm_discovery && ret=0 - ;; - (argument) - ret=0 - ;; - esac - return ret -} - - -__docker-machine_subcommand() { - local -a opts_help - opts_help=("(- :)--help[Print usage]") - local -a opts_only_host opts_driver opts_storage_driver opts_state - opts_only_host=( - "$opts_help" - "*:host:__docker-machine_hosts_all" - ) - opts_driver=('amazonec2' 'azure' 'digitalocean' 'exoscale' 'generic' 'google' 'hyperv' 'none' 'openstack' 'rackspace' 'softlayer' 'virtualbox' 'vmwarefusion' 'vmwarevcloudair' 'vmwarevsphere') - opts_storage_driver=('overlay' 'aufs' 'btrfs' 'devicemapper' 'vfs' 'zfs') - integer ret=1 - - case "$words[1]" in - (active) - _arguments \ - $opts_help \ - '(--timeout -t)'{--timeout=,-t=}'[Timeout in seconds, default to 10s]:seconds' && ret=0 - ;; - (config) - _arguments \ - $opts_help \ - '--swarm[Display the Swarm config instead of the Docker daemon]' \ - "*:host:__docker-machine_hosts_all" && ret=0 - ;; - (create) - __get_create_argument - ;; - (env) - _arguments \ - $opts_help \ - '--swarm[Display the Swarm config instead of the Docker daemon]' \ - '--shell=[Force environment to be configured for a specified shell: \[fish, cmd, powershell\], default is auto-detect]:shell' \ - '(--unset -u)'{--unset,-u}'[Unset variables instead of setting them]' \ - '--no-proxy[Add machine IP to NO_PROXY environment variable]' \ - '*:host:__docker-machine_hosts_running' && ret=0 - ;; - (help) - _arguments ':subcommand:__docker-machine_commands' && ret=0 - ;; - (inspect) - _arguments \ - $opts_help \ - '(--format -f)'{--format=,-f=}'[Format the output using the given go template]:template' \ - '*:host:__docker-machine_hosts_all' && ret=0 - ;; - (ip) - _arguments \ - $opts_help \ - '*:host:__docker-machine_hosts_running' && ret=0 - ;; - (kill) - _arguments \ - $opts_help \ - '*:host:__docker-machine_hosts_with_state' && ret=0 - ;; - (ls) - _arguments \ - $opts_help \ - '(--quiet -q)'{--quiet,-q}'[Enable quiet mode]' \ - '*--filter=[Filter output based on conditions provided]:filter:->filter-options' \ - '(--timeout -t)'{--timeout=,-t=}'[Timeout in seconds, default to 10s]:seconds' \ - '(--format -f)'{--format=,-f=}'[Pretty-print machines using a Go template]:template' && ret=0 - case $state in - (filter-options) - __docker-machine_filters && ret=0 - ;; - esac - ;; - (provision) - _arguments $opts_only_host && ret=0 - ;; - (regenerate-certs) - _arguments \ - $opts_help \ - '(--force -f)'{--force,-f}'[Force rebuild and do not prompt]' \ - '*:host:__docker-machine_hosts_all' && ret=0 - ;; - (restart) - _arguments \ - $opts_help \ - '*:host:__docker-machine_hosts_with_state' && ret=0 - ;; - (rm) - _arguments \ - $opts_help \ - '(--force -f)'{--force,-f}'[Remove local configuration even if machine cannot be removed, also implies an automatic yes (`-y`)]' \ - '-y[Assumes automatic yes to proceed with remove, without prompting further user confirmation]' \ - '*:host:__docker-machine_hosts_with_state' && ret=0 - ;; - (scp) - _arguments \ - $opts_help \ - '(--recursive -r)'{--recursive,-r}'[Copy files recursively (required to copy directories))]' \ - '*:files:__docker-machine_hosts_and_files' && ret=0 - ;; - (ssh) - _arguments \ - $opts_help \ - '*:host:__docker-machine_hosts_running' && ret=0 - ;; - (start) - _arguments \ - $opts_help \ - '*:host:__docker-machine_hosts_with_state' && ret=0 - ;; - (status) - _arguments $opts_only_host && ret=0 - ;; - (stop) - _arguments \ - $opts_help \ - '*:host:__docker-machine_hosts_with_state' && ret=0 - ;; - (upgrade) - _arguments $opts_only_host && ret=0 - ;; - (url) - _arguments \ - $opts_help \ - '*:host:__docker-machine_hosts_running' && ret=0 - ;; - esac - - return ret -} - - -__docker-machine_commands() { - local cache_policy - - zstyle -s ":completion:${curcontext}:" cache-policy cache_policy - if [[ -z "$cache_policy" ]]; then - zstyle ":completion:${curcontext}:" cache-policy __docker-machine_caching_policy - fi - - if ( [[ ${+_docker_machine_subcommands} -eq 0 ]] || _cache_invalid docker_machine_subcommands) \ - && ! _retrieve_cache docker_machine_subcommands; - then - local -a lines - lines=(${(f)"$(_call_program commands docker-machine 2>&1)"}) - _docker_machine_subcommands=(${${${lines[$((${lines[(i)Commands:]} + 1)),${lines[(I) *]}]}## #}/$'\t'##/:}) - (( $#_docker_machine_subcommands > 0 )) && _store_cache docker_machine_subcommands _docker_machine_subcommands - fi - _describe -t docker-machine-commands "docker-machine command" _docker_machine_subcommands -} - -__docker-machine_caching_policy() { - oldp=( "$1"(Nmh+1) ) - (( $#oldp )) -} - -_docker-machine() { - if [[ $service != docker-machine ]]; then - _call_function - _$service - return - fi - - local curcontext="$curcontext" state line - integer ret=1 - typeset -A opt_args - - _arguments -C \ - "(- :)"{-h,--help}"[Show help]" \ - "(-D --debug)"{-D,--debug}"[Enable debug mode]" \ - '(-s --storage-path)'{-s,--storage-path}'[Configures storage path]:file:_files' \ - '--tls-ca-cert[CA to verify remotes against]:file:_files' \ - '--tls-ca-key[Private key to generate certificates]:file:_files' \ - '--tls-client-cert[Client cert to use for TLS]:file:_files' \ - '--tls-client-key[Private key used in client TLS auth]:file:_files' \ - '--github-api-token[Token to use for requests to the GitHub API]' \ - '--native-ssh[Use the native (Go-based) SSH implementation.]' \ - '--bugsnag-api-token[Bugsnag API token for crash reporting]' \ - '(- :)'{-v,--version}'[Print the version]' \ - "(-): :->command" \ - "(-)*:: :->option-or-argument" && ret=0 - - case $state in - (command) - __docker-machine_commands && ret=0 - ;; - (option-or-argument) - curcontext=${curcontext%:*:*}:docker-machine-$words[1]: - __docker-machine_subcommand && ret=0 - ret=0 - ;; - esac - - return ret -} - -_docker-machine "$@" diff --git a/plugins/docker-machine/docker-machine.plugin.zsh b/plugins/docker-machine/docker-machine.plugin.zsh deleted file mode 100644 index 235d90ee8..000000000 --- a/plugins/docker-machine/docker-machine.plugin.zsh +++ /dev/null @@ -1,33 +0,0 @@ -DEFAULT_MACHINE="default" - -docker-up() { - if [ -z "$1" ] - then - docker-machine start "${DEFAULT_MACHINE}" - eval $(docker-machine env "${DEFAULT_MACHINE}") - else - docker-machine start $1 - eval $(docker-machine env $1) - fi - echo $DOCKER_HOST -} -docker-stop() { - if [ -z "$1" ] - then - docker-machine stop "${DEFAULT_MACHINE}" - else - docker-machine stop $1 - fi -} -docker-switch() { - eval $(docker-machine env $1) - echo $DOCKER_HOST -} -docker-vm() { - if [ -z "$1" ] - then - docker-machine create -d virtualbox --virtualbox-disk-size 20000 --virtualbox-memory 4096 --virtualbox-cpu-count 2 "${DEFAULT_MACHINE}" - else - docker-machine create -d virtualbox --virtualbox-disk-size 20000 --virtualbox-memory 4096 --virtualbox-cpu-count 2 $1 - fi -} \ No newline at end of file From fccaaf2fc60149baab966acaeae35f55325e6f98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 8 Aug 2024 20:43:20 +0200 Subject: [PATCH 256/453] fix(heroku-alias): fix loading `heroku-alias` plugin and rework docs --- plugins/heroku-alias/README.md | 223 +++++++++--------- ...eroku.alias.sh => heroku-alias.plugin.zsh} | 0 2 files changed, 118 insertions(+), 105 deletions(-) rename plugins/heroku-alias/{heroku.alias.sh => heroku-alias.plugin.zsh} (100%) diff --git a/plugins/heroku-alias/README.md b/plugins/heroku-alias/README.md index 4b7b953fd..4ecb07a23 100644 --- a/plugins/heroku-alias/README.md +++ b/plugins/heroku-alias/README.md @@ -1,127 +1,140 @@ # heroku-alias -🧬 Full alias for heroku cli -|🚀 last maj|📡 source| -|---|---| -|02/06/2020|[heroku cli doc](https://devcenter.heroku.com/articles/heroku-cli-commands)| +Full alias list for Heroku CLI. -# Alias list +To use it, add `heroku-alias` to the plugins array in your zshrc file: -## general -| Alias | Command | -| ------------- | ------------- | -| h | heroku | -| hauto | heroku autocomplete $(echo $SHELL) | -| hl | heroku local | - -## config -| Alias | Command | -| ------------- | ------------- | -| hc | heroku config | -| hca | heroku config -a | -| hcr | heroku config -r | -| hcs | heroku config:set | -| hcu | heroku config:unset | -| hcfile | function hcfile bellow | - -```sh -hcfile() { - echo " Which platform [-r/a name] ? " - read platform - echo " Which file ? " - read file - while read line; - do heroku config:set "$platform" "$line"; - done < "$file" -} +```zsh +plugins=(... heroku-alias) ``` -## apps and favorites -| Alias | Command | -| ------------- | ------------- | -| ha | heroku apps | -| hpop | heroku create | -| hkill | heroku apps:destroy | -| hlog | heroku apps:errors | -| hfav | heroku apps:favorites | -| hfava | heroku apps:favorites:add | -| hfavr | heroku apps:favorites:remove | -| hai | heroku apps:info | -| hair | heroku apps:info -r | -| haia | heroku apps:info -a | +## Requirements -# auth -| Alias | Command | -| ------------- | ------------- | -| h2fa | heroku auth:2fa | +- [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli) + +| 🚀 last maj | 📡 source | +| ---------- | --------------------------------------------------------------------------- | +| 02/06/2020 | [heroku cli doc](https://devcenter.heroku.com/articles/heroku-cli-commands) | + +## Aliases + +### general + +| Alias | Command | +| ----- | ---------------------------------- | +| h | heroku | +| hauto | heroku autocomplete $(echo $SHELL) | +| hl | heroku local | + +### config + +| Alias | Command | +| ------ | ---------------------- | +| hc | heroku config | +| hca | heroku config -a | +| hcr | heroku config -r | +| hcs | heroku config:set | +| hcu | heroku config:unset | + +Also, you can use the `hcfile` function to set multiple config variables from a file, +which asks you for a platform and a config file to read the configuration from. + +### apps and favorites + +| Alias | Command | +| ----- | ---------------------------- | +| ha | heroku apps | +| hpop | heroku create | +| hkill | heroku apps:destroy | +| hlog | heroku apps:errors | +| hfav | heroku apps:favorites | +| hfava | heroku apps:favorites:add | +| hfavr | heroku apps:favorites:remove | +| hai | heroku apps:info | +| hair | heroku apps:info -r | +| haia | heroku apps:info -a | + +## auth + +| Alias | Command | +| ----- | ----------------------- | +| h2fa | heroku auth:2fa | | h2far | heroku auth:2fa:disable | -# access -| Alias | Command | -| ------------- | ------------- | -| hac | heroku access | -| hacr | heroku access -r | -| haca | heroku access -a | -| hadd | heroku access:add | -| hdel | heroku access:remove | -| hup | heroku access:update | +## access -## addons -| Alias | Command | -| ------------- | ------------- | -| hads | heroku addons -A | -| hada | heroku addons -a | -| hadr | heroku addons -r | -| hadat | heroku addons:attach | -| hadc | heroku addons:create | +| Alias | Command | +| ----- | -------------------- | +| hac | heroku access | +| hacr | heroku access -r | +| haca | heroku access -a | +| hadd | heroku access:add | +| hdel | heroku access:remove | +| hup | heroku access:update | + +### addons + +| Alias | Command | +| ----- | --------------------- | +| hads | heroku addons -A | +| hada | heroku addons -a | +| hadr | heroku addons -r | +| hadat | heroku addons:attach | +| hadc | heroku addons:create | | hadel | heroku addons:destroy | -| hadde | heroku addons:detach | -| hadoc | heroku addons:docs | +| hadde | heroku addons:detach | +| hadoc | heroku addons:docs | -## login -| Alias | Command | -| ------------- | ------------- | -| hin | heroku login | -| hout | heroku logout | -| hi | heroku login -i | -| hwho | heroku auth:whoami | +### login -## authorizations -| Alias | Command | -| ------------- | ------------- | -| hth | heroku authorizations | +| Alias | Command | +| ----- | ------------------ | +| hin | heroku login | +| hout | heroku logout | +| hi | heroku login -i | +| hwho | heroku auth:whoami | + +### authorizations + +| Alias | Command | +| ------ | ---------------------------- | +| hth | heroku authorizations | | hthadd | heroku authorizations:create | -| hthif | heroku authorizations:info | +| hthif | heroku authorizations:info | | hthdel | heroku authorizations:revoke | | hthrot | heroku authorizations:rotate | -| hthup | heroku authorizations:update | +| hthup | heroku authorizations:update | -## plugins -| Alias | Command | -| ------------- | ------------- | -| hp | heroku plugins | +### plugins -# log -| Alias | Command | -| ------------- | ------------- | -|hg | heroku logs| -| hgt | heroku log tail | +| Alias | Command | +| ----- | -------------- | +| hp | heroku plugins | -# database -| Alias | Command | -| ------------- | ------------- | -| hpg | heroku pg | -| hpsql | heroku pg:psql | -| hpb | heroku pg:backups | -| hpbc | heroku pg:backups:capture | -| hpbd | heroku pg:backups:download | -| hpbr | heroku pg:backups:restore | +### log -# certs -| Alias | Command | -| ------------- | ------------- | -| hssl | heroku certs | -| hssli | heroku certs:info | -| hssla | heroku certs:add | +| Alias | Command | +| ----- | --------------- | +| hg | heroku logs | +| hgt | heroku log tail | + +### database + +| Alias | Command | +| ----- | -------------------------- | +| hpg | heroku pg | +| hpsql | heroku pg:psql | +| hpb | heroku pg:backups | +| hpbc | heroku pg:backups:capture | +| hpbd | heroku pg:backups:download | +| hpbr | heroku pg:backups:restore | + +### certs + +| Alias | Command | +| ----- | ------------------- | +| hssl | heroku certs | +| hssli | heroku certs:info | +| hssla | heroku certs:add | | hsslu | heroku certs:update | | hsslr | heroku certs:remove | diff --git a/plugins/heroku-alias/heroku.alias.sh b/plugins/heroku-alias/heroku-alias.plugin.zsh similarity index 100% rename from plugins/heroku-alias/heroku.alias.sh rename to plugins/heroku-alias/heroku-alias.plugin.zsh From efafef8495f030501e0df59ccb76a598bbce3ae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Fri, 9 Aug 2024 09:44:46 +0200 Subject: [PATCH 257/453] docs: improve several plugin READMEs and add one for `ssh` plugin --- plugins/aliases/README.md | 4 +- plugins/ansible/README.md | 2 - plugins/arduino-cli/README.md | 1 + plugins/asdf/README.md | 6 ++- plugins/chucknorris/README.md | 2 +- plugins/dbt/README.md | 6 +-- plugins/fancy-ctrl-z/README.md | 12 ++++- plugins/gatsby/README.md | 2 +- plugins/isodate/README.md | 4 +- plugins/jira/README.md | 48 ++++++++++--------- plugins/kube-ps1/README.md | 3 +- plugins/per-directory-history/README.md | 3 +- plugins/pipenv/README.md | 4 +- plugins/spring/README.md | 14 ++---- plugins/ssh/README.md | 16 +++++++ plugins/suse/README.md | 8 ++-- plugins/swiftpm/README.md | 2 - plugins/vagrant-prompt/README.md | 31 +++++++++++- .../vagrant-prompt/vagrant-prompt.plugin.zsh | 17 ------- plugins/vim-interaction/README.md | 16 +++---- plugins/xcode/README.md | 2 - plugins/yii2/README.md | 4 +- plugins/zsh-interactive-cd/README.md | 8 +++- 23 files changed, 124 insertions(+), 91 deletions(-) create mode 100644 plugins/ssh/README.md diff --git a/plugins/aliases/README.md b/plugins/aliases/README.md index 14f9c5c53..5a7e7dfc6 100644 --- a/plugins/aliases/README.md +++ b/plugins/aliases/README.md @@ -1,7 +1,5 @@ # Aliases cheatsheet -**Maintainer:** [@hqingyi](https://github.com/hqingyi) - With lots of 3rd-party amazing aliases installed, this plugin helps list the shortcuts that are currently available based on the plugins you have enabled. @@ -13,6 +11,8 @@ plugins=(aliases) Requirements: Python needs to be installed. +**Maintainer:** [@hqingyi](https://github.com/hqingyi) + ## Usage - `als`: show all aliases by group diff --git a/plugins/ansible/README.md b/plugins/ansible/README.md index dd0e1ce03..6a06962ee 100644 --- a/plugins/ansible/README.md +++ b/plugins/ansible/README.md @@ -1,7 +1,5 @@ # ansible plugin -## Introduction - The `ansible plugin` adds several aliases for useful [ansible](https://docs.ansible.com/ansible/latest/index.html) commands and [aliases](#aliases). To use it, add `ansible` to the plugins array of your zshrc file: diff --git a/plugins/arduino-cli/README.md b/plugins/arduino-cli/README.md index 91bda9067..821d72bbf 100644 --- a/plugins/arduino-cli/README.md +++ b/plugins/arduino-cli/README.md @@ -1,6 +1,7 @@ # Arduino CLI plugin This plugin adds completion for the [arduino-cli](https://github.com/arduino/arduino-cli) tool. + To use it, add `arduino-cli` to the plugins array in your zshrc file: ```zsh diff --git a/plugins/asdf/README.md b/plugins/asdf/README.md index f047860e2..4af69a75c 100644 --- a/plugins/asdf/README.md +++ b/plugins/asdf/README.md @@ -1,7 +1,5 @@ ## asdf -**Maintainer:** [@RobLoach](https://github.com/RobLoach) - Adds integration with [asdf](https://github.com/asdf-vm/asdf), the extendable version manager, with support for Ruby, Node.js, Elixir, Erlang and more. ### Installation @@ -28,3 +26,7 @@ asdf install nodejs latest asdf global nodejs latest asdf local nodejs latest ``` + +### Maintainer + +- [@RobLoach](https://github.com/RobLoach) diff --git a/plugins/chucknorris/README.md b/plugins/chucknorris/README.md index b51875de9..0562b3b59 100644 --- a/plugins/chucknorris/README.md +++ b/plugins/chucknorris/README.md @@ -1,6 +1,6 @@ # chucknorris -Chuck Norris fortunes plugin for Oh My Zsh. Perfectly suitable as MOTD. +Fortunes plugin for Chuck Norris for Oh My Zsh. Perfectly suitable as MOTD. To use it add `chucknorris` to the plugins array in you zshrc file. diff --git a/plugins/dbt/README.md b/plugins/dbt/README.md index e05d79cc3..74ae631cd 100644 --- a/plugins/dbt/README.md +++ b/plugins/dbt/README.md @@ -1,13 +1,11 @@ # dbt plugin -## Introduction - The `dbt plugin` adds several aliases for useful [dbt](https://docs.getdbt.com/) commands and [aliases](#aliases). To use it, add `dbt` to the plugins array of your zshrc file: -``` +```zsh plugins=(... dbt) ``` @@ -26,4 +24,4 @@ plugins=(... dbt) ## Maintainer -### [msempere](https://github.com/msempere) +- [msempere](https://github.com/msempere) diff --git a/plugins/fancy-ctrl-z/README.md b/plugins/fancy-ctrl-z/README.md index 82a4fd75e..7766c51eb 100644 --- a/plugins/fancy-ctrl-z/README.md +++ b/plugins/fancy-ctrl-z/README.md @@ -1,4 +1,14 @@ -# Use Ctrl-Z to switch back to Vim +# fancy-ctrl-z + +Allows pressing Ctrl-Z again to switch back to a background job. + +To use it, add `fancy-ctrl-z` to the plugins array in your zshrc file: + +```zsh +plugins=(... fancy-ctrl-z) +``` + +## Motivation 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. diff --git a/plugins/gatsby/README.md b/plugins/gatsby/README.md index 36846a228..cc1bd392e 100644 --- a/plugins/gatsby/README.md +++ b/plugins/gatsby/README.md @@ -1,6 +1,6 @@ # gatsby autocomplete plugin -* Adds autocomplete options for all gatsby commands. +Adds autocomplete options for all gatsby commands. ## Requirements diff --git a/plugins/isodate/README.md b/plugins/isodate/README.md index 1ec75b2d4..5329310c2 100644 --- a/plugins/isodate/README.md +++ b/plugins/isodate/README.md @@ -1,7 +1,5 @@ # Isodate plugin -**Maintainer:** [@Frani](https://github.com/frani) - This plugin adds completion for the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601), as well as some aliases for common Date commands. @@ -11,6 +9,8 @@ To use it, add `isodate` to the plugins array in your zshrc file: plugins=(... isodate) ``` +**Maintainer:** [@Frani](https://github.com/frani) + ## Aliases | Alias | Command | Description | diff --git a/plugins/jira/README.md b/plugins/jira/README.md index 1c6930298..7cfb81b19 100644 --- a/plugins/jira/README.md +++ b/plugins/jira/README.md @@ -1,16 +1,18 @@ -# Jira plugin # - -CLI support for JIRA interaction - -## Description ## +# Jira plugin This plugin provides command line tools for interacting with Atlassian's [JIRA](https://www.atlassian.com/software/jira) bug tracking software. +To use it, add `jira` to the plugins array in your zshrc file: + +```zsh +plugins=(... jira) +``` + The interaction is all done through the web. No local installation of JIRA is necessary. In this document, "JIRA" refers to the JIRA issue tracking server, and `jira` refers to the command this plugin supplies. -## Usage ## +## Usage This plugin supplies one command, `jira`, through which all its features are exposed. Most forms of this command open a JIRA page in your web browser. @@ -18,19 +20,19 @@ This plugin supplies one command, `jira`, through which all its features are exp `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 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 | +| 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 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 @@ -43,7 +45,7 @@ This is also checks if the prefix is in the name, and adds it if not, so: "MP-12 -#### Debugging usage #### +#### Debugging usage These calling forms are for developers' use, and may change at any time. @@ -51,7 +53,7 @@ These calling forms are for developers' use, and may change at any time. jira dumpconfig # displays the effective configuration ``` -## Setup ## +## Setup The URL for your JIRA instance is set by `$JIRA_URL` or a `.jira_url` file. @@ -68,7 +70,7 @@ echo "https://jira.atlassian.com" >> .jira-url (Note: The current implementation only looks in the current directory for `.jira-url` and `.jira-prefix`, not up the path, so if you are in a subdirectory of your project, it will fall back to your default JIRA URL. This will probably change in the future though.) -### Variables ### +### Variables * `$JIRA_URL` - Your JIRA instance's URL * `$JIRA_NAME` - Your JIRA username; used as the default user for `assigned`/`reported` searches @@ -79,6 +81,6 @@ echo "https://jira.atlassian.com" >> .jira-url * `$JIRA_TEMPO_PATH` - Your JIRA tempo url path; defaults to "/secure/Tempo.jspa" -### Browser ### +### Browser Your default web browser, as determined by how `open_command` handles `http://` URLs, is used for interacting with the JIRA instance. If you change your system's URL handler associations, it will change the browser that `jira` uses. diff --git a/plugins/kube-ps1/README.md b/plugins/kube-ps1/README.md index dd49eff39..be3c184be 100644 --- a/plugins/kube-ps1/README.md +++ b/plugins/kube-ps1/README.md @@ -1,5 +1,4 @@ -kube-ps1: Kubernetes prompt for bash and zsh -============================================ +# kube-ps1: Kubernetes prompt for bash and zsh A script that lets you add the current Kubernetes context and namespace configured on `kubectl` to your Bash/Zsh prompt strings (i.e. the `$PS1`). diff --git a/plugins/per-directory-history/README.md b/plugins/per-directory-history/README.md index 11150b059..2816c11ba 100644 --- a/plugins/per-directory-history/README.md +++ b/plugins/per-directory-history/README.md @@ -1,5 +1,4 @@ -per-directory-history plugin ----------------------------- +# per-directory-history plugin This plugin adds per-directory history for zsh, as well as a global history, and the ability to toggle between them with a keyboard shortcut. This is a diff --git a/plugins/pipenv/README.md b/plugins/pipenv/README.md index e78ef0e3b..429b6f186 100644 --- a/plugins/pipenv/README.md +++ b/plugins/pipenv/README.md @@ -1,6 +1,6 @@ # Pipenv -## Installation +This plugin provides some features to simplify the use of [Pipenv](https://pipenv.pypa.io/) while working on ZSH. In your `.zshrc` file, add `pipenv` to the plugins section @@ -10,8 +10,6 @@ plugins=(... pipenv ...) ## Features -This plugin provides some features to simplify the use of Pipenv while working on ZSH. - - Adds completion for pipenv - Auto activates and deactivates pipenv shell - Adds short aliases for common pipenv commands diff --git a/plugins/spring/README.md b/plugins/spring/README.md index 816181326..b93402000 100644 --- a/plugins/spring/README.md +++ b/plugins/spring/README.md @@ -1,16 +1,12 @@ # Spring Boot oh-my-zsh plugin -oh-my-zsh Spring Boot plugin -## Spring Boot autocomplete plugin +Adds autocomplete options for all [Spring Boot](https://spring.io/projects/spring-boot) commands. -- Adds autocomplete options for all spring boot commands. +To use it, add `spring` to the plugins array in your zshrc file: -## Manual Install - - $ cd ~/.oh-my-zsh/plugins - $ git clone git@github.com:linux-china/oh-my-zsh-spring-boot-plugin.git spring - -Adjust your .zshrc file and add spring to plugins=(...) +```zsh +plugins=(... spring) +``` ## Tips diff --git a/plugins/ssh/README.md b/plugins/ssh/README.md new file mode 100644 index 000000000..3dd32ec76 --- /dev/null +++ b/plugins/ssh/README.md @@ -0,0 +1,16 @@ +# ssh plugin + +This plugin provides host completion based off of your `~/.ssh/config` file, and adds +some utility functions to work with SSH keys. + +To use it, add `ssh` to the plugins array in your zshrc file: + +```zsh +plugins=(... ssh) +``` + +## Functions + +- `ssh_rmhkey`: remove host key from known hosts based on a host section name from `.ssh/config`. +- `ssh_load_key`: load SSH key into agent. +- `ssh_unload_key`: remove SSH key from agent. diff --git a/plugins/suse/README.md b/plugins/suse/README.md index f37ec1695..e1e3aad29 100644 --- a/plugins/suse/README.md +++ b/plugins/suse/README.md @@ -1,8 +1,6 @@ # suse -**Maintainer**: [r-darwish](https://github.com/r-darwish) - -Alias for Zypper according to the official Zypper's alias +Aliases for [Zypper](https://en.opensuse.org/Portal:Zypper) according to the official Zypper's alias To use it add `suse` to the plugins array in you zshrc file. @@ -10,6 +8,8 @@ To use it add `suse` to the plugins array in you zshrc file. plugins=(... suse) ``` +**Maintainer**: [r-darwish](https://github.com/r-darwish) + ## Main commands | Alias | Commands | Description | @@ -79,6 +79,7 @@ Related: [#9798](https://github.com/ohmyzsh/ohmyzsh/pull/9798). | zrr | `sudo zypper rr` | remove repositories | ## Services commands + | Alias | Commands | Description | | ----- | ------------------ | -------------------------------------------------------------- | | zas | `sudo zypper as` | adds a service specified by URI to the system | @@ -88,6 +89,7 @@ Related: [#9798](https://github.com/ohmyzsh/ohmyzsh/pull/9798). | zls | `zypper ls` | list services defined on the system | ## Package Locks Management commands + | Alias | Commands | Description | | ----- | ---------------- | ----------------------------------- | | zal | `sudo zypper al` | add a package lock | diff --git a/plugins/swiftpm/README.md b/plugins/swiftpm/README.md index e5b4752e4..babbf4d66 100644 --- a/plugins/swiftpm/README.md +++ b/plugins/swiftpm/README.md @@ -1,7 +1,5 @@ # Swift Package Manager -## Description - This plugin provides a few utilities that make you faster on your daily work with the [Swift Package Manager](https://github.com/apple/swift-package-manager), as well as autocompletion for Swift 5.9. To start using it, add the `swiftpm` plugin to your `plugins` array in `~/.zshrc`: diff --git a/plugins/vagrant-prompt/README.md b/plugins/vagrant-prompt/README.md index dd0ca363b..0720f4bde 100644 --- a/plugins/vagrant-prompt/README.md +++ b/plugins/vagrant-prompt/README.md @@ -1,6 +1,33 @@ +# vagrant-prompt + 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. +To use it, add `vagrant-prompt` to the plugins array in your zshrc file: -Alberto Re +```zsh +plugins=(... vagrant-prompt) +``` + +**Alberto Re ** + +## Usage + +To display Vagrant info on your prompt add the `vagrant_prompt_info` to the +`$PROMPT` or `$RPROMPT` variable in your theme. Example: + +```zsh +PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(vagrant_prompt_info)$(svn_prompt_info)$(git_prompt_info)%(!.#.$) ' +``` + +`vagrant_prompt_info` makes use of some custom variables. This is an example +definition: + +```zsh +ZSH_THEME_VAGRANT_PROMPT_PREFIX="%{$fg_bold[blue]%}[" +ZSH_THEME_VAGRANT_PROMPT_SUFFIX="%{$fg_bold[blue]%}]%{$reset_color%} " +ZSH_THEME_VAGRANT_PROMPT_RUNNING="%{$fg_no_bold[green]%}●" +ZSH_THEME_VAGRANT_PROMPT_POWEROFF="%{$fg_no_bold[red]%}●" +ZSH_THEME_VAGRANT_PROMPT_SUSPENDED="%{$fg_no_bold[yellow]%}●" +ZSH_THEME_VAGRANT_PROMPT_NOT_CREATED="%{$fg_no_bold[white]%}○" +``` diff --git a/plugins/vagrant-prompt/vagrant-prompt.plugin.zsh b/plugins/vagrant-prompt/vagrant-prompt.plugin.zsh index d7c76c3c9..29f4038c5 100644 --- a/plugins/vagrant-prompt/vagrant-prompt.plugin.zsh +++ b/plugins/vagrant-prompt/vagrant-prompt.plugin.zsh @@ -1,20 +1,3 @@ -# vim:ft=zsh ts=2 sw=2 sts=2 -# -# To display Vagrant infos on your prompt add the vagrant_prompt_info to the -# $PROMPT variable in your theme. Example: -# -# PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(vagrant_prompt_info)$(svn_prompt_info)$(git_prompt_info)%(!.#.$) ' -# -# `vagrant_prompt_info` makes use of some custom variables. This is an example -# definition: -# -# ZSH_THEME_VAGRANT_PROMPT_PREFIX="%{$fg_bold[blue]%}[" -# ZSH_THEME_VAGRANT_PROMPT_SUFFIX="%{$fg_bold[blue]%}]%{$reset_color%} " -# ZSH_THEME_VAGRANT_PROMPT_RUNNING="%{$fg_no_bold[green]%}●" -# ZSH_THEME_VAGRANT_PROMPT_POWEROFF="%{$fg_no_bold[red]%}●" -# ZSH_THEME_VAGRANT_PROMPT_SUSPENDED="%{$fg_no_bold[yellow]%}●" -# ZSH_THEME_VAGRANT_PROMPT_NOT_CREATED="%{$fg_no_bold[white]%}○" - function vagrant_prompt_info() { local vm_states vm_state if [[ -d .vagrant && -f Vagrantfile ]]; then diff --git a/plugins/vim-interaction/README.md b/plugins/vim-interaction/README.md index c2b45f1d8..437b48d99 100644 --- a/plugins/vim-interaction/README.md +++ b/plugins/vim-interaction/README.md @@ -1,5 +1,13 @@ # Vim Interaction # +The idea for this script is to give you some decent interaction with a running +GVim session. Normally you'll be running around your filesystem doing any +number of amazing things and you'll need to load some files into GVim for +editing, inspecting, destruction, or other bits of mayhem. This script lets you +do that. + +## Usage + The plugin presents a function called `callvim` whose usage is: usage: callvim [-b cmd] [-a cmd] [file ... fileN] @@ -9,14 +17,6 @@ The plugin presents a function called `callvim` whose usage is: file The file to edit ... fileN The other files to add to the argslist -## Rationale ## - -The idea for this script is to give you some decent interaction with a running -GVim session. Normally you'll be running around your filesystem doing any -number of amazing things and you'll need to load some files into GVim for -editing, inspecting, destruction, or other bits of mayhem. This script lets you -do that. - ## Aliases ## There are a few aliases presented as well: diff --git a/plugins/xcode/README.md b/plugins/xcode/README.md index 27d6a228b..ac79f728d 100644 --- a/plugins/xcode/README.md +++ b/plugins/xcode/README.md @@ -1,7 +1,5 @@ # Xcode -## Description - This plugin provides a few utilities that can help you on your daily use of Xcode and iOS development. To start using it, add the `xcode` plugin to your `plugins` array in `~/.zshrc`: diff --git a/plugins/yii2/README.md b/plugins/yii2/README.md index 345b66eb6..e6c71f23e 100644 --- a/plugins/yii2/README.md +++ b/plugins/yii2/README.md @@ -1,7 +1,7 @@ # Yii2 autocomplete plugin -* Adds autocomplete commands and subcommands for yii. +Adds autocomplete commands and subcommands for [yii](https://www.yiiframework.com/). ## Requirements -Autocomplete works from directory where your `yii` file contains. +Autocomplete works from directory where your `yii` file is contained. diff --git a/plugins/zsh-interactive-cd/README.md b/plugins/zsh-interactive-cd/README.md index 4bffbf04a..29812a295 100644 --- a/plugins/zsh-interactive-cd/README.md +++ b/plugins/zsh-interactive-cd/README.md @@ -1,5 +1,7 @@ # zsh-interactive-cd +This plugin provides an interactive way to change directories in zsh using fzf. + ## Demo ![demo](demo.gif) @@ -8,7 +10,11 @@ 1. Install [fzf](https://github.com/junegunn/fzf) by following its [installation instruction](https://github.com/junegunn/fzf#installation). -2. Source `zsh-interactive-cd.plugin.zsh` in `.zshrc`. +2. Add `zsh-interactive-cd` to your plugin list in `~/.zshrc`: + + ```zsh + plugins=(... zsh-interactive-cd) + ``` ## Usage From f1764f8a569a84264ad5a6182721f6ae3bba835d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 11 Aug 2024 19:51:32 +0200 Subject: [PATCH 258/453] chore(deps): bump pyyaml from 6.0.1 to 6.0.2 in /.github/workflows/dependencies (#12610) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependencies/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt index f125da542..2a383e14b 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -1,7 +1,7 @@ certifi==2024.7.4 charset-normalizer==3.3.2 idna==3.7 -PyYAML==6.0.1 +PyYAML==6.0.2 requests==2.32.3 semver==3.0.2 urllib3==2.2.2 From 47767bd03cae60bc4b3d8ab4ba8e6b6c78bc17ed Mon Sep 17 00:00:00 2001 From: August Feng <46177585+augustfengd@users.noreply.github.com> Date: Sun, 11 Aug 2024 14:01:39 -0400 Subject: [PATCH 259/453] fix(colorize): support args when input is stdin (#11038) Co-authored-by: August Feng --- plugins/colorize/colorize.plugin.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/colorize/colorize.plugin.zsh b/plugins/colorize/colorize.plugin.zsh index 12841e0ee..c49acd864 100644 --- a/plugins/colorize/colorize.plugin.zsh +++ b/plugins/colorize/colorize.plugin.zsh @@ -42,12 +42,12 @@ colorize_cat() { ZSH_COLORIZE_STYLE="emacs" fi - # Use stdin if no arguments have been passed. - if [ $# -eq 0 ]; then + # Use stdin if stdin is not attached to a terminal. + if [ ! -t 0 ]; then if [[ "$ZSH_COLORIZE_TOOL" == "pygmentize" ]]; then pygmentize -O style="$ZSH_COLORIZE_STYLE" -g else - chroma --style="$ZSH_COLORIZE_STYLE" --formatter="${ZSH_COLORIZE_CHROMA_FORMATTER:-terminal}" + chroma --style="$ZSH_COLORIZE_STYLE" --formatter="${ZSH_COLORIZE_CHROMA_FORMATTER:-terminal}" "$@" fi return $? fi From d6f84f3e7d2515cee8ba776d05ee2009ffd471d7 Mon Sep 17 00:00:00 2001 From: Gentoo <43550690+maxutka99@users.noreply.github.com> Date: Mon, 12 Aug 2024 12:46:16 +0300 Subject: [PATCH 260/453] fix(catimg): add support to `magick` binary (#12608) Co-authored-by: Carlo Sala --- plugins/catimg/README.md | 5 +++-- plugins/catimg/catimg.plugin.zsh | 8 +++++--- plugins/catimg/catimg.sh | 14 +++++++++----- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/plugins/catimg/README.md b/plugins/catimg/README.md index 68dc33c1f..4cfda0e25 100644 --- a/plugins/catimg/README.md +++ b/plugins/catimg/README.md @@ -1,6 +1,7 @@ # catimg -Plugin for displaying images on the terminal using the `catimg.sh` script provided by [posva](https://github.com/posva/catimg) +Plugin for displaying images on the terminal using the `catimg.sh` script provided by +[posva](https://github.com/posva/catimg) To use it, add `catimg` to the plugins array in your zshrc file: @@ -10,7 +11,7 @@ plugins=(... catimg) ## Requirements -- `convert` (ImageMagick) +- `magick convert` (ImageMagick) ## Functions diff --git a/plugins/catimg/catimg.plugin.zsh b/plugins/catimg/catimg.plugin.zsh index f4ff6f856..ad10d8574 100644 --- a/plugins/catimg/catimg.plugin.zsh +++ b/plugins/catimg/catimg.plugin.zsh @@ -9,9 +9,11 @@ function catimg() { - if [[ -x `which convert` ]]; then - zsh $ZSH/plugins/catimg/catimg.sh $@ + if (( $+commands[magick] )); then + CONVERT_CMD="magick" zsh $ZSH/plugins/catimg/catimg.sh $@ + elif (( $+commands[convert] )); then + CONVERT_CMD="convert" zsh $ZSH/plugins/catimg/catimg.sh $@ else - echo "catimg need convert (ImageMagick) to work)" + echo "catimg need magick/convert (ImageMagick) to work)" fi } diff --git a/plugins/catimg/catimg.sh b/plugins/catimg/catimg.sh index f58392428..7946ad16e 100644 --- a/plugins/catimg/catimg.sh +++ b/plugins/catimg/catimg.sh @@ -7,6 +7,10 @@ # GitHub: https://github.com/posva/catimg # ################################################################################ +# this should come from outside, either `magick` or `convert` +# from imagemagick v7 and ahead `convert` is deprecated +: ${CONVERT_CMD:=convert} + function help() { echo "Usage catimg [-h] [-w width] [-c char] img" echo "By default char is \" \" and w is the terminal width" @@ -43,23 +47,23 @@ if [ ! "$WIDTH" ]; then else COLS=$(expr $WIDTH "/" $(echo -n "$CHAR" | wc -c)) fi -WIDTH=$(convert "$IMG" -print "%w\n" /dev/null) +WIDTH=$($CONVERT_CMD "$IMG" -print "%w\n" /dev/null) if [ "$WIDTH" -gt "$COLS" ]; then WIDTH=$COLS fi REMAP="" -if convert "$IMG" -resize $COLS\> +dither -remap $COLOR_FILE /dev/null ; then +if $CONVERT_CMD "$IMG" -resize $COLS\> +dither -remap $COLOR_FILE /dev/null ; then REMAP="-remap $COLOR_FILE" else echo "The version of convert is too old, don't expect good results :(" >&2 - #convert "$IMG" -colors 256 PNG8:tmp.png - #IMG="tmp.png" + # $CONVERT_CMD "$IMG" -colors 256 PNG8:tmp.png + # IMG="tmp.png" fi # Display the image I=0 -convert "$IMG" -resize $COLS\> +dither `echo $REMAP` txt:- 2>/dev/null | +$CONVERT_CMD "$IMG" -resize $COLS\> +dither `echo $REMAP` txt:- 2>/dev/null | sed -e 's/.*none.*/NO NO NO/g' -e '1d;s/^.*(\(.*\)[,)].*$/\1/g;y/,/ /' | while read R G B f; do if [ ! "$R" = "NO" ]; then From 9ba6daa1b5d0b60c89525d679eb30fe3ed9947de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Sun, 21 Oct 2018 13:00:03 +0200 Subject: [PATCH 261/453] feat(conda): add `conda` aliases plugin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #7318 Closed #9691 Co-authored-by: garywei944 <33930674+garywei944@users.noreply.github.com> Co-authored-by: Marc Cornellà --- plugins/conda/README.md | 37 ++++++++++++++++++++++++++++++++++ plugins/conda/conda.plugin.zsh | 23 +++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 plugins/conda/README.md create mode 100644 plugins/conda/conda.plugin.zsh diff --git a/plugins/conda/README.md b/plugins/conda/README.md new file mode 100644 index 000000000..70530d01e --- /dev/null +++ b/plugins/conda/README.md @@ -0,0 +1,37 @@ +# conda plugin + +The conda plugin provides [aliases](#aliases) for `conda`, usually installed via [anaconda](https://www.anaconda.com/) or [miniconda](https://docs.conda.io/en/latest/miniconda.html). + +To use it, add `conda` to the plugins array in your zshrc file: + +```zsh +plugins=(... conda) +``` + +## Aliases + +| Alias | Command | Description | +| :------- | :-------------------------------------- | :------------------------------------------------------------------------------ | +| `cna` | `conda activate` | Activate the specified conda environment | +| `cnab` | `conda activate base` | Activate the base conda environment | +| `cncf` | `conda env create -f` | Create a new conda environment from a YAML file | +| `cncn` | `conda create -y -n` | Create a new conda environment with the given name | +| `cnconf` | `conda config` | View or modify conda configuration | +| `cncp` | `conda create -y -p` | Create a new conda environment with the given prefix | +| `cncr` | `conda create -n` | Create new virtual environment with given name | +| `cncss` | `conda config --show-source` | Show the locations of conda configuration sources | +| `cnde` | `conda deactivate` | Deactivate the current conda environment | +| `cnel` | `conda env list` | List all available conda environments | +| `cni` | `conda install` | Install given package | +| `cniy` | `conda install -y` | Install given package without confirmation | +| `cnl` | `conda list` | List installed packages in the current environment | +| `cnle` | `conda list --export` | Export the list of installed packages in the current environment | +| `cnles` | `conda list --explicit > spec-file.txt` | Export the list of installed packages in the current environment to a spec file | +| `cnr` | `conda remove` | Remove given package | +| `cnrn` | `conda remove -y -all -n` | Remove all packages in the specified environment | +| `cnrp` | `conda remove -y -all -p` | Remove all packages in the specified prefix | +| `cnry` | `conda remove -y` | Remove given package without confirmation | +| `cnsr` | `conda search` | Search conda repositories for package | +| `cnu` | `conda update` | Update conda package manager | +| `cnua` | `conda update --all` | Update all installed packages | +| `cnuc` | `conda update conda` | Update conda package manager | diff --git a/plugins/conda/conda.plugin.zsh b/plugins/conda/conda.plugin.zsh new file mode 100644 index 000000000..a93ceeb95 --- /dev/null +++ b/plugins/conda/conda.plugin.zsh @@ -0,0 +1,23 @@ +alias cna='conda activate' +alias cnab='conda activate base' +alias cncf='conda env create -f' +alias cncn='conda create -y -n' +alias cnconf='conda config' +alias cncp='conda create -y -p' +alias cncr='conda create -n' +alias cncss='conda config --show-source' +alias cnde='conda deactivate' +alias cnel='conda env list' +alias cni='conda install' +alias cniy='conda install -y' +alias cnl='conda list' +alias cnle='conda list --export' +alias cnles='conda list --explicit > spec-file.txt' +alias cnr='conda remove' +alias cnrn='conda remove -y -all -n' +alias cnrp='conda remove -y -all -p' +alias cnry='conda remove -y' +alias cnsr='conda search' +alias cnu='conda update' +alias cnua='conda update --all' +alias cnuc='conda update conda' From d26c4a276610445670fb71d415804625cebd7ccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 15 Aug 2024 16:26:46 +0200 Subject: [PATCH 262/453] chore(tmux): add link to iTerm2 integration docs --- plugins/tmux/README.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/plugins/tmux/README.md b/plugins/tmux/README.md index 09952a9f5..28ad3558a 100644 --- a/plugins/tmux/README.md +++ b/plugins/tmux/README.md @@ -29,18 +29,18 @@ The plugin also supports the following: ## Configuration Variables -| Variable | Description | -| ----------------------------------- | ----------------------------------------------------------------------------------------------------------- | -| `ZSH_TMUX_AUTOSTART` | Automatically starts tmux (default: `false`) | -| `ZSH_TMUX_AUTOSTART_ONCE` | Autostart only if tmux hasn't been started previously (default: `true`) | -| `ZSH_TMUX_AUTOCONNECT` | Automatically connect to a previous session if it exits (default: `true`) | -| `ZSH_TMUX_AUTOQUIT` | Automatically closes terminal once tmux exits (default: `ZSH_TMUX_AUTOSTART`) | -| `ZSH_TMUX_CONFIG` | Set the configuration path (default: `$HOME/.tmux.conf`, `$XDG_CONFIG_HOME/tmux/tmux.conf`) | -| `ZSH_TMUX_DEFAULT_SESSION_NAME` | Set tmux default session name when autostart is enabled | -| `ZSH_TMUX_AUTONAME_SESSION` | Automatically name new sessions based on the basename of `$PWD` (default: `false`) | -| `ZSH_TMUX_DETACHED` | Set the detached mode (default: `false`) | -| `ZSH_TMUX_FIXTERM` | Sets `$TERM` to 256-color term or not based on current terminal support | -| `ZSH_TMUX_FIXTERM_WITHOUT_256COLOR` | `$TERM` to use for non 256-color terminals (default: `tmux` if available, `screen` otherwise) | -| `ZSH_TMUX_FIXTERM_WITH_256COLOR` | `$TERM` to use for 256-color terminals (default: `tmux-256color` if available, `screen-256color` otherwise) | -| `ZSH_TMUX_ITERM2` | Sets the `-CC` option for iTerm2 tmux integration (default: `false`) | -| `ZSH_TMUX_UNICODE` | Set `tmux -u` option to support unicode | +| Variable | Description | +| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | +| `ZSH_TMUX_AUTOSTART` | Automatically starts tmux (default: `false`) | +| `ZSH_TMUX_AUTOSTART_ONCE` | Autostart only if tmux hasn't been started previously (default: `true`) | +| `ZSH_TMUX_AUTOCONNECT` | Automatically connect to a previous session if it exits (default: `true`) | +| `ZSH_TMUX_AUTOQUIT` | Automatically closes terminal once tmux exits (default: `ZSH_TMUX_AUTOSTART`) | +| `ZSH_TMUX_CONFIG` | Set the configuration path (default: `$HOME/.tmux.conf`, `$XDG_CONFIG_HOME/tmux/tmux.conf`) | +| `ZSH_TMUX_DEFAULT_SESSION_NAME` | Set tmux default session name when autostart is enabled | +| `ZSH_TMUX_AUTONAME_SESSION` | Automatically name new sessions based on the basename of `$PWD` (default: `false`) | +| `ZSH_TMUX_DETACHED` | Set the detached mode (default: `false`) | +| `ZSH_TMUX_FIXTERM` | Sets `$TERM` to 256-color term or not based on current terminal support | +| `ZSH_TMUX_FIXTERM_WITHOUT_256COLOR` | `$TERM` to use for non 256-color terminals (default: `tmux` if available, `screen` otherwise) | +| `ZSH_TMUX_FIXTERM_WITH_256COLOR` | `$TERM` to use for 256-color terminals (default: `tmux-256color` if available, `screen-256color` otherwise) | +| `ZSH_TMUX_ITERM2` | Sets the `-CC` option for [iTerm2 tmux integration](https://iterm2.com/documentation-tmux-integration.html) (default: `false`) | +| `ZSH_TMUX_UNICODE` | Set `tmux -u` option to support unicode | From c13795d4c40fe075ec8b4450bb78b65ecf8108b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 15 Aug 2024 16:48:03 +0200 Subject: [PATCH 263/453] feat(git)!: ask for confirmation in `gpf` alias (#10169) - Rename `git push --force-with-lease ...` to `gpff` - Add a y/n confirmation prompt to `gpf` before running `git push --force-with-lease ...` BREAKING CHANGE: this change adds a confirmation prompt to the `gpf` alias before running the potentially destructive `git push --force-with-lease` command. If you want to force-run the command without having to confirm it, run `gpff`. --- plugins/git/README.md | 8 +++++--- plugins/git/git.plugin.zsh | 9 ++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/plugins/git/README.md b/plugins/git/README.md index bcd9aca96..592840f87 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -89,7 +89,7 @@ plugins=(... git) | `gdnolock` | `git diff $@ ":(exclude)package-lock.json" ":(exclude)\*.lock"` | | `gdt` | `git diff-tree --no-commit-id --name-only -r` | | `gf` | `git fetch` | -| `gfa` | `git fetch --all --tags --prune` | +| `gfa` | `git fetch --all --tags --prune` | | `gfo` | `git fetch origin` | | `gg` | `git gui citool` | | `gga` | `git gui citool --amend` | @@ -133,8 +133,10 @@ plugins=(... git) | `gpd` | `git push --dry-run` | | `gpf!` | `git push --force` | | `ggf` | `git push --force origin $(current_branch)` | -| `gpf` | On Git >= 2.30: `git push --force-with-lease --force-if-includes` | -| `gpf` | On Git < 2.30: `git push --force-with-lease` | +| `gpf` | On Git >= 2.30: after confirmation, `git push --force-with-lease --force-if-includes` | +| `gpf` | On Git < 2.30: after confirmation, `git push --force-with-lease` | +| `gpff` | On Git >= 2.30: `git push --force-with-lease --force-if-includes` | +| `gpff` | On Git < 2.30: `git push --force-with-lease` | | `ggfl` | `git push --force-with-lease origin $(current_branch)` | | `gpsup` | `git push --set-upstream origin $(git_current_branch)` | | `gpsupf` | On Git >= 2.30: `git push --set-upstream origin $(git_current_branch) --force-with-lease --force-if-includes` | diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 0a26399a2..99f640e88 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -297,10 +297,13 @@ function ggf() { } compdef _git ggf=git-checkout -alias gpf!='git push --force' +alias 'gpf!'='git push --force' is-at-least 2.30 "$git_version" \ - && alias gpf='git push --force-with-lease --force-if-includes' \ - || alias gpf='git push --force-with-lease' + && alias gpf='read -k 1 -q "?Continue force-push? [y/N] " && echo && git push --force-with-lease --force-if-includes' \ + || alias gpf='read -k 1 -q "?Continue force-push? [y/N] " && echo && git push --force-with-lease' +is-at-least 2.30 "$git_version" \ + && alias gpff='git push --force-with-lease --force-if-includes' \ + || alias gpff='git push --force-with-lease' function ggfl() { [[ "$#" != 1 ]] && local b="$(git_current_branch)" From f30df6c855d1df077adc6b226219629312015ec6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 15 Aug 2024 17:04:50 +0200 Subject: [PATCH 264/453] docs: document disclaimer about theme appearance --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index dc4f36864..0f20fd065 100644 --- a/README.md +++ b/README.md @@ -167,7 +167,15 @@ ZSH_THEME="agnoster" # (this is one of the fancy ones) # see https://github.com/ohmyzsh/ohmyzsh/wiki/Themes#agnoster ``` -_Note: many themes require installing a [Powerline Font](https://github.com/powerline/fonts) or a [Nerd Font](https://github.com/ryanoasis/nerd-fonts) in order to render properly. Without them, these themes will render [weird prompt symbols](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#i-have-a-weird-character-in-my-prompt)_ +> [!NOTE] +> You will many times see screenshots for a zsh theme, and try it out, and find that it doesn't look the same for you. +> +> This is because many themes require installing a [Powerline Font](https://github.com/powerline/fonts) or a [Nerd Font](https://github.com/ryanoasis/nerd-fonts) in order to render properly. +> Without them, these themes will render weird prompt symbols. Check out [the FAQ](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#i-have-a-weird-character-in-my-prompt) for more information. +> +> Also, beware that themes only control what your prompt looks like. This is, the text you see before or after your cursor, where you'll type your commands. +> Themes don't control things such as the colors of your terminal window (known as _color scheme_) or the font of your terminal. These are settings that you can change in your terminal emulator. +> For more information, see [what is a zsh theme](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#what-is-a-zsh-theme). Open up a new terminal window and your prompt should look something like this: From b0204f78394d84771436a7717aafee6cad140319 Mon Sep 17 00:00:00 2001 From: whisperity Date: Thu, 15 Aug 2024 17:53:03 +0200 Subject: [PATCH 265/453] feat(git): add `gmff`, `gprum(i)`, `grbum` aliases to work with `upstream` remotes (#11428) --- plugins/git/README.md | 4 ++++ plugins/git/git.plugin.zsh | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/plugins/git/README.md b/plugins/git/README.md index 592840f87..d3a927f23 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -114,6 +114,7 @@ plugins=(... git) | `gma` | `git merge --abort` | | `gmc` | `git merge --continue` | | `gms` | `git merge --squash` | +| `gmff` | `git merge --ff-only` | | `gmom` | `git merge origin/$(git_main_branch)` | | `gmum` | `git merge upstream/$(git_main_branch)` | | `gmtl` | `git mergetool --no-prompt` | @@ -125,6 +126,8 @@ plugins=(... git) | `gprav` | `git pull --rebase --autostash -v` | | `gprom` | `git pull --rebase origin $(git_main_branch)` | | `gpromi` | `git pull --rebase=interactive origin $(git_main_branch)` | +| `gprum` | `git pull --rebase upstream $(git_main_branch)` | +| `gprumi` | `git pull --rebase=interactive upstream $(git_main_branch)` | | `ggpull` | `git pull origin "$(git_current_branch)"` | | `ggl` | `git pull origin $(current_branch)` | | `gluc` | `git pull upstream $(git_current_branch)` | @@ -156,6 +159,7 @@ plugins=(... git) | `grbd` | `git rebase $(git_develop_branch)` | | `grbm` | `git rebase $(git_main_branch)` | | `grbom` | `git rebase origin/$(git_main_branch)` | +| `grbum` | `git rebase upstream/$(git_main_branch)` | | `grf` | `git reflog` | | `gr` | `git remote` | | `grv` | `git remote --verbose` | diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 99f640e88..8436fb440 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -255,6 +255,7 @@ alias gm='git merge' alias gma='git merge --abort' alias gmc='git merge --continue' alias gms="git merge --squash" +alias gmff="git merge --ff-only" alias gmom='git merge origin/$(git_main_branch)' alias gmum='git merge upstream/$(git_main_branch)' alias gmtl='git mergetool --no-prompt' @@ -274,6 +275,8 @@ compdef _git ggu=git-checkout alias gprom='git pull --rebase origin $(git_main_branch)' alias gpromi='git pull --rebase=interactive origin $(git_main_branch)' +alias gprum='git pull --rebase upstream $(git_main_branch)' +alias gprumi='git pull --rebase=interactive upstream $(git_main_branch)' alias ggpull='git pull origin "$(git_current_branch)"' function ggl() { @@ -340,6 +343,7 @@ alias grbs='git rebase --skip' alias grbd='git rebase $(git_develop_branch)' alias grbm='git rebase $(git_main_branch)' alias grbom='git rebase origin/$(git_main_branch)' +alias grbum='git rebase upstream/$(git_main_branch)' alias grf='git reflog' alias gr='git remote' alias grv='git remote --verbose' From 2056aeeeaddd977eb205619c6f236b94dac896be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 18 Aug 2024 11:22:30 +0200 Subject: [PATCH 266/453] Revert "feat(git)!: ask for confirmation in `gpf` alias (#10169)" This reverts commit c13795d4c40fe075ec8b4450bb78b65ecf8108b2. --- plugins/git/README.md | 8 +++----- plugins/git/git.plugin.zsh | 9 +++------ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/plugins/git/README.md b/plugins/git/README.md index d3a927f23..e03f204f7 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -89,7 +89,7 @@ plugins=(... git) | `gdnolock` | `git diff $@ ":(exclude)package-lock.json" ":(exclude)\*.lock"` | | `gdt` | `git diff-tree --no-commit-id --name-only -r` | | `gf` | `git fetch` | -| `gfa` | `git fetch --all --tags --prune` | +| `gfa` | `git fetch --all --tags --prune` | | `gfo` | `git fetch origin` | | `gg` | `git gui citool` | | `gga` | `git gui citool --amend` | @@ -136,10 +136,8 @@ plugins=(... git) | `gpd` | `git push --dry-run` | | `gpf!` | `git push --force` | | `ggf` | `git push --force origin $(current_branch)` | -| `gpf` | On Git >= 2.30: after confirmation, `git push --force-with-lease --force-if-includes` | -| `gpf` | On Git < 2.30: after confirmation, `git push --force-with-lease` | -| `gpff` | On Git >= 2.30: `git push --force-with-lease --force-if-includes` | -| `gpff` | On Git < 2.30: `git push --force-with-lease` | +| `gpf` | On Git >= 2.30: `git push --force-with-lease --force-if-includes` | +| `gpf` | On Git < 2.30: `git push --force-with-lease` | | `ggfl` | `git push --force-with-lease origin $(current_branch)` | | `gpsup` | `git push --set-upstream origin $(git_current_branch)` | | `gpsupf` | On Git >= 2.30: `git push --set-upstream origin $(git_current_branch) --force-with-lease --force-if-includes` | diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 8436fb440..28d5cb314 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -300,13 +300,10 @@ function ggf() { } compdef _git ggf=git-checkout -alias 'gpf!'='git push --force' +alias gpf!='git push --force' is-at-least 2.30 "$git_version" \ - && alias gpf='read -k 1 -q "?Continue force-push? [y/N] " && echo && git push --force-with-lease --force-if-includes' \ - || alias gpf='read -k 1 -q "?Continue force-push? [y/N] " && echo && git push --force-with-lease' -is-at-least 2.30 "$git_version" \ - && alias gpff='git push --force-with-lease --force-if-includes' \ - || alias gpff='git push --force-with-lease' + && alias gpf='git push --force-with-lease --force-if-includes' \ + || alias gpf='git push --force-with-lease' function ggfl() { [[ "$#" != 1 ]] && local b="$(git_current_branch)" From c10a99406a779606fe32eb9b824c90a91f95c842 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Tue, 20 Aug 2024 16:34:08 +0200 Subject: [PATCH 267/453] chore: typo --- templates/zshrc.zsh-template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 930015798..3546ed82b 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -85,7 +85,7 @@ source $ZSH/oh-my-zsh.sh # if [[ -n $SSH_CONNECTION ]]; then # export EDITOR='vim' # else -# export EDITOR='mvim' +# export EDITOR='nvim' # fi # Compilation flags From ebb479e5e2395d26fc368c9b9d534e935a292740 Mon Sep 17 00:00:00 2001 From: Mathias Date: Wed, 21 Aug 2024 18:50:42 +0300 Subject: [PATCH 268/453] feat(mix): add mix plugin test.watch (#10963) --- plugins/mix/README.md | 1 + plugins/mix/_mix | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/mix/README.md b/plugins/mix/README.md index f0258fe88..9bbe53a41 100644 --- a/plugins/mix/README.md +++ b/plugins/mix/README.md @@ -17,3 +17,4 @@ plugins=(... mix) | Ecto | [Ecto](https://hexdocs.pm/ecto/Ecto.html) | | Hex | [Hex](https://hex.pm/) | | Nerves | [Nerves](https://nerves-project.org/) | +| mix_test_watch | [mix_test_watch](https://hex.pm/packages/mix_test_watch) | diff --git a/plugins/mix/_mix b/plugins/mix/_mix index 7940ff1c9..656c7fe19 100644 --- a/plugins/mix/_mix +++ b/plugins/mix/_mix @@ -109,6 +109,7 @@ _1st_arguments=( 'release.init:Generates sample files for releases' 'run:Run the given file or expression' "test:Run a project's tests" + "test.watch:Run a project's tests continuously using hex package mix_test_watch" 'test.coverage:Build report from exported test coverage' 'xref:Prints cross reference information' '--help:Describe available tasks' @@ -120,7 +121,7 @@ __task_list () local expl declare -a tasks - tasks=(app.config app.start app.tree archive archive.build archive.install archive.uninstall clean cmd compile compile.protocols deps deps.clean deps.compile deps.get deps.tree deps.unlock deps.update do ecto.create ecto.drop ecto.dump ecto.gen.migration ecto.gen.repo ecto.load ecto.migrate ecto.migrations ecto.rollback escript escript.build escript.install escript.uninstall firmware firmware.burn firmware.image format help hex hex.audit hex.build hex.config hex.docs hex.info hex.organization hex.key hex.outdated hex.owner hex.package hex.publish hex.registry hex.repo hex.retire hex.search hex.sponsor hex.user loadconfig local local.hex local.phoenix local.phx local.public_keys local.rebar nerves.artifact nerves.artifact.get nerves.info nerves.new nerves.release.init new phoenix.digest phoenix.gen.channel phoenix.gen.html phoenix.gen.json phoenix.gen.model phoenix.gen.secret phoenix.new phoenix.routes phoenix.server phx.digest phx.digest.clean phx.gen.auth phx.gen.cert phx.gen.channel phx.gen.context phx.gen.embedded phx.gen.html phx.gen.json phx.gen.live phx.gen.notifier phx.gen.presence phx.gen.schema phx.gen.secret phx.gen.socket phx.new phx.new.ecto phx.new.web phx.routes phx.server profile.cprof profile.eprof profile.fprof release release.init run test test.coverage xref) + tasks=(app.config app.start app.tree archive archive.build archive.install archive.uninstall clean cmd compile compile.protocols deps deps.clean deps.compile deps.get deps.tree deps.unlock deps.update do ecto.create ecto.drop ecto.dump ecto.gen.migration ecto.gen.repo ecto.load ecto.migrate ecto.migrations ecto.rollback escript escript.build escript.install escript.uninstall firmware firmware.burn firmware.image format help hex hex.audit hex.build hex.config hex.docs hex.info hex.organization hex.key hex.outdated hex.owner hex.package hex.publish hex.registry hex.repo hex.retire hex.search hex.sponsor hex.user loadconfig local local.hex local.phoenix local.phx local.public_keys local.rebar nerves.artifact nerves.artifact.get nerves.info nerves.new nerves.release.init new phoenix.digest phoenix.gen.channel phoenix.gen.html phoenix.gen.json phoenix.gen.model phoenix.gen.secret phoenix.new phoenix.routes phoenix.server phx.digest phx.digest.clean phx.gen.auth phx.gen.cert phx.gen.channel phx.gen.context phx.gen.embedded phx.gen.html phx.gen.json phx.gen.live phx.gen.notifier phx.gen.presence phx.gen.schema phx.gen.secret phx.gen.socket phx.new phx.new.ecto phx.new.web phx.routes phx.server profile.cprof profile.eprof profile.fprof release release.init run test test.watch test.coverage xref) _wanted tasks expl 'help' compadd $tasks } @@ -148,6 +149,9 @@ case $state in (test) _files ;; + (test.watch) + _files + ;; (run) _files ;; From f622e6a6367b5142c868f554fda968982226e5df Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 25 Aug 2024 17:15:23 +0200 Subject: [PATCH 269/453] chore(deps): bump idna from 3.7 to 3.8 in /.github/workflows/dependencies (#12638) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependencies/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt index 2a383e14b..81a119844 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -1,6 +1,6 @@ certifi==2024.7.4 charset-normalizer==3.3.2 -idna==3.7 +idna==3.8 PyYAML==6.0.2 requests==2.32.3 semver==3.0.2 From efe21261d031b4836f64112a899706322acd26b0 Mon Sep 17 00:00:00 2001 From: robertoaceves Date: Tue, 27 Aug 2024 02:13:47 -0400 Subject: [PATCH 270/453] fix(grep): remove duplicate options (#12639) --- lib/grep.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/grep.zsh b/lib/grep.zsh index 54e0f694e..5b3dec87e 100644 --- a/lib/grep.zsh +++ b/lib/grep.zsh @@ -24,8 +24,8 @@ else if [[ -n "$GREP_OPTIONS" ]]; then # export grep, egrep and fgrep settings alias grep="grep $GREP_OPTIONS" - alias egrep="grep -E $GREP_OPTIONS" - alias fgrep="grep -F $GREP_OPTIONS" + alias egrep="grep -E" + alias fgrep="grep -F" # write to cache file if cache directory is writable if [[ -w "$ZSH_CACHE_DIR" ]]; then From a3dfe290363c5f0ac6add41a1126d7c842a4d7c4 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Wed, 28 Aug 2024 10:34:25 +0200 Subject: [PATCH 271/453] feat(nvm): add `pnpx` as lazy cmd --- plugins/nvm/README.md | 7 ++++--- plugins/nvm/nvm.plugin.zsh | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/nvm/README.md b/plugins/nvm/README.md index eb1e236ee..fe91cc3b2 100644 --- a/plugins/nvm/README.md +++ b/plugins/nvm/README.md @@ -26,9 +26,10 @@ These settings should go in your zshrc file, before Oh My Zsh is sourced: #### Lazy startup This option will help you to defer nvm's load until you use it to speed-up your zsh startup. This will source -nvm script only when using it, and will create a function for `node`, `npm`, `npx`, `pnpm`, `yarn`, `corepack` -and the command(s) specified by `lazy-cmd` option, so when you call either of them, nvm will be loaded and run -with default version. To enable it, you can add this snippet to your zshrc, before Oh My Zsh is sourced: +nvm script only when using it, and will create a function for `node`, `npm`, `npx`, `pnpm`, `pnpx`, `yarn`, +`corepack` and the command(s) specified by `lazy-cmd` option, so when you call either of them, nvm will be +loaded and run with default version. To enable it, you can add this snippet to your zshrc, before Oh My Zsh is +sourced: ```zsh zstyle ':omz:plugins:nvm' lazy yes diff --git a/plugins/nvm/nvm.plugin.zsh b/plugins/nvm/nvm.plugin.zsh index f36182eda..a00c2e117 100644 --- a/plugins/nvm/nvm.plugin.zsh +++ b/plugins/nvm/nvm.plugin.zsh @@ -74,7 +74,7 @@ function _omz_setup_autoload { if zstyle -t ':omz:plugins:nvm' lazy; then # Call nvm when first using nvm, node, npm, pnpm, yarn, corepack or other commands in lazy-cmd zstyle -a ':omz:plugins:nvm' lazy-cmd nvm_lazy_cmd - nvm_lazy_cmd=(nvm node npm npx pnpm yarn corepack $nvm_lazy_cmd) # default values + nvm_lazy_cmd=(nvm node npm npx pnpm pnpx yarn corepack $nvm_lazy_cmd) # default values eval " function $nvm_lazy_cmd { for func in $nvm_lazy_cmd; do From c80050d6f538d6d8d8942068ea9bf1d4de2b14e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Wed, 28 Aug 2024 14:27:50 +0200 Subject: [PATCH 272/453] fix(scd): avoid hardcoded binary path (#12641) Co-authored-by: Carlo Sala --- plugins/scd/scd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/scd/scd b/plugins/scd/scd index 7e9654b44..c79de4538 100755 --- a/plugins/scd/scd +++ b/plugins/scd/scd @@ -445,7 +445,7 @@ _scd_Y19oug_match() { # build a list of matching directories reverse-sorted by their probabilities dmatching=( ${(f)"$( builtin printf "%s %s\n" ${(Oakv)drank} | - /usr/bin/sort -grk1 )"} + command sort -grk1 )"} ) dmatching=( ${dmatching#*[[:blank:]]} ) From e2ba73af6342fed58c1b26391f105a447110d520 Mon Sep 17 00:00:00 2001 From: Luke Ashe-Browne Date: Wed, 28 Aug 2024 23:01:36 +0100 Subject: [PATCH 273/453] feat(tailscale): new tailscale plugin (#12523) --- plugins/tailscale/README.md | 11 +++++++++++ plugins/tailscale/tailscale.plugin.zsh | 4 ++++ 2 files changed, 15 insertions(+) create mode 100644 plugins/tailscale/README.md create mode 100644 plugins/tailscale/tailscale.plugin.zsh diff --git a/plugins/tailscale/README.md b/plugins/tailscale/README.md new file mode 100644 index 000000000..be5a62137 --- /dev/null +++ b/plugins/tailscale/README.md @@ -0,0 +1,11 @@ +# tailscale + +This plugin provides completion for [tailscale](https://tailscale.com/) (Easy software-defined networks using an implementation of wireguard). + +To use it, add `tailscale` to the plugins array in your zshrc file. + +``` +plugins=(... tailscale) +``` + +**Author:** [@lukeab](https://github.com/lukeab) diff --git a/plugins/tailscale/tailscale.plugin.zsh b/plugins/tailscale/tailscale.plugin.zsh new file mode 100644 index 000000000..ae664a665 --- /dev/null +++ b/plugins/tailscale/tailscale.plugin.zsh @@ -0,0 +1,4 @@ + +if [ $commands[tailscale] ]; then + source <(tailscale completion zsh) +fi From ea8068aa3eeecc785249f2e83289e8a9294b9d6b Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 29 Aug 2024 12:19:19 +0200 Subject: [PATCH 274/453] fix(tailscale): make completion loading async --- plugins/tailscale/tailscale.plugin.zsh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/plugins/tailscale/tailscale.plugin.zsh b/plugins/tailscale/tailscale.plugin.zsh index ae664a665..7f0b1414a 100644 --- a/plugins/tailscale/tailscale.plugin.zsh +++ b/plugins/tailscale/tailscale.plugin.zsh @@ -1,4 +1,13 @@ - -if [ $commands[tailscale] ]; then - source <(tailscale completion zsh) +if (( ! $+commands[tailscale] )); then + return fi + +# If the completion file doesn't exist yet, we need to autoload it and +# bind it to `tailscale`. Otherwise, compinit will have already done that. +if [[ ! -f "$ZSH_CACHE_DIR/completions/_tailscale" ]]; then + typeset -g -A _comps + autoload -Uz _tailscale + _comps[tailscale]=_tailscale +fi + +tailscale completion zsh >| "$ZSH_CACHE_DIR/completions/_tailscale" &| From c68ff8aeedc2b779ae42d745457ecd443e22e212 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Fri, 30 Aug 2024 14:30:57 +0200 Subject: [PATCH 275/453] feat(extract): add support for .vsix files (VS Code extension) (#12643) --- plugins/extract/README.md | 1 + plugins/extract/extract.plugin.zsh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/extract/README.md b/plugins/extract/README.md index c8d98b229..e0f571521 100644 --- a/plugins/extract/README.md +++ b/plugins/extract/README.md @@ -52,6 +52,7 @@ plugins=(... extract) | `tlz` | Tarball with lzma compression | | `txz` | Tarball with lzma2 compression | | `tzst` | Tarball with zstd compression | +| `vsix` | VS Code extension zip file | | `war` | Web Application archive (Java-based) | | `whl` | Python wheel file | | `xpi` | Mozilla XPI module file | diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index e2b3111d5..f2eebf4d6 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -76,7 +76,7 @@ EOF (*.lz4) lz4 -d "$full_path" ;; (*.lzma) unlzma "$full_path" ;; (*.z) uncompress "$full_path" ;; - (*.zip|*.war|*.jar|*.ear|*.sublime-package|*.ipa|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$full_path" ;; + (*.zip|*.war|*.jar|*.ear|*.sublime-package|*.ipa|*.ipsw|*.xpi|*.apk|*.aar|*.whl|*.vsix) unzip "$full_path" ;; (*.rar) unrar x -ad "$full_path" ;; (*.rpm) rpm2cpio "$full_path" | cpio --quiet -id ;; From d78275fdbb876cee9c55f5c2731b8c1fac7be6d2 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Sun, 1 Sep 2024 21:01:27 +0200 Subject: [PATCH 276/453] chore: fix typos (#12647) --- plugins/bedtools/_bedtools | 2 +- plugins/brew/brew.plugin.zsh | 2 +- plugins/docker/docker.plugin.zsh | 2 +- plugins/emoji/update_emoji.py | 4 ++-- plugins/gem/gem.plugin.zsh | 2 +- plugins/history-substring-search/history-substring-search.zsh | 4 ++-- plugins/hitchhiker/fortunes/hitchhiker | 2 +- plugins/lpass/_lpass | 2 +- plugins/python/python.plugin.zsh | 2 +- plugins/rails/_rails | 4 ++-- plugins/swiftpm/_swift | 2 +- plugins/zsh-navigation-tools/README.md | 2 +- plugins/zsh-navigation-tools/doc/n-preview | 2 +- 13 files changed, 16 insertions(+), 16 deletions(-) diff --git a/plugins/bedtools/_bedtools b/plugins/bedtools/_bedtools index ef6c4179a..15e3dc2ff 100644 --- a/plugins/bedtools/_bedtools +++ b/plugins/bedtools/_bedtools @@ -47,7 +47,7 @@ case $state in "random[Generate random intervals in a genome.]" \ "reldist[Calculate the distribution of relative distances b/w two files.]" \ "sample[Sample random records from file using reservoir sampling.]" \ - "shuffle[Randomly redistrubute intervals in a genome.]" \ + "shuffle[Randomly redistribute intervals in a genome.]" \ "slop[Adjust the size of intervals.]" \ "sort[Order the intervals in a file.]" \ "subtract[Remove intervals based on overlaps b/w two files.]" \ diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh index a138a4827..4dab6f413 100644 --- a/plugins/brew/brew.plugin.zsh +++ b/plugins/brew/brew.plugin.zsh @@ -24,7 +24,7 @@ if (( ! $+commands[brew] )); then fi if [[ -z "$HOMEBREW_PREFIX" ]]; then - # Maintain compatability with potential custom user profiles, where we had + # Maintain compatibility with potential custom user profiles, where we had # previously relied on always sourcing shellenv. OMZ plugins should not rely # on this to be defined due to out of order processing. export HOMEBREW_PREFIX="$(brew --prefix)" diff --git a/plugins/docker/docker.plugin.zsh b/plugins/docker/docker.plugin.zsh index 19269427e..16db77df6 100644 --- a/plugins/docker/docker.plugin.zsh +++ b/plugins/docker/docker.plugin.zsh @@ -39,7 +39,7 @@ if (( ! $+commands[docker] )); then return fi -# Standarized $0 handling +# Standardized $0 handling # https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html 0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" 0="${${(M)0:#/*}:-$PWD/$0}" diff --git a/plugins/emoji/update_emoji.py b/plugins/emoji/update_emoji.py index 18b3c060d..9e115a7fa 100644 --- a/plugins/emoji/update_emoji.py +++ b/plugins/emoji/update_emoji.py @@ -1,6 +1,6 @@ """ Update Emoji.py -Refeshes OMZ emoji database based on the latest Unicode spec +Refreshes OMZ emoji database based on the latest Unicode spec """ import re import json @@ -95,7 +95,7 @@ def name_to_omz(_name, _group, _subgroup, _status): shortname = snake_case(_name) # Special treatment by status # Enables us to have every emoji combination, - # even the one that are not officially sanctionned + # even the one that are not officially sanctioned # and are implemented by, say, only one vendor if _status == "unqualified": shortname += "_unqualified" diff --git a/plugins/gem/gem.plugin.zsh b/plugins/gem/gem.plugin.zsh index b8a49fb56..58716594d 100644 --- a/plugins/gem/gem.plugin.zsh +++ b/plugins/gem/gem.plugin.zsh @@ -23,7 +23,7 @@ if is-at-least 5.5; then fi { - # Standarized $0 handling + # Standardized $0 handling # https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html 0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" 0="${${(M)0:#/*}:-$PWD/$0}" diff --git a/plugins/history-substring-search/history-substring-search.zsh b/plugins/history-substring-search/history-substring-search.zsh index 2137b7950..9f0e0b0d5 100644 --- a/plugins/history-substring-search/history-substring-search.zsh +++ b/plugins/history-substring-search/history-substring-search.zsh @@ -295,8 +295,8 @@ _history-substring-search-begin() { fi # - # Escape and join query parts with wildcard character '*' as seperator - # `(j:CHAR:)` join array to string with CHAR as seperator + # Escape and join query parts with wildcard character '*' as separator + # `(j:CHAR:)` join array to string with CHAR as separator # local search_pattern="${(j:*:)_history_substring_search_query_parts[@]//(#m)[\][()|\\*?#<>~^]/\\$MATCH}*" diff --git a/plugins/hitchhiker/fortunes/hitchhiker b/plugins/hitchhiker/fortunes/hitchhiker index 94cc1c835..6620a2a4f 100644 --- a/plugins/hitchhiker/fortunes/hitchhiker +++ b/plugins/hitchhiker/fortunes/hitchhiker @@ -42,7 +42,7 @@ - Zaphod. % -"`In those days spirits were brave, the stakes were high, men were REAL men, women were REAL women, and small furry creatures from Alpha Centauri were REAL small furry creatures from Aplha Centauri.'" +"`In those days spirits were brave, the stakes were high, men were REAL men, women were REAL women, and small furry creatures from Alpha Centauri were REAL small furry creatures from Alpha Centauri.'" - The Book getting all nostalgic. % diff --git a/plugins/lpass/_lpass b/plugins/lpass/_lpass index 621a7bcd7..e312fb9a3 100644 --- a/plugins/lpass/_lpass +++ b/plugins/lpass/_lpass @@ -78,7 +78,7 @@ _lpass() { has_sync=1 ;; status) - _arguments : '(-q --quiet)'{-q,--quiet}'[Supress output to stdout]' + _arguments : '(-q --quiet)'{-q,--quiet}'[Suppress output to stdout]' has_color=1 ;; sync) diff --git a/plugins/python/python.plugin.zsh b/plugins/python/python.plugin.zsh index 6d7f440aa..811745257 100644 --- a/plugins/python/python.plugin.zsh +++ b/plugins/python/python.plugin.zsh @@ -74,7 +74,7 @@ function vrun() { } # Create a new virtual environment using the specified name. -# If none specfied, use $PYTHON_VENV_NAME +# If none specified, use $PYTHON_VENV_NAME function mkv() { local name="${1:-$PYTHON_VENV_NAME}" local venvpath="${name:P}" diff --git a/plugins/rails/_rails b/plugins/rails/_rails index 48fd1909e..dbd843c80 100644 --- a/plugins/rails/_rails +++ b/plugins/rails/_rails @@ -366,10 +366,10 @@ _rails_generate() { ;| (controller|job|model|resource|scaffold) opts+=( - '--parent=[The parent class for the generated controler]:parent class' + '--parent=[The parent class for the generated controller]:parent class' ) ;| - (controler|mailer|resource|scaffold|scaffold_controller) + (controller|mailer|resource|scaffold|scaffold_controller) opts+=( '(-e --template-engine)'{-e,--template-engine=}'[Template engine to be invoked]:engine:(erb)' ) diff --git a/plugins/swiftpm/_swift b/plugins/swiftpm/_swift index f9a603f58..358d1dcae 100644 --- a/plugins/swiftpm/_swift +++ b/plugins/swiftpm/_swift @@ -634,7 +634,7 @@ _swift_package_unedit() { integer ret=1 local -a args args+=( - '--force[Unedit the package even if it has uncommited and unpushed changes]' + '--force[Unedit the package even if it has uncommitted and unpushed changes]' ':package-name:' '--version[Show the version.]' '(-help -h --help)'{-help,-h,--help}'[Show help information.]' diff --git a/plugins/zsh-navigation-tools/README.md b/plugins/zsh-navigation-tools/README.md index 4dc9cdba2..6d6c22f4f 100644 --- a/plugins/zsh-navigation-tools/README.md +++ b/plugins/zsh-navigation-tools/README.md @@ -185,7 +185,7 @@ Result is stored as `$reply[REPLY]` (`$` isn't needed before `REPLY` because of arithmetic context inside `[]`). The returned array might be different from input arguments as `n-list` can process them via incremental search or uniq mode. `$REPLY` is the index in that possibly processed array. If `$REPLY` -equals `-1` it means that no selection have been made (user quitted via `q` +equals `-1` it means that no selection have been made (user quit via `q` key). To set up entries that can be jumped to with `[`,`]` keys add their indices to diff --git a/plugins/zsh-navigation-tools/doc/n-preview b/plugins/zsh-navigation-tools/doc/n-preview index 2d8eea3fb..bcbbb88c7 100644 --- a/plugins/zsh-navigation-tools/doc/n-preview +++ b/plugins/zsh-navigation-tools/doc/n-preview @@ -170,7 +170,7 @@ while (( 1 )); do elif [ -n "$keypad" ]; then final_key="$keypad" else - _vpreview_status_msg "Inproper input detected" + _vpreview_status_msg "Improper input detected" zcurses refresh status fi From b8c69d265257fae88fe504ea43cbcf2728bc1308 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Sep 2024 21:02:04 +0200 Subject: [PATCH 277/453] chore(deps): bump certifi in /.github/workflows/dependencies (#12646) Bumps [certifi](https://github.com/certifi/python-certifi) from 2024.7.4 to 2024.8.30. - [Commits](https://github.com/certifi/python-certifi/compare/2024.07.04...2024.08.30) --- updated-dependencies: - dependency-name: certifi dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependencies/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt index 81a119844..7cf0b642f 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -1,4 +1,4 @@ -certifi==2024.7.4 +certifi==2024.8.30 charset-normalizer==3.3.2 idna==3.8 PyYAML==6.0.2 From ab3d42a34cd0600b723de0accc248632f2dcf4e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 3 Sep 2024 23:35:22 +0200 Subject: [PATCH 278/453] Revert "fix(awesomepanda): new line wrap" (#12651) This reverts commit 80c114cb3a64044ea50b623f96a35bc022db5e8d. --- themes/awesomepanda.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/awesomepanda.zsh-theme b/themes/awesomepanda.zsh-theme index 000697397..85036e4ac 100644 --- a/themes/awesomepanda.zsh-theme +++ b/themes/awesomepanda.zsh-theme @@ -1,6 +1,6 @@ # the svn plugin has to be activated for this to work. local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)" -PROMPT='%{${ret_status}%}%{$fg_bold[green]%} %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}$(svn_prompt_info)%{$reset_color%}' +PROMPT='${ret_status}%{$fg_bold[green]%} %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}$(svn_prompt_info)%{$reset_color%}' ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" From e50dd3417c8b9e072593b6c14473e1360bd88b02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 5 Sep 2024 12:07:18 +0200 Subject: [PATCH 279/453] feat(extract): add support for `.crx` (Chrome extension format) (#12652) --- plugins/extract/_extract | 49 +++++++++++++++++++++++++++++- plugins/extract/extract.plugin.zsh | 2 +- 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/plugins/extract/_extract b/plugins/extract/_extract index 56b17058f..0b43e86bc 100644 --- a/plugins/extract/_extract +++ b/plugins/extract/_extract @@ -1,7 +1,54 @@ #compdef extract #autoload +local -a exts=( + 7z + aar + apk + bz2 + cab + cpio + crx + deb + ear + gz + ipa + ipsw + jar + lrz + lz4 + lzma + obscpio + rar + rpm + sublime-package + tar + tar.bz2 + tar.gz + tar.lrz + tar.lz + tar.lz4 + tar.xz + tar.zma + tar.zst + tbz + tbz2 + tgz + tlz + txz + tzst + vsix + war + whl + xpi + xz + Z + zip + zpaq + zst +) + _arguments \ '(-r --remove)'{-r,--remove}'[Remove archive.]' \ - "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|cab|cpio|deb|ear|gz|ipa|ipsw|jar|lrz|lz4|lzma|obscpio|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lrz|tar.lz|tar.lz4|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst|zpaq)(-.)'" \ + "*::archive file:_files -g '(#i)*.(${(j:|:)exts})(-.)'" \ && return 0 diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index f2eebf4d6..aa3fd00e6 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -76,7 +76,7 @@ EOF (*.lz4) lz4 -d "$full_path" ;; (*.lzma) unlzma "$full_path" ;; (*.z) uncompress "$full_path" ;; - (*.zip|*.war|*.jar|*.ear|*.sublime-package|*.ipa|*.ipsw|*.xpi|*.apk|*.aar|*.whl|*.vsix) unzip "$full_path" ;; + (*.zip|*.war|*.jar|*.ear|*.sublime-package|*.ipa|*.ipsw|*.xpi|*.apk|*.aar|*.whl|*.vsix|*.crx) unzip "$full_path" ;; (*.rar) unrar x -ad "$full_path" ;; (*.rpm) rpm2cpio "$full_path" | cpio --quiet -id ;; From 2acfe1aa0e0c6a9c316fbec508f43dcf9f292ce3 Mon Sep 17 00:00:00 2001 From: Eduardo Dos Santos Vilke Date: Thu, 5 Sep 2024 14:40:19 -0300 Subject: [PATCH 280/453] feat(localstack): add plugin (#12595) --- plugins/localstack/README.md | 24 +++++++++++++++ plugins/localstack/localstack.plugin.zsh | 37 +++++++++++++++++++++++ plugins/localstack/sqs-send-result.png | Bin 0 -> 70661 bytes 3 files changed, 61 insertions(+) create mode 100644 plugins/localstack/README.md create mode 100644 plugins/localstack/localstack.plugin.zsh create mode 100644 plugins/localstack/sqs-send-result.png diff --git a/plugins/localstack/README.md b/plugins/localstack/README.md new file mode 100644 index 000000000..2c71e9edf --- /dev/null +++ b/plugins/localstack/README.md @@ -0,0 +1,24 @@ +# Localstack plugin # + +CLI support for LOCALSTACK interaction + +## Description ## +To use it, add `localstack` to the plugins array in your zshrc file: + +```zsh +plugins=(... localstack) +``` + +## Usage ## + +This plugin supplies one command, `lsk`, through which all its features are exposed. + +## Commands + +| Command | Description | +| :------------ | :-------------------------------------------------------------------- | +| `lsk sqs-send ` | sends a given message in sqs to a given queue | + +## Examples + +![staging](sqs-send-result.png) diff --git a/plugins/localstack/localstack.plugin.zsh b/plugins/localstack/localstack.plugin.zsh new file mode 100644 index 000000000..080b14a54 --- /dev/null +++ b/plugins/localstack/localstack.plugin.zsh @@ -0,0 +1,37 @@ +# CLI support for LOCALSTACK interaction +# +# See README.md for details +lsk() { + case $1 in + sqs-send) + shift + sqs-send "$@" + ;; + *) + echo "Command not found: $1" + return 1 + ;; + esac +} + +# Send SQS function +# +# This function sends a given message in sqs to a given queue, when used Localstack +# +# Use: +# sqs-send +# +# Parameters +# A given queue +# A content of message em json archive +# +# Example +# sqs-send user user.json +sqs-send(){ + if [ -z "$1" ]; then + echo "Use: sqs-send " + return 1 + fi + + curl -X POST "http://localhost:4566/000000000000/$1" -d "Action=SendMessage" -d "MessageBody=$(cat $2)" +} \ No newline at end of file diff --git a/plugins/localstack/sqs-send-result.png b/plugins/localstack/sqs-send-result.png new file mode 100644 index 0000000000000000000000000000000000000000..69eb2a64096b0b3fc476234fce1c50e51ea56b5a GIT binary patch literal 70661 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 Date: Thu, 5 Sep 2024 19:52:39 +0200 Subject: [PATCH 281/453] feat(terraform): add `fmt -recursive` alias (#12637) --- plugins/opentofu/README.md | 33 +++++++++++++------------- plugins/opentofu/opentofu.plugin.zsh | 1 + plugins/terraform/README.md | 31 ++++++++++++------------ plugins/terraform/terraform.plugin.zsh | 1 + 4 files changed, 35 insertions(+), 31 deletions(-) diff --git a/plugins/opentofu/README.md b/plugins/opentofu/README.md index 9c19501aa..9811e2751 100644 --- a/plugins/opentofu/README.md +++ b/plugins/opentofu/README.md @@ -15,22 +15,23 @@ plugins=(... opentofu) ## Aliases -| Alias | Command | -| ----- | --------------- | -| `tt` | `tofu` | -| `tta` | `tofu apply` | -| `ttc` | `tofu console` | -| `ttd` | `tofu destroy` | -| `ttf` | `tofu fmt` | -| `tti` | `tofu init` | -| `tto` | `tofu output` | -| `ttp` | `tofu plan` | -| `ttv` | `tofu validate` | -| `tts` | `tofu state` | -| `ttsh`| `tofu show` | -| `ttr` | `tofu refresh` | -| `ttt` | `tofu test` | -| `ttws`| `tofu workspace`| +| Alias | Command | +|--------|-----------------------| +| `tt` | `tofu` | +| `tta` | `tofu apply` | +| `ttc` | `tofu console` | +| `ttd` | `tofu destroy` | +| `ttf` | `tofu fmt` | +| `ttfr` | `tofu fmt -recursive` | +| `tti` | `tofu init` | +| `tto` | `tofu output` | +| `ttp` | `tofu plan` | +| `ttv` | `tofu validate` | +| `tts` | `tofu state` | +| `ttsh` | `tofu show` | +| `ttr` | `tofu refresh` | +| `ttt` | `tofu test` | +| `ttws` | `tofu workspace` | ## Prompt functions diff --git a/plugins/opentofu/opentofu.plugin.zsh b/plugins/opentofu/opentofu.plugin.zsh index c6844c84a..aa6cac78a 100644 --- a/plugins/opentofu/opentofu.plugin.zsh +++ b/plugins/opentofu/opentofu.plugin.zsh @@ -32,6 +32,7 @@ alias tta='tofu apply' alias ttc='tofu console' alias ttd='tofu destroy' alias ttf='tofu fmt' +alias ttfr='tofu fmt -recursive' alias tti='tofu init' alias tto='tofu output' alias ttp='tofu plan' diff --git a/plugins/terraform/README.md b/plugins/terraform/README.md index b5158b4e9..ca5a771bc 100644 --- a/plugins/terraform/README.md +++ b/plugins/terraform/README.md @@ -15,21 +15,22 @@ plugins=(... terraform) ## Aliases -| Alias | Command | -| ------ | ------------------------- | -| `tf` | `terraform` | -| `tfa` | `terraform apply` | -| `tfc` | `terraform console` | -| `tfd` | `terraform destroy` | -| `tff` | `terraform fmt` | -| `tfi` | `terraform init` | -| `tfiu` | `terraform init -upgrade` | -| `tfo` | `terraform output` | -| `tfp` | `terraform plan` | -| `tfv` | `terraform validate` | -| `tfs` | `terraform state` | -| `tft` | `terraform test` | -| `tfsh` | `terraform show` | +| Alias | Command | +|--------|----------------------------| +| `tf` | `terraform` | +| `tfa` | `terraform apply` | +| `tfc` | `terraform console` | +| `tfd` | `terraform destroy` | +| `tff` | `terraform fmt` | +| `tffr` | `terraform fmt -recursive` | +| `tfi` | `terraform init` | +| `tfiu` | `terraform init -upgrade` | +| `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 71a58b939..181f57b9b 100644 --- a/plugins/terraform/terraform.plugin.zsh +++ b/plugins/terraform/terraform.plugin.zsh @@ -20,6 +20,7 @@ alias tfa='terraform apply' alias tfc='terraform console' alias tfd='terraform destroy' alias tff='terraform fmt' +alias tffr='terraform fmt -recursive' alias tfi='terraform init' alias tfiu='terraform init -upgrade' alias tfo='terraform output' From bc42097900e296a20f979b4ab836d4fd07670778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my?= Date: Thu, 5 Sep 2024 19:57:11 +0200 Subject: [PATCH 282/453] feat(kubectl): show labels in aliases `kgpsl` (get pod) and `kgnosl` (get node) (#12612) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marc Cornellà --- plugins/kubectl/README.md | 234 +++++++++++++++-------------- plugins/kubectl/kubectl.plugin.zsh | 10 +- 2 files changed, 122 insertions(+), 122 deletions(-) diff --git a/plugins/kubectl/README.md b/plugins/kubectl/README.md index 579a90b3b..28a502d11 100644 --- a/plugins/kubectl/README.md +++ b/plugins/kubectl/README.md @@ -11,122 +11,124 @@ plugins=(... kubectl) ## Aliases -| Alias | Command | Description | -|:--------|:------------------------------------|:-------------------------------------------------------------------------------------------------| -| k | `kubectl` | The kubectl command | -| kca | `kubectl --all-namespaces` | The kubectl command targeting all namespaces | -| kaf | `kubectl apply -f` | Apply a YML file | -| keti | `kubectl exec -ti` | Drop into an interactive terminal on a container | -| | | **Manage configuration quickly to switch contexts between local, dev and staging** | -| kcuc | `kubectl config use-context` | Set the current-context in a kubeconfig file | -| kcsc | `kubectl config set-context` | Set a context entry in kubeconfig | -| kcdc | `kubectl config delete-context` | Delete the specified context from the kubeconfig | -| kccc | `kubectl config current-context` | Display the current-context | -| kcgc | `kubectl config get-contexts` | List of contexts available | -| | | **General aliases** | -| kdel | `kubectl delete` | Delete resources by filenames, stdin, resources and names, or by resources and label selector | -| kdelf | `kubectl delete -f` | Delete a pod using the type and name specified in -f argument | -| | | **Pod management** | -| kgp | `kubectl get pods` | List all pods in ps output format | -| kgpw | `kgp --watch` | After listing/getting the requested object, watch for changes | -| kgpwide | `kgp -o wide` | Output in plain-text format with any additional information. For pods, the node name is included | -| kep | `kubectl edit pods` | Edit pods from the default editor | -| kdp | `kubectl describe pods` | Describe all pods | -| kdelp | `kubectl delete pods` | Delete all pods matching passed arguments | -| kgpl | `kgp -l` | Get pods by label. Example: `kgpl "app=myapp" -n myns` | -| kgpn | `kgp -n` | Get pods by namespace. Example: `kgpn kube-system` | -| | | **Service management** | -| kgs | `kubectl get svc` | List all services in ps output format | -| kgsw | `kgs --watch` | After listing all services, watch for changes | -| kgswide | `kgs -o wide` | After listing all services, output in plain-text format with any additional information | -| kes | `kubectl edit svc` | Edit services(svc) from the default editor | -| kds | `kubectl describe svc` | Describe all services in detail | -| kdels | `kubectl delete svc` | Delete all services matching passed argument | -| | | **Ingress management** | -| kgi | `kubectl get ingress` | List ingress resources in ps output format | -| kei | `kubectl edit ingress` | Edit ingress resource from the default editor | -| kdi | `kubectl describe ingress` | Describe ingress resource in detail | -| kdeli | `kubectl delete ingress` | Delete ingress resources matching passed argument | -| | | **Namespace management** | -| kgns | `kubectl get namespaces` | List the current namespaces in a cluster | -| kcn | `kubectl config set-context --current --namespace` | Change current namespace | -| kens | `kubectl edit namespace` | Edit namespace resource from the default editor | -| kdns | `kubectl describe namespace` | Describe namespace resource in detail | -| kdelns | `kubectl delete namespace` | Delete the namespace. WARNING! This deletes everything in the namespace | -| | | **ConfigMap management** | -| kgcm | `kubectl get configmaps` | List the configmaps in ps output format | -| kecm | `kubectl edit configmap` | Edit configmap resource from the default editor | -| kdcm | `kubectl describe configmap` | Describe configmap resource in detail | -| kdelcm | `kubectl delete configmap` | Delete the configmap | -| | | **Secret management** | -| kgsec | `kubectl get secret` | Get secret for decoding | -| kdsec | `kubectl describe secret` | Describe secret resource in detail | -| kdelsec | `kubectl delete secret` | Delete the secret | -| | | **Deployment management** | -| kgd | `kubectl get deployment` | Get the deployment | -| kgdw | `kgd --watch` | After getting the deployment, watch for changes | -| kgdwide | `kgd -o wide` | After getting the deployment, output in plain-text format with any additional information | -| ked | `kubectl edit deployment` | Edit deployment resource from the default editor | -| kdd | `kubectl describe deployment` | Describe deployment resource in detail | -| kdeld | `kubectl delete deployment` | Delete the deployment | -| ksd | `kubectl scale deployment` | Scale a deployment | -| krsd | `kubectl rollout status deployment` | Check the rollout status of a deployment | -| kres | `kubectl set env $@ REFRESHED_AT=...` | Recreate all pods in deployment with zero-downtime | -| | | **Rollout management** | -| kgrs | `kubectl get replicaset` | List all ReplicaSets `rs` created by the deployment | -| kdrs | `kubectl describe replicaset` | Describe ReplicaSet in detail | -| kers | `kubectl edit replicaset` | Edit ReplicaSet from the default editor | -| krh | `kubectl rollout history` | Check the revisions of this deployment | -| kru | `kubectl rollout undo` | Rollback to the previous revision | -| | | **Port forwarding** | -| kpf | `kubectl port-forward` | Forward one or more local ports to a pod | -| | | **Tools for accessing all information** | -| kga | `kubectl get all` | List all resources in ps format | -| kgaa | `kubectl get all --all-namespaces` | List the requested object(s) across all namespaces | -| | | **Logs** | -| kl | `kubectl logs` | Print the logs for a container or resource | -| klf | `kubectl logs -f` | Stream the logs for a container or resource (follow) | -| | | **File copy** | -| kcp | `kubectl cp` | Copy files and directories to and from containers | -| | | **Node management** | -| kgno | `kubectl get nodes` | List the nodes in ps output format | -| keno | `kubectl edit node` | Edit nodes resource from the default editor | -| kdno | `kubectl describe node` | Describe node resource in detail | -| kdelno | `kubectl delete node` | Delete the node | -| | | **Persistent Volume Claim management** | -| kgpvc | `kubectl get pvc` | List all PVCs | -| kgpvcw | `kgpvc --watch` | After listing/getting the requested object, watch for changes | -| kepvc | `kubectl edit pvc` | Edit pvcs from the default editor | -| kdpvc | `kubectl describe pvc` | Describe all pvcs | -| kdelpvc | `kubectl delete pvc` | Delete all pvcs matching passed arguments | -| | | **StatefulSets management** | -| kgss | `kubectl get statefulset` | List the statefulsets in ps format | -| kgssw | `kgss --watch` | After getting the list of statefulsets, watch for changes | -| kgsswide| `kgss -o wide` | After getting the statefulsets, output in plain-text format with any additional information | -| kess | `kubectl edit statefulset` | Edit statefulset resource from the default editor | -| kdss | `kubectl describe statefulset` | Describe statefulset resource in detail | -| kdelss | `kubectl delete statefulset` | Delete the statefulset | -| ksss | `kubectl scale statefulset` | Scale a statefulset | -| krsss | `kubectl rollout status statefulset`| Check the rollout status of a deployment | -| | | **Service Accounts management** | -| kdsa | `kubectl describe sa` | Describe a service account in details | -| kdelsa | `kubectl delete sa` | Delete the service account | -| | | **DaemonSet management** | -| kgds | `kubectl get daemonset` | List all DaemonSets in ps output format | -| kgdsw | `kgds --watch` | After listing all DaemonSets, watch for changes | -| keds | `kubectl edit daemonset` | Edit DaemonSets from the default editor | -| kdds | `kubectl describe daemonset` | Describe all DaemonSets in detail | -| kdelds | `kubectl delete daemonset` | Delete all DaemonSets matching passed argument | -| | | **CronJob management** | -| kgcj | `kubectl get cronjob` | List all CronJobs in ps output format | -| kecj | `kubectl edit cronjob` | Edit CronJob from the default editor | -| kdcj | `kubectl describe cronjob` | Describe a CronJob in details | -| kdelcj | `kubectl delete cronjob` | Delete the CronJob | -| | | **Job management** | -| kgj | `kubectl get job` | List all Job in ps output format | -| kej | `kubectl edit job` | Edit a Job in details | -| kdj | `kubectl describe job` | Describe the Job | -| kdelj | `kubectl delete job` | Delete the Job | +| Alias | Command | Description | +| :------- | :------------------------------------------------- | :----------------------------------------------------------------------------------------------- | +| k | `kubectl` | The kubectl command | +| kca | `kubectl --all-namespaces` | The kubectl command targeting all namespaces | +| kaf | `kubectl apply -f` | Apply a YML file | +| keti | `kubectl exec -ti` | Drop into an interactive terminal on a container | +| | | **Manage configuration quickly to switch contexts between local, dev and staging** | +| kcuc | `kubectl config use-context` | Set the current-context in a kubeconfig file | +| kcsc | `kubectl config set-context` | Set a context entry in kubeconfig | +| kcdc | `kubectl config delete-context` | Delete the specified context from the kubeconfig | +| kccc | `kubectl config current-context` | Display the current-context | +| kcgc | `kubectl config get-contexts` | List of contexts available | +| | | **General aliases** | +| kdel | `kubectl delete` | Delete resources by filenames, stdin, resources and names, or by resources and label selector | +| kdelf | `kubectl delete -f` | Delete a pod using the type and name specified in -f argument | +| | | **Pod management** | +| kgp | `kubectl get pods` | List all pods in ps output format | +| kgpl | `kgp -l` | Get pods by label. Example: `kgpl "app=myapp" -n myns` | +| kgpn | `kgp -n` | Get pods by namespace. Example: `kgpn kube-system` | +| kgpsl | `kubectl get pods --show-labels` | List all pods in ps output format with labels | +| kgpw | `kgp --watch` | After listing/getting the requested object, watch for changes | +| kgpwide | `kgp -o wide` | Output in plain-text format with any additional information. For pods, the node name is included | +| kep | `kubectl edit pods` | Edit pods from the default editor | +| kdp | `kubectl describe pods` | Describe all pods | +| kdelp | `kubectl delete pods` | Delete all pods matching passed arguments | +| | | **Service management** | +| kgs | `kubectl get svc` | List all services in ps output format | +| kgsw | `kgs --watch` | After listing all services, watch for changes | +| kgswide | `kgs -o wide` | After listing all services, output in plain-text format with any additional information | +| kes | `kubectl edit svc` | Edit services(svc) from the default editor | +| kds | `kubectl describe svc` | Describe all services in detail | +| kdels | `kubectl delete svc` | Delete all services matching passed argument | +| | | **Ingress management** | +| kgi | `kubectl get ingress` | List ingress resources in ps output format | +| kei | `kubectl edit ingress` | Edit ingress resource from the default editor | +| kdi | `kubectl describe ingress` | Describe ingress resource in detail | +| kdeli | `kubectl delete ingress` | Delete ingress resources matching passed argument | +| | | **Namespace management** | +| kgns | `kubectl get namespaces` | List the current namespaces in a cluster | +| kcn | `kubectl config set-context --current --namespace` | Change current namespace | +| kens | `kubectl edit namespace` | Edit namespace resource from the default editor | +| kdns | `kubectl describe namespace` | Describe namespace resource in detail | +| kdelns | `kubectl delete namespace` | Delete the namespace. WARNING! This deletes everything in the namespace | +| | | **ConfigMap management** | +| kgcm | `kubectl get configmaps` | List the configmaps in ps output format | +| kecm | `kubectl edit configmap` | Edit configmap resource from the default editor | +| kdcm | `kubectl describe configmap` | Describe configmap resource in detail | +| kdelcm | `kubectl delete configmap` | Delete the configmap | +| | | **Secret management** | +| kgsec | `kubectl get secret` | Get secret for decoding | +| kdsec | `kubectl describe secret` | Describe secret resource in detail | +| kdelsec | `kubectl delete secret` | Delete the secret | +| | | **Deployment management** | +| kgd | `kubectl get deployment` | Get the deployment | +| kgdw | `kgd --watch` | After getting the deployment, watch for changes | +| kgdwide | `kgd -o wide` | After getting the deployment, output in plain-text format with any additional information | +| ked | `kubectl edit deployment` | Edit deployment resource from the default editor | +| kdd | `kubectl describe deployment` | Describe deployment resource in detail | +| kdeld | `kubectl delete deployment` | Delete the deployment | +| ksd | `kubectl scale deployment` | Scale a deployment | +| krsd | `kubectl rollout status deployment` | Check the rollout status of a deployment | +| kres | `kubectl set env $@ REFRESHED_AT=...` | Recreate all pods in deployment with zero-downtime | +| | | **Rollout management** | +| kgrs | `kubectl get replicaset` | List all ReplicaSets `rs` created by the deployment | +| kdrs | `kubectl describe replicaset` | Describe ReplicaSet in detail | +| kers | `kubectl edit replicaset` | Edit ReplicaSet from the default editor | +| krh | `kubectl rollout history` | Check the revisions of this deployment | +| kru | `kubectl rollout undo` | Rollback to the previous revision | +| | | **Port forwarding** | +| kpf | `kubectl port-forward` | Forward one or more local ports to a pod | +| | | **Tools for accessing all information** | +| kga | `kubectl get all` | List all resources in ps format | +| kgaa | `kubectl get all --all-namespaces` | List the requested object(s) across all namespaces | +| | | **Logs** | +| kl | `kubectl logs` | Print the logs for a container or resource | +| klf | `kubectl logs -f` | Stream the logs for a container or resource (follow) | +| | | **File copy** | +| kcp | `kubectl cp` | Copy files and directories to and from containers | +| | | **Node management** | +| kgno | `kubectl get nodes` | List the nodes in ps output format | +| kgnosl | `kubectl get nodes --show-labels` | List the nodes in ps output format with labels | +| keno | `kubectl edit node` | Edit nodes resource from the default editor | +| kdno | `kubectl describe node` | Describe node resource in detail | +| kdelno | `kubectl delete node` | Delete the node | +| | | **Persistent Volume Claim management** | +| kgpvc | `kubectl get pvc` | List all PVCs | +| kgpvcw | `kgpvc --watch` | After listing/getting the requested object, watch for changes | +| kepvc | `kubectl edit pvc` | Edit pvcs from the default editor | +| kdpvc | `kubectl describe pvc` | Describe all pvcs | +| kdelpvc | `kubectl delete pvc` | Delete all pvcs matching passed arguments | +| | | **StatefulSets management** | +| kgss | `kubectl get statefulset` | List the statefulsets in ps format | +| kgssw | `kgss --watch` | After getting the list of statefulsets, watch for changes | +| kgsswide | `kgss -o wide` | After getting the statefulsets, output in plain-text format with any additional information | +| kess | `kubectl edit statefulset` | Edit statefulset resource from the default editor | +| kdss | `kubectl describe statefulset` | Describe statefulset resource in detail | +| kdelss | `kubectl delete statefulset` | Delete the statefulset | +| ksss | `kubectl scale statefulset` | Scale a statefulset | +| krsss | `kubectl rollout status statefulset` | Check the rollout status of a deployment | +| | | **Service Accounts management** | +| kdsa | `kubectl describe sa` | Describe a service account in details | +| kdelsa | `kubectl delete sa` | Delete the service account | +| | | **DaemonSet management** | +| kgds | `kubectl get daemonset` | List all DaemonSets in ps output format | +| kgdsw | `kgds --watch` | After listing all DaemonSets, watch for changes | +| keds | `kubectl edit daemonset` | Edit DaemonSets from the default editor | +| kdds | `kubectl describe daemonset` | Describe all DaemonSets in detail | +| kdelds | `kubectl delete daemonset` | Delete all DaemonSets matching passed argument | +| | | **CronJob management** | +| kgcj | `kubectl get cronjob` | List all CronJobs in ps output format | +| kecj | `kubectl edit cronjob` | Edit CronJob from the default editor | +| kdcj | `kubectl describe cronjob` | Describe a CronJob in details | +| kdelcj | `kubectl delete cronjob` | Delete the CronJob | +| | | **Job management** | +| kgj | `kubectl get job` | List all Job in ps output format | +| kej | `kubectl edit job` | Edit a Job in details | +| kdj | `kubectl describe job` | Describe the Job | +| kdelj | `kubectl delete job` | Delete the Job | ## Wrappers diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index ad78fedeb..33699bdf9 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -39,6 +39,9 @@ alias kdelf='kubectl delete -f' # Pod management. alias kgp='kubectl get pods' +alias kgpl='kgp -l' +alias kgpn='kgp -n' +alias kgpsl='kubectl get pods --show-labels' alias kgpa='kubectl get pods --all-namespaces' alias kgpw='kgp --watch' alias kgpwide='kgp -o wide' @@ -47,12 +50,6 @@ alias kdp='kubectl describe pods' alias kdelp='kubectl delete pods' alias kgpall='kubectl get pods --all-namespaces -o wide' -# get pod by label: kgpl "app=myapp" -n myns -alias kgpl='kgp -l' - -# get pod by namespace: kgpn kube-system" -alias kgpn='kgp -n' - # Service management. alias kgs='kubectl get svc' alias kgsa='kubectl get svc --all-namespaces' @@ -144,6 +141,7 @@ alias kcp='kubectl cp' # Node Management alias kgno='kubectl get nodes' +alias kgnosl='kubectl get nodes --show-labels' alias keno='kubectl edit node' alias kdno='kubectl describe node' alias kdelno='kubectl delete node' From 95579e3ca181036af31c0c9039fe3edc65c231b4 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 5 Sep 2024 20:20:06 +0200 Subject: [PATCH 283/453] feat(1password): make completion loading async --- plugins/1password/1password.plugin.zsh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plugins/1password/1password.plugin.zsh b/plugins/1password/1password.plugin.zsh index 941523ca8..e8f91f8fe 100644 --- a/plugins/1password/1password.plugin.zsh +++ b/plugins/1password/1password.plugin.zsh @@ -1,9 +1,15 @@ # Do nothing if op is not installed (( ${+commands[op]} )) || return -# Load op completion -eval "$(op completion zsh)" -compdef _op op +# If the completion file doesn't exist yet, we need to autoload it and +# bind it to `op`. Otherwise, compinit will have already done that. +if [[ ! -f "$ZSH_CACHE_DIR/completions/_op" ]]; then + typeset -g -A _comps + autoload -Uz _op + _comps[op]=_op +fi + +op completion zsh >| "$ZSH_CACHE_DIR/completions/_op" &| # Load opswd function autoload -Uz opswd From 80fa5e137672a529f65a05e396b40f0d133b2432 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 5 Sep 2024 20:20:45 +0200 Subject: [PATCH 284/453] fix(1password): copy password properly in `opswd` Closes #12635 --- plugins/1password/opswd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/1password/opswd b/plugins/1password/opswd index 0f667d2ff..753de9f99 100644 --- a/plugins/1password/opswd +++ b/plugins/1password/opswd @@ -27,7 +27,7 @@ function opswd() { local password # Copy the password to the clipboard - if ! password=$(op item get "$service" --fields password 2>/dev/null); then + if ! password=$(op item get "$service" --reveal --fields password 2>/dev/null); then echo "error: could not obtain password for $service" return 1 fi From 2abecedf67f47f0b39ee31b38705630eaa8dc21f Mon Sep 17 00:00:00 2001 From: Mattias Eriksson <6420639+snaggen@users.noreply.github.com> Date: Tue, 10 Sep 2024 11:32:18 +0200 Subject: [PATCH 285/453] feat(ssh-agent): support `id_ed25519_sk` (#12663) --- plugins/ssh-agent/ssh-agent.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index 1da54d4dd..35d06384d 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -43,7 +43,7 @@ function _add_identities() { # this is to mimic the call to ssh-add with no identities if [[ ${#identities} -eq 0 ]]; then # key list found on `ssh-add` man page's DESCRIPTION section - for id in id_rsa id_dsa id_ecdsa id_ed25519 identity; do + for id in id_rsa id_dsa id_ecdsa id_ed25519 id_ed25519_sk identity; do # check if file exists [[ -f "$HOME/.ssh/$id" ]] && identities+=($id) done From f6cd6a776993b584f4abbdd204c6e4011b7d2f93 Mon Sep 17 00:00:00 2001 From: Tulsi Prasad Date: Tue, 10 Sep 2024 18:53:37 +0530 Subject: [PATCH 286/453] feat(web-search): add chatgpt (#12660) --- plugins/web-search/README.md | 15 ++++++++------- plugins/web-search/web-search.plugin.zsh | 2 ++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/plugins/web-search/README.md b/plugins/web-search/README.md index d21c81ca9..91754ac7f 100644 --- a/plugins/web-search/README.md +++ b/plugins/web-search/README.md @@ -50,16 +50,17 @@ Available search contexts are: | `npmpkg` | `https://www.npmjs.com/search?q=` | | `packagist` | `https://packagist.org/?query=` | | `gopkg` | `https://pkg.go.dev/search?m=package&q=` | +| `chatgpt` | `https://chatgpt.com/?q=` | Also there are aliases for bang-searching DuckDuckGo: -| Context | Bang | -| --------- | ----- | -| `wiki` | `!w` | -| `news` | `!n` | -| `map` | `!m` | -| `image` | `!i` | -| `ducky` | `!` | +| Context | Bang | +| ------- | ---- | +| `wiki` | `!w` | +| `news` | `!n` | +| `map` | `!m` | +| `image` | `!i` | +| `ducky` | `!` | ### Custom search engines diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh index c602e0623..2f524ba1e 100644 --- a/plugins/web-search/web-search.plugin.zsh +++ b/plugins/web-search/web-search.plugin.zsh @@ -31,6 +31,7 @@ function web_search() { npmpkg "https://www.npmjs.com/search?q=" packagist "https://packagist.org/?query=" gopkg "https://pkg.go.dev/search?m=package&q=" + chatgpt "https://chatgpt.com/?q=" ) # check whether the search engine is supported @@ -83,6 +84,7 @@ alias dockerhub='web_search dockerhub' alias npmpkg='web_search npmpkg' alias packagist='web_search packagist' alias gopkg='web_search gopkg' +alias chatgpt='web_search chatgpt' #add your own !bang searches here alias wiki='web_search duckduckgo \!w' From f709cd45484ff7a451414fcd53bca8529323512d Mon Sep 17 00:00:00 2001 From: "ohmyzsh[bot]" <54982679+ohmyzsh[bot]@users.noreply.github.com> Date: Sun, 15 Sep 2024 08:16:50 +0200 Subject: [PATCH 287/453] feat(wd): update to 7054de2b (#12675) Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com> --- .github/dependencies.yml | 2 +- plugins/wd/README.md | 17 +++++++---------- plugins/wd/wd.plugin.zsh | 3 +-- plugins/wd/wd.sh | 14 +++----------- 4 files changed, 12 insertions(+), 24 deletions(-) diff --git a/.github/dependencies.yml b/.github/dependencies.yml index be2d02cd8..2be4cdfb0 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -28,7 +28,7 @@ dependencies: plugins/wd: repo: mfaerevaag/wd branch: master - version: tag:v0.7.1 + version: tag:v0.9.0 precopy: | set -e rm -r test diff --git a/plugins/wd/README.md b/plugins/wd/README.md index bf19031f8..b345d65f5 100644 --- a/plugins/wd/README.md +++ b/plugins/wd/README.md @@ -115,9 +115,11 @@ wd() { 3. Install manpage (optional): +Move manpage into an appropriate directory, then trigger `mandb` to discover it + ```zsh -sudo cp ~/.local/wd/wd.1 /usr/share/man/man1/wd.1 -sudo chmod 644 /usr/share/man/man1/wd.1 +sudo install -m 644 ~/.local/wd/wd.1 /usr/share/man/man1/wd.1 +sudo mandb /usr/share/man/man1 ``` **Note:** when pulling and updating `wd`, you'll need to repeat step 3 should the manpage change @@ -139,10 +141,11 @@ rm -f ~/.zcompdump; compinit ## Browse -If you want to make use of the `fzf`-powered browse feature to fuzzy search through all your warp points, set up a keybind in your `.zshrc`: +`wd` comes with an `fzf`-powered browse feature to fuzzy search through all your warp points. It's available through the `wd browse` command. For quick access you can set up an alias or keybind in your `.zshrc`: ```zsh -bindkey ${FZF_WD_BINDKEY:-'^B'} fuzzy_wd_widget +# ctrl-b to open the fzf browser +bindkey ${FZF_WD_BINDKEY:-'^B'} wd_browse_widget ``` ## Usage @@ -255,12 +258,6 @@ wd --version wd --config ./file ``` -* Force `exit` with return code after running. This is not default, as it will *exit your terminal*, though required for testing/debugging. - -```zsh -wd --debug -``` - * Silence all output: ```zsh diff --git a/plugins/wd/wd.plugin.zsh b/plugins/wd/wd.plugin.zsh index 9910cb968..2397e6f31 100644 --- a/plugins/wd/wd.plugin.zsh +++ b/plugins/wd/wd.plugin.zsh @@ -1,4 +1,4 @@ -#!/bin/zsh +#!/usr/bin/env zsh # WARP DIRECTORY # ============== @@ -18,4 +18,3 @@ zle -N wd_browse_widget zle -N wd_restore_buffer autoload -Uz add-zle-hook-widget add-zle-hook-widget line-init wd_restore_buffer -bindkey ${FZF_WD_BINDKEY:-'^B'} wd_browse_widget diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh index 34f887a0e..ddd31e6f6 100755 --- a/plugins/wd/wd.sh +++ b/plugins/wd/wd.sh @@ -1,4 +1,4 @@ -#!/bin/zsh +#!/usr/bin/env zsh # WARP DIRECTORY # ============== @@ -8,7 +8,7 @@ # @github.com/mfaerevaag/wd # version -readonly WD_VERSION=0.7.0 +readonly WD_VERSION=0.9.0 # colors readonly WD_BLUE="\033[96m" @@ -90,7 +90,6 @@ Commands: clean Remove points warping to nonexistent directories (will prompt unless --force is used) -v | --version Print version - -d | --debug Exit after execution with exit codes (for testing) -c | --config Specify config file (default ~/.warprc) -q | --quiet Suppress all output -f | --force Allows overwriting without warning (for add & clean) @@ -426,7 +425,6 @@ wd_export_static_named_directories() { WD_CONFIG=${WD_CONFIG:-$HOME/.warprc} local WD_QUIET=0 local WD_EXIT_CODE=0 -local WD_DEBUG=0 # Parse 'meta' options first to avoid the need to have them before # other commands. The `-D` flag consumes recognized options so that @@ -436,7 +434,6 @@ zparseopts -D -E \ c:=wd_alt_config -config:=wd_alt_config \ q=wd_quiet_mode -quiet=wd_quiet_mode \ v=wd_print_version -version=wd_print_version \ - d=wd_debug_mode -debug=wd_debug_mode \ f=wd_force_mode -force=wd_force_mode if [[ ! -z $wd_print_version ]] @@ -583,9 +580,4 @@ unset args unset points unset val &> /dev/null # fixes issue #1 -if [[ -n $wd_debug_mode ]] -then - exit $WD_EXIT_CODE -else - unset wd_debug_mode -fi +return $WD_EXIT_CODE From 33ac2ee30f92183565b30ef2ed847870d0b9b052 Mon Sep 17 00:00:00 2001 From: Saravana J Date: Sun, 15 Sep 2024 11:47:43 +0530 Subject: [PATCH 288/453] fix(git): update prefix map for modified files (#12674) --- lib/git.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git.zsh b/lib/git.zsh index db6c9174c..2ad5afe04 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -227,7 +227,7 @@ function _omz_git_prompt_status() { prefix_constant_map=( '\?\? ' 'UNTRACKED' 'A ' 'ADDED' - 'M ' 'ADDED' + 'M ' 'MODIFIED' 'MM ' 'MODIFIED' ' M ' 'MODIFIED' 'AM ' 'MODIFIED' From a84bc2dadd9c0925c2f88e66a1796746e63fa427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 15 Sep 2024 15:06:47 +0200 Subject: [PATCH 289/453] fix(python)!: remove harmful `ipython` alias (#12676) BREAKING CHANGE: the `ipython` alias was incorrectly trying to manually call ipython from the installed module in the virtual environment, when actually a command already exists when loading the virtual environment. This change removes the unnecessary alias and allows calling the right command. Fixes #12676 --- plugins/python/README.md | 1 - plugins/python/python.plugin.zsh | 3 --- 2 files changed, 4 deletions(-) diff --git a/plugins/python/README.md b/plugins/python/README.md index b990a26b9..8014992de 100644 --- a/plugins/python/README.md +++ b/plugins/python/README.md @@ -13,7 +13,6 @@ plugins=(... python) | Command | Description | | ---------------- | -------------------------------------------------------------------------------------- | | `py` | Runs `python3`. Only set if `py` is not installed. | -| `ipython` | Runs the appropriate `ipython` version according to the activated virtualenv | | `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 in the current directory, recursively | diff --git a/plugins/python/python.plugin.zsh b/plugins/python/python.plugin.zsh index 811745257..63733e1de 100644 --- a/plugins/python/python.plugin.zsh +++ b/plugins/python/python.plugin.zsh @@ -43,9 +43,6 @@ function pyuserpaths() { # Grep among .py files alias pygrep='grep -nr --include="*.py"' -# Run proper IPython regarding current virtualenv (if any) -alias ipython='python3 -c "import sys; del sys.path[0]; import IPython; sys.exit(IPython.start_ipython())"' - # Share local directory as a HTTP server alias pyserver="python3 -m http.server" From e3e80b98b575ab75b9c7d182184faffc0b51c5f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 15 Sep 2024 15:14:38 +0200 Subject: [PATCH 290/453] chore(jsontools): change link to NDJSON spec (#12671) Fixes #12671 --- plugins/jsontools/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/jsontools/README.md b/plugins/jsontools/README.md index 6a2740014..d92608806 100644 --- a/plugins/jsontools/README.md +++ b/plugins/jsontools/README.md @@ -19,7 +19,7 @@ Usage is simple... just take your json data and pipe it into the appropriate jso ### Supports NDJSON (Newline Delimited JSON) -The plugin also supports [NDJSON](http://ndjson.org/) input, which means all functions +The plugin also supports [NDJSON](https://github.com/ndjson/ndjson-spec) input, which means all functions have an alternative function that reads and processes the input line by line. These functions have the same name except using `ndjson` instead of `json`: From 8c13f021bf3f0315f516f73c8f2555bd7a4313d1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 15 Sep 2024 19:36:08 +0200 Subject: [PATCH 291/453] chore(deps): bump idna in /.github/workflows/dependencies (#12678) Bumps [idna](https://github.com/kjd/idna) from 3.8 to 3.9. - [Release notes](https://github.com/kjd/idna/releases) - [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.rst) - [Commits](https://github.com/kjd/idna/compare/v3.8...v3.9) --- updated-dependencies: - dependency-name: idna dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependencies/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt index 7cf0b642f..9b5b03ea0 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -1,6 +1,6 @@ certifi==2024.8.30 charset-normalizer==3.3.2 -idna==3.8 +idna==3.9 PyYAML==6.0.2 requests==2.32.3 semver==3.0.2 From ec7d01faf837f17ccdc91249d0e63117ad0585af Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 15 Sep 2024 19:36:24 +0200 Subject: [PATCH 292/453] chore(deps): bump urllib3 in /.github/workflows/dependencies (#12677) Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.2.2 to 2.2.3. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst) - [Commits](https://github.com/urllib3/urllib3/compare/2.2.2...2.2.3) --- updated-dependencies: - dependency-name: urllib3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependencies/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt index 9b5b03ea0..05b2f27fe 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -4,4 +4,4 @@ idna==3.9 PyYAML==6.0.2 requests==2.32.3 semver==3.0.2 -urllib3==2.2.2 +urllib3==2.2.3 From ac325a7caba6630538c39e1c0ffa192d866cdcff Mon Sep 17 00:00:00 2001 From: PukNgae Cryolitia Date: Mon, 16 Sep 2024 05:20:59 +0800 Subject: [PATCH 293/453] feat(bgnotify): add config to pass extra args (#12679) --- plugins/bgnotify/README.md | 1 + plugins/bgnotify/bgnotify.plugin.zsh | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/bgnotify/README.md b/plugins/bgnotify/README.md index 33d529f15..1389def86 100644 --- a/plugins/bgnotify/README.md +++ b/plugins/bgnotify/README.md @@ -38,6 +38,7 @@ One can configure a few things: - `bgnotify_bell` enabled or disables the terminal bell (default true) - `bgnotify_threshold` sets the notification threshold time (default 6 seconds) - `function bgnotify_formatted` lets you change the notification. You can for instance customize the message and pass in an icon. +- `bgnotify_extraargs` appends extra args to notifier (e.g. `-e` for notify-send to create a transient notification) Use these by adding a function definition before the your call to source. Example: diff --git a/plugins/bgnotify/bgnotify.plugin.zsh b/plugins/bgnotify/bgnotify.plugin.zsh index 7de6f9a91..f6ffb6ed5 100644 --- a/plugins/bgnotify/bgnotify.plugin.zsh +++ b/plugins/bgnotify/bgnotify.plugin.zsh @@ -117,15 +117,15 @@ function bgnotify { local icon="$3" if (( ${+commands[terminal-notifier]} )); then # macOS local term_id=$(bgnotify_programid) - terminal-notifier -message "$message" -title "$title" ${=icon:+-appIcon "$icon"} ${=term_id:+-activate "$term_id"} &>/dev/null + terminal-notifier -message "$message" -title "$title" ${=icon:+-appIcon "$icon"} ${=term_id:+-activate "$term_id"} ${=bgnotify_extraargs:-} &>/dev/null elif (( ${+commands[growlnotify]} )); then # macOS growl - growlnotify -m "$title" "$message" + growlnotify -m "$title" "$message" ${=bgnotify_extraargs:-} elif (( ${+commands[notify-send]} )); then - notify-send "$title" "$message" ${=icon:+--icon "$icon"} + notify-send "$title" "$message" ${=icon:+--icon "$icon"} ${=bgnotify_extraargs:-} elif (( ${+commands[kdialog]} )); then # KDE - kdialog --title "$title" --passivepopup "$message" 5 + kdialog --title "$title" --passivepopup "$message" 5 ${=bgnotify_extraargs:-} elif (( ${+commands[notifu]} )); then # cygwin - notifu /m "$message" /p "$title" ${=icon:+/i "$icon"} + notifu /m "$message" /p "$title" ${=icon:+/i "$icon"} ${=bgnotify_extraargs:-} fi } From 3151c9c1a330cdea66dd7d1a24810fe805298711 Mon Sep 17 00:00:00 2001 From: Ruslan Tursunov Date: Wed, 18 Sep 2024 13:58:00 +0300 Subject: [PATCH 294/453] fix(git): re-add accidentally removed `gcn` (#12681) --- plugins/git/README.md | 1 + plugins/git/git.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/git/README.md b/plugins/git/README.md index e03f204f7..bcadc4713 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -73,6 +73,7 @@ plugins=(... git) | `gcans!` | `git commit --verbose --all --signoff --no-edit --amend` | | `gcann!` | `git commit --verbose --all --date=now --no-edit --amend` | | `gc!` | `git commit --verbose --amend` | +| `gcn` | `git commit --verbose --no-edit` | | `gcn!` | `git commit --verbose --no-edit --amend` | | `gcs` | `git commit -S` | | `gcss` | `git commit -S -s` | diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 28d5cb314..f34c0726b 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -197,6 +197,7 @@ alias gcan!='git commit --verbose --all --no-edit --amend' alias gcans!='git commit --verbose --all --signoff --no-edit --amend' alias gcann!='git commit --verbose --all --date=now --no-edit --amend' alias gc!='git commit --verbose --amend' +alias gcn='git commit --verbose --no-edit' alias gcn!='git commit --verbose --no-edit --amend' alias gcf='git config --list' alias gdct='git describe --tags $(git rev-list --tags --max-count=1)' From 9bcafe1c27f62f224c095cd2479763280336090b Mon Sep 17 00:00:00 2001 From: Erik Teichmann Date: Wed, 18 Sep 2024 11:26:38 -0700 Subject: [PATCH 295/453] feat(functions): add `takezip` (#12670) --- lib/functions.zsh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/functions.zsh b/lib/functions.zsh index 2e667332e..b68c35c13 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -57,6 +57,16 @@ function takeurl() { cd "$thedir" } +function takezip() { + local data thedir + data="$(mktemp)" + curl -L "$1" > "$data" + unzip "$data" -d "./" + thedir="$(unzip -l "$data" | awk 'NR==4 {print $4}' | sed 's/\/.*//')" + rm "$data" + cd "$thedir" +} + function takegit() { git clone "$1" cd "$(basename ${1%%.git})" @@ -65,6 +75,8 @@ function takegit() { function take() { if [[ $1 =~ ^(https?|ftp).*\.(tar\.(gz|bz2|xz)|tgz)$ ]]; then takeurl "$1" + elif [[ $1 =~ ^(https?|ftp).*\.(zip)$ ]]; then + takezip "$1" elif [[ $1 =~ ^([A-Za-z0-9]\+@|https?|git|ssh|ftps?|rsync).*\.git/?$ ]]; then takegit "$1" else From 865291cb7af2fef7e67128fd4294f3ffa9b08c3d Mon Sep 17 00:00:00 2001 From: Tushar Mohod <98651842+tusharmohod@users.noreply.github.com> Date: Thu, 19 Sep 2024 00:10:54 +0530 Subject: [PATCH 296/453] feat (terraform): add `apply -auto-approve` alias (#12658) Closes #12591 --- plugins/terraform/README.md | 33 +++++++++++++------------- plugins/terraform/terraform.plugin.zsh | 1 + 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/plugins/terraform/README.md b/plugins/terraform/README.md index ca5a771bc..3f8ed6dee 100644 --- a/plugins/terraform/README.md +++ b/plugins/terraform/README.md @@ -15,22 +15,23 @@ plugins=(... terraform) ## Aliases -| Alias | Command | -|--------|----------------------------| -| `tf` | `terraform` | -| `tfa` | `terraform apply` | -| `tfc` | `terraform console` | -| `tfd` | `terraform destroy` | -| `tff` | `terraform fmt` | -| `tffr` | `terraform fmt -recursive` | -| `tfi` | `terraform init` | -| `tfiu` | `terraform init -upgrade` | -| `tfo` | `terraform output` | -| `tfp` | `terraform plan` | -| `tfv` | `terraform validate` | -| `tfs` | `terraform state` | -| `tft` | `terraform test` | -| `tfsh` | `terraform show` | +| Alias | Command | +|---------|----------------------------------| +| `tf` | `terraform` | +| `tfa` | `terraform apply` | +| `tfaa` | `terraform apply -auto-approve` | +| `tfc` | `terraform console` | +| `tfd` | `terraform destroy` | +| `tff` | `terraform fmt` | +| `tffr` | `terraform fmt -recursive` | +| `tfi` | `terraform init` | +| `tfiu` | `terraform init -upgrade` | +| `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 181f57b9b..bedd46011 100644 --- a/plugins/terraform/terraform.plugin.zsh +++ b/plugins/terraform/terraform.plugin.zsh @@ -17,6 +17,7 @@ function tf_version_prompt_info() { alias tf='terraform' alias tfa='terraform apply' +alias tfaa='terraform apply -auto-approve' alias tfc='terraform console' alias tfd='terraform destroy' alias tff='terraform fmt' From d91944d47e6f4163da16e6fa71a41e35e2af191e Mon Sep 17 00:00:00 2001 From: rakeshgm Date: Thu, 19 Sep 2024 00:12:18 +0530 Subject: [PATCH 297/453] feat(gnzh): add virtualenv prompt (#12666) --- themes/gnzh.zsh-theme | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/themes/gnzh.zsh-theme b/themes/gnzh.zsh-theme index ca62320e2..0297a6f6f 100644 --- a/themes/gnzh.zsh-theme +++ b/themes/gnzh.zsh-theme @@ -30,8 +30,9 @@ local return_code="%(?..%F{red}%? ↵%f)" local user_host="${PR_USER}%F{cyan}@${PR_HOST}" local current_dir="%B%F{blue}%~%f%b" local git_branch='$(git_prompt_info)' +local venv_prompt='$(virtualenv_prompt_info)' -PROMPT="╭─${user_host} ${current_dir} \$(ruby_prompt_info) ${git_branch} +PROMPT="╭─${venv_prompt}${user_host} ${current_dir} \$(ruby_prompt_info) ${git_branch} ╰─$PR_PROMPT " RPROMPT="${return_code}" @@ -39,5 +40,7 @@ ZSH_THEME_GIT_PROMPT_PREFIX="%F{yellow}‹" ZSH_THEME_GIT_PROMPT_SUFFIX="› %f" ZSH_THEME_RUBY_PROMPT_PREFIX="%F{red}‹" ZSH_THEME_RUBY_PROMPT_SUFFIX="›%f" +ZSH_THEME_VIRTUALENV_PREFIX="%F{red}(" +ZSH_THEME_VIRTUALENV_SUFFIX=")%f " } From e52598a5cc3c73fa907f83c84f4270fdaee9c930 Mon Sep 17 00:00:00 2001 From: Francesco Cataldo <78490028+FraCata00@users.noreply.github.com> Date: Wed, 18 Sep 2024 20:43:52 +0200 Subject: [PATCH 298/453] feat(web-search): add `reddit` (#12664) --- plugins/web-search/README.md | 1 + plugins/web-search/web-search.plugin.zsh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/plugins/web-search/README.md b/plugins/web-search/README.md index 91754ac7f..ad3741fc9 100644 --- a/plugins/web-search/README.md +++ b/plugins/web-search/README.md @@ -51,6 +51,7 @@ Available search contexts are: | `packagist` | `https://packagist.org/?query=` | | `gopkg` | `https://pkg.go.dev/search?m=package&q=` | | `chatgpt` | `https://chatgpt.com/?q=` | +| `reddit` | `https://www.reddit.com/search/?q=` | 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 2f524ba1e..81eb1c77d 100644 --- a/plugins/web-search/web-search.plugin.zsh +++ b/plugins/web-search/web-search.plugin.zsh @@ -32,6 +32,7 @@ function web_search() { packagist "https://packagist.org/?query=" gopkg "https://pkg.go.dev/search?m=package&q=" chatgpt "https://chatgpt.com/?q=" + reddit "https://www.reddit.com/search/?q=" ) # check whether the search engine is supported @@ -85,6 +86,7 @@ alias npmpkg='web_search npmpkg' alias packagist='web_search packagist' alias gopkg='web_search gopkg' alias chatgpt='web_search chatgpt' +alias reddit='web_search reddit' #add your own !bang searches here alias wiki='web_search duckduckgo \!w' From 99e2c31484bba519925a65b442d0516fc6e01c94 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Wed, 18 Sep 2024 21:05:45 +0200 Subject: [PATCH 299/453] feat(git): add `git_previous_branch` function Closes #12538 --- lib/git.zsh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/git.zsh b/lib/git.zsh index 2ad5afe04..8237af751 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -162,6 +162,18 @@ function git_current_branch() { echo ${ref#refs/heads/} } +# Outputs the name of the previously checked out branch +# Usage example: git pull origin $(git_current_branch) +# rev-parse --symbolic-full-name @{-1} only prints if it is a branch +function git_previous_branch() { + local ref + ref=$(__git_prompt_git rev-parse --quiet --symbolic-full-name @{-1} 2> /dev/null) + local ret=$? + if [[ $ret != 0 ]] || [[ -z $ref ]]; then + return # no git repo or non-branch previous ref + fi + echo ${ref#refs/heads/} +} # Gets the number of commits ahead from remote function git_commits_ahead() { From 1514145a09140425b914e9cd98fc1d638a8c4003 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 19 Sep 2024 11:44:51 +0200 Subject: [PATCH 300/453] feat(nvm): add `_omz_nvm_load` function --- plugins/nvm/README.md | 2 ++ plugins/nvm/nvm.plugin.zsh | 24 +++++++++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/plugins/nvm/README.md b/plugins/nvm/README.md index fe91cc3b2..1245f66db 100644 --- a/plugins/nvm/README.md +++ b/plugins/nvm/README.md @@ -42,6 +42,8 @@ as you want: zstyle ':omz:plugins:nvm' lazy-cmd eslint prettier typescript ... ``` +There will be a function `_omz_nvm_load` available to load `nvm` without executing any other trigger command. + #### `.nvmrc` autoload Note: _if used at the same time as `lazy`, `autoload` will start working only after nvm has been lazy-loaded_ diff --git a/plugins/nvm/nvm.plugin.zsh b/plugins/nvm/nvm.plugin.zsh index a00c2e117..682bddc47 100644 --- a/plugins/nvm/nvm.plugin.zsh +++ b/plugins/nvm/nvm.plugin.zsh @@ -20,7 +20,7 @@ if [[ -z "$NVM_DIR" ]] || [[ ! -f "$NVM_DIR/nvm.sh" ]]; then return fi -function _omz_load_nvm_completion { +function _omz_nvm_setup_completion { local _nvm_completion # Load nvm bash completion for _nvm_completion in "$NVM_DIR/bash_completion" "$NVM_HOMEBREW/etc/bash_completion.d/nvm"; do @@ -33,12 +33,12 @@ function _omz_load_nvm_completion { break fi done - unfunction _omz_load_nvm_completion + unfunction _omz_nvm_setup_completion } -function _omz_setup_autoload { +function _omz_nvm_setup_autoload { if ! zstyle -t ':omz:plugins:nvm' autoload; then - unfunction _omz_setup_autoload + unfunction _omz_nvm_setup_autoload return fi @@ -68,13 +68,13 @@ function _omz_setup_autoload { add-zsh-hook chpwd load-nvmrc load-nvmrc - unfunction _omz_setup_autoload + unfunction _omz_nvm_setup_autoload } if zstyle -t ':omz:plugins:nvm' lazy; then # Call nvm when first using nvm, node, npm, pnpm, yarn, corepack or other commands in lazy-cmd zstyle -a ':omz:plugins:nvm' lazy-cmd nvm_lazy_cmd - nvm_lazy_cmd=(nvm node npm npx pnpm pnpx yarn corepack $nvm_lazy_cmd) # default values + nvm_lazy_cmd=(_omz_nvm_load nvm node npm npx pnpm pnpx yarn corepack $nvm_lazy_cmd) # default values eval " function $nvm_lazy_cmd { for func in $nvm_lazy_cmd; do @@ -84,14 +84,16 @@ if zstyle -t ':omz:plugins:nvm' lazy; then done # Load nvm if it exists in \$NVM_DIR [[ -f \"\$NVM_DIR/nvm.sh\" ]] && source \"\$NVM_DIR/nvm.sh\" - _omz_load_nvm_completion - _omz_setup_autoload - \"\$0\" \"\$@\" + _omz_nvm_setup_completion + _omz_nvm_setup_autoload + if [[ \"\$0\" != _omz_nvm_load ]]; then + \"\$0\" \"\$@\" + fi } " unset nvm_lazy_cmd else source "$NVM_DIR/nvm.sh" - _omz_load_nvm_completion - _omz_setup_autoload + _omz_nvm_setup_completion + _omz_nvm_setup_autoload fi From f11cc8fea190eb9a1638dc67877436d0b8475ff5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Sep 2024 16:20:33 +0200 Subject: [PATCH 301/453] chore(deps): bump idna in /.github/workflows/dependencies (#12688) Bumps [idna](https://github.com/kjd/idna) from 3.9 to 3.10. - [Release notes](https://github.com/kjd/idna/releases) - [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.rst) - [Commits](https://github.com/kjd/idna/compare/v3.9...v3.10) --- updated-dependencies: - dependency-name: idna dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependencies/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt index 05b2f27fe..eedd6d276 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -1,6 +1,6 @@ certifi==2024.8.30 charset-normalizer==3.3.2 -idna==3.9 +idna==3.10 PyYAML==6.0.2 requests==2.32.3 semver==3.0.2 From 367e9381dfae65e020cb5c439818e04ae1dd9423 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Mon, 23 Sep 2024 17:32:44 +0200 Subject: [PATCH 302/453] chore(git): fix typo --- lib/git.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git.zsh b/lib/git.zsh index 8237af751..0efff3e07 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -163,7 +163,7 @@ function git_current_branch() { } # Outputs the name of the previously checked out branch -# Usage example: git pull origin $(git_current_branch) +# Usage example: git pull origin $(git_previous_branch) # rev-parse --symbolic-full-name @{-1} only prints if it is a branch function git_previous_branch() { local ref From 9114853500ea66cff7c803b0e951754833946f3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 24 Sep 2024 18:18:17 +0200 Subject: [PATCH 303/453] fix(aussiegeek): quote color sequences --- themes/aussiegeek.zsh-theme | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/themes/aussiegeek.zsh-theme b/themes/aussiegeek.zsh-theme index 2ded5c157..9ea6662b6 100644 --- a/themes/aussiegeek.zsh-theme +++ b/themes/aussiegeek.zsh-theme @@ -1,8 +1,8 @@ +PROMPT="%{${fg_bold[blue]}%}[ %{${fg[red]}%}%t %{${fg_bold[blue]}%}] %{${fg_bold[blue]}%} [ %{${fg[red]}%}%n@%m:%~\$(git_prompt_info)%{${fg[yellow]}%}\$(ruby_prompt_info)%{${fg_bold[blue]}%} ]%{$reset_color%} + $ " -PROMPT='$fg_bold[blue][ $fg[red]%t $fg_bold[blue]] $fg_bold[blue] [ $fg[red]%n@%m:%~$(git_prompt_info)$fg[yellow]$(ruby_prompt_info)$fg_bold[blue] ]$reset_color - $ ' # git theming -ZSH_THEME_GIT_PROMPT_PREFIX="$fg_bold[green](" -ZSH_THEME_GIT_PROMPT_SUFFIX=")" +ZSH_THEME_GIT_PROMPT_PREFIX="%{${fg_bold[green]}%}(" +ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}" ZSH_THEME_GIT_PROMPT_CLEAN="✔" ZSH_THEME_GIT_PROMPT_DIRTY="✗" From c1679a12f819f99dd5c6ca801e013e3be597d1a9 Mon Sep 17 00:00:00 2001 From: Alexander Schaber Date: Fri, 27 Sep 2024 11:39:09 +0200 Subject: [PATCH 304/453] feat(systemadmin): add `ping6` alias with count limit (#12697) --- plugins/systemadmin/README.md | 1 + plugins/systemadmin/systemadmin.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/systemadmin/README.md b/plugins/systemadmin/README.md index bd6b08760..7ff21a635 100644 --- a/plugins/systemadmin/README.md +++ b/plugins/systemadmin/README.md @@ -13,6 +13,7 @@ plugins=(... systemadmin) | Alias | Command | Description | |---------|----------------------------------------------------------------------------|--------------------------------------------------------------------| | ping | `ping -c 5` | Sends only 5 ICMP Messages | +| ping6 | `ping6 -c 5` | Sends only 5 ICMPv6 Messages | | clr | `clear; echo Currently logged in on $TTY, as $USERNAME in directory $PWD.` | Clears the screen and prints the current user, TTY, and directory | | path | `print -l $path` | Displays PATH with each entry on a separate line | | mkdir | `mkdir -pv` | Automatically create parent directories and display verbose output | diff --git a/plugins/systemadmin/systemadmin.plugin.zsh b/plugins/systemadmin/systemadmin.plugin.zsh index 03dd995b6..fa7e5f786 100644 --- a/plugins/systemadmin/systemadmin.plugin.zsh +++ b/plugins/systemadmin/systemadmin.plugin.zsh @@ -21,6 +21,7 @@ function retlog() { } alias ping='ping -c 5' +alias ping6='ping6 -c 5' alias clr='clear; echo Currently logged in on $TTY, as $USERNAME in directory $PWD.' alias path='print -l $path' alias mkdir='mkdir -pv' From 2a2f8ecb67674538b4b267f0796673f779f0ae5d Mon Sep 17 00:00:00 2001 From: flyingpeakock Date: Fri, 27 Sep 2024 09:40:15 +0000 Subject: [PATCH 305/453] fix(ssh-agent): use termux prefix for tmp (#12695) --- plugins/ssh-agent/ssh-agent.plugin.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index 35d06384d..83548648b 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -100,7 +100,11 @@ function _add_identities() { if zstyle -t :omz:plugins:ssh-agent agent-forwarding \ && [[ -n "$SSH_AUTH_SOCK" ]]; then if [[ ! -L "$SSH_AUTH_SOCK" ]]; then - ln -sf "$SSH_AUTH_SOCK" /tmp/ssh-agent-$USERNAME-screen + if [[ -n "$TERMUX_VERSION" ]]; then + ln -sf "$SSH_AUTH_SOCK" "$PREFIX"/tmp/ssh-agent-$USERNAME-screen + else + ln -sf "$SSH_AUTH_SOCK" /tmp/ssh-agent-$USERNAME-screen + fi fi else _start_agent From a72a26406ad3aa9a47c3f5227291bad23494bed0 Mon Sep 17 00:00:00 2001 From: Alexander Schaber Date: Fri, 27 Sep 2024 13:58:56 +0200 Subject: [PATCH 306/453] feat(chezmoi): add completion plugin (#12696) --- plugins/chezmoi/README.md | 11 +++++++++++ plugins/chezmoi/chezmoi.plugin.zsh | 14 ++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 plugins/chezmoi/README.md create mode 100644 plugins/chezmoi/chezmoi.plugin.zsh diff --git a/plugins/chezmoi/README.md b/plugins/chezmoi/README.md new file mode 100644 index 000000000..32aee73b2 --- /dev/null +++ b/plugins/chezmoi/README.md @@ -0,0 +1,11 @@ +# chezmoi Plugin + +## Introduction + +This `chezmoi` plugin sets up completion for [chezmoi](https://chezmoi.io). + +To use it, add `chezmoi` to the plugins array of your zshrc file: + +```bash +plugins=(... chezmoi) +``` diff --git a/plugins/chezmoi/chezmoi.plugin.zsh b/plugins/chezmoi/chezmoi.plugin.zsh new file mode 100644 index 000000000..80e19fea1 --- /dev/null +++ b/plugins/chezmoi/chezmoi.plugin.zsh @@ -0,0 +1,14 @@ +# COMPLETION FUNCTION +if (( ! $+commands[chezmoi] )); then + return +fi + +# If the completion file doesn't exist yet, we need to autoload it and +# bind it to `chezmoi`. Otherwise, compinit will have already done that. +if [[ ! -f "$ZSH_CACHE_DIR/completions/_chezmoi" ]]; then + typeset -g -A _comps + autoload -Uz _chezmoi + _comps[chezmoi]=_chezmoi +fi + +chezmoi completion zsh >| "$ZSH_CACHE_DIR/completions/_chezmoi" &| From ec3cb127b2803712a1c19127f6a7382748675fcb Mon Sep 17 00:00:00 2001 From: gsspdev Date: Tue, 1 Oct 2024 02:18:46 -0500 Subject: [PATCH 307/453] fix(fastfile): use idiomatic expressions (#12708) --- plugins/fastfile/fastfile.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/fastfile/fastfile.plugin.zsh b/plugins/fastfile/fastfile.plugin.zsh index 896fed5f7..86f224b71 100644 --- a/plugins/fastfile/fastfile.plugin.zsh +++ b/plugins/fastfile/fastfile.plugin.zsh @@ -5,8 +5,8 @@ # If they are not set yet, they will be # overwritten with their default values -default fastfile_dir "${HOME}/.fastfile" -default fastfile_var_prefix "§" +fastfile_dir="${fastfile_dir:-${HOME}/.fastfile}" +fastfile_var_prefix="${fastfile_var_prefix:-§}" ########################### # Impl From f4423ebd09fbc7670815c3c20cc86c81b7319e5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 26 Sep 2024 13:12:53 +0200 Subject: [PATCH 308/453] feat(cli): style plugin README in `omz plugin info` --- lib/cli.zsh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/cli.zsh b/lib/cli.zsh index 383b0cfb0..d1896f18d 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -397,8 +397,23 @@ function _omz::plugin::info { local readme for readme in "$ZSH_CUSTOM/plugins/$1/README.md" "$ZSH/plugins/$1/README.md"; do if [[ -f "$readme" ]]; then - (( ${+commands[less]} )) && less "$readme" || cat "$readme" - return 0 + # If being piped, just cat the README + if [[ ! -t 1 ]]; then + cat "$readme" + return $? + fi + + # Enrich the README display depending on the tools we have + # - glow: https://github.com/charmbracelet/glow + # - bat: https://github.com/sharkdp/bat + # - less: typical pager command + case 1 in + ${+commands[glow]}) glow -p "$readme" ;; + ${+commands[bat]}) bat -l md --style plain "$readme" ;; + ${+commands[less]}) less "$readme" ;; + *) cat "$readme" ;; + esac + return $? fi done From dae5a4115917e2b9c65d9166c5d64df693f70dd4 Mon Sep 17 00:00:00 2001 From: za Date: Wed, 2 Oct 2024 15:49:31 +0700 Subject: [PATCH 309/453] feat(opentofu): add `apply -auto-approve` alias (#12714) --- plugins/opentofu/README.md | 35 ++++++++++++++-------------- plugins/opentofu/opentofu.plugin.zsh | 1 + 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/plugins/opentofu/README.md b/plugins/opentofu/README.md index 9811e2751..cc6e94acd 100644 --- a/plugins/opentofu/README.md +++ b/plugins/opentofu/README.md @@ -15,23 +15,24 @@ plugins=(... opentofu) ## Aliases -| Alias | Command | -|--------|-----------------------| -| `tt` | `tofu` | -| `tta` | `tofu apply` | -| `ttc` | `tofu console` | -| `ttd` | `tofu destroy` | -| `ttf` | `tofu fmt` | -| `ttfr` | `tofu fmt -recursive` | -| `tti` | `tofu init` | -| `tto` | `tofu output` | -| `ttp` | `tofu plan` | -| `ttv` | `tofu validate` | -| `tts` | `tofu state` | -| `ttsh` | `tofu show` | -| `ttr` | `tofu refresh` | -| `ttt` | `tofu test` | -| `ttws` | `tofu workspace` | +| Alias | Command | +|--------|------------------------------| +| `tt` | `tofu` | +| `tta` | `tofu apply` | +| `ttaa` | `tofu apply -auto-approve` | +| `ttc` | `tofu console` | +| `ttd` | `tofu destroy` | +| `ttf` | `tofu fmt` | +| `ttfr` | `tofu fmt -recursive` | +| `tti` | `tofu init` | +| `tto` | `tofu output` | +| `ttp` | `tofu plan` | +| `ttv` | `tofu validate` | +| `tts` | `tofu state` | +| `ttsh` | `tofu show` | +| `ttr` | `tofu refresh` | +| `ttt` | `tofu test` | +| `ttws` | `tofu workspace` | ## Prompt functions diff --git a/plugins/opentofu/opentofu.plugin.zsh b/plugins/opentofu/opentofu.plugin.zsh index aa6cac78a..79b102a74 100644 --- a/plugins/opentofu/opentofu.plugin.zsh +++ b/plugins/opentofu/opentofu.plugin.zsh @@ -29,6 +29,7 @@ function tofu_version_prompt_info() { alias tt='tofu' alias tta='tofu apply' +alias ttaa='tofu apply -auto-approve' alias ttc='tofu console' alias ttd='tofu destroy' alias ttf='tofu fmt' From 00b9b623858874c8b34c6f8dd72370e6ffa95dfc Mon Sep 17 00:00:00 2001 From: mnv Date: Wed, 2 Oct 2024 19:00:32 +0530 Subject: [PATCH 310/453] refactor(bzr): simplify and improve code (#12716) --- lib/bzr.zsh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/bzr.zsh b/lib/bzr.zsh index 005a16500..78273d578 100644 --- a/lib/bzr.zsh +++ b/lib/bzr.zsh @@ -1,10 +1,14 @@ ## Bazaar integration -## Just works with the GIT integration just add $(bzr_prompt_info) to the PROMPT +## Just works with the GIT integration. Add $(bzr_prompt_info) to the PROMPT function bzr_prompt_info() { - BZR_CB=`bzr nick 2> /dev/null | grep -v "ERROR" | cut -d ":" -f2 | awk -F / '{print "bzr::"$1}'` - if [ -n "$BZR_CB" ]; then - BZR_DIRTY="" - [[ -n `bzr status` ]] && BZR_DIRTY=" %{$fg[red]%} * %{$fg[green]%}" - echo "$ZSH_THEME_SCM_PROMPT_PREFIX$BZR_CB$BZR_DIRTY$ZSH_THEME_GIT_PROMPT_SUFFIX" - fi -} \ No newline at end of file + local bzr_branch + bzr_branch=$(bzr nick 2>/dev/null) || return + + if [[ -n "$bzr_branch" ]]; then + local bzr_dirty="" + if [[ -n $(bzr status 2>/dev/null) ]]; then + bzr_dirty=" %{$fg[red]%}*%{$reset_color%}" + fi + printf "%s%s%s%s" "$ZSH_THEME_SCM_PROMPT_PREFIX" "bzr::${bzr_branch##*:}" "$bzr_dirty" "$ZSH_THEME_GIT_PROMPT_SUFFIX" + fi +} From 7ce26a810d79fa65abdb6a9b47b64bed59f1eefc Mon Sep 17 00:00:00 2001 From: za Date: Thu, 3 Oct 2024 15:42:18 +0700 Subject: [PATCH 311/453] feat(opentofu): add `destroy -auto-approve` alias (#12719) --- plugins/opentofu/README.md | 1 + plugins/opentofu/opentofu.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/opentofu/README.md b/plugins/opentofu/README.md index cc6e94acd..56f116492 100644 --- a/plugins/opentofu/README.md +++ b/plugins/opentofu/README.md @@ -22,6 +22,7 @@ plugins=(... opentofu) | `ttaa` | `tofu apply -auto-approve` | | `ttc` | `tofu console` | | `ttd` | `tofu destroy` | +| `ttd!` | `tofu destroy -auto-approve` | | `ttf` | `tofu fmt` | | `ttfr` | `tofu fmt -recursive` | | `tti` | `tofu init` | diff --git a/plugins/opentofu/opentofu.plugin.zsh b/plugins/opentofu/opentofu.plugin.zsh index 79b102a74..bb65c12e3 100644 --- a/plugins/opentofu/opentofu.plugin.zsh +++ b/plugins/opentofu/opentofu.plugin.zsh @@ -32,6 +32,7 @@ alias tta='tofu apply' alias ttaa='tofu apply -auto-approve' alias ttc='tofu console' alias ttd='tofu destroy' +alias ttd!='tofu destroy -auto-approve' alias ttf='tofu fmt' alias ttfr='tofu fmt -recursive' alias tti='tofu init' From 0c8ce9d6adf9982c2f024c42f13b9781fd9846f0 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Thu, 3 Oct 2024 01:47:33 -0700 Subject: [PATCH 312/453] fix(theme-chooser): use `env` in shebang (#12720) --- tools/theme_chooser.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/theme_chooser.sh b/tools/theme_chooser.sh index 3883f1d37..ab270e8e1 100755 --- a/tools/theme_chooser.sh +++ b/tools/theme_chooser.sh @@ -1,4 +1,4 @@ -#!/bin/zsh +#!/usr/bin/env zsh # Zsh Theme Chooser by fox (fox91 at anche dot no) # This program is free software. It comes without any warranty, to From 62cf1201b031399e7251abeee859e895ee825a48 Mon Sep 17 00:00:00 2001 From: So4resAlex <53014800+So4resAlex@users.noreply.github.com> Date: Thu, 3 Oct 2024 09:34:30 -0300 Subject: [PATCH 313/453] feat(terraform): add `destroy -auto-approve` alias (#12704) --- plugins/terraform/README.md | 1 + plugins/terraform/terraform.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/terraform/README.md b/plugins/terraform/README.md index 3f8ed6dee..feaf21d40 100644 --- a/plugins/terraform/README.md +++ b/plugins/terraform/README.md @@ -22,6 +22,7 @@ plugins=(... terraform) | `tfaa` | `terraform apply -auto-approve` | | `tfc` | `terraform console` | | `tfd` | `terraform destroy` | +| `tfd!` | `terraform destroy -auto-approve`| | `tff` | `terraform fmt` | | `tffr` | `terraform fmt -recursive` | | `tfi` | `terraform init` | diff --git a/plugins/terraform/terraform.plugin.zsh b/plugins/terraform/terraform.plugin.zsh index bedd46011..1c1d1b37e 100644 --- a/plugins/terraform/terraform.plugin.zsh +++ b/plugins/terraform/terraform.plugin.zsh @@ -20,6 +20,7 @@ alias tfa='terraform apply' alias tfaa='terraform apply -auto-approve' alias tfc='terraform console' alias tfd='terraform destroy' +alias 'tfd!'='terraform destroy -auto-approve' alias tff='terraform fmt' alias tffr='terraform fmt -recursive' alias tfi='terraform init' From d59f2fac36ac7d83d33c0054b1de33cce54e3210 Mon Sep 17 00:00:00 2001 From: Sebastian Correa <43179146+sebastian-correa@users.noreply.github.com> Date: Mon, 7 Oct 2024 16:50:56 -0300 Subject: [PATCH 314/453] feat(uv): add `uv` plugin (#12702) The uv plugin adds shell completions and many useful aliases. --- plugins/uv/README.md | 28 ++++++++++++++++++++++++++++ plugins/uv/uv.plugin.zsh | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 plugins/uv/README.md create mode 100644 plugins/uv/uv.plugin.zsh diff --git a/plugins/uv/README.md b/plugins/uv/README.md new file mode 100644 index 000000000..1b99c1185 --- /dev/null +++ b/plugins/uv/README.md @@ -0,0 +1,28 @@ +# uv plugin + +This plugin automatically installs [uv](https://github.com/astral-sh/uv)'s completions for you, and keeps them up to date. It also adds convenient aliases for common usage. + +To use it, add `uv` to the plugins array in your zshrc file: + +```zsh +plugins=(... uv) +``` + +## Aliases + +| Alias | Command | Description | +|:----- |------------------------------------------------------------------------ |:-------------------------------------------------------------------- | +| uva | `uv add` | Add packages to the project | +| uvexp | `uv export --format requirements-txt --no-hashes --output-file requirements.txt --quiet` | Export the lock file to `requirements.txt` | +| uvl | `uv lock` | Lock the dependencies | +| uvlr | `uv lock --refresh` | Rebuild the lock file without upgrading dependencies | +| uvlu | `uv lock --upgrade` | Lock the dependencies to the newest compatible versions | +| uvp | `uv pip` | Manage pip packages | +| uvpy | `uv python` | Manage Python installs | +| uvr | `uv run` | Run commands within the project's environment | +| uvrm | `uv remove` | Remove packages from the project | +| uvs | `uv sync` | Sync the environment with the lock file | +| uvsr | `uv sync --refresh` | "Force" sync the environment with the lock file (ignore cache) | +| uvsu | `uv sync --upgrade` | Sync the environment, allowing upgrades and ignoring the lock file | +| uvup | `uv self update` | Update the UV tool to the latest version | +| uvv | `uv venv` | Manage virtual environments | diff --git a/plugins/uv/uv.plugin.zsh b/plugins/uv/uv.plugin.zsh new file mode 100644 index 000000000..f1ad37e15 --- /dev/null +++ b/plugins/uv/uv.plugin.zsh @@ -0,0 +1,38 @@ +# Return immediately if uv is not found +if (( ! ${+commands[uv]} )); then + return +fi + +alias uva='uv add' +alias uvexp='uv export --format requirements-txt --no-hashes --output-file requirements.txt --quiet' +alias uvl='uv lock' +alias uvlr='uv lock --refresh' +alias uvlu='uv lock --upgrade' +alias uvp='uv pip' +alias uvpy='uv python' +alias uvr='uv run' +alias uvrm='uv remove' +alias uvs='uv sync' +alias uvsr='uv sync --refresh' +alias uvsu='uv sync --upgrade' +alias uvup='uv self update' +alias uvv='uv venv' + +# If the completion file doesn't exist yet, we need to autoload it and +# bind it. Otherwise, compinit will have already done that. +if [[ ! -f "$ZSH_CACHE_DIR/completions/_uv" ]]; then + typeset -g -A _comps + autoload -Uz _uv + _comps[uv]=_uv +fi + +if [[ ! -f "$ZSH_CACHE_DIR/completions/_uvx" ]]; then + typeset -g -A _comps + autoload -Uz _uvx + _comps[uvx]=_uvx +fi + +# uv and uvx are installed together (uvx is an alias to `uv tool run`) +# Overwrites the file each time as completions might change with uv versions. +uv generate-shell-completion zsh >| "$ZSH_CACHE_DIR/completions/_uv" &| +uvx --generate-shell-completion zsh >| "$ZSH_CACHE_DIR/completions/_uvx" &| From 767c927a6dd2853439696a0ca229c5d78be249a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 8 Oct 2024 19:32:04 +0200 Subject: [PATCH 315/453] fix(cli): add plugins with indentation in `omz plugin enable` --- lib/cli.zsh | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/lib/cli.zsh b/lib/cli.zsh index d1896f18d..38a84840c 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -344,20 +344,40 @@ function _omz::plugin::enable { next } -# if plugins=() is in multiline form, enable multi flag +# if plugins=() is in multiline form, enable multi flag and indent by default with 2 spaces /^[ \t]*plugins=\(/ { multi=1 + indent=\" \" + print \$0 + next } # if multi flag is enabled and we find a valid closing parenthesis, -# add new plugins and disable multi flag +# add new plugins with proper indent and disable multi flag multi == 1 && /^[^#]*\)/ { multi=0 - sub(/\)/, \" $add_plugins&\") + split(\"$add_plugins\",p,\" \") + for (i in p) { + print indent p[i] + } print \$0 next } +# if multi flag is enabled and we didnt find a closing parenthesis, +# get the indentation level to match when adding plugins +multi == 1 && /^[^#]*/ { + indent=\"\" + for (i = 1; i <= length(\$0); i++) { + char=substr(\$0, i, 1) + if (char == \" \" || char == \"\t\") { + indent = indent char + } else { + break + } + } +} + { print \$0 } " From 29b81a38a4f1748830bb218363799022976562ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 8 Oct 2024 19:58:10 +0200 Subject: [PATCH 316/453] chore: assign owner for terraform and k8s-related plugins --- .github/CODEOWNERS | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 361ed624b..17e8b43cb 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -5,10 +5,15 @@ plugins/eza/ @pepoluan plugins/genpass/ @atoponce plugins/git-lfs/ @hellovietduc plugins/gitfast/ @felipec +plugins/kube-ps1/ @mcornella +plugins/kubectl/ @mcornella +plugins/kubectx/ @mcornella +plugins/opentofu/ @mcornella plugins/react-native @esthor plugins/sdk/ @rgoldberg plugins/shell-proxy/ @septs plugins/starship/ @axieax +plugins/terraform/ @mcornella plugins/universalarchive/ @Konfekt plugins/wp-cli/ @joshmedeski plugins/zoxide/ @ajeetdsouza From 4382288aeba14c58d8eab138fba39aeb5edcdbf6 Mon Sep 17 00:00:00 2001 From: Shubham Rajvanshi Date: Tue, 8 Oct 2024 13:25:20 -0500 Subject: [PATCH 317/453] feat(k9s): add completion plugin for `k9s` (#12691) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marc Cornellà --- plugins/k9s/README.md | 9 +++++++++ plugins/k9s/k9s.plugin.zsh | 14 ++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 plugins/k9s/README.md create mode 100644 plugins/k9s/k9s.plugin.zsh diff --git a/plugins/k9s/README.md b/plugins/k9s/README.md new file mode 100644 index 000000000..275048cdb --- /dev/null +++ b/plugins/k9s/README.md @@ -0,0 +1,9 @@ +# k9s plugin + +This plugin adds completion support for the [k9s](https://k9scli.io). + +To use it, add `k9s` to the plugins array in your zshrc file: + +```zsh +plugins=(... k9s) +``` diff --git a/plugins/k9s/k9s.plugin.zsh b/plugins/k9s/k9s.plugin.zsh new file mode 100644 index 000000000..630d4f7d3 --- /dev/null +++ b/plugins/k9s/k9s.plugin.zsh @@ -0,0 +1,14 @@ +if (( ! $+commands[k9s] )); then + return +fi + +# If the completion file does not exist, fake it and load it +if [[ ! -f "$ZSH_CACHE_DIR/completions/_k9s" ]]; then + typeset -g -A _comps + autoload -Uz _k9s + _comps[k9s]=_k9s +fi + +# and then generate it in the background. On first completion, +# the actual completion file will be loaded. +k9s completion zsh >| "$ZSH_CACHE_DIR/completions/_k9s" &| From 6a10a4d6a3004b39e0bbcff530f97c95cad5127d Mon Sep 17 00:00:00 2001 From: Henrik Holmboe Date: Tue, 8 Oct 2024 20:29:30 +0200 Subject: [PATCH 318/453] feat(grep): exclude Python virtualenv from `grep` (#12685) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The convention to use `.venv` or `venv` directories for Python virtualenvs is widespread. This directory is huge and gives very little value when grepping in a source code directory. Co-authored-by: Marc Cornellà --- lib/grep.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/grep.zsh b/lib/grep.zsh index 5b3dec87e..1a70de7e5 100644 --- a/lib/grep.zsh +++ b/lib/grep.zsh @@ -10,7 +10,7 @@ else } # Ignore these folders (if the necessary grep flags are available) - EXC_FOLDERS="{.bzr,CVS,.git,.hg,.svn,.idea,.tox}" + EXC_FOLDERS="{.bzr,CVS,.git,.hg,.svn,.idea,.tox,.venv,venv}" # Check for --exclude-dir, otherwise check for --exclude. If --exclude # isn't available, --color won't be either (they were released at the same From 0a6f88ba0672f38d6925f8ffc8e7658e99f37489 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Tue, 8 Oct 2024 20:13:28 +0200 Subject: [PATCH 319/453] style: run prettier on main README --- README.md | 218 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 133 insertions(+), 85 deletions(-) diff --git a/README.md b/README.md index 0f20fd065..78db3a88f 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,21 @@

Oh My Zsh

-Oh My Zsh is an open source, community-driven framework for managing your [zsh](https://www.zsh.org/) configuration. +Oh My Zsh is an open source, community-driven framework for managing your [zsh](https://www.zsh.org/) +configuration. Sounds boring. Let's try again. **Oh My Zsh will not make you a 10x developer...but you may feel like one.** -Once installed, your terminal shell will become the talk of the town _or your money back!_ With each keystroke in your command prompt, you'll take advantage of the hundreds of powerful plugins and beautiful themes. Strangers will come up to you in cafés and ask you, _"that is amazing! are you some sort of genius?"_ +Once installed, your terminal shell will become the talk of the town _or your money back!_ With each keystroke +in your command prompt, you'll take advantage of the hundreds of powerful plugins and beautiful themes. +Strangers will come up to you in cafés and ask you, _"that is amazing! are you some sort of genius?"_ -Finally, you'll begin to get the sort of attention that you have always felt you deserved. ...or maybe you'll use the time that you're saving to start flossing more often. 😬 +Finally, you'll begin to get the sort of attention that you have always felt you deserved. ...or maybe you'll +use the time that you're saving to start flossing more often. 😬 -To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://x.com/ohmyzsh) on X (formerly Twitter), and join us on [Discord](https://discord.gg/ohmyzsh). +To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://x.com/ohmyzsh) on X (formerly +Twitter), and join us on [Discord](https://discord.gg/ohmyzsh). [![CI](https://github.com/ohmyzsh/ohmyzsh/workflows/CI/badge.svg)](https://github.com/ohmyzsh/ohmyzsh/actions?query=workflow%3ACI) [![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/ohmyzsh?label=%40ohmyzsh&logo=x&style=flat)](https://twitter.com/intent/follow?screen_name=ohmyzsh) @@ -62,26 +67,28 @@ To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://x.c ### Operating System Compatibility -| O/S | Status | -| :------------- | :-----: | -| Android | ✅ | -| freeBSD | ✅ | -| LCARS | 🛸 | -| Linux | ✅ | -| macOS | ✅ | -| OS/2 Warp | ❌ | -| Windows (WSL2) | ✅ | - +| O/S | Status | +| :------------- | :----: | +| Android | ✅ | +| freeBSD | ✅ | +| LCARS | 🛸 | +| Linux | ✅ | +| macOS | ✅ | +| OS/2 Warp | ❌ | +| Windows (WSL2) | ✅ | ### Prerequisites -- [Zsh](https://www.zsh.org) should be installed (v4.3.9 or more recent is fine but we prefer 5.0.8 and newer). If not pre-installed (run `zsh --version` to confirm), check the following wiki instructions here: [Installing ZSH](https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH) +- [Zsh](https://www.zsh.org) should be installed (v4.3.9 or more recent is fine but we prefer 5.0.8 and + newer). If not pre-installed (run `zsh --version` to confirm), check the following wiki instructions here: + [Installing ZSH](https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH) - `curl` or `wget` should be installed - `git` should be installed (recommended v2.4.11 or higher) ### Basic Installation -Oh My Zsh is installed by running one of the following commands in your terminal. You can install this via the command-line with either `curl`, `wget` or another similar tool. +Oh My Zsh is installed by running one of the following commands in your terminal. You can install this via the +command-line with either `curl`, `wget` or another similar tool. | Method | Command | | :-------- | :------------------------------------------------------------------------------------------------ | @@ -89,38 +96,44 @@ Oh My Zsh is installed by running one of the following commands in your terminal | **wget** | `sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"` | | **fetch** | `sh -c "$(fetch -o - https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"` | -Alternatively, the installer is also mirrored outside GitHub. Using this URL instead may be required if you're in a country like China or India (for certain ISPs), that blocks `raw.githubusercontent.com`: +Alternatively, the installer is also mirrored outside GitHub. Using this URL instead may be required if you're +in a country like China or India (for certain ISPs), that blocks `raw.githubusercontent.com`: -| Method | Command | -| :-------- | :------------------------------------------------------------------------------------------------ | -| **curl** | `sh -c "$(curl -fsSL https://install.ohmyz.sh/)"` | -| **wget** | `sh -c "$(wget -O- https://install.ohmyz.sh/)"` | -| **fetch** | `sh -c "$(fetch -o - https://install.ohmyz.sh/)"` | +| Method | Command | +| :-------- | :------------------------------------------------ | +| **curl** | `sh -c "$(curl -fsSL https://install.ohmyz.sh/)"` | +| **wget** | `sh -c "$(wget -O- https://install.ohmyz.sh/)"` | +| **fetch** | `sh -c "$(fetch -o - https://install.ohmyz.sh/)"` | -_Note that any previous `.zshrc` will be renamed to `.zshrc.pre-oh-my-zsh`. After installation, you can move the configuration you want to preserve into the new `.zshrc`._ +_Note that any previous `.zshrc` will be renamed to `.zshrc.pre-oh-my-zsh`. After installation, you can move +the configuration you want to preserve into the new `.zshrc`._ #### Manual Inspection -It's a good idea to inspect the install script from projects you don't yet know. You can do -that by downloading the install script first, looking through it so everything looks normal, -then running it: +It's a good idea to inspect the install script from projects you don't yet know. You can do that by +downloading the install script first, looking through it so everything looks normal, then running it: ```sh wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh sh install.sh ``` -If the above URL times out or otherwise fails, you may have to substitute the URL for `https://install.ohmyz.sh` to be able to get the script. +If the above URL times out or otherwise fails, you may have to substitute the URL for +`https://install.ohmyz.sh` to be able to get the script. ## Using Oh My Zsh ### Plugins -Oh My Zsh comes with a shitload of plugins for you to take advantage of. You can take a look in the [plugins](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins) directory and/or the [wiki](https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins) to see what's currently available. +Oh My Zsh comes with a shitload of plugins for you to take advantage of. You can take a look in the +[plugins](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins) directory and/or the +[wiki](https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins) to see what's currently available. #### Enabling Plugins -Once you spot a plugin (or several) that you'd like to use with Oh My Zsh, you'll need to enable them in the `.zshrc` file. You'll find the zshrc file in your `$HOME` directory. Open it with your favorite text editor and you'll see a spot to list all the plugins you want to load. +Once you spot a plugin (or several) that you'd like to use with Oh My Zsh, you'll need to enable them in the +`.zshrc` file. You'll find the zshrc file in your `$HOME` directory. Open it with your favorite text editor +and you'll see a spot to list all the plugins you want to load. ```sh vi ~/.zshrc @@ -140,21 +153,28 @@ plugins=( ) ``` -_Note that the plugins are separated by whitespace (spaces, tabs, new lines...). **Do not** use commas between them or it will break._ +_Note that the plugins are separated by whitespace (spaces, tabs, new lines...). **Do not** use commas between +them or it will break._ #### Using Plugins -Each built-in plugin includes a **README**, documenting it. This README should show the aliases (if the plugin adds any) and extra goodies that are included in that particular plugin. +Each built-in plugin includes a **README**, documenting it. This README should show the aliases (if the plugin +adds any) and extra goodies that are included in that particular plugin. ### Themes -We'll admit it. Early in the Oh My Zsh world, we may have gotten a bit too theme happy. We have over one hundred and fifty themes now bundled. Most of them have [screenshots](https://github.com/ohmyzsh/ohmyzsh/wiki/Themes) on the wiki (We are working on updating this!). Check them out! +We'll admit it. Early in the Oh My Zsh world, we may have gotten a bit too theme happy. We have over one +hundred and fifty themes now bundled. Most of them have +[screenshots](https://github.com/ohmyzsh/ohmyzsh/wiki/Themes) on the wiki (We are working on updating this!). +Check them out! #### Selecting A Theme -_Robby's theme is the default one. It's not the fanciest one. It's not the simplest one. It's just the right one (for him)._ +_Robby's theme is the default one. It's not the fanciest one. It's not the simplest one. It's just the right +one (for him)._ -Once you find a theme that you'd like to use, you will need to edit the `~/.zshrc` file. You'll see an environment variable (all caps) in there that looks like: +Once you find a theme that you'd like to use, you will need to edit the `~/.zshrc` file. You'll see an +environment variable (all caps) in there that looks like: ```sh ZSH_THEME="robbyrussell" @@ -167,23 +187,32 @@ ZSH_THEME="agnoster" # (this is one of the fancy ones) # see https://github.com/ohmyzsh/ohmyzsh/wiki/Themes#agnoster ``` + > [!NOTE] > You will many times see screenshots for a zsh theme, and try it out, and find that it doesn't look the same for you. -> -> This is because many themes require installing a [Powerline Font](https://github.com/powerline/fonts) or a [Nerd Font](https://github.com/ryanoasis/nerd-fonts) in order to render properly. -> Without them, these themes will render weird prompt symbols. Check out [the FAQ](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#i-have-a-weird-character-in-my-prompt) for more information. + + +> This is because many themes require installing a [Powerline Font](https://github.com/powerline/fonts) or a +> [Nerd Font](https://github.com/ryanoasis/nerd-fonts) in order to render properly. Without them, these themes +> will render weird prompt symbols. Check out +> [the FAQ](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#i-have-a-weird-character-in-my-prompt) for more +> information. > -> Also, beware that themes only control what your prompt looks like. This is, the text you see before or after your cursor, where you'll type your commands. -> Themes don't control things such as the colors of your terminal window (known as _color scheme_) or the font of your terminal. These are settings that you can change in your terminal emulator. -> For more information, see [what is a zsh theme](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#what-is-a-zsh-theme). +> Also, beware that themes only control what your prompt looks like. This is, the text you see before or after +> your cursor, where you'll type your commands. Themes don't control things such as the colors of your +> terminal window (known as _color scheme_) or the font of your terminal. These are settings that you can +> change in your terminal emulator. For more information, see +> [what is a zsh theme](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#what-is-a-zsh-theme). Open up a new terminal window and your prompt should look something like this: ![Agnoster theme](https://cloud.githubusercontent.com/assets/2618447/6316862/70f58fb6-ba03-11e4-82c9-c083bf9a6574.png) -In case you did not find a suitable theme for your needs, please have a look at the wiki for [more of them](https://github.com/ohmyzsh/ohmyzsh/wiki/External-themes). +In case you did not find a suitable theme for your needs, please have a look at the wiki for +[more of them](https://github.com/ohmyzsh/ohmyzsh/wiki/External-themes). -If you're feeling feisty, you can let the computer select one randomly for you each time you open a new terminal window. +If you're feeling feisty, you can let the computer select one randomly for you each time you open a new +terminal window. ```sh ZSH_THEME="random" # (...please let it be pie... please be some pie..) @@ -206,7 +235,8 @@ ZSH_THEME_RANDOM_IGNORED=(pygmalion tjkirch_mod) ### FAQ -If you have some more questions or issues, you might find a solution in our [FAQ](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ). +If you have some more questions or issues, you might find a solution in our +[FAQ](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ). ## Advanced Topics @@ -214,16 +244,16 @@ If you're the type that likes to get their hands dirty, these sections might res ### Advanced Installation -Some users may want to manually install Oh My Zsh, or change the default path or other settings that -the installer accepts (these settings are also documented at the top of the install script). +Some users may want to manually install Oh My Zsh, or change the default path or other settings that the +installer accepts (these settings are also documented at the top of the install script). #### Custom Directory -The default location is `~/.oh-my-zsh` (hidden in your home directory, you can access it with `cd ~/.oh-my-zsh`) +The default location is `~/.oh-my-zsh` (hidden in your home directory, you can access it with +`cd ~/.oh-my-zsh`) If you'd like to change the install directory with the `ZSH` environment variable, either by running -`export ZSH=/your/path` before installing, or by setting it before the end of the install pipeline -like this: +`export ZSH=/your/path` before installing, or by setting it before the end of the install pipeline like this: ```sh ZSH="$HOME/.dotfiles/oh-my-zsh" sh install.sh @@ -231,32 +261,33 @@ ZSH="$HOME/.dotfiles/oh-my-zsh" sh install.sh #### Unattended Install -If you're running the Oh My Zsh install script as part of an automated install, you can pass the `--unattended` -flag to the `install.sh` script. This will have the effect of not trying to change -the default shell, and it also won't run `zsh` when the installation has finished. +If you're running the Oh My Zsh install script as part of an automated install, you can pass the +`--unattended` flag to the `install.sh` script. This will have the effect of not trying to change the default +shell, and it also won't run `zsh` when the installation has finished. ```sh sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended ``` -If you're in China, India, or another country that blocks `raw.githubusercontent.com`, you may have to substitute the URL for `https://install.ohmyz.sh` for it to install. +If you're in China, India, or another country that blocks `raw.githubusercontent.com`, you may have to +substitute the URL for `https://install.ohmyz.sh` for it to install. #### Installing From A Forked Repository The install script also accepts these variables to allow the installation of a different repository: -- `REPO` (default: `ohmyzsh/ohmyzsh`): this takes the form of `owner/repository`. If you set - this variable, the installer will look for a repository at `https://github.com/{owner}/{repository}`. +- `REPO` (default: `ohmyzsh/ohmyzsh`): this takes the form of `owner/repository`. If you set this variable, + the installer will look for a repository at `https://github.com/{owner}/{repository}`. -- `REMOTE` (default: `https://github.com/${REPO}.git`): this is the full URL of the git repository - clone. You can use this setting if you want to install from a fork that is not on GitHub (GitLab, - Bitbucket...) or if you want to clone with SSH instead of HTTPS (`git@github.com:user/project.git`). +- `REMOTE` (default: `https://github.com/${REPO}.git`): this is the full URL of the git repository clone. You + can use this setting if you want to install from a fork that is not on GitHub (GitLab, Bitbucket...) or if + you want to clone with SSH instead of HTTPS (`git@github.com:user/project.git`). _NOTE: it's incompatible with setting the `REPO` variable. This setting will take precedence._ - `BRANCH` (default: `master`): you can use this setting if you want to change the default branch to be - checked out when cloning the repository. This might be useful for testing a Pull Request, or if you - want to use a branch other than `master`. + checked out when cloning the repository. This might be useful for testing a Pull Request, or if you want to + use a branch other than `master`. For example: @@ -302,16 +333,21 @@ Once you open up a new terminal window, it should load zsh with Oh My Zsh's conf If you have any hiccups installing, here are a few common fixes. -- You _might_ need to modify your `PATH` in `~/.zshrc` if you're not able to find some commands after switching to `oh-my-zsh`. -- If you installed manually or changed the install location, check the `ZSH` environment variable in `~/.zshrc`. +- You _might_ need to modify your `PATH` in `~/.zshrc` if you're not able to find some commands after + switching to `oh-my-zsh`. +- If you installed manually or changed the install location, check the `ZSH` environment variable in + `~/.zshrc`. ### Custom Plugins And Themes -If you want to override any of the default behaviors, just add a new file (ending in `.zsh`) in the `custom/` directory. +If you want to override any of the default behaviors, just add a new file (ending in `.zsh`) in the `custom/` +directory. -If you have many functions that go well together, you can put them as a `XYZ.plugin.zsh` file in the `custom/plugins/` directory and then enable this plugin. +If you have many functions that go well together, you can put them as a `XYZ.plugin.zsh` file in the +`custom/plugins/` directory and then enable this plugin. -If you would like to override the functionality of a plugin distributed with Oh My Zsh, create a plugin of the same name in the `custom/plugins/` directory and it will be loaded instead of the one in `plugins/`. +If you would like to override the functionality of a plugin distributed with Oh My Zsh, create a plugin of the +same name in the `custom/plugins/` directory and it will be loaded instead of the one in `plugins/`. ### Enable GNU ls In macOS And freeBSD Systems @@ -331,9 +367,9 @@ _Note: this is not compatible with `DISABLE_LS_COLORS=true`_
-If you want to skip default Oh My Zsh aliases (those defined in `lib/*` files) or plugin aliases, -you can use the settings below in your `~/.zshrc` file, **before Oh My Zsh is loaded**. Note that -there are many different ways to skip aliases, depending on your needs. +If you want to skip default Oh My Zsh aliases (those defined in `lib/*` files) or plugin aliases, you can use +the settings below in your `~/.zshrc` file, **before Oh My Zsh is loaded**. Note that there are many different +ways to skip aliases, depending on your needs. ```sh # Skip all aliases, in lib files and enabled plugins @@ -372,19 +408,19 @@ zstyle ':omz:lib:directories' aliases no #### Notice -> This feature is currently in a testing phase and it may be subject to change in the future. -> It is also not currently compatible with plugin managers such as zpm or zinit, which don't -> source the init script (`oh-my-zsh.sh`) where this feature is implemented in. +> This feature is currently in a testing phase and it may be subject to change in the future. It is also not +> currently compatible with plugin managers such as zpm or zinit, which don't source the init script +> (`oh-my-zsh.sh`) where this feature is implemented in. -> It is also not currently aware of "aliases" that are defined as functions. Example of such -> are `gccd`, `ggf`, or `ggl` functions from the git plugin. +> It is also not currently aware of "aliases" that are defined as functions. Example of such are `gccd`, +> `ggf`, or `ggl` functions from the git plugin. ### 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 -asynchronously. 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 off by setting the following in your .zshrc file, -before Oh My Zsh is sourced: +Async prompt functions are an experimental feature (included on April 3, 2024) that allows Oh My Zsh to render +prompt information asynchronously. 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 off by setting the following in your .zshrc file, before Oh My Zsh is sourced: ```sh zstyle ':omz:alpha:lib:git' async-prompt no @@ -392,7 +428,8 @@ zstyle ':omz:alpha:lib:git' async-prompt no ## Getting Updates -By default, you will be prompted to check for updates every 2 weeks. You can choose other update modes by adding a line to your `~/.zshrc` file, **before Oh My Zsh is loaded**: +By default, you will be prompted to check for updates every 2 weeks. You can choose other update modes by +adding a line to your `~/.zshrc` file, **before Oh My Zsh is loaded**: 1. Automatic update without confirmation prompt: @@ -435,7 +472,8 @@ zstyle ':omz:update' verbose silent # only errors ### Manual Updates -If you'd like to update at any point in time (maybe someone just released a new plugin and you don't want to wait a week?) you just need to run: +If you'd like to update at any point in time (maybe someone just released a new plugin and you don't want to +wait a week?) you just need to run: ```sh omz update @@ -447,25 +485,31 @@ Magic! 🎉 Oh My Zsh isn't for everyone. We'll miss you, but we want to make this an easy breakup. -If you want to uninstall `oh-my-zsh`, just run `uninstall_oh_my_zsh` from the command-line. It will remove itself and revert your previous `bash` or `zsh` configuration. +If you want to uninstall `oh-my-zsh`, just run `uninstall_oh_my_zsh` from the command-line. It will remove +itself and revert your previous `bash` or `zsh` configuration. ## How Do I Contribute To Oh My Zsh? Before you participate in our delightful community, please read the [code of conduct](CODE_OF_CONDUCT.md). -I'm far from being a [Zsh](https://www.zsh.org/) expert and suspect there are many ways to improve – if you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests! +I'm far from being a [Zsh](https://www.zsh.org/) expert and suspect there are many ways to improve – if you +have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send +pull requests! -We also need people to test out pull requests. So take a look through [the open issues](https://github.com/ohmyzsh/ohmyzsh/issues) and help where you can. +We also need people to test out pull requests. So take a look through +[the open issues](https://github.com/ohmyzsh/ohmyzsh/issues) and help where you can. See [Contributing](CONTRIBUTING.md) for more details. ### Do Not Send Us Themes -We have (more than) enough themes for the time being. Please add your theme to the [external themes](https://github.com/ohmyzsh/ohmyzsh/wiki/External-themes) wiki page. +We have (more than) enough themes for the time being. Please add your theme to the +[external themes](https://github.com/ohmyzsh/ohmyzsh/wiki/External-themes) wiki page. ## Contributors -Oh My Zsh has a vibrant community of happy users and delightful contributors. Without all the time and help from our contributors, it wouldn't be so awesome. +Oh My Zsh has a vibrant community of happy users and delightful contributors. Without all the time and help +from our contributors, it wouldn't be so awesome. Thank you so much! @@ -484,7 +528,9 @@ We're on social media: ## Merchandise -We have [stickers, shirts, and coffee mugs available](https://shop.planetargon.com/collections/oh-my-zsh?utm_source=github) for you to show off your love of Oh My Zsh. Again, you will become the talk of the town! +We have +[stickers, shirts, and coffee mugs available](https://shop.planetargon.com/collections/oh-my-zsh?utm_source=github) +for you to show off your love of Oh My Zsh. Again, you will become the talk of the town! ## License @@ -494,4 +540,6 @@ Oh My Zsh is released under the [MIT license](LICENSE.txt). ![Planet Argon](https://pa-github-assets.s3.amazonaws.com/PARGON_logo_digital_COL-small.jpg) -Oh My Zsh was started by the team at [Planet Argon](https://www.planetargon.com/?utm_source=github), a [Ruby on Rails development agency](https://www.planetargon.com/services/ruby-on-rails-development?utm_source=github). Check out our [other open source projects](https://www.planetargon.com/open-source?utm_source=github). +Oh My Zsh was started by the team at [Planet Argon](https://www.planetargon.com/?utm_source=github), a +[Ruby on Rails development agency](https://www.planetargon.com/services/ruby-on-rails-development?utm_source=github). +Check out our [other open source projects](https://www.planetargon.com/open-source?utm_source=github). From 2a109d30afe4ab164a946c307abc3d2a444a42ad Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Tue, 8 Oct 2024 20:26:23 +0200 Subject: [PATCH 320/453] feat(git): add escape hatch to enable async prompt --- README.md | 12 ++++++++++-- lib/git.zsh | 16 ++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 78db3a88f..1303292d2 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Twitter), and join us on [Discord](https://discord.gg/ohmyzsh). - [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) + - [Async git prompt](#async-git-prompt) - [Getting Updates](#getting-updates) - [Updates Verbosity](#updates-verbosity) - [Manual Updates](#manual-updates) @@ -415,7 +415,7 @@ zstyle ':omz:lib:directories' aliases no > It is also not currently aware of "aliases" that are defined as functions. Example of such are `gccd`, > `ggf`, or `ggl` functions from the git plugin. -### Disable async git prompt +### Async git prompt Async prompt functions are an experimental feature (included on April 3, 2024) that allows Oh My Zsh to render prompt information asynchronously. This can improve prompt rendering performance, but it might not work well @@ -426,6 +426,14 @@ turn it off by setting the following in your .zshrc file, before Oh My Zsh is so zstyle ':omz:alpha:lib:git' async-prompt no ``` +If your problem is that the git prompt just stopped appearing, you can try to force it setting the following +configuration before `oh-my-zsh.sh` is sourced. If it still does not work, please open an issue with your +case. + +```sh +zstyle ':omz:alpha:lib:git' async-prompt force +``` + ## Getting Updates By default, you will be prompted to check for updates every 2 weeks. You can choose other update modes by diff --git a/lib/git.zsh b/lib/git.zsh index 0efff3e07..a1b4d1587 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -44,6 +44,7 @@ function _omz_git_prompt_info() { # - https://github.com/ohmyzsh/ohmyzsh/issues/12331 # - https://github.com/ohmyzsh/ohmyzsh/issues/12360 # TODO(2024-06-12): @mcornella remove workaround when CentOS 7 reaches EOL +local _style if zstyle -t ':omz:alpha:lib:git' async-prompt \ || { is-at-least 5.0.6 && zstyle -T ':omz:alpha:lib:git' async-prompt }; then function git_prompt_info() { @@ -81,6 +82,21 @@ if zstyle -t ':omz:alpha:lib:git' async-prompt \ # Register the async handler first. This needs to be done before # the async request prompt is run precmd_functions=(_defer_async_git_register $precmd_functions) +elif zstyle -s ':omz:alpha:lib:git' async-prompt _style && [[ $_style == "force" ]]; 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 + } + + _omz_register_handler _omz_git_prompt_info + _omz_register_handler _omz_git_prompt_status else function git_prompt_info() { _omz_git_prompt_info From 0987eee19034e36dda27887775fccfe7b8c0157e Mon Sep 17 00:00:00 2001 From: Alex Rosenfeld Date: Tue, 8 Oct 2024 15:44:18 -0400 Subject: [PATCH 321/453] fix(poetry-env): only run `deactivate` if needed (#12701) Co-authored-by: Carlo Sala --- plugins/poetry-env/poetry-env.plugin.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/poetry-env/poetry-env.plugin.zsh b/plugins/poetry-env/poetry-env.plugin.zsh index be46717d8..dd52b1655 100644 --- a/plugins/poetry-env/poetry-env.plugin.zsh +++ b/plugins/poetry-env/poetry-env.plugin.zsh @@ -6,10 +6,11 @@ _togglePoetryShell() { fi # Deactivate the current environment if moving out of a Poetry directory or into a different Poetry directory - if [[ $poetry_active -eq 1 ]] && { [[ $in_poetry_dir -eq 0 ]] && [[ "$PWD" != "$poetry_dir"* ]]; }; then + if [[ $poetry_active -eq 1 ]] && [[ $in_poetry_dir -eq 0 ]] \ + && [[ "$PWD" != "$poetry_dir"* ]]; then export poetry_active=0 unset poetry_dir - deactivate + (( $+functions[deactivate] )) && deactivate fi # Activate the environment if in a Poetry directory and no environment is currently active From ba1732833b81c69df5135825d38ea9d889d1aa47 Mon Sep 17 00:00:00 2001 From: Paul <41666738+kutukvpavel@users.noreply.github.com> Date: Tue, 8 Oct 2024 22:45:12 +0300 Subject: [PATCH 322/453] feat(jonathan): add virtualenv support (#12705) Co-authored-by: paul --- themes/jonathan.zsh-theme | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/themes/jonathan.zsh-theme b/themes/jonathan.zsh-theme index e8c490884..da6ed2281 100644 --- a/themes/jonathan.zsh-theme +++ b/themes/jonathan.zsh-theme @@ -7,14 +7,15 @@ function theme_precmd { local promptsize=${#${(%):---(%n@%m:%l)---()--}} local rubypromptsize=${#${(%)$(ruby_prompt_info)}} local pwdsize=${#${(%):-%~}} + local venvpromptsize=$((${#$(virtualenv_prompt_info)})) # Truncate the path if it's too long. - if (( promptsize + rubypromptsize + pwdsize > TERMWIDTH )); then + if (( promptsize + rubypromptsize + pwdsize + venvpromptsize > TERMWIDTH )); then (( PR_PWDLEN = TERMWIDTH - promptsize )) elif [[ "${langinfo[CODESET]}" = UTF-8 ]]; then - PR_FILLBAR="\${(l:$(( TERMWIDTH - (promptsize + rubypromptsize + pwdsize) ))::${PR_HBAR}:)}" + PR_FILLBAR="\${(l:$(( TERMWIDTH - (promptsize + rubypromptsize + pwdsize + venvpromptsize ) ))::${PR_HBAR}:)}" else - PR_FILLBAR="${PR_SHIFT_IN}\${(l:$(( TERMWIDTH - (promptsize + rubypromptsize + pwdsize) ))::${altchar[q]:--}:)}${PR_SHIFT_OUT}" + PR_FILLBAR="${PR_SHIFT_IN}\${(l:$(( TERMWIDTH - (promptsize + rubypromptsize + pwdsize + venvpromptsize ) ))::${altchar[q]:--}:)}${PR_SHIFT_OUT}" fi } @@ -103,7 +104,7 @@ fi PROMPT='${PR_SET_CHARSET}${PR_STITLE}${(e)PR_TITLEBAR}\ ${PR_CYAN}${PR_ULCORNER}${PR_HBAR}${PR_GREY}(\ ${PR_GREEN}%${PR_PWDLEN}<...<%~%<<\ -${PR_GREY})$(ruby_prompt_info)${PR_CYAN}${PR_HBAR}${PR_HBAR}${(e)PR_FILLBAR}${PR_HBAR}${PR_GREY}(\ +${PR_GREY})$(virtualenv_prompt_info)$(ruby_prompt_info)${PR_CYAN}${PR_HBAR}${PR_HBAR}${(e)PR_FILLBAR}${PR_HBAR}${PR_GREY}(\ ${PR_CYAN}%(!.%SROOT%s.%n)${PR_GREY}@${PR_GREEN}%m:%l\ ${PR_GREY})${PR_CYAN}${PR_HBAR}${PR_URCORNER}\ From 61bacd95b285a9792a05d1c818d9cee15ebe53c6 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Tue, 8 Oct 2024 21:50:31 +0200 Subject: [PATCH 323/453] fix(gem): regression with gem completion (#12735) --- plugins/gem/gem.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/gem/gem.plugin.zsh b/plugins/gem/gem.plugin.zsh index 58716594d..41c434a09 100644 --- a/plugins/gem/gem.plugin.zsh +++ b/plugins/gem/gem.plugin.zsh @@ -11,7 +11,7 @@ function gemy { if [[ ! -f "$ZSH_CACHE_DIR/completions/_gem" ]]; then typeset -g -A _comps autoload -Uz _gem - _comps[docker]=_gem + _comps[gem]=_gem fi # zsh 5.5 already provides completion for `_gem`. With this we ensure that From d2d5155d41cbe183ef172fef1e83a29d116a5af6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A9=D0=B0=D0=BD=D0=BD=D0=B8=D0=BA=D0=BE=D0=B2=20=D0=9C?= =?UTF-8?q?=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= <79425045+mikhailde@users.noreply.github.com> Date: Thu, 10 Oct 2024 14:39:07 +0300 Subject: [PATCH 324/453] feat(ssh-agent): add keys regardless of filename (#12741) Co-authored-by: Carlo Sala --- plugins/ssh-agent/ssh-agent.plugin.zsh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index 83548648b..becd5ea17 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -39,13 +39,16 @@ function _add_identities() { return fi - # add default keys if no identities were set up via zstyle - # this is to mimic the call to ssh-add with no identities - if [[ ${#identities} -eq 0 ]]; then - # key list found on `ssh-add` man page's DESCRIPTION section - for id in id_rsa id_dsa id_ecdsa id_ed25519 id_ed25519_sk identity; do - # check if file exists - [[ -f "$HOME/.ssh/$id" ]] && identities+=($id) + # If no keys specified in zstyle, add default keys. + # Mimics calling ssh-add with no arguments. + if [[ ${#identities[@]} -eq 0 ]]; then + # Iterate over files in .ssh folder. + for file in "$HOME/.ssh"/*; do + # Check if file is a regular file and starts with "-----BEGIN OPENSSH PRIVATE KEY-----". + if [[ -f "$file" && $(command head -n 1 "$file") =~ ^-----BEGIN\ OPENSSH\ PRIVATE\ KEY----- ]]; then + # Add filename (without path) to identities array. + identities+=("${file##*/}") + fi done fi From a82f6c79abdb888f6f63ee2ddc77742a84c28486 Mon Sep 17 00:00:00 2001 From: "ohmyzsh[bot]" <54982679+ohmyzsh[bot]@users.noreply.github.com> Date: Sun, 13 Oct 2024 21:10:29 +0200 Subject: [PATCH 325/453] feat(wd): update to f0f47b71 (#12747) Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com> --- .github/dependencies.yml | 2 +- plugins/wd/wd.sh | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/dependencies.yml b/.github/dependencies.yml index 2be4cdfb0..d53b0cd4d 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -28,7 +28,7 @@ dependencies: plugins/wd: repo: mfaerevaag/wd branch: master - version: tag:v0.9.0 + version: tag:v0.9.1 precopy: | set -e rm -r test diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh index ddd31e6f6..66435a2a6 100755 --- a/plugins/wd/wd.sh +++ b/plugins/wd/wd.sh @@ -8,7 +8,7 @@ # @github.com/mfaerevaag/wd # version -readonly WD_VERSION=0.9.0 +readonly WD_VERSION=0.9.1 # colors readonly WD_BLUE="\033[96m" @@ -59,7 +59,7 @@ wd_print_msg() then local color="${1:-$WD_BLUE}" # Default to blue if no color is provided local msg="$2" - + if [[ -z "$msg" ]]; then print "${WD_RED}*${WD_NOC} Could not print message. Sorry!" else @@ -344,6 +344,7 @@ wd_path() wd_show() { local name_arg=$1 + local show_pwd # if there's an argument we look up the value if [[ -n $name_arg ]] then @@ -358,12 +359,12 @@ wd_show() local wd_matches wd_matches=() # do a reverse lookup to check whether PWD is in $points - PWD="${PWD/$HOME/~}" - if [[ ${points[(r)$PWD]} == "$PWD" ]] + show_pwd="${PWD/$HOME/~}" + if [[ ${points[(r)$show_pwd]} == "$show_pwd" ]] then for name in ${(k)points} do - if [[ $points[$name] == "$PWD" ]] + if [[ $points[$name] == "$show_pwd" ]] then wd_matches[$(($#wd_matches+1))]=$name fi @@ -371,7 +372,7 @@ wd_show() wd_print_msg "$WD_BLUE" "$#wd_matches warp point(s) to current directory: ${WD_GREEN}$wd_matches${WD_NOC}" else - wd_print_msg "$WD_YELLOW" "No warp point to $(echo "$PWD" | sed "s:$HOME:~:")" + wd_print_msg "$WD_YELLOW" "No warp point to $show_pwd" fi fi } From 9bfa3395f34f63d14945e01c45c72ec43d372dfa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 13 Oct 2024 21:11:03 +0200 Subject: [PATCH 326/453] chore(deps): bump charset-normalizer in /.github/workflows/dependencies (#12749) Bumps [charset-normalizer](https://github.com/Ousret/charset_normalizer) from 3.3.2 to 3.4.0. - [Release notes](https://github.com/Ousret/charset_normalizer/releases) - [Changelog](https://github.com/jawah/charset_normalizer/blob/master/CHANGELOG.md) - [Commits](https://github.com/Ousret/charset_normalizer/compare/3.3.2...3.4.0) --- updated-dependencies: - dependency-name: charset-normalizer dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependencies/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt index eedd6d276..ed0d129b3 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -1,5 +1,5 @@ certifi==2024.8.30 -charset-normalizer==3.3.2 +charset-normalizer==3.4.0 idna==3.10 PyYAML==6.0.2 requests==2.32.3 From b3ba8da4218c3b9e1e5e45e1d4c00d312ff7226b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 14 Oct 2024 13:15:39 +0200 Subject: [PATCH 327/453] ci(dependencies): use tag version in git commit if available (#12756) Related: https://github.com/ohmyzsh/ohmyzsh/pull/12747#issuecomment-2410440748 --- .github/workflows/dependencies/updater.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies/updater.py b/.github/workflows/dependencies/updater.py index f85c9eda7..02cff9030 100644 --- a/.github/workflows/dependencies/updater.py +++ b/.github/workflows/dependencies/updater.py @@ -228,7 +228,7 @@ class Dependency: self.__apply_upstream_changes() # Add all changes and commit - has_new_commit = Git.add_and_commit(self.name, short_sha) + has_new_commit = Git.add_and_commit(self.name, new_version) if has_new_commit: # Push changes to remote From 09a94672003b21b8a3d8d15d31098641e7f3a4db Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Tue, 15 Oct 2024 13:02:12 +0200 Subject: [PATCH 328/453] Revert "feat(ssh-agent): add keys regardless of filename (#12741)" (#12761) This reverts commit d2d5155d41cbe183ef172fef1e83a29d116a5af6. Closes #12743 Closes #12745 Closes #12758 --- plugins/ssh-agent/ssh-agent.plugin.zsh | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index becd5ea17..83548648b 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -39,16 +39,13 @@ function _add_identities() { return fi - # If no keys specified in zstyle, add default keys. - # Mimics calling ssh-add with no arguments. - if [[ ${#identities[@]} -eq 0 ]]; then - # Iterate over files in .ssh folder. - for file in "$HOME/.ssh"/*; do - # Check if file is a regular file and starts with "-----BEGIN OPENSSH PRIVATE KEY-----". - if [[ -f "$file" && $(command head -n 1 "$file") =~ ^-----BEGIN\ OPENSSH\ PRIVATE\ KEY----- ]]; then - # Add filename (without path) to identities array. - identities+=("${file##*/}") - fi + # add default keys if no identities were set up via zstyle + # this is to mimic the call to ssh-add with no identities + if [[ ${#identities} -eq 0 ]]; then + # key list found on `ssh-add` man page's DESCRIPTION section + for id in id_rsa id_dsa id_ecdsa id_ed25519 id_ed25519_sk identity; do + # check if file exists + [[ -f "$HOME/.ssh/$id" ]] && identities+=($id) done fi From 9ae155336f24dd459c1030b717e11489ababa624 Mon Sep 17 00:00:00 2001 From: nervo Date: Wed, 16 Oct 2024 20:57:04 +0200 Subject: [PATCH 329/453] feat(scw): use official scw completion (#12755) --- plugins/scw/README.md | 10 +- plugins/scw/_scw | 333 ------------------------------------- plugins/scw/scw.plugin.zsh | 14 ++ 3 files changed, 20 insertions(+), 337 deletions(-) delete mode 100644 plugins/scw/_scw create mode 100644 plugins/scw/scw.plugin.zsh diff --git a/plugins/scw/README.md b/plugins/scw/README.md index d2312c2e5..5dd630d64 100644 --- a/plugins/scw/README.md +++ b/plugins/scw/README.md @@ -1,7 +1,9 @@ -## Scaleway CLI autocomplete plugin +## Scaleway CLI plugin -[scw](https://github.com/scaleway/scaleway-cli): Manage Bare Metal servers from Command Line (as easily as with Docker) +This plugin adds completion for [scw](https://github.com/scaleway/scaleway-cli), the command line interface for Scaleway. -- Adds autocomplete options for all `scw` commands. +To use it, add `scw` to the plugins array in your zshrc file: -Maintainer : Manfred Touron ([@moul](https://github.com/moul)) +```zsh +plugins=(... scw) +``` diff --git a/plugins/scw/_scw b/plugins/scw/_scw deleted file mode 100644 index 0eb125c65..000000000 --- a/plugins/scw/_scw +++ /dev/null @@ -1,333 +0,0 @@ -#compdef scw -# -# zsh completion for scw (https://www.scaleway.com) -# -# Inspired by https://github.com/felixr/docker-zsh-completion - -__scw_get_servers() { - local expl - declare -a servers - servers=(${(f)"$(_call_program commands scw _completion servers-names)"}) - _describe -t servers "servers" servers -} - -__scw_stoppedservers() { - __scw_get_servers -} - -__scw_runningservers() { - __scw_get_servers -} - -__scw_servers () { - __scw_get_servers -} - -__scw_images () { - local expl - declare -a images - images=(${(f)"$(_call_program commands scw _completion images-names)"}) - _describe -t images "images" images -} - -__scw_images_and_snapshots () { - __scw_images - __scw_snapshots -} - -__scw_snapshots () { - local expl - declare -a snapshots - snapshots=(${(f)"$(_call_program commands scw _completion --prefix snapshots-names)"}) - _describe -t snapshots "snapshots" snapshots -} - -__scw_bootscripts () { - local expl - declare -a bootscripts - bootscripts=(${(f)"$(_call_program commands scw _completion bootscripts-names)"}) - _describe -t bootscripts "bootscripts" bootscripts -} - -__scw_tags() { - __scw_images -} - -__scw_repositories_with_tags() { - __scw_images -} - -__scw_search() { - # declare -a scwsearch - local cache_policy - zstyle -s ":completion:${curcontext}:" cache-policy cache_policy - if [[ -z "$cache_policy" ]]; then - zstyle ":completion:${curcontext}:" cache-policy __scw_caching_policy - fi - - local searchterm cachename - searchterm="${words[$CURRENT]%/}" - cachename=_scw-search-$searchterm - - local expl - local -a result - if ( [[ ${(P)+cachename} -eq 0 ]] || _cache_invalid ${cachename#_} ) \ - && ! _retrieve_cache ${cachename#_}; then - _message "Searching for ${searchterm}..." - result=(${${${(f)"$(_call_program commands scw search ${searchterm})"}%% *}[2,-1]}) - _store_cache ${cachename#_} result - fi - _wanted scwsearch expl 'available images' compadd -a result -} - -__scw_caching_policy() -{ - oldp=( "$1"(Nmh+1) ) # 1 hour - (( $#oldp )) -} - - -__scw_repositories () { - __scw_images -} - -__scw_commands () { - # local -a _scw_subcommands - local cache_policy - - zstyle -s ":completion:${curcontext}:" cache-policy cache_policy - if [[ -z "$cache_policy" ]]; then - zstyle ":completion:${curcontext}:" cache-policy __scw_caching_policy - fi - - if ( [[ ${+_scw_subcommands} -eq 0 ]] || _cache_invalid scw_subcommands) \ - && ! _retrieve_cache scw_subcommands; - then - local -a lines - lines=(${(f)"$(_call_program commands scw 2>&1)"}) - _scw_subcommands=(${${${lines[$((${lines[(i)Commands:]} + 1)),${lines[(I) *]}]}## #}/ ##/:}) - _scw_subcommands=($_scw_subcommands 'help:Show help for a command') - _store_cache scw_subcommands _scw_subcommands - fi - _describe -t scw-commands "scw command" _scw_subcommands -} - -__scw_subcommand () { - local -a _command_args - case "$words[1]" in - (attach) - _arguments \ - '--no-stdin[Do not attach stdin]' \ - ':servers:__scw_runningservers' - ;; - (commit) - _arguments \ - {-v,--volume=0}'[Volume slot]:volume: ' \ - ':server:__scw_servers' \ - ':repository:__scw_repositories_with_tags' - ;; - (cp) - _arguments \ - ':server:->server' \ - ':hostpath:_files' - case $state in - (server) - if compset -P '*:'; then - _files - else - __scw_servers -qS ":" - fi - ;; - esac - ;; - (exec) - local state ret - _arguments \ - {-T,--timeout=0}'[Set timeout values to seconds]' \ - {-w,--wait}'[Wait for SSH to be ready]' \ - ':servers:__scw_runningservers' \ - '*::command:->anycommand' && ret=0 - - case $state in - (anycommand) - shift 1 words - (( CURRENT-- )) - _normal - ;; - esac - - return ret - ;; - (history) - _arguments \ - '--no-trunc[Do not truncate output]' \ - {-q,--quiet}'[Only show numeric IDs]' \ - '*:images:__scw_images' - ;; - (images) - _arguments \ - {-a,--all}'[Show all images]' \ - '--no-trunc[Do not truncate output]' \ - {-q,--quiet}'[Only show numeric IDs]' \ - ':repository:__scw_repositories' - ;; - (info) - ;; - (inspect) - _arguments \ - {-f,--format=-}'[Format the output using the given go template]:template: ' \ - '*:servers:__scw_servers' - ;; - (kill) - _arguments \ - '*:servers:__scw_runningservers' - ;; - (login) - _arguments \ - {-o,--organization=-}'[Organization]:organization: ' \ - {-t,--token=-}'[Token]:token: ' \ - ':server: ' - ;; - (logout) - _arguments \ - ':server: ' - ;; - (logs) - _arguments \ - '*:servers:__scw_servers' - ;; - (port) - _arguments \ - '1:servers:__scw_runningservers' \ - '2:port:_ports' - ;; - (start) - _arguments \ - {-T,--timeout=0}'[Set timeout values to seconds]' \ - {-w,--wait}'[Wait for SSH to be ready]' \ - '*:servers:__scw_stoppedservers' - ;; - (rm) - _arguments \ - '*:servers:__scw_stoppedservers' - ;; - (rmi) - _arguments \ - '*:images:__scw_images' - ;; - (restart) - _arguments \ - '*:servers:__scw_runningservers' - ;; - (stop) - _arguments \ - {-t,--terminate}'[Stop and trash a server with its volumes]' \ - {-w,--wait}'[Synchronous stop. Wait for server to be stopped]' \ - '*:servers:__scw_runningservers' - ;; - (top) - _arguments \ - '1:servers:__scw_runningservers' \ - '(-)*:: :->ps-arguments' - case $state in - (ps-arguments) - _ps - ;; - esac - ;; - (ps) - _arguments \ - {-a,--all}'[Show all servers. Only running servers are shown by default]' \ - {-l,--latest}'[Show only the latest created server]' \ - '-n[Show n last created servers, include non-running one]:n:(1 5 10 25 50)' \ - '--no-trunc[Do not truncate output]' \ - {-q,--quiet}'[Only show numeric IDs]' - ;; - (tag) - _arguments \ - {-f,--force}'[force]'\ - ':image:__scw_images'\ - ':repository:__scw_repositories_with_tags' - ;; - (create|run) - _arguments \ - {-a,--attach}'[Attach to stdin, stdout or stderr]' \ - '*'{-e,--environment=-}'[Set environment variables]:environment variable: ' \ - '--name=-[Server name]:name: ' \ - '--bootscript=-[Assign a bootscript]:bootscript:__scw_bootscripts ' \ - '*-v[Bind mount a volume]:volume: '\ - '(-):images:__scw_images_and_snapshots' \ - '(-):command: _command_names -e' \ - '*::arguments: _normal' - - case $state in - (link) - if compset -P '*:'; then - _wanted alias expl 'Alias' compadd -E "" - else - __scw_runningservers -qS ":" - fi - ;; - esac - ;; - (rename) - _arguments \ - ':old name:__scw_servers' \ - ':new name: ' - ;; - (search) - _arguments \ - '--no-trunc[Do not truncate output]' \ - ':term: ' - ;; - (wait) - _arguments '*:servers:__scw_runningservers' - ;; - (help) - _arguments ':subcommand:__scw_commands' - ;; - (*) - _message 'Unknown sub command' - esac - -} - -_scw () { - # Support for subservices, which allows for `compdef _scw scw-shell=_scw_servers`. - # Based on /usr/share/zsh/functions/Completion/Unix/_git without support for `ret`. - if [[ $service != scw ]]; then - _call_function - _$service - return - fi - - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - '-H[tcp://host:port to bind/connect to]:socket: ' \ - '(-): :->command' \ - '(-)*:: :->option-or-argument' - - if (( CURRENT == 1 )); then - - fi - case $state in - (command) - __scw_commands - ;; - (option-or-argument) - curcontext=${curcontext%:*:*}:scw-$words[1]: - __scw_subcommand - ;; - esac -} - -_scw "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 4 -# indent-tabs-mode: nil -# sh-basic-offset: 4 -# End: -# vim: ft=zsh sw=4 ts=4 et diff --git a/plugins/scw/scw.plugin.zsh b/plugins/scw/scw.plugin.zsh new file mode 100644 index 000000000..cd8ed4ac7 --- /dev/null +++ b/plugins/scw/scw.plugin.zsh @@ -0,0 +1,14 @@ +if (( ! $+commands[scw] )); then + return +fi + +_scw () { + output=($(scw autocomplete complete zsh -- ${CURRENT} ${words})) + opts=('-S' ' ') + if [[ $output == *= ]]; then + opts=('-S' '') + fi + compadd "${opts[@]}" -- "${output[@]}" +} + +compdef _scw scw From 1b5af717a987a58deda1873cb28e4b05ba26bba8 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Wed, 16 Oct 2024 21:09:31 +0200 Subject: [PATCH 330/453] fix(pm2): update completion Closes #12733 --- plugins/pm2/_pm2 | 398 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 302 insertions(+), 96 deletions(-) diff --git a/plugins/pm2/_pm2 b/plugins/pm2/_pm2 index 66320b810..afe4ae0db 100644 --- a/plugins/pm2/_pm2 +++ b/plugins/pm2/_pm2 @@ -1,16 +1,233 @@ -#!/bin/zsh -f #compdef pm2 -#autoload +# ------------------------------------------------------------------------------ +# Description +# ----------- +# +# Completion script for pm2 5.2.2 (https://pm2.keymetrics.io/). +# +# ------------------------------------------------------------------------------ +# Authors +# ------- +# +# * Myoungdo Park +# * Shohei Yoshida +# +# ------------------------------------------------------------------------------ -local -a _1st_arguments +_pm2() { + typeset -A opt_args + local context state line -_1st_arguments=( + local curcontext="$curcontext" + + local ret=1 + + _arguments -C \ + '(- *)'{-v,-V,--version}'[print pm2 version]' \ + '(-s --silent)'{-s,--silent}'[hide all messages]' \ + '--ext[watch only this file extension]:extension' \ + '(-n --name)'{-n,--name}'[set a name for the process in the process list]:name' \ + '(-m --mini-list)'{-m,--mini-list}'[display a compacted list without formatting]' \ + '--interpreter[set a specific interpreter to use for executing app(default: node)]:prog' \ + '(--interpreter-args --node-args)'{--interpreter-args,--node-args}'[set arguments to pass to the interpreter]:args' \ + '(-o --output)'{-o,--output}'[specify log file for stdout]: :_files' \ + '(-e --error)'{-e,--error}'[specify log file for stderr]: :_files' \ + '(-l --log)'{-l,--log}'[specify log file which gathers both stdout and stderr]' \ + '--filter-env[filter out outgoing global values that contain provided strings]:envs' \ + '--log-type[specify log output style]: :(raw json)' \ + '--log-date-format[specify log output style]:format' \ + '--time[enable time logging]' \ + '--disable-logs[disable all logs storage]' \ + '*--env[specify which set of environment variables from ecosystem file must be injected]:env' \ + '(-a --update-env)'{-a,--update-env}'[force and update of the environment with restart/reload]' \ + '(-f --force)'{-f,--force}'[force actions]' \ + '(-i --instances)'{-i,--instances}'[launch number instances]:num' \ + '--parallel[number of parallel actions]:num' \ + '--shutdown-with-message[shutdown an application with process.send("shutdown") instead of process.kill(pid, SIGINT)]' \ + '(-p --pid)'{-p,--pid}'[specify pid file]: :_files' \ + '(-k --kill-timeout)'{-k,--kill-timeout}'[delay before sending final SIGKILL signal to process]:delay' \ + '--listen-timeout[listen timeout an application reload]:delay' \ + '--max-memory-restart[restart the app if an amount of memory is exceeded (in bytes)]:bytes' \ + '--restart-delay[specify a delay between restarts(in milliseconds)]:delay' \ + '--exp-backoff-restart-delay[specify a delay between restarts(in milliseconds)]:delay' \ + '(-x --execute-command)'{-e,--execute-command}'[execute a program using fork system]' \ + '--max-restarts[only start the script COUNT times]:count' \ + '(-u --user)'{-u,--user}'[define user when generating startup script]:username' \ + '--uid[run target script with rights]:uid' \ + '--gid[run target script with rights]:gui' \ + '--namespace[start application within specified namespace]:namespace' \ + '--cwd[run target script from path ]:cwd:_paths -/' \ + '--hp[define home path when generating startup script]: :_paths -/' \ + '--wait-ip[override systemd script to wait for full internet connectivity to launch pm2]' \ + '--service-name[define service name when generating startup script]' \ + '(-c --cron --cron-restart)'{-c,--cron,--cron-restart}'[restart a running process based on a cron pattern]:pattern' \ + '(-w --write)'{-w,--write}'[write configuration in local folder]' \ + '--no-daemon[run pm2 daemon in the foreground if it does not exist already]' \ + '(--disable-source-map-support --source-map-support)--source-map-support[force source map support]' \ + '--only[with json declaration, allow to only act on one application]:app' \ + '(--disable-source-map-support --source-map-support)--disable-source-map-support[force disable source map support]' \ + '--wait-ready[ask pm2 to wait for ready event from your app]' \ + '--merge-logs[merge logs from different instances but keep error and out separated]' \ + '*--watch[watch application folder for changes]: :_files -/' \ + '*--ignore-watch[list of paths to ignore]: :_files' \ + '--no-color[skip colors]' \ + '--no-vizion[start an app without vizion feature]' \ + '--np-autorestart[start an app without automatic restart]' \ + '--no-treekill[Only kill the main process, not detached children]' \ + '--no-pmx[start an app without pmx]' \ + '--no-automation[start an app without automation]' \ + '(--disable-trace --trace)--trace[enable transaction tracing with km]' \ + '(--disable-trace --trace)--disable-trace[disable transaction tracing with km]' \ + "--sort[sort process according to field's]:field_name" \ + '--attach[attach logging after your start/restart/stop/reload]' \ + '--v8[enable v8 data collecting]' \ + '--event-loop-inspector[enable event-loop-inspector dump in pmx]' \ + '--deep-monitoring[enable all monitoring tools]' \ + '(- *)'{-h,--help}'[output usage information]' \ + '1: :_pm2_subcommands' \ + '*:: :->subcmds' && return 0 + + case "$state" in + (subcmds) + case $words[1] in + (start) + _arguments \ + '--watch[watch folder for changes]' \ + '--fresh[Rebuild Dockerfile]' \ + '--daemon[Run container in Daemon mode(debug purposes)]' \ + '--container[Start application in container mode]' \ + '--dist[--with-container; change local Dockerfile to containerize all files in current directory]' \ + '--image-name[with --dist; set the exported image name]:name' \ + '--node-version[with --container, set a specific major Node.js version]:version' \ + '--dockerdaemon[for debugging purpose]' \ + '(- *)'{-h,--help}'[output usage information]' \ + '*: :_pm2_id_namespace_file' \ + && ret=0 + ;; + (trigger) + _arguments \ + '(- *)'{-h,--help}'[output usage information]' \ + '1: :_pm2_id_names' \ + && ret=0 + ;; + (deploy|startOrRestart|startOrReload|startOrGracefulReload) + _arguments \ + '(- *)'{-h,--help}'[output usage information]' \ + '1: :_files -g "*.json"' \ + && ret=0 + ;; + (stop|restart) + _arguments \ + '(- *)'{-h,--help}'[output usage information]' \ + '--watch[Stop watching folder for changes]' \ + '*: :_pm2_id_namespace_all' \ + && ret=0 + ;; + (reload|delete|reset) + _arguments \ + '(- *)'{-h,--help}'[output usage information]' \ + '*: :_pm2_id_namespace_all' \ + && ret=0 + ;; + (module:install) + _arguments \ + '(- *)'{-h,--help}'[output usage information]' \ + '--tarball[is local tarball]' \ + '--install[run yarn install before starting module]' \ + '--docker[is docker container]' \ + '--v1[install module in v1 manner(do not use it)]' \ + '--safe[keep module backup, if new module fail = restore with previous]:time' \ + && ret=0 + ;; + (publish|module:publish) + _arguments \ + '(- *)'{-h,--help}'[output usage information]' \ + '--npm[publish on npm]' \ + '*: :_files -/' \ + && ret=0 + ;; + (link) + _arguments \ + '(- *)'{-h,--help}'[output usage information]' \ + '--info-node[set url info node]:url' \ + && ret=0 + ;; + (plus) + _arguments \ + '(- *)'{-h,--help}'[output usage information]' \ + '--info-node[set url info node]:url' \ + '(-d --discrete)'{-d,--discrete}'[silent mode]' \ + '(-a --install-all)'{-a,--install-all}'[install all modules (force yes)]' \ + && ret=0 + ;; + (dump|save) + _arguments \ + '(- *)'{-h,--help}'[output usage information]' \ + '--force[force deletion of dump file even if empty]' \ + && ret=0 + ;; + (send|attach|describe|env) + _arguments \ + '(- *)'{-h,--help}'[output usage information]' \ + '1: :_pm2_id_names' \ + && ret=0 + ;; + (slist|sysinfos) + _arguments \ + '(- *)'{-h,--help}'[output usage information]' \ + '--tree[show as tree]' \ + && ret=0 + ;; + (logs) + _arguments \ + '(- *)'{-h,--help}'[output usage information]' \ + '--json[json log output]' \ + '--format[formatted log output]' \ + '--raw[raw output]' \ + '--err[only shows error output]' \ + '--out[only shows standard output]' \ + '--line[output the last N lines, instead of the last 15 by default]:lines' \ + '--timestamp[add timestamps(default format YYYY-MM-DD-HH:mm:ss)]:format' \ + '--nostream[print logs without launching the log stream]' \ + '*--highlight[highlights the given value]' \ + '1: :_pm2_id_namespace' \ + && ret=0 + ;; + (serve) + _arguments \ + '(- *)'{-h,--help}'[output usage information]' \ + '--port[specify port to listen to]:port' \ + '--spa[always serving index.html on inexistent sub path]' \ + '--basic-auth-username[set basic auth username]:username' \ + '--basic-auth-password[set basic auth password]:password' \ + '--monitor[frontend app monitoring]:app' \ + '*: :_files -/' \ + && ret=0 + ;; + (*) + _arguments \ + '(- *)'{-h,--help}'[output usage information]' \ + '*: :_files' \ + && ret=0 + ;; + esac + ;; + esac + + return ret +} + +(( $+functions[_pm2_subcommands] )) || +_pm2_subcommands() { + local -a subcommands=( "start:start and daemonize an app" "trigger:trigger process action" "deploy:deploy your json" "startOrRestart:start or restart JSON file" "startOrReload:start or gracefully reload JSON file" "pid:return pid of [app_name] or all" + "create:return pid of [app_name] or all" + "startOrGracefulReload:start or gracefully reload JSON file" "stop:stop a process" "restart:restart a process" "scale:scale up/down a process in cluster mode depending on total_number param" @@ -23,18 +240,23 @@ _1st_arguments=( "sendSignal:send a system signal to the target process" "ping:ping pm2 daemon - if not up it will launch it" "updatePM2:update in-memory PM2 with local PM2" + "update:update in-memory PM2 with local PM2" "install:install or update a module and run it forever" + "module\:install:install or update a module and run it forever" "module\:update:update a module and run it forever" "module\:generate:Generate a sample module in current folder" "uninstall:stop and uninstall a module" + "module\:uninstall:stop and uninstall a module" "package:Check & Package TAR type module" "publish:Publish the module you are currently on" + "module\:publish:Publish the module you are currently on" "set:sets the specified config " "multiset:multiset eg \"key1 val1 key2 val2\"" "get:get value for " + "conf:get / set module config values" "config:get / set module config values" "unset:clears the specified config " - "report:give a full pm2 report for https\://github.com/Unitech/pm2/issues" + "report:give a full pm2 report for https://github.com/Unitech/pm2/issues" "link:link with the pm2 monitoring dashboard" "unlink:unlink with the pm2 monitoring dashboard" "monitor:monitor target process" @@ -43,8 +265,8 @@ _1st_arguments=( "plus:enable pm2 plus" "login:Login to pm2 plus" "logout:Logout from pm2 plus" - "web:launch a health API on 0.0.0.0\:9615" "dump:dump all processes for resurrecting them later" + "save:dump all processes for resurrecting them later" "cleardump:Create empty dump file" "send:send stdin to " "attach:attach stdin/stdout to application identified by " @@ -52,15 +274,27 @@ _1st_arguments=( "unstartup:disable the pm2 startup hook" "startup:enable the pm2 startup hook" "logrotate:copy default logrotate configuration" - "ecosystem:generate a process conf file. (mode = null or simple)" + "ecosystem:generate a process conf file" + "init:generate a process conf file" "reset:reset counters for process" - "describe:describe all parameters of a process id" + "describe:describe all parameters of a process" + "desc:describe all parameters of a process" + "info:describe all parameters of a process" + "show:describe all parameters of a process" + "env:list all environment variables of a process id" "list:list all processes" + "l:list all processes" + "ps:list all processes" + "status:list all processes" "jlist:list all processes in JSON format" + "sysmonit:start system monitoring daemon" + "slist:list system infos in JSON" + "sysinfos:list system infos in JSON" "prettylist:print json in a prettified JSON" "monit:launch termcaps monitoring" "imonit:launch legacy termcaps monitoring" "dashboard:launch dashboard with monitoring and logs" + "dash:launch dashboard with monitoring and logs" "flush:flush logs" "reloadLogs:reload all logs" "logs:stream logs file. Default stream all logs" @@ -70,99 +304,71 @@ _1st_arguments=( "backward:downgrades repository to the previous commit for a given app" "deepUpdate:performs a deep update of PM2" "serve:serve a directory over http via port" + "autoinstall:auto install" "examples:display pm2 usage examples" -) + ) -local -a id_names - -_id_names() { - local app_list - app_list=`pm2 list -m` - - local -a names ids - names=(`echo $app_list | grep '+---' | awk '{print $2}'`) - ids=(`echo $app_list | grep 'pm2 id' | awk '{print $4}'`) - - if (( ${#ids} > 0 )); then - for i in {1..${#ids}}; do - id_names+=( "${ids[i]}:${names[i]}" ) - done - fi + _describe -t subcommands 'subcommand' subcommands "$@" } -_arguments \ - '(-v --version)'{-v,--version}'[output version]' \ - '(-h --help)'{-h,--help}'[output usage information]' \ - '*:: :->subcmds' && return 0 +(( $+functions[_pm2_id_names] )) || +_pm2_id_names() { + local app_list=$(pm2 list -m) + local -a names=(${(@f)"$(echo $app_list | awk '/^\+---/{sub("+--- ", ""); print}')"}) + local -a ids=(${(@f)"$(echo $app_list | awk '/^pm2 id/{sub("pm2 id :", ""); print}')"}) -if (( CURRENT == 1 )); then - _describe "command" _1st_arguments - return + if (( ${#ids} > 0 )); then + local -a id_names + for i in {1..${#ids}}; do + id_names+=( "${ids[i]}:${names[i]}" ) + done + + _describe 'id' id_names + fi +} + +(( $+functions[_pm2_namespaces] )) || +_pm2_namespaces() { + local -a namespaces=(${(@f)"$(pm2 list -m | awk '/^namespace :/{ print $3 }')"}) + if (( ${#namespaces} > 0 )); then + _values 'namespace' $namespaces + fi +} + +(( $+functions[_pm2_id_namespace] )) || +_pm2_id_namespace() { + _alternative \ + 'ids:id:_pm2_id_names' \ + 'namespaces:namespace:_pm2_namespaces' +} + +(( $+functions[_pm2_id_namespace_all] )) || +_pm2_id_namespace_all() { + _alternative \ + 'ids:id:_pm2_id_names' \ + 'namespaces:namespace:_pm2_namespaces' \ + 'all:all:(all)' +} + +(( $+functions[_pm2_id_namespace_file] )) || +_pm2_id_namespace_file() { + _alternative \ + 'ids:id:_pm2_id_names' \ + 'namespaces:namespace:_pm2_namespaces' \ + 'files:file:_files' +} + +if [ "$funcstack[1]" = "_pm2" ]; then + _pm2 "$@" +else + compdef _pm2 pm2 fi -local -a id_comp id_all_comp id_all_files_comp start_options logs_options -id_comp=('1: :->id_comp') -id_all_comp=('1: :->id_all_comp') -id_all_files_comp=('1: :->id_all_files_comp') -start_options=( - '--watch[Watch folder for changes]' - '--fresh[Rebuild Dockerfile]' - '--daemon[Run container in Daemon mode (debug purposes)]' - '--container[Start application in container mode]' - '--dist[with --container; change local Dockerfile to containerize all files in current directory]' - '--image-name[with --dist; set the exported image name]' - '--node-version[with --container, set a specific major Node.js version]' - '--dockerdaemon[for debugging purpose]' - '(-h --help)'{-h,--help}'[output usage information]' - $id_all_files_comp -) -logs_options=( - '--json[json log output]' - '--format[formatted log output]' - '--raw[raw output]' - '--err[only shows error output]' - '--out[only shows standard output]' - '--lines[output the last N lines, instead of the last 15 by default]' - '--timestamp[add timestamps (default format YYYY-MM-DD-HH:mm:ss)]' - '--nostream[print logs without launching the log stream]' - '(-h --help)'{-h,--help}'[output usage information]' - $id_all_comp -) +# Local Variables: +# mode: Shell-Script +# sh-indentation: 2 +# indent-tabs-mode: nil +# sh-basic-offset: 2 +# End: -case "$words[1]" in - start) - _arguments $start_options && return 0 - ;; - logs) - _arguments $logs_options && return 0 - ;; - stop|restart|delete|reload|reset) - _arguments $id_all_comp && return 0 - ;; - env|inspect|monitor|unmonitor|describe) - _arguments $id_comp && return 0 - ;; - deploy|startOrRestart|startOrReload) - _files ;; -esac - -case "$state" in - id_comp) - _id_names - _alternative \ - 'args:app args:(($id_names))' - ;; - id_all_comp) - _id_names - id_names+=(all) - _alternative \ - 'args:app args:(($id_names))' - ;; - id_all_files_comp) - _id_names - id_names+=(all) - _alternative \ - 'args:app args:(($id_names))' \ - 'files:filename:_files' - ;; -esac +# vim: ft=zsh sw=2 ts=2 et From 8da75e390bbe3b64f01fa643cfab815a20bc48f6 Mon Sep 17 00:00:00 2001 From: Lin <56944601+LinPr@users.noreply.github.com> Date: Thu, 17 Oct 2024 16:00:29 +0800 Subject: [PATCH 331/453] feat(buf): add completion plugin --- plugins/buf/README.md | 9 +++++++++ plugins/buf/buf.plugin.zsh | 14 ++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 plugins/buf/README.md create mode 100644 plugins/buf/buf.plugin.zsh diff --git a/plugins/buf/README.md b/plugins/buf/README.md new file mode 100644 index 000000000..946cf38dd --- /dev/null +++ b/plugins/buf/README.md @@ -0,0 +1,9 @@ +# Buf plugin + +This plugin adds completion for [Buf CLI](https://github.com/bufbuild/buf), a tool working with Protocol Buffers. + +To use it, add `buf` to the plugins array in your zshrc file: + +```zsh +plugins=(... buf) +``` \ No newline at end of file diff --git a/plugins/buf/buf.plugin.zsh b/plugins/buf/buf.plugin.zsh new file mode 100644 index 000000000..0b251ac37 --- /dev/null +++ b/plugins/buf/buf.plugin.zsh @@ -0,0 +1,14 @@ +# Autocompletion for the Buf CLI (buf). +if (( !$+commands[buf] )); then + return +fi +# If the completion file doesn't exist yet, we need to autoload it and +# bind it to `buf`. Otherwise, compinit will have already done that. +if [[ ! -f "$ZSH_CACHE_DIR/completions/_buf" ]]; then + typeset -g -A _comps + autoload -Uz _buf + _comps[buf]=_buf +fi + +# Generate and load buf completion +buf completion zsh >! "$ZSH_CACHE_DIR/completions/_buf" &| \ No newline at end of file From 067558da9274986d326533daca047bbcb01f2451 Mon Sep 17 00:00:00 2001 From: Lin <56944601+LinPr@users.noreply.github.com> Date: Thu, 17 Oct 2024 16:01:07 +0800 Subject: [PATCH 332/453] docs(volta): fix typo (#12765) --- plugins/volta/volta.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/volta/volta.plugin.zsh b/plugins/volta/volta.plugin.zsh index ab05ed5df..173b9c871 100644 --- a/plugins/volta/volta.plugin.zsh +++ b/plugins/volta/volta.plugin.zsh @@ -4,7 +4,7 @@ if (( ! $+commands[volta] )); then fi # If the completion file doesn't exist yet, we need to autoload it and -# bind it to `deno`. Otherwise, compinit will have already done that. +# bind it to `volta`. Otherwise, compinit will have already done that. if [[ ! -f "$ZSH_CACHE_DIR/completions/_volta" ]]; then typeset -g -A _comps autoload -Uz _volta From 4ada1541900539ce585a26642eecc7e8e56d16f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Fri, 18 Oct 2024 14:27:54 +0200 Subject: [PATCH 333/453] chore(installer): only serve installer in / and /install.sh This avoids false positive detections on other bruteforced paths, such as .zsh_history or others, which eventually result in automated false vulnerability submissions. --- .github/workflows/installer/vercel.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/installer/vercel.json b/.github/workflows/installer/vercel.json index 524dc3c0f..88ec18725 100644 --- a/.github/workflows/installer/vercel.json +++ b/.github/workflows/installer/vercel.json @@ -1,7 +1,7 @@ { "headers": [ { - "source": "/((?!favicon.ico).*)", + "source": "/(|install.sh)", "headers": [ { "key": "Content-Type", @@ -16,7 +16,7 @@ ], "rewrites": [ { - "source": "/((?!favicon.ico|install.sh).*)", + "source": "/", "destination": "/install.sh" } ] From a9e29fc12c856fd235b37c223feb8b3f05905b6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 20 Oct 2024 10:48:00 +0200 Subject: [PATCH 334/453] chore: fix note block in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1303292d2..58828cf7f 100644 --- a/README.md +++ b/README.md @@ -190,8 +190,7 @@ ZSH_THEME="agnoster" # (this is one of the fancy ones) > [!NOTE] > You will many times see screenshots for a zsh theme, and try it out, and find that it doesn't look the same for you. - - +> > This is because many themes require installing a [Powerline Font](https://github.com/powerline/fonts) or a > [Nerd Font](https://github.com/ryanoasis/nerd-fonts) in order to render properly. Without them, these themes > will render weird prompt symbols. Check out @@ -203,6 +202,7 @@ ZSH_THEME="agnoster" # (this is one of the fancy ones) > terminal window (known as _color scheme_) or the font of your terminal. These are settings that you can > change in your terminal emulator. For more information, see > [what is a zsh theme](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#what-is-a-zsh-theme). + Open up a new terminal window and your prompt should look something like this: From 7bbebcd520a113eb82e869aecca8f5c825540700 Mon Sep 17 00:00:00 2001 From: nervo Date: Tue, 22 Oct 2024 21:51:40 +0200 Subject: [PATCH 335/453] feat(rclone): create completion plugin (#12754) --- plugins/rclone/README.md | 9 +++++++++ plugins/rclone/rclone.plugin.zsh | 14 ++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 plugins/rclone/README.md create mode 100644 plugins/rclone/rclone.plugin.zsh diff --git a/plugins/rclone/README.md b/plugins/rclone/README.md new file mode 100644 index 000000000..aa2ced94a --- /dev/null +++ b/plugins/rclone/README.md @@ -0,0 +1,9 @@ +# Rclone plugin + +This plugin adds completion for [Rclone](https://rclone.org/), the command-line program to manage files on cloud storage. + +To use it, add `rclone` to the plugins array in your zshrc file: + +```zsh +plugins=(... rclone) +``` diff --git a/plugins/rclone/rclone.plugin.zsh b/plugins/rclone/rclone.plugin.zsh new file mode 100644 index 000000000..a6676131c --- /dev/null +++ b/plugins/rclone/rclone.plugin.zsh @@ -0,0 +1,14 @@ +# Completion +if (( ! $+commands[rclone] )); then + return +fi + +# If the completion file doesn't exist yet, we need to autoload it and +# bind it to `rclone`. Otherwise, compinit will have already done that. +if [[ ! -f "$ZSH_CACHE_DIR/completions/_rclone" ]]; then + typeset -g -A _comps + autoload -Uz _rclone + _comps[rclone]=_rclone +fi + +rclone completion zsh - >| "$ZSH_CACHE_DIR/completions/_rclone" &| From eeb01c18c1d1edff0c2563764a998b2d30947844 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Wed, 23 Oct 2024 12:37:25 +0200 Subject: [PATCH 336/453] fix(websearch): allow multi-word parameters --- plugins/web-search/web-search.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh index 81eb1c77d..b97e33a0b 100644 --- a/plugins/web-search/web-search.plugin.zsh +++ b/plugins/web-search/web-search.plugin.zsh @@ -50,7 +50,7 @@ function web_search() { # build search url: # join arguments passed with '+', then append to search engine URL - url="${urls[$1]}$(omz_urlencode $param ${@[2,-1]})" + url="${urls[$1]}$(omz_urlencode $param ${(s: :)@[2,-1]})" else # build main page url: # split by '/', then rejoin protocol (1) and domain (2) parts with '//' From 45516ca1d830fd21f75942bf414d540db1ab0db2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 27 Oct 2024 15:13:05 +0100 Subject: [PATCH 337/453] docs(jsontools): document requirements Fixes #10834 --- plugins/jsontools/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/jsontools/README.md b/plugins/jsontools/README.md index d92608806..804edba40 100644 --- a/plugins/jsontools/README.md +++ b/plugins/jsontools/README.md @@ -8,6 +8,17 @@ To use it, add `jsontools` to the plugins array in your zshrc file: plugins=(... jsontools) ``` +## Requirements + +The plugin uses one of these tools to process JSON data, in the following order: + +- `node` +- `python3` +- `ruby` + +Any of these must be in `$PATH` before the plugin is loaded, otherwise the plugin exits +prematurely and the functions will not be available. + ## Usage Usage is simple... just take your json data and pipe it into the appropriate jsontool: From 68d189cb35b9826dc186f1697a501314a63e6fe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 27 Oct 2024 15:51:38 +0100 Subject: [PATCH 338/453] fix(last-working-dir): save working directory more strictly (#11343) Fixes #11343 --- .../last-working-dir.plugin.zsh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/plugins/last-working-dir/last-working-dir.plugin.zsh b/plugins/last-working-dir/last-working-dir.plugin.zsh index 684972cc1..b816f6a8f 100644 --- a/plugins/last-working-dir/last-working-dir.plugin.zsh +++ b/plugins/last-working-dir/last-working-dir.plugin.zsh @@ -9,20 +9,23 @@ chpwd_last_working_dir() { [[ "$ZSH_SUBSHELL" -eq 0 ]] || return 0 # Add ".$SSH_USER" suffix to cache file if $SSH_USER is set and non-empty local cache_file="$ZSH_CACHE_DIR/last-working-dir${SSH_USER:+.$SSH_USER}" - builtin pwd >| "$cache_file" + 'builtin' 'echo' '-E' "$PWD" >| "$cache_file" } # Changes directory to the last working directory lwd() { # Add ".$SSH_USER" suffix to cache file if $SSH_USER is set and non-empty local cache_file="$ZSH_CACHE_DIR/last-working-dir${SSH_USER:+.$SSH_USER}" - [[ -r "$cache_file" ]] && cd "$(cat "$cache_file")" + [[ -r "$cache_file" ]] && cd "$(<"$cache_file")" } # Jump to last directory automatically unless: -# - this isn't the first time the plugin is loaded -# - it's not in $HOME directory -[[ -n "$ZSH_LAST_WORKING_DIRECTORY" ]] && return -[[ "$PWD" != "$HOME" ]] && return +# +# - This isn't the first time the plugin is loaded +# - We're not in the $HOME directory (e.g. if terminal opened a different folder) +[[ -z "$ZSH_LAST_WORKING_DIRECTORY" ]] || return +[[ "$PWD" == "$HOME" ]] || return -lwd 2>/dev/null && ZSH_LAST_WORKING_DIRECTORY=1 || true +if lwd 2>/dev/null; then + ZSH_LAST_WORKING_DIRECTORY=1 +fi From fa64758aeaeb17abdefca5d193c1002230048977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 27 Oct 2024 17:31:38 +0100 Subject: [PATCH 339/453] fix(vagrant-prompt): make `vagrant_prompt_info` generic for any state (#12782) --- plugins/vagrant-prompt/README.md | 25 +++++++++++++++-- .../vagrant-prompt/vagrant-prompt.plugin.zsh | 28 ++++++++++--------- 2 files changed, 37 insertions(+), 16 deletions(-) diff --git a/plugins/vagrant-prompt/README.md b/plugins/vagrant-prompt/README.md index 0720f4bde..f7bfce4f3 100644 --- a/plugins/vagrant-prompt/README.md +++ b/plugins/vagrant-prompt/README.md @@ -17,11 +17,15 @@ To display Vagrant info on your prompt add the `vagrant_prompt_info` to the `$PROMPT` or `$RPROMPT` variable in your theme. Example: ```zsh -PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(vagrant_prompt_info)$(svn_prompt_info)$(git_prompt_info)%(!.#.$) ' +PROMPT="$PROMPT"' $(vagrant_prompt_info)' +# or +RPROMPT='$(vagrant_prompt_info)' ``` -`vagrant_prompt_info` makes use of some custom variables. This is an example -definition: +### Customization + +`vagrant_prompt_info` makes use of the following custom variables, which can be set in your +`.zshrc` file: ```zsh ZSH_THEME_VAGRANT_PROMPT_PREFIX="%{$fg_bold[blue]%}[" @@ -31,3 +35,18 @@ ZSH_THEME_VAGRANT_PROMPT_POWEROFF="%{$fg_no_bold[red]%}●" ZSH_THEME_VAGRANT_PROMPT_SUSPENDED="%{$fg_no_bold[yellow]%}●" ZSH_THEME_VAGRANT_PROMPT_NOT_CREATED="%{$fg_no_bold[white]%}○" ``` + +### State to variable mapping + +The plugin uses the output reported by `vagrant status` to print whichever symbol matches, +according to the following table: + +| State | Symbol | +| ----------- | -------------------------------------- | +| running | `ZSH_THEME_VAGRANT_PROMPT_RUNNING` | +| not running | `ZSH_THEME_VAGRANT_PROMPT_POWEROFF` | +| poweroff | `ZSH_THEME_VAGRANT_PROMPT_POWEROFF` | +| paused | `ZSH_THEME_VAGRANT_PROMPT_SUSPENDED` | +| saved | `ZSH_THEME_VAGRANT_PROMPT_SUSPENDED` | +| suspended | `ZSH_THEME_VAGRANT_PROMPT_SUSPENDED` | +| not created | `ZSH_THEME_VAGRANT_PROMPT_NOT_CREATED` | diff --git a/plugins/vagrant-prompt/vagrant-prompt.plugin.zsh b/plugins/vagrant-prompt/vagrant-prompt.plugin.zsh index 29f4038c5..2d8455a53 100644 --- a/plugins/vagrant-prompt/vagrant-prompt.plugin.zsh +++ b/plugins/vagrant-prompt/vagrant-prompt.plugin.zsh @@ -1,16 +1,18 @@ function vagrant_prompt_info() { - local vm_states vm_state - if [[ -d .vagrant && -f Vagrantfile ]]; then - vm_states=(${(f)"$(vagrant status 2> /dev/null | sed -nE 's/^.*(saved|poweroff|running|not created) \([[:alnum:]_]+\)$/\1/p')"}) - printf '%s' $ZSH_THEME_VAGRANT_PROMPT_PREFIX - for vm_state in $vm_states; do - case "$vm_state" in - saved) printf '%s' $ZSH_THEME_VAGRANT_PROMPT_SUSPENDED ;; - running) printf '%s' $ZSH_THEME_VAGRANT_PROMPT_RUNNING ;; - poweroff) printf '%s' $ZSH_THEME_VAGRANT_PROMPT_POWEROFF ;; - "not created") printf '%s' $ZSH_THEME_VAGRANT_PROMPT_NOT_CREATED ;; - esac - done - printf '%s' $ZSH_THEME_VAGRANT_PROMPT_SUFFIX + if [[ ! -d .vagrant || ! -f Vagrantfile ]]; then + return fi + + local vm_states vm_state + vm_states=(${(f)"$(vagrant status 2> /dev/null | sed -nE 's/^[^ ]* *([[:alnum:] ]*) \([[:alnum:]_]+\)$/\1/p')"}) + printf '%s' $ZSH_THEME_VAGRANT_PROMPT_PREFIX + for vm_state in $vm_states; do + case "$vm_state" in + running) printf '%s' $ZSH_THEME_VAGRANT_PROMPT_RUNNING ;; + "not running"|poweroff) printf '%s' $ZSH_THEME_VAGRANT_PROMPT_POWEROFF ;; + paused|saved|suspended) printf '%s' $ZSH_THEME_VAGRANT_PROMPT_SUSPENDED ;; + "not created") printf '%s' $ZSH_THEME_VAGRANT_PROMPT_NOT_CREATED ;; + esac + done + printf '%s' $ZSH_THEME_VAGRANT_PROMPT_SUFFIX } From c690f731618959cba3b85500acee20ebf43e51c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 27 Oct 2024 20:46:46 +0100 Subject: [PATCH 340/453] feat: add `devcontainers` configuration (#12783) Co-authored-by: Vatsal Gupta <40350810+gvatsal60@users.noreply.github.com> --- .devcontainer/devcontainer.json | 20 ++++++++++++++++++++ .editorconfig | 4 ++++ templates/minimal.zshrc | 5 +++++ templates/zshrc.zsh-template | 2 +- 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .devcontainer/devcontainer.json create mode 100644 templates/minimal.zshrc diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..d3ad1a3a7 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,20 @@ +{ + "image": "mcr.microsoft.com/devcontainers/base:noble", + "features": { + "ghcr.io/devcontainers/features/common-utils": { + "installZsh": true, + "configureZshAsDefaultShell": true, + "username": "vscode", + "userUid": 1000, + "userGid": 1000 + } + }, + "postCreateCommand": "dir=/workspaces/ohmyzsh; rm -rf $HOME/.oh-my-zsh && ln -s $dir $HOME/.oh-my-zsh && cp $dir/templates/minimal.zshrc $HOME/.zshrc && chgrp -R 1000 $dir && chmod g-w,o-w $dir", + "customizations": { + "codespaces": { + "openFiles": [ + "README.md" + ] + } + } +} diff --git a/.editorconfig b/.editorconfig index b349bcc42..797fb62d0 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,3 +9,7 @@ indent_style = space [*.py] indent_size = 4 + +[devcontainer.json] +indent_size = 4 +indent_style = tab diff --git a/templates/minimal.zshrc b/templates/minimal.zshrc new file mode 100644 index 000000000..6d4cd9a71 --- /dev/null +++ b/templates/minimal.zshrc @@ -0,0 +1,5 @@ +export ZSH="$HOME/.oh-my-zsh" +ZSH_THEME="robbyrussell" +plugins=(git) + +source $ZSH/oh-my-zsh.sh diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 3546ed82b..fa83cc0c6 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -2,7 +2,7 @@ # export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH # Path to your Oh My Zsh installation. -export ZSH=$HOME/.oh-my-zsh +export ZSH="$HOME/.oh-my-zsh" # Set name of the theme to load --- if set to "random", it will # load a random theme each time Oh My Zsh is loaded, in which case, From 7ed475cb589c9e82211f71b3a5d7083b69cea93c Mon Sep 17 00:00:00 2001 From: drjaska <88596812+drjaska@users.noreply.github.com> Date: Sun, 3 Nov 2024 16:35:58 +0200 Subject: [PATCH 341/453] feat(autojump): add `termux` install path (#12791) --- 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 e385a2de8..a0668a415 100644 --- a/plugins/autojump/autojump.plugin.zsh +++ b/plugins/autojump/autojump.plugin.zsh @@ -6,6 +6,7 @@ autojump_paths=( /run/current-system/sw/share/autojump/autojump.zsh # NixOS installation /etc/profiles/per-user/$USER/share/autojump/autojump.zsh # Home Manager, NixOS with user-scoped packages /usr/share/autojump/autojump.zsh # Debian and Ubuntu package + $PREFIX/share/autojump/autojump.zsh # Termux package /etc/profile.d/autojump.zsh # manual installation /etc/profile.d/autojump.sh # Gentoo installation /usr/local/share/autojump/autojump.zsh # FreeBSD installation From ca5471fe496f00007727fd26db762d19519c2e8f Mon Sep 17 00:00:00 2001 From: Kate Sullivan <75387802+katesullivan@users.noreply.github.com> Date: Thu, 14 Nov 2024 02:00:48 -0600 Subject: [PATCH 342/453] fix(poetry-env): switch venv between poetry dirs (#12804) Co-authored-by: Carlo Sala --- plugins/poetry-env/poetry-env.plugin.zsh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/poetry-env/poetry-env.plugin.zsh b/plugins/poetry-env/poetry-env.plugin.zsh index dd52b1655..dca388dfe 100644 --- a/plugins/poetry-env/poetry-env.plugin.zsh +++ b/plugins/poetry-env/poetry-env.plugin.zsh @@ -6,8 +6,7 @@ _togglePoetryShell() { fi # Deactivate the current environment if moving out of a Poetry directory or into a different Poetry directory - if [[ $poetry_active -eq 1 ]] && [[ $in_poetry_dir -eq 0 ]] \ - && [[ "$PWD" != "$poetry_dir"* ]]; then + if [[ $poetry_active -eq 1 ]] && { [[ $in_poetry_dir -eq 0 ]] || [[ "$PWD" != "$poetry_dir"* ]]; }; then export poetry_active=0 unset poetry_dir (( $+functions[deactivate] )) && deactivate From b5d52682cab844a5ffdc1b1f2ee80de561e0e6aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 19 Nov 2024 15:43:04 +0100 Subject: [PATCH 343/453] fix(dash): urlencode special parameters like `:` in query (#12811) In macOS, using queries such as `dash php:enum` does not open Dash.app, possibly due to colon character being interpreted as a port. URL-encoding the parameter (: -> %3A) makes this work again. Fixes https://discord.com/channels/642496866407284746/809850042575093760/1308076125456437300 --- plugins/dash/dash.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/dash/dash.plugin.zsh b/plugins/dash/dash.plugin.zsh index f6801a870..9abd691c7 100644 --- a/plugins/dash/dash.plugin.zsh +++ b/plugins/dash/dash.plugin.zsh @@ -1,5 +1,5 @@ # Usage: dash [keyword:]query -dash() { open -a Dash.app dash://"$*" } +dash() { open -a Dash.app "dash://$(omz_urlencode -r $*)" } compdef _dash dash _dash() { From 081d704f3273df6095b712096e3f334b04f52782 Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Wed, 20 Nov 2024 06:32:01 +1100 Subject: [PATCH 344/453] feat(pyenv): add prompt customization (#12738) Co-authored-by: Carlo Sala --- plugins/pyenv/README.md | 8 ++++++++ plugins/pyenv/pyenv.plugin.zsh | 10 ++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/plugins/pyenv/README.md b/plugins/pyenv/README.md index 95d79cb52..2476bbd95 100644 --- a/plugins/pyenv/README.md +++ b/plugins/pyenv/README.md @@ -26,6 +26,14 @@ eval "$(pyenv init --path)" - `ZSH_PYENV_VIRTUALENV`: if set to `false`, the plugin will not load pyenv-virtualenv when it finds it. +- `ZSH_THEME_PYENV_NO_SYSTEM`: if set to `true`, the plugin will not show the system or + default Python version when it finds it. +- `ZSH_THEME_PYENV_PREFIX`: the prefix to display before the Python version in + the prompt. + +- `ZSH_THEME_PYENV_SUFFIX`: the prefix to display after the Python version in + the prompt. + ## Functions - `pyenv_prompt_info`: displays the Python version in use by pyenv; or the global Python diff --git a/plugins/pyenv/pyenv.plugin.zsh b/plugins/pyenv/pyenv.plugin.zsh index b5c9a7bd3..cd2a9e0ac 100644 --- a/plugins/pyenv/pyenv.plugin.zsh +++ b/plugins/pyenv/pyenv.plugin.zsh @@ -88,13 +88,19 @@ if [[ $FOUND_PYENV -eq 1 ]]; then function pyenv_prompt_info() { local version="$(pyenv version-name)" - echo "${version:gs/%/%%}" + if [[ "$ZSH_THEME_PYENV_NO_SYSTEM" == "true" ]] && [[ "${version}" == "system" ]]; then + return + fi + echo "${ZSH_THEME_PYENV_PREFIX=}${version:gs/%/%%}${ZSH_THEME_PYENV_SUFFIX=}" } else # Fall back to system python function pyenv_prompt_info() { + if [[ "$ZSH_THEME_PYENV_NO_SYSTEM" == "true" ]]; then + return + fi local version="$(python3 -V 2>&1 | cut -d' ' -f2)" - echo "system: ${version:gs/%/%%}" + echo "${ZSH_THEME_PYENV_PREFIX=}system: ${version:gs/%/%%}${ZSH_THEME_PYENV_SUFFIX=}" } fi From e636eeb6963edf52d726112155bd9712654e2381 Mon Sep 17 00:00:00 2001 From: Hu Yufan <58105986+Hyffer@users.noreply.github.com> Date: Wed, 20 Nov 2024 03:34:28 +0800 Subject: [PATCH 345/453] fix(tailscale): load completion when `tailscale` is an alias (#12726) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes it work when Tailscale is installed via App Store: https://tailscale.com/kb/1080/cli?tab=macos. Co-authored-by: Marc Cornellà --- plugins/tailscale/tailscale.plugin.zsh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/tailscale/tailscale.plugin.zsh b/plugins/tailscale/tailscale.plugin.zsh index 7f0b1414a..e0e011196 100644 --- a/plugins/tailscale/tailscale.plugin.zsh +++ b/plugins/tailscale/tailscale.plugin.zsh @@ -1,4 +1,4 @@ -if (( ! $+commands[tailscale] )); then +if (( ! $+commands[tailscale] && ! $+aliases[tailscale] )); then return fi @@ -7,7 +7,12 @@ fi if [[ ! -f "$ZSH_CACHE_DIR/completions/_tailscale" ]]; then typeset -g -A _comps autoload -Uz _tailscale - _comps[tailscale]=_tailscale + + if (( $+commands[tailscale] )); then + _comps[tailscale]=_tailscale + elif (( $+aliases[tailscale] )); then + _comps[${aliases[tailscale]:t}]=_tailscale + fi fi tailscale completion zsh >| "$ZSH_CACHE_DIR/completions/_tailscale" &| From 9ad764d80c3b0cca1fb3251cb9c14e25543d5a42 Mon Sep 17 00:00:00 2001 From: nervo Date: Tue, 19 Nov 2024 20:47:20 +0100 Subject: [PATCH 346/453] feat(vault): re-introduce vault plugin (#12753) Co-authored-by: Carlo Sala --- plugins/vault/README.md | 9 +++++++++ plugins/vault/vault.plugin.zsh | 7 +++++++ 2 files changed, 16 insertions(+) create mode 100644 plugins/vault/README.md create mode 100644 plugins/vault/vault.plugin.zsh diff --git a/plugins/vault/README.md b/plugins/vault/README.md new file mode 100644 index 000000000..cc270a385 --- /dev/null +++ b/plugins/vault/README.md @@ -0,0 +1,9 @@ +# Vault plugin + +This plugin adds completion for [Vault](https://www.vaultproject.io/), the secrets and sensitive data manager. + +To use it, add `vault` to the plugins array in your zshrc file: + +```zsh +plugins=(... vault) +``` diff --git a/plugins/vault/vault.plugin.zsh b/plugins/vault/vault.plugin.zsh new file mode 100644 index 000000000..996cd12ad --- /dev/null +++ b/plugins/vault/vault.plugin.zsh @@ -0,0 +1,7 @@ +# Completion +if (( ! $+commands[vault] )); then + return +fi + +autoload -Uz bashcompinit && bashcompinit +complete -o nospace -C vault vault From 2e8d2d74014f366461d36712840ea59e8f734df3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 19 Nov 2024 21:05:34 +0100 Subject: [PATCH 347/453] fix(pipenv): fix auto-shell functionality when cd-ing out (#12813) Co-authored-by: Jean-Tiare Le Bigot --- plugins/pipenv/pipenv.plugin.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/pipenv/pipenv.plugin.zsh b/plugins/pipenv/pipenv.plugin.zsh index f81c266a4..76d66b301 100644 --- a/plugins/pipenv/pipenv.plugin.zsh +++ b/plugins/pipenv/pipenv.plugin.zsh @@ -19,7 +19,8 @@ if zstyle -T ':omz:plugins:pipenv' auto-shell; then if [[ ! -f "$PWD/Pipfile" ]]; then if [[ "$PIPENV_ACTIVE" == 1 ]]; then if [[ "$PWD" != "$pipfile_dir"* ]]; then - exit + unset PIPENV_ACTIVE pipfile_dir + deactivate fi fi fi @@ -28,7 +29,8 @@ if zstyle -T ':omz:plugins:pipenv' auto-shell; then if [[ "$PIPENV_ACTIVE" != 1 ]]; then if [[ -f "$PWD/Pipfile" ]]; then export pipfile_dir="$PWD" - pipenv shell + source "$(pipenv --venv)/bin/activate" + export PIPENV_ACTIVE=1 fi fi } From 1b9d6e5c82cab11ad58eb43988d4e5a256dabdc6 Mon Sep 17 00:00:00 2001 From: Matheus Pimenta Date: Tue, 19 Nov 2024 20:11:51 +0000 Subject: [PATCH 348/453] feat(timoni): add completion plugin (#12802) --- plugins/timoni/README.md | 9 +++++++++ plugins/timoni/timoni.plugin.zsh | 14 ++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 plugins/timoni/README.md create mode 100644 plugins/timoni/timoni.plugin.zsh diff --git a/plugins/timoni/README.md b/plugins/timoni/README.md new file mode 100644 index 000000000..8701ede48 --- /dev/null +++ b/plugins/timoni/README.md @@ -0,0 +1,9 @@ +# Timoni plugin + +This plugin adds completion for [Timoni](https://timoni.sh), a package manager for Kubernetes, powered by CUE and inspired by Helm. + +To use it, add `timoni` to the plugins array in your zshrc file: + +```zsh +plugins=(... timoni) +``` diff --git a/plugins/timoni/timoni.plugin.zsh b/plugins/timoni/timoni.plugin.zsh new file mode 100644 index 000000000..971eda0b4 --- /dev/null +++ b/plugins/timoni/timoni.plugin.zsh @@ -0,0 +1,14 @@ +# Autocompletion for the Timoni CLI (timoni). +if (( ! $+commands[timoni] )); then + return +fi + +# If the completion file doesn't exist yet, we need to autoload it and +# bind it to `timoni`. Otherwise, compinit will have already done that. +if [[ ! -f "$ZSH_CACHE_DIR/completions/_timoni" ]]; then + typeset -g -A _comps + autoload -Uz _timoni + _comps[timoni]=_timoni +fi + +timoni completion zsh >| "$ZSH_CACHE_DIR/completions/_timoni" &| From 9991822f8cfcef020fa7e99a6d47303bd900f721 Mon Sep 17 00:00:00 2001 From: Markus Hofbauer Date: Tue, 19 Nov 2024 21:20:58 +0100 Subject: [PATCH 349/453] feat(bazel): add bzlmod integrity gen function (#12797) Co-authored-by: Carlo Sala --- plugins/bazel/README.md | 21 ++++++++++++++------- plugins/bazel/bazel.plugin.zsh | 4 ++++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/plugins/bazel/README.md b/plugins/bazel/README.md index eba4175bc..b0c34a15f 100644 --- a/plugins/bazel/README.md +++ b/plugins/bazel/README.md @@ -1,6 +1,7 @@ # Bazel plugin -This plugin adds completion and aliases for [bazel](https://bazel.build), an open-source build and test tool that scalably supports multi-language and multi-platform projects. +This plugin adds completion and aliases for [bazel](https://bazel.build), an open-source build and test tool +that scalably supports multi-language and multi-platform projects. To use it, add `bazel` to the plugins array in your zshrc file: @@ -14,9 +15,15 @@ The plugin has a copy of [the completion script from the git repository][1]. ## Aliases -| Alias | Command | Description | -| ------- | -------------------------------------- | ------------------------------------------------------ | -| bzb | `bazel build` | The `bazel build` command | -| bzt | `bazel test` | The `bazel test` command | -| bzr | `bazel run` | The `bazel run` command | -| bzq | `bazel query` | The `bazel query` command | +| Alias | Command | Description | +| ----- | ------------- | ------------------------- | +| bzb | `bazel build` | The `bazel build` command | +| bzt | `bazel test` | The `bazel test` command | +| bzr | `bazel run` | The `bazel run` command | +| bzq | `bazel query` | The `bazel query` command | + +## Functions + +| Function | Description | +| -------- | -------------------------------- | +| sri-hash | Generate SRI hash used by bzlmod | diff --git a/plugins/bazel/bazel.plugin.zsh b/plugins/bazel/bazel.plugin.zsh index d239a06b5..818d5652b 100644 --- a/plugins/bazel/bazel.plugin.zsh +++ b/plugins/bazel/bazel.plugin.zsh @@ -3,3 +3,7 @@ alias bzb='bazel build' alias bzt='bazel test' alias bzr='bazel run' alias bzq='bazel query' + +sri-hash() { + openssl dgst -sha256 -binary $1 | openssl base64 -A | sed 's/^/sha256-/' +} From 6c91a5e389a26f532ba2fdbe40216b0d79e33124 Mon Sep 17 00:00:00 2001 From: Chris Texe Date: Wed, 20 Nov 2024 10:04:46 +0100 Subject: [PATCH 350/453] feat(laravel): add alias for `optimize:clear` (#12793) Co-authored-by: Carlo Sala --- plugins/laravel/README.md | 1 + plugins/laravel/laravel.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/laravel/README.md b/plugins/laravel/README.md index 21eb89373..d722770c9 100644 --- a/plugins/laravel/README.md +++ b/plugins/laravel/README.md @@ -49,6 +49,7 @@ plugins=(... laravel) | `pacoc` | `php artisan config:clear` | | `pavic` | `php artisan view:clear` | | `paroc` | `php artisan route:clear` | +| `paopc` | `php artisan optimize:clear` | ## Queues diff --git a/plugins/laravel/laravel.plugin.zsh b/plugins/laravel/laravel.plugin.zsh index 86ae27299..ef462b13c 100644 --- a/plugins/laravel/laravel.plugin.zsh +++ b/plugins/laravel/laravel.plugin.zsh @@ -36,6 +36,7 @@ alias pacac='php artisan cache:clear' alias pacoc='php artisan config:clear' alias pavic='php artisan view:clear' alias paroc='php artisan route:clear' +alias paopc='php artisan optimize:clear' # queues alias paqf='php artisan queue:failed' From ccbe504f224a0aae688aaa729d4258e3392a9fc8 Mon Sep 17 00:00:00 2001 From: Bin Chang Date: Thu, 21 Nov 2024 16:01:48 +0800 Subject: [PATCH 351/453] chore: fix some typos (#12818) --- lib/misc.zsh | 2 +- plugins/macports/README.md | 2 +- plugins/opentofu/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/misc.zsh b/lib/misc.zsh index ff2017713..054485f5a 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -19,7 +19,7 @@ setopt multios # enable redirect to multiple streams: echo >file1 > setopt long_list_jobs # show long list format job notifications setopt interactivecomments # recognize comments -# define pager dependant on what is available (less or more) +# define pager depending on what is available (less or more) if (( ${+commands[less]} )); then env_default 'PAGER' 'less' env_default 'LESS' '-R' diff --git a/plugins/macports/README.md b/plugins/macports/README.md index 09bd42df2..ffe3f973f 100644 --- a/plugins/macports/README.md +++ b/plugins/macports/README.md @@ -16,7 +16,7 @@ plugins=(... macports) | pc | `sudo port clean --all installed` | Clean up intermediate installation files for installed ports | | pi | `sudo port install` | Install package given as argument | | pli | `port livecheck installed` | Check for updates for installed ports | -| plm | `port-livecheck-maintainer` | Check for updates of ports mainained by the specified users | +| plm | `port-livecheck-maintainer` | Check for updates of ports maintained by the specified users | | psu | `sudo port selfupdate` | Update ports tree with MacPorts repository | | puni | `sudo port uninstall inactive` | Uninstall inactive ports | | puo | `sudo port upgrade outdated` | Upgrade ports with newer versions available | diff --git a/plugins/opentofu/README.md b/plugins/opentofu/README.md index 56f116492..45b98c3c9 100644 --- a/plugins/opentofu/README.md +++ b/plugins/opentofu/README.md @@ -40,7 +40,7 @@ plugins=(... opentofu) - `tofu_prompt_info`: shows the current workspace when in an OpenTofu project directory. -- `tofu_version_prompt_info`: shows the current version of the `tofu` commmand. +- `tofu_version_prompt_info`: shows the current version of the `tofu` command. To use them, add them to a `PROMPT` variable in your theme or `.zshrc` file: From 366d25435229bfa725109a147d6cb2fef8011b3c Mon Sep 17 00:00:00 2001 From: "ohmyzsh[bot]" <54982679+ohmyzsh[bot]@users.noreply.github.com> Date: Sun, 24 Nov 2024 13:25:13 +0100 Subject: [PATCH 352/453] feat(wd): update to v0.9.2 (#12820) Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com> --- .github/dependencies.yml | 2 +- plugins/wd/wd.sh | 42 ++++++++++++++++++++++++---------------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/.github/dependencies.yml b/.github/dependencies.yml index d53b0cd4d..603bf7566 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -28,7 +28,7 @@ dependencies: plugins/wd: repo: mfaerevaag/wd branch: master - version: tag:v0.9.1 + version: tag:v0.9.2 precopy: | set -e rm -r test diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh index 66435a2a6..962ad9afa 100755 --- a/plugins/wd/wd.sh +++ b/plugins/wd/wd.sh @@ -8,7 +8,7 @@ # @github.com/mfaerevaag/wd # version -readonly WD_VERSION=0.9.1 +readonly WD_VERSION=0.9.2 # colors readonly WD_BLUE="\033[96m" @@ -145,14 +145,17 @@ wd_warp() else (( n = $#1 - 1 )) cd -$n > /dev/null + WD_EXIT_CODE=$? fi elif [[ ${points[$point]} != "" ]] then if [[ $sub != "" ]] then cd ${points[$point]/#\~/$HOME}/$sub + WD_EXIT_CODE=$? else cd ${points[$point]/#\~/$HOME} + WD_EXIT_CODE=$? fi else wd_exit_fail "Unknown warp point '${point}'" @@ -185,11 +188,11 @@ wd_add() elif [[ ${points[$point]} == "" ]] || [ ! -z "$force" ] then wd_remove "$point" > /dev/null - printf "%q:%s\n" "${point}" "${PWD/#$HOME/~}" >> "$WD_CONFIG" + printf "%q:%s\n" "${point}" "${PWD/#$HOME/~}" >> "$wd_config_file" if (whence sort >/dev/null); then local config_tmp=$(mktemp "${TMPDIR:-/tmp}/wd.XXXXXXXXXX") - # use 'cat' below to ensure we respect $WD_CONFIG as a symlink - command sort -o "${config_tmp}" "$WD_CONFIG" && command cat "${config_tmp}" >| "$WD_CONFIG" && command rm "${config_tmp}" + # use 'cat' below to ensure we respect $wd_config_file as a symlink + command sort -o "${config_tmp}" "$wd_config_file" && command cat "${config_tmp}" >| "$wd_config_file" && command rm "${config_tmp}" fi wd_export_static_named_directories @@ -240,7 +243,7 @@ wd_remove() then local config_tmp=$(mktemp "${TMPDIR:-/tmp}/wd.XXXXXXXXXX") # Copy and delete in two steps in order to preserve symlinks - if sed -n "/^${point_name}:.*$/!p" "$WD_CONFIG" >| "$config_tmp" && command cp "$config_tmp" "$WD_CONFIG" && command rm "$config_tmp" + if sed -n "/^${point_name}:.*$/!p" "$wd_config_file" >| "$config_tmp" && command cp "$config_tmp" "$wd_config_file" && command rm "$config_tmp" then wd_print_msg "$WD_GREEN" "Warp point removed" else @@ -257,7 +260,7 @@ wd_browse() { echo "This functionality requires fzf. Please install fzf first." return 1 fi - local entries=("${(@f)$(sed "s:${HOME}:~:g" "$WD_CONFIG" | awk -F ':' '{print $1 " -> " $2}')}") + local entries=("${(@f)$(sed "s:${HOME}:~:g" "$wd_config_file" | awk -F ':' '{print $1 " -> " $2}')}") local script_path="${${(%):-%x}:h}" local wd_remove_output=$(mktemp "${TMPDIR:-/tmp}/wd.XXXXXXXXXX") entries=("All warp points:" "Press enter to select. Press delete to remove" "${entries[@]}") @@ -275,7 +278,7 @@ wd_browse() { } wd_browse_widget() { - if [[ -e $WD_CONFIG ]]; then + if [[ -e $wd_config_file ]]; then wd_browse saved_buffer=$BUFFER saved_cursor=$CURSOR @@ -298,7 +301,7 @@ wd_list_all() { wd_print_msg "$WD_BLUE" "All warp points:" - entries=$(sed "s:${HOME}:~:g" "$WD_CONFIG") + entries=$(sed "s:${HOME}:~:g" "$wd_config_file") max_warp_point_length=0 while IFS= read -r line @@ -398,7 +401,7 @@ wd_clean() { count=$((count+1)) fi fi - done < "$WD_CONFIG" + done < "$wd_config_file" if [[ $count -eq 0 ]] then @@ -406,7 +409,7 @@ wd_clean() { else if [ ! -z "$force" ] || wd_yesorno "Removing ${count} warp points. Continue? (y/n)" then - echo "$wd_tmp" >! "$WD_CONFIG" + echo "$wd_tmp" >! "$wd_config_file" wd_print_msg "$WD_GREEN" "Cleanup complete. ${count} warp point(s) removed" else wd_print_msg "$WD_BLUE" "Cleanup aborted" @@ -417,7 +420,7 @@ wd_clean() { wd_export_static_named_directories() { if [[ ! -z $WD_EXPORT ]] then - command grep '^[0-9a-zA-Z_-]\+:' "$WD_CONFIG" | sed -e "s,~,$HOME," -e 's/:/=/' | while read -r warpdir ; do + command grep '^[0-9a-zA-Z_-]\+:' "$wd_config_file" | sed -e "s,~,$HOME," -e 's/:/=/' | while read -r warpdir ; do hash -d "$warpdir" done fi @@ -442,16 +445,19 @@ then echo "wd version $WD_VERSION" fi +# set the config file from variable or default +typeset wd_config_file=${WD_CONFIG:-$HOME/.warprc} if [[ ! -z $wd_alt_config ]] then - WD_CONFIG=$wd_alt_config[2] + # prefer the flag if provided + wd_config_file=$wd_alt_config[2] fi # check if config file exists -if [ ! -e "$WD_CONFIG" ] +if [ ! -e "$wd_config_file" ] then # if not, create config file - touch "$WD_CONFIG" + touch "$wd_config_file" else wd_export_static_named_directories fi @@ -473,7 +479,7 @@ do val=${(j,:,)arr[2,-1]} points[$key]=$val -done < "$WD_CONFIG" +done < "$wd_config_file" # get opts args=$(getopt -o a:r:c:lhs -l add:,rm:,clean,list,ls:,path:,help,show -- $*) @@ -484,11 +490,11 @@ then wd_print_usage # check if config file is writeable -elif [ ! -w "$WD_CONFIG" ] +elif [ ! -w "$wd_config_file" ] then # do nothing # can't run `exit`, as this would exit the executing shell - wd_exit_fail "\'$WD_CONFIG\' is not writeable." + wd_exit_fail "\'$wd_config_file\' is not writeable." else # parse rest of options @@ -572,8 +578,10 @@ unset wd_print_msg unset wd_yesorno unset wd_print_usage unset wd_alt_config +unset wd_config_file unset wd_quiet_mode unset wd_print_version +unset wd_force_mode unset wd_export_static_named_directories unset wd_o From 69a6359f7cf8978d464573fb7b023ee3cd00181a Mon Sep 17 00:00:00 2001 From: Jonathan Stacks Date: Thu, 28 Nov 2024 00:57:21 -0800 Subject: [PATCH 353/453] feat(ngrok): add completion plugin (#12826) --- plugins/ngrok/README.md | 20 ++++++++++++++++++++ plugins/ngrok/ngrok.plugin.zsh | 14 ++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 plugins/ngrok/README.md create mode 100644 plugins/ngrok/ngrok.plugin.zsh diff --git a/plugins/ngrok/README.md b/plugins/ngrok/README.md new file mode 100644 index 000000000..6c37b1905 --- /dev/null +++ b/plugins/ngrok/README.md @@ -0,0 +1,20 @@ +# ngrok plugin + +This plugin adds completion for the [ngrok](https://ngrok.com) CLI. + +To use it, add `ngrok` to the plugins array in your zshrc file: + +```zsh +plugins=(... ngrok) +``` + +This plugin does not add any aliases. + +## Cache + +This plugin caches the completion script and is automatically updated asynchronously when the plugin is +loaded, which is usually when you start up a new terminal emulator. + +The cache is stored at: + +- `$ZSH_CACHE/completions/_ngrok` completions script diff --git a/plugins/ngrok/ngrok.plugin.zsh b/plugins/ngrok/ngrok.plugin.zsh new file mode 100644 index 000000000..ca3c82db0 --- /dev/null +++ b/plugins/ngrok/ngrok.plugin.zsh @@ -0,0 +1,14 @@ +# Autocompletion for ngrok +if (( ! $+commands[ngrok] )); then + return +fi + +# If the completion file doesn't exist yet, we need to autoload it and +# bind it to `ngrok`. Otherwise, compinit will have already done that. +if [[ ! -f "$ZSH_CACHE_DIR/completions/_ngrok" ]]; then + typeset -g -A _comps + autoload -Uz _ngrok + _comps[ngrok]=_ngrok +fi + +ngrok completion zsh >| "$ZSH_CACHE_DIR/completions/_ngrok" &| From 62e3e0b2fdd25919de6ae2d4e09317e1bd07a2dc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 15 Dec 2024 23:38:56 +0100 Subject: [PATCH 354/453] chore(deps): bump certifi from 2024.8.30 to 2024.12.14 in /.github/workflows/dependencies (#12848) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependencies/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt index ed0d129b3..8ca4477c9 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -1,4 +1,4 @@ -certifi==2024.8.30 +certifi==2024.12.14 charset-normalizer==3.4.0 idna==3.10 PyYAML==6.0.2 From b9e73b44811becbdf24cff54441c73839a29c523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Federico=20Fran=C3=A7ois?= Date: Sun, 15 Dec 2024 23:40:09 +0100 Subject: [PATCH 355/453] docs(per-directory-history): add variable docs (#12844) --- plugins/per-directory-history/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/per-directory-history/README.md b/plugins/per-directory-history/README.md index 2816c11ba..c7d062a0c 100644 --- a/plugins/per-directory-history/README.md +++ b/plugins/per-directory-history/README.md @@ -35,6 +35,7 @@ toggle set the `PER_DIRECTORY_HISTORY_TOGGLE` environment variable. function above (default `^G`) * `PER_DIRECTORY_HISTORY_PRINT_MODE_CHANGE` is a variable which toggles whether the current mode is printed to the screen following a mode change (default `true`) +* `HISTORY_START_WITH_GLOBAL` is a global variable that defines how to start the plugin: global or local (default `false`) ## History From 048e166c9ea6c70d383141d89054740ae8d59681 Mon Sep 17 00:00:00 2001 From: "ohmyzsh[bot]" <54982679+ohmyzsh[bot]@users.noreply.github.com> Date: Sun, 22 Dec 2024 11:46:24 +0100 Subject: [PATCH 356/453] feat(z): update to dd94ef04 (#12862) Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com> --- .github/dependencies.yml | 2 +- plugins/z/LICENSE | 2 +- plugins/z/MANUAL.md | 51 ++++++++++++++++++++-------------------- plugins/z/z.plugin.zsh | 3 +-- 4 files changed, 28 insertions(+), 30 deletions(-) diff --git a/.github/dependencies.yml b/.github/dependencies.yml index 603bf7566..3386e55a0 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -36,7 +36,7 @@ dependencies: plugins/z: branch: master repo: agkozak/zsh-z - version: afaf2965b41fdc6ca66066e09382726aa0b6aa04 + version: dd94ef04acc41748ba171eb219971cb455e0040b precopy: | set -e test -e README.md && mv -f README.md MANUAL.md diff --git a/plugins/z/LICENSE b/plugins/z/LICENSE index 6af13b9e0..162cba8d1 100644 --- a/plugins/z/LICENSE +++ b/plugins/z/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018-2023 Alexandros Kozak +Copyright (c) 2018-2024 Alexandros Kozak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/plugins/z/MANUAL.md b/plugins/z/MANUAL.md index 106d8c107..eddf787dd 100644 --- a/plugins/z/MANUAL.md +++ b/plugins/z/MANUAL.md @@ -6,15 +6,15 @@ ![Zsh-z demo](img/demo.gif) -Zsh-z is a command line tool that allows you to jump quickly to directories that you have visited frequently in the past, or recently -- but most often a combination of the two (a concept known as ["frecency"](https://en.wikipedia.org/wiki/Frecency)). It works by keeping track of when you go to directories and how much time you spend in them. It is then in the position to guess where you want to go when you type a partial string, e.g., `z src` might take you to `~/src/zsh`. `z zsh` might also get you there, and `z c/z` might prove to be even more specific -- it all depends on your habits and how much time you have been using Zsh-z to build up a database. After using Zsh-z for a little while, you will get to where you want to be by typing considerably less than you would need if you were using `cd`. +Zsh-z is a command-line tool that allows you to jump quickly to directories that you have visited frequently or recently -- but most often a combination of the two (a concept known as ["frecency"](https://en.wikipedia.org/wiki/Frecency)). It works by keeping track of when you go to directories and how much time you spend in them. Based on this data, it predicts where you want to go when you type a partial string. For example, `z src` might take you to `~/src/zsh`. `z zsh` might also get you there, and `z c/z` might prove to be even more specific -- it all depends on your habits and how long you have been using Zsh-z to build up a database. After using Zsh-z for a little while, you will get to where you want to be by typing considerably less than you would need to if you were using `cd`. -Zsh-z is a native Zsh port of [rupa/z](https://github.com/rupa/z), a tool written for `bash` and Zsh that uses embedded `awk` scripts to do the heavy lifting. It was quite possibly my most used command line tool for a couple of years. I decided to translate it, `awk` parts and all, into pure Zsh script, to see if by eliminating calls to external tools (`awk`, `sort`, `date`, `sed`, `mv`, `rm`, and `chown`) and reducing forking through subshells I could make it faster. The performance increase is impressive, particularly on systems where forking is slow, such as Cygwin, MSYS2, and WSL. I have found that, in those environments, switching directories using Zsh-z can be over 100% faster than it is using `rupa/z`. +Zsh-z is a native Zsh port of [`rupa/z`](https://github.com/rupa/z), a tool written for `bash` and Zsh that uses embedded `awk` scripts to do the heavy lifting. `rupa/z` was my most used command-line tool for a couple of years. I decided to translate it, `awk` parts and all, into pure Zsh script, to see if by eliminating calls to external tools (`awk`, `sort`, `date`, `sed`, `mv`, `rm`, and `chown`) and reducing forking through subshells I could make it faster. The performance increase is impressive, particularly on systems where forking is slow, such as Cygwin, MSYS2, and WSL. I have found that in those environments, switching directories using Zsh-z can be over 100% faster than it is using `rupa/z`. -There is a noteworthy stability increase as well. Race conditions have always been a problem with `rupa/z`, and users of that utility will occasionally lose their `.z` databases. By having Zsh-z only use Zsh (`rupa/z` uses a hybrid shell code that works on `bash` as well), I have been able to implement a `zsh/system`-based file-locking mechanism similar to [the one @mafredri once proposed for `rupa/z`](https://github.com/rupa/z/pull/199). It is now nearly impossible to crash the database, even through extreme testing. +There is also a significant stability improvement. Race conditions have always been a problem with `rupa/z`, and users of that utility occasionally lose their `~/.z` databases. By having Zsh-z only use Zsh (`rupa/z` uses a hybrid shell code standard that works on `bash` as well), I have been able to implement a `zsh/system`-based file-locking mechanism similar to [the one @mafredri once proposed for `rupa/z`](https://github.com/rupa/z/pull/199). It is now nearly impossible to crash the database. -There are other, smaller improvements which I try to document in [Improvements and Fixes](#improvements-and-fixes). These include the new default behavior of sorting your tab completions by frecency rather than just letting Zsh sort the raw results alphabetically (a behavior which can be restored if you like it -- [see below](#settings)). +There are other, smaller improvements which I document below in [Improvements and Fixes](#improvements-and-fixes). For instance, tab completions are now sorted by frecency by default rather than alphabetically (the latter behavior can be restored if you like it -- [see below](#settings)). -Zsh-z is a drop-in replacement for `rupa/z` and will, by default, use the same database (`~/.z`), so you can go on using `rupa/z` when you launch `bash`. +Zsh-z is a drop-in replacement for `rupa/z` and will, by default, use the same database (`~/.z`, or whatever database file you specify), so you can go on using `rupa/z` when you launch `bash`. ## Table of Contents - [News](#news) @@ -37,13 +37,13 @@ Zsh-z is a drop-in replacement for `rupa/z` and will, by default, use the same d - August 24, 2023 + Zsh-z will now run when `setopt NO_UNSET` has been enabled (props @ntninja). - August 23, 2023 - + Better logic for loading `zsh/files` (props @z0rc) + + Better logic for loading `zsh/files` (props @z0rc). - August 2, 2023 - + Zsh-z still uses the `zsh/files` module when possible, but will fall back on the standard `chown`, `mv`, and `rm` commands in its absence. + + Zsh-z still uses the `zsh/files` module when possible but will fall back on the standard `chown`, `mv`, and `rm` commands in its absence. - April 27, 2023 + Zsh-z now allows the user to specify the directory-changing command using the `ZSHZ_CD` environment variable (default: `builtin cd`; props @basnijholt). - January 27, 2023 - + If the datafile directory specified by `ZSHZ_DATA` or `_Z_DATA` does not already exist, create it (props @mattmc3). + + If the database file directory specified by `ZSHZ_DATA` or `_Z_DATA` does not already exist, create it (props @mattmc3). - June 29, 2022 + Zsh-z is less likely to leave temporary files sitting around (props @mafredri). - June 27, 2022 @@ -69,7 +69,7 @@ Zsh-z is a drop-in replacement for `rupa/z` and will, by default, use the same d + Fixed the explanation string printed during completion so that it may be formatted with `zstyle`. + Zsh-z now declares `ZSHZ_EXCLUDE_DIRS` as an array with unique elements so that you do not have to. - July 29, 2021 - + Temporarily disabling use of `print -v`, which seems to be mangling CJK multibyte strings. + + Temporarily disabling the use of `print -v`, which was mangling CJK multibyte strings. - July 27, 2021 + Internal escaping of path names now works with older versions of ZSH. + Zsh-z now detects and discards any incomplete or incorrectly formatted database entries. @@ -102,7 +102,7 @@ Zsh-z is a drop-in replacement for `rupa/z` and will, by default, use the same d - December 22, 2020 + `ZSHZ_CASE`: when set to `ignore`, pattern matching is case-insensitive; when set to `smart`, patterns are matched case-insensitively when they are all lowercase and case-sensitively when they have uppercase characters in them (a behavior very much like Vim's `smartcase` setting). + `ZSHZ_KEEP_DIRS` is an array of directory names that should not be removed from the database, even if they are not currently available (useful when a drive is not always mounted). - + Symlinked datafiles were having their symlinks overwritten; this bug has been fixed. + + Symlinked database files were having their symlinks overwritten; this bug has been fixed. @@ -118,7 +118,7 @@ For tab completion to work, `_zshz` *must* be in the same directory as `zsh-z.pl autoload -U compinit; compinit -in your .zshrc somewhere below where you source `zsh-z.plugin.zsh`. +in your `.zshrc` somewhere below where you source `zsh-z.plugin.zsh`. If you add @@ -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 @@ -228,7 +228,7 @@ Add the line to your `.zshrc`. -`zsh-z` supports `zinit`'s `unload` feature; just run `zinit unload agkozak/zshz` to restore the shell to its state before `zsh-z` was loaded. +Zsh-z supports `zinit`'s `unload` feature; just run `zinit unload agkozak/zsh-z` to restore the shell to its state before Zsh-z was loaded. ### For [Znap](https://github.com/marlonrichert/zsh-snap) users @@ -249,7 +249,7 @@ somewhere above the line that says `zplug load`. Then run zplug install zplug load -to install `zsh-z`. +to install Zsh-z. ## Command Line Options @@ -263,9 +263,9 @@ to install `zsh-z`. - `-x` Remove a directory (by default, the current directory) from the database - `-xR` Remove a directory (by default, the current directory) and its subdirectories from the database -# Settings +## Settings -Zsh-z has environment variables (they all begin with `ZSHZ_`) that change its behavior if you set them; you can also keep your old ones if you have been using `rupa/z` (they begin with `_Z_`). +Zsh-z has environment variables (they all begin with `ZSHZ_`) that change its behavior if you set them. You can also keep your old ones if you have been using `rupa/z` (whose environment variables begin with `_Z_`). * `ZSHZ_CMD` changes the command name (default: `z`) * `ZSHZ_CD` specifies the default directory-changing command (default: `builtin cd`) @@ -324,19 +324,18 @@ A good example might involve a directory tree that has Git repositories within i (As a Zsh user, I tend to use `**` instead of `find`, but it is good to see how deep your directory trees go before doing that.) - ## Other Improvements and Fixes * `z -x` works, with the help of `chpwd_functions`. -* Zsh-z works on Solaris. +* Zsh-z is compatible with Solaris. * Zsh-z uses the "new" `zshcompsys` completion system instead of the old `compctl` one. -* There is no error message when the database file has not yet been created. -* There is support for special characters (e.g., `[`) in directory names. -* If `z -l` only returns one match, a common root is not printed. -* Exit status codes increasingly make sense. -* Completions work with options `-c`, `-r`, and `-t`. -* If `~/foo` and `~/foob` are matches, `~/foo` is *not* the common root. Only a common parent directory can be a common root. -* `z -x` and the new, recursive `z -xR` can take an argument so that you can remove directories other than `PWD` from the database. +* No error message is displayed when the database file has not yet been created. +* Special characters (e.g., `[`) in directory names are now supported. +* If `z -l` returns only one match, a common root is not printed. +* Exit status codes are more logical. +* Completions now work with options `-c`, `-r`, and `-t`. +* If `~/foo` and `~/foob` are matches, `~/foo` is no longer considered the common root. Only a common parent directory can be a common root. +* `z -x` and the new, recursive `z -xR` can now accept an argument so that you can remove directories other than `PWD` from the database. ## Migrating from Other Tools @@ -358,7 +357,7 @@ the line That will re-bind `z` or the command of your choice to the underlying Zsh-z function. -## Known Bugs +## Known Bug It is possible to run a completion on a string with spaces in it, e.g., `z us bi` might take you to `/usr/local/bin`. This works, but as things stand, after the completion the command line reads z us /usr/local/bin. diff --git a/plugins/z/z.plugin.zsh b/plugins/z/z.plugin.zsh index a41a4ae25..bf15b01de 100644 --- a/plugins/z/z.plugin.zsh +++ b/plugins/z/z.plugin.zsh @@ -4,7 +4,7 @@ # # https://github.com/agkozak/zsh-z # -# Copyright (c) 2018-2023 Alexandros Kozak +# Copyright (c) 2018-2024 Alexandros Kozak # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -120,7 +120,6 @@ fi [[ ${builtins[zf_mv]-} == 'defined' ]] && ZSHZ[MV]='zf_mv' [[ ${builtins[zf_rm]-} == 'defined' ]] && ZSHZ[RM]='zf_rm' - # Load zsh/system, if necessary [[ ${modules[zsh/system]-} == 'loaded' ]] || zmodload zsh/system &> /dev/null From f733dc340b2a1c5b2e61a4da7de790b2f557175f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Dec 2024 16:19:12 +0100 Subject: [PATCH 357/453] chore(deps): bump urllib3 from 2.2.3 to 2.3.0 in /.github/workflows/dependencies (#12863) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependencies/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt index 8ca4477c9..5204e2cb7 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -4,4 +4,4 @@ idna==3.10 PyYAML==6.0.2 requests==2.32.3 semver==3.0.2 -urllib3==2.2.3 +urllib3==2.3.0 From 9c8afcc3ee2fe6da2e2487a623498a9105cbd38c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 29 Dec 2024 13:22:49 +0100 Subject: [PATCH 358/453] chore(deps): bump charset-normalizer in /.github/workflows/dependencies (#12874) Bumps [charset-normalizer](https://github.com/jawah/charset_normalizer) from 3.4.0 to 3.4.1. - [Release notes](https://github.com/jawah/charset_normalizer/releases) - [Changelog](https://github.com/jawah/charset_normalizer/blob/master/CHANGELOG.md) - [Commits](https://github.com/jawah/charset_normalizer/compare/3.4.0...3.4.1) --- updated-dependencies: - dependency-name: charset-normalizer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependencies/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt index 5204e2cb7..a3922cd03 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -1,5 +1,5 @@ certifi==2024.12.14 -charset-normalizer==3.4.0 +charset-normalizer==3.4.1 idna==3.10 PyYAML==6.0.2 requests==2.32.3 From d82669199b5d900b50fd06dd3518c277f0def869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalle=20Ahlstr=C3=B6m?= <71292737+kahlstrm@users.noreply.github.com> Date: Mon, 30 Dec 2024 11:15:05 +0200 Subject: [PATCH 359/453] fix(af-magic): add logic for virtualenv separator (#12875) --- themes/af-magic.zsh-theme | 2 ++ 1 file changed, 2 insertions(+) diff --git a/themes/af-magic.zsh-theme b/themes/af-magic.zsh-theme index 70549d01f..668c4e5de 100644 --- a/themes/af-magic.zsh-theme +++ b/themes/af-magic.zsh-theme @@ -13,6 +13,8 @@ function afmagic_dashes { # the prompt, account for it when returning the number of dashes if [[ -n "$python_env" && "$PS1" = *\(${python_env}\)* ]]; then echo $(( COLUMNS - ${#python_env} - 3 )) + elif [[ -n "$VIRTUAL_ENV_PROMPT" && "$PS1" = *${VIRTUAL_ENV_PROMPT}* ]]; then + echo $(( COLUMNS - ${#VIRTUAL_ENV_PROMPT} )) else echo $COLUMNS fi From 5c17bcd21f104d2508e0bc94d984c4d9e6a607da Mon Sep 17 00:00:00 2001 From: Bhanu Date: Wed, 8 Jan 2025 00:34:00 -0800 Subject: [PATCH 360/453] feat(web-search): add perplexity.ai (#12815) --- plugins/web-search/README.md | 1 + plugins/web-search/web-search.plugin.zsh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/plugins/web-search/README.md b/plugins/web-search/README.md index ad3741fc9..d0b03dff2 100644 --- a/plugins/web-search/README.md +++ b/plugins/web-search/README.md @@ -52,6 +52,7 @@ Available search contexts are: | `gopkg` | `https://pkg.go.dev/search?m=package&q=` | | `chatgpt` | `https://chatgpt.com/?q=` | | `reddit` | `https://www.reddit.com/search/?q=` | +| `ppai` | `https://www.perplexity.ai/search/new?q=` | 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 b97e33a0b..ff77faed7 100644 --- a/plugins/web-search/web-search.plugin.zsh +++ b/plugins/web-search/web-search.plugin.zsh @@ -33,6 +33,7 @@ function web_search() { gopkg "https://pkg.go.dev/search?m=package&q=" chatgpt "https://chatgpt.com/?q=" reddit "https://www.reddit.com/search/?q=" + ppai "https://www.perplexity.ai/search/new?q=" ) # check whether the search engine is supported @@ -87,6 +88,7 @@ alias packagist='web_search packagist' alias gopkg='web_search gopkg' alias chatgpt='web_search chatgpt' alias reddit='web_search reddit' +alias ppai='web_search ppai' #add your own !bang searches here alias wiki='web_search duckduckgo \!w' From 276e540eed9c47d11539dfcd056cd9d162e1c732 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Fri, 10 Jan 2025 14:11:33 +0100 Subject: [PATCH 361/453] fix(cli): ensure `ksharrays` is unset Closes #12900 --- lib/cli.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/cli.zsh b/lib/cli.zsh index 38a84840c..c63185a3d 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -1,6 +1,7 @@ #!/usr/bin/env zsh function omz { + setopt localoptions noksharrays [[ $# -gt 0 ]] || { _omz::help return 1 From cae2e451933ffe1108bfd00fa67ff5d63741ab85 Mon Sep 17 00:00:00 2001 From: Thomas Date: Fri, 10 Jan 2025 14:17:49 +0100 Subject: [PATCH 362/453] fix(rust): call `rustc` through `rustup run` (#12901) --- plugins/rust/rust.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/rust/rust.plugin.zsh b/plugins/rust/rust.plugin.zsh index 858f14126..567cebc64 100644 --- a/plugins/rust/rust.plugin.zsh +++ b/plugins/rust/rust.plugin.zsh @@ -22,5 +22,5 @@ fi rustup completions zsh >| "$ZSH_CACHE_DIR/completions/_rustup" &| cat >| "$ZSH_CACHE_DIR/completions/_cargo" <<'EOF' #compdef cargo -source "$(rustc +${${(z)$(rustup default)}[1]} --print sysroot)"/share/zsh/site-functions/_cargo +source "$(rustup run ${${(z)$(rustup default)}[1]} rustc --print sysroot)"/share/zsh/site-functions/_cargo EOF From 7a3695aadf51aaa24e79175b1684d4836e31956d Mon Sep 17 00:00:00 2001 From: Michele Bologna Date: Sun, 12 Jan 2025 14:25:00 +0100 Subject: [PATCH 363/453] fix(grc): add linuxbrew path (#12903) --- plugins/grc/grc.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/grc/grc.plugin.zsh b/plugins/grc/grc.plugin.zsh index 55ffc1a1e..fc6ecc8ac 100644 --- a/plugins/grc/grc.plugin.zsh +++ b/plugins/grc/grc.plugin.zsh @@ -5,6 +5,7 @@ files=( /etc/grc.zsh # default /usr/local/etc/grc.zsh # homebrew darwin-x64 /opt/homebrew/etc/grc.zsh # homebrew darwin-arm64 + /home/linuxbrew/.linuxbrew/etc/grc.zsh # linuxbrew /usr/share/grc/grc.zsh # Gentoo Linux (app-misc/grc) ) From 04cba220f7bd7b27483a5b346e2ca717f0341895 Mon Sep 17 00:00:00 2001 From: Nico Just Date: Wed, 15 Jan 2025 12:40:52 +0100 Subject: [PATCH 364/453] feat(eza): add color-scale options (#12841) --- plugins/eza/README.md | 23 +++++++++++++++++++++++ plugins/eza/eza.plugin.zsh | 8 ++++++++ 2 files changed, 31 insertions(+) diff --git a/plugins/eza/README.md b/plugins/eza/README.md index 90e549994..bec1f85cb 100644 --- a/plugins/eza/README.md +++ b/plugins/eza/README.md @@ -65,6 +65,29 @@ If `yes`, sets the `--icons` option of `eza`, adding icons for files and folders Default: `no` +### `color-scale` + +```zsh +zstyle ':omz:plugins:eza' 'color-scale' all|age|size +``` + +Highlight levels of field(s) distinctly. Use comma(,) separated list of `all`, `age`, `size` + +Default: `none` + +### `color-scale-mode` + +```zsh +zstyle ':omz:plugins:eza' 'color-scale-mode' gradient|fixed +``` + +Choose the mode for highlighting: + +- `gradient` (default) -- gradient coloring +- `fixed` -- fixed coloring + +Default: `gradient` + ### `size-prefix` ```zsh diff --git a/plugins/eza/eza.plugin.zsh b/plugins/eza/eza.plugin.zsh index f25f1c30b..60ed1eb27 100644 --- a/plugins/eza/eza.plugin.zsh +++ b/plugins/eza/eza.plugin.zsh @@ -34,6 +34,14 @@ function _configure_eza() { if zstyle -t ':omz:plugins:eza' 'icons'; then _EZA_TAIL+=("--icons=auto") fi + zstyle -s ':omz:plugins:eza' 'color-scale' _val + if [[ $_val ]]; then + _EZA_TAIL+=("--color-scale=$_val") + fi + zstyle -s ':omz:plugins:eza' 'color-scale-mode' _val + if [[ $_val == (gradient|fixed) ]]; then + _EZA_TAIL+=("--color-scale-mode=$_val") + fi zstyle -s ':omz:plugins:eza' 'time-style' _val if [[ $_val ]]; then _EZA_TAIL+=("--time-style='$_val'") From 028d65363230b4aa54f3aaa14e03237243a2f1d8 Mon Sep 17 00:00:00 2001 From: Abhijeet Vashistha Date: Wed, 15 Jan 2025 21:33:32 +0530 Subject: [PATCH 365/453] fix(sonicradish): reset color typo (#12912) --- themes/sonicradish.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/sonicradish.zsh-theme b/themes/sonicradish.zsh-theme index db6170969..11d66a27e 100644 --- a/themes/sonicradish.zsh-theme +++ b/themes/sonicradish.zsh-theme @@ -29,7 +29,7 @@ ZSH_THEME_GIT_PROMPT_SUFFIX="%{$GIT_PROMPT_INFO%} :" ZSH_THEME_GIT_PROMPT_DIRTY=" %{$GIT_DIRTY_COLOR%}✘" ZSH_THEME_GIT_PROMPT_CLEAN=" %{$GIT_CLEAN_COLOR%}✔" -ZSH_THEME_GIT_PROMPT_ADDED="%{$FG[103]%}✚%{$rset_color%}" +ZSH_THEME_GIT_PROMPT_ADDED="%{$FG[103]%}✚%{$reset_color%}" ZSH_THEME_GIT_PROMPT_MODIFIED="%{$FG[103]%}✹%{$reset_color%}" ZSH_THEME_GIT_PROMPT_DELETED="%{$FG[103]%}✖%{$reset_color%}" ZSH_THEME_GIT_PROMPT_RENAMED="%{$FG[103]%}➜%{$reset_color%}" From 8c5b71b2f430283d0e9404ad1d2b470ed336aaab Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Sun, 19 Jan 2025 04:18:37 -0600 Subject: [PATCH 366/453] ci(deps): update `gitfast` to its new structure (#12922) Co-authored-by: Carlo Sala --- .github/dependencies.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/dependencies.yml b/.github/dependencies.yml index 3386e55a0..2c92aee52 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -5,8 +5,10 @@ dependencies: version: tag:v2.1 postcopy: | set -e - rm -rf git-completion.plugin.zsh Makefile README.adoc t tools - test -e git-completion.zsh && mv -f git-completion.zsh _git + rm -rf git-completion.plugin.zsh Makefile t tools + mv README.adoc MANUAL.adoc + mv -f src/* . + rmdir src plugins/gradle: repo: gradle/gradle-completion branch: master From d689aa289e5dcda7c35b907af62bd08feb679b37 Mon Sep 17 00:00:00 2001 From: "ohmyzsh[bot]" <54982679+ohmyzsh[bot]@users.noreply.github.com> Date: Sun, 19 Jan 2025 11:20:14 +0100 Subject: [PATCH 367/453] feat(gitfast): update to version v2.2 (#12923) Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com> --- .github/dependencies.yml | 2 +- plugins/gitfast/MANUAL.adoc | 40 +++++++++++++++++++++++++++++ plugins/gitfast/_git | 18 +++---------- plugins/gitfast/git-completion.bash | 2 ++ 4 files changed, 46 insertions(+), 16 deletions(-) create mode 100644 plugins/gitfast/MANUAL.adoc diff --git a/.github/dependencies.yml b/.github/dependencies.yml index 2c92aee52..02995d6cd 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -2,7 +2,7 @@ dependencies: plugins/gitfast: repo: felipec/git-completion branch: master - version: tag:v2.1 + version: tag:v2.2 postcopy: | set -e rm -rf git-completion.plugin.zsh Makefile t tools diff --git a/plugins/gitfast/MANUAL.adoc b/plugins/gitfast/MANUAL.adoc new file mode 100644 index 000000000..5333f5a2c --- /dev/null +++ b/plugins/gitfast/MANUAL.adoc @@ -0,0 +1,40 @@ +This project is a friendly fork of the official Git completion +(`contrib/completion`) and prompt scripts for Bash, Zsh, and possibly other +shells. + +Most Git developers use the Bash shell, for which the completion scripts work +rather well, however, Zsh is typically neglected. I've sent many patches to fix +the issues, many have been merged, but many have been ignored, thus the need for +a canonical location of a good, working Zsh completion. + +There are advantages for Bash users too. Currently the scripts under `contrib` are tied to the +specific Git version, for example the completion scripts of version v2.40 +(https://git.kernel.org/pub/scm/git/git.git/plain/contrib/completion/git-completion.bash?h=v2.40.0[git-completion.bash]) +have issues with older versions of Git (e.g. v2.33); the ones in +this project don't. + +With `git-completion` you can be sure you are using the latest completion that +works in both shells, and any Git version. + +This is a sister project of the +https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/gitfast[Oh My Zsh +gitfast] plugin (that I also maintain), which has similar needs. + +== Installation == + +* https://github.com/felipec/git-completion/wiki/Bash[Bash instructions] +* https://github.com/felipec/git-completion/wiki/Zsh[Zsh instructions] + +== Improvements from upstream == + +This is a short list of the benefits you get: + +* Easier installation +* Tons of bug fixes +* Works with older versions of git +* Zsh: much more options +* Zsh: quoting works properly +* Zsh: automatic suffix removal + +For a full list of all the patches on top of upstream git check +https://github.com/felipec/git-completion/wiki/Patches[Patches]. diff --git a/plugins/gitfast/_git b/plugins/gitfast/_git index 31bf88c1c..1283c713e 100644 --- a/plugins/gitfast/_git +++ b/plugins/gitfast/_git @@ -2,23 +2,11 @@ # zsh completion wrapper for git # -# Copyright (c) 2012-2020 Felipe Contreras +# Copyright (c) 2012-2024 Felipe Contreras # -# The recommended way to install this script is to make a copy of it as a -# file named '_git' inside any directory in your fpath. +# The recommended way to use this script is to prepend its location to your $fpath: # -# For example, create a directory '~/.zsh/', copy this file to '~/.zsh/_git', -# and then add the following to your ~/.zshrc file: -# -# fpath=(~/.zsh $fpath) -# -# You need git's bash completion script installed. By default bash-completion's -# location will be used (e.g. pkg-config --variable=completionsdir bash-completion). -# -# If your bash completion script is somewhere else, you can specify the -# location in your ~/.zshrc: -# -# zstyle ':completion:*:*:git:*' script ~/.git-completion.bash +# fpath=($git_completion_srcdir $fpath) # zstyle -T ':completion:*:*:git:*' tag-order && \ diff --git a/plugins/gitfast/git-completion.bash b/plugins/gitfast/git-completion.bash index 9a2045f26..8a790ca69 100644 --- a/plugins/gitfast/git-completion.bash +++ b/plugins/gitfast/git-completion.bash @@ -1,6 +1,8 @@ # bash/zsh completion support for core Git. # # Copyright (C) 2006,2007 Shawn O. Pearce +# Copyright (c) 2012-2024 Felipe Contreras +# # Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/). # Distributed under the GNU General Public License, version 2.0. # From 6e9cda3d30d8e73c11e4d32044b7f4c5e06f822d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 19 Jan 2025 23:30:40 +0100 Subject: [PATCH 368/453] chore(deps): bump semver in /.github/workflows/dependencies (#12924) Bumps [semver](https://github.com/python-semver/python-semver) from 3.0.2 to 3.0.3. - [Release notes](https://github.com/python-semver/python-semver/releases) - [Changelog](https://github.com/python-semver/python-semver/blob/master/CHANGELOG.rst) - [Commits](https://github.com/python-semver/python-semver/compare/3.0.2...3.0.3) --- updated-dependencies: - dependency-name: semver dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependencies/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt index a3922cd03..d8149743c 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -3,5 +3,5 @@ charset-normalizer==3.4.1 idna==3.10 PyYAML==6.0.2 requests==2.32.3 -semver==3.0.2 +semver==3.0.3 urllib3==2.3.0 From cca4043238421ae8e018720326d5357027f27cf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 23 Jan 2025 19:54:50 +0100 Subject: [PATCH 369/453] feat(python): support multiple venvs via `$PYTHON_VENV_NAMES` (#12932) --- plugins/python/README.md | 45 ++++++++++++++++++++++++++------ plugins/python/python.plugin.zsh | 26 +++++++++++++++--- 2 files changed, 59 insertions(+), 12 deletions(-) diff --git a/plugins/python/README.md b/plugins/python/README.md index 8014992de..490cf88f1 100644 --- a/plugins/python/README.md +++ b/plugins/python/README.md @@ -24,16 +24,45 @@ plugins=(... python) The plugin provides three utilities to manage Python 3.3+ [venv](https://docs.python.org/3/library/venv.html) virtual environments: -- `mkv [name]`: make a new virtual environment called `name` (default: if set `$PYTHON_VENV_NAME`, else - `venv`) in the current directory. +- `mkv [name]`: make a new virtual environment called `name` in the current directory. + **Default**: `$PYTHON_VENV_NAME` if set, otherwise `venv`. -- `vrun [name]`: Activate the virtual environment called `name` (default: if set `$PYTHON_VENV_NAME`, else - `venv`) in the current directory. +- `vrun [name]`: activate the virtual environment called `name` in the current directory. + **Default**: the first existing in `$PYTHON_VENV_NAMES`. -- `auto_vrun`: Automatically activate the venv virtual environment when entering a directory containing +- `auto_vrun`: automatically activate the venv virtual environment when entering a directory containing `/bin/activate`, and automatically deactivate it when navigating out of it (keeps venv activated in subdirectories). - - To enable the feature, set `export PYTHON_AUTO_VRUN=true` before sourcing oh-my-zsh. - - Plugin activates first virtual environment in lexicographic order whose name begins with ``. + - To enable the feature, set `PYTHON_AUTO_VRUN=true` before sourcing oh-my-zsh. + - The plugin activates the first existing virtual environment, in order, appearing in `$PYTON_VENV_NAMES`. The default virtual environment name is `venv`. To use a different name, set - `export PYTHON_VENV_NAME=`. For example: `export PYTHON_VENV_NAME=".venv"` + `PYTHON_VENV_NAME=`. For example: `PYTHON_VENV_NAME=".venv"` + +### Settings + +You can set these variables in your `.zshrc` file, before Oh My Zsh is sourced. +For example: + +```sh +PYTHON_VENV_NAME=".venv" +PYTHON_VENV_NAMES=($PYTHON_VENV_NAME venv) +... +plugins=(... python) +source "$ZSH/oh-my-zsh.sh" +``` + + +## `$PYTHON_VENV_NAME` + +**Default**: `venv`. + +Preferred name for virtual environments, for example when creating via `mkv`. + +## `$PYTHON_VENV_NAMES` + +**Default**: `$PYTHON_VENV_NAME venv .venv`. + +Array of virtual environment names to be checked, in order, by `vrun` and `auto_vrun`. +This means these functions will load the first existing virtual environment in this list. +Duplicate names are ignored. + diff --git a/plugins/python/python.plugin.zsh b/plugins/python/python.plugin.zsh index 63733e1de..2b139ddf0 100644 --- a/plugins/python/python.plugin.zsh +++ b/plugins/python/python.plugin.zsh @@ -47,12 +47,29 @@ alias pygrep='grep -nr --include="*.py"' alias pyserver="python3 -m http.server" -## venv utilities +## venv settings : ${PYTHON_VENV_NAME:=venv} +# Array of possible virtual environment names to look for, in order +# -U for removing duplicates +typeset -gaU PYTHON_VENV_NAMES +[[ -n "$PYTHON_VENV_NAMES" ]] || PYTHON_VENV_NAMES=($PYTHON_VENV_NAME venv .venv) + # Activate a the python virtual environment specified. -# If none specified, use $PYTHON_VENV_NAME, else 'venv'. +# If none specified, use the first existing in $PYTHON_VENV_NAMES. function vrun() { + if [[ -z "$1" ]]; then + local name + for name in $PYTHON_VENV_NAMES; do + local venvpath="${name:P}" + if [[ -d "$venvpath" ]]; then + vrun "$name" + return $? + fi + done + echo >&2 "Error: no virtual environment found in current directory" + fi + local name="${1:-$PYTHON_VENV_NAME}" local venvpath="${name:P}" @@ -91,10 +108,11 @@ if [[ "$PYTHON_AUTO_VRUN" == "true" ]]; then fi if [[ $PWD != ${VIRTUAL_ENV:h} ]]; then - for _file in "${PYTHON_VENV_NAME}"*/bin/activate(N.); do + local file + for file in "${^PYTHON_VENV_NAMES[@]}"/bin/activate(N.); do # make sure we're not in a venv already (( $+functions[deactivate] )) && deactivate > /dev/null 2>&1 - source $_file > /dev/null 2>&1 + source $file > /dev/null 2>&1 break done fi From 501f29f90c67bfb47506715c894e710c46ae3e0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 23 Jan 2025 20:10:10 +0100 Subject: [PATCH 370/453] fix(tailscale): fix completion binding for alias to `Tailscale` (#12928) Fixes #12928 --- plugins/tailscale/tailscale.plugin.zsh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/tailscale/tailscale.plugin.zsh b/plugins/tailscale/tailscale.plugin.zsh index e0e011196..8b4e1e34d 100644 --- a/plugins/tailscale/tailscale.plugin.zsh +++ b/plugins/tailscale/tailscale.plugin.zsh @@ -15,4 +15,11 @@ if [[ ! -f "$ZSH_CACHE_DIR/completions/_tailscale" ]]; then fi fi +# If using the alias, let's make sure that the aliased executable is also bound +# in case the alias points to "Tailscale" instead of "tailscale". +# See https://github.com/ohmyzsh/ohmyzsh/discussions/12928 +if (( $+aliases[tailscale] )); then + _comps[${aliases[tailscale]:t}]=_tailscale +fi + tailscale completion zsh >| "$ZSH_CACHE_DIR/completions/_tailscale" &| From 9a0e22c184f4348b4bda4cd3de306d65eb541341 Mon Sep 17 00:00:00 2001 From: jamesrtnz Date: Fri, 24 Jan 2025 08:24:43 +1300 Subject: [PATCH 371/453] feat(perl): add `perlbrew` auto activation (#12814) Co-authored-by: Carlo Sala --- plugins/perl/README.md | 40 +++++++++++++++++++++--------------- plugins/perl/perl.plugin.zsh | 9 ++++++++ 2 files changed, 32 insertions(+), 17 deletions(-) diff --git a/plugins/perl/README.md b/plugins/perl/README.md index dd9b7dc75..a387455c1 100644 --- a/plugins/perl/README.md +++ b/plugins/perl/README.md @@ -8,30 +8,36 @@ To use it, add `perl` to the plugins array in your zshrc file: plugins=(... perl) ``` +## Perlbrew activation + +If the plugin detects that `perlbrew` hasn't been activated, yet there is an installation of it in +`$PERLBREW_ROOT`, it'll initialize by default. To avoid this behaviour, set `ZSH_PERLBREW_ACTIVATE=false` +before `source oh-my-zsh.sh` in your zshrc. + ## Aliases -| Aliases | Command | Description | -| :------------ | :----------------- | :------------------------------------- | -| pbi | `perlbrew install` | Install specific perl version | -| pbl | `perlbrew list` | List all perl version installed | -| pbo | `perlbrew off` | Go back to the system perl | -| pbs | `perlbrew switch` | Turn it back on | -| pbu | `perlbrew use` | Use specific version of perl | -| pd | `perldoc` | Show the perl documentation | -| ple | `perl -wlne` | Use perl like awk/sed | -| latest-perl | `curl ...` | Show the latest stable release of Perl | +| Aliases | Command | Description | +| :---------- | :----------------- | :------------------------------------- | +| pbi | `perlbrew install` | Install specific perl version | +| pbl | `perlbrew list` | List all perl version installed | +| pbo | `perlbrew off` | Go back to the system perl | +| pbs | `perlbrew switch` | Turn it back on | +| pbu | `perlbrew use` | Use specific version of perl | +| pd | `perldoc` | Show the perl documentation | +| ple | `perl -wlne` | Use perl like awk/sed | +| latest-perl | `curl ...` | Show the latest stable release of Perl | ## Functions -* `newpl`: creates a basic Perl script file and opens it with $EDITOR. +- `newpl`: creates a basic Perl script file and opens it with $EDITOR. -* `pgs`: Perl Global Substitution: `pgs ` - Looks for `` and replaces it with `` in ``. +- `pgs`: Perl Global Substitution: `pgs ` Looks for + `` and replaces it with `` in ``. -* `prep`: Perl grep, because 'grep -P' is terrible: `prep []` - Lets you work with pipes or files (if no `` provided, use stdin). +- `prep`: Perl grep, because 'grep -P' is terrible: `prep []` Lets you work with pipes or + files (if no `` provided, use stdin). ## Requirements -In order to make this work, you will need to have perl installed. -More info on the usage and install: https://www.perl.org/get.html +In order to make this work, you will need to have perl installed. More info on the usage and install: +https://www.perl.org/get.html diff --git a/plugins/perl/perl.plugin.zsh b/plugins/perl/perl.plugin.zsh index 678e88d97..137fa252a 100644 --- a/plugins/perl/perl.plugin.zsh +++ b/plugins/perl/perl.plugin.zsh @@ -54,3 +54,12 @@ pgs() { # [find] [replace] [filename] prep() { # [pattern] [filename unless STDOUT] perl -nle 'print if /'"$1"'/;' $2 } + +# If the 'perlbrew' function isn't defined, perlbrew isn't setup. +if [[ $ZSH_PERLBREW_ACTIVATE != false ]] && (( ! $+functions[perlbrew] )); then + local _perlbrew="${PERLBREW_ROOT:-${HOME}/perl5/perlbrew}" + if [[ -f "${_perlbrew}/etc/bashrc" ]]; then + source "${_perlbrew}/etc/bashrc" + fi + unset _perlbrew +fi From bd0a5b2598f5614aa60b056783cd3acb803c664a Mon Sep 17 00:00:00 2001 From: Keith Bennett Date: Fri, 24 Jan 2025 02:28:44 +0700 Subject: [PATCH 372/453] docs(chucknorris): add useful note (#12822) --- plugins/chucknorris/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/chucknorris/README.md b/plugins/chucknorris/README.md index 0562b3b59..655e7cf11 100644 --- a/plugins/chucknorris/README.md +++ b/plugins/chucknorris/README.md @@ -36,3 +36,10 @@ Last login: Fri Jan 30 23:12:26 on ttys001 - `cowsay` if using `chuck_cow` Available via homebrew, apt, ... + +> [!NOTE] +> In addition to installing `fortune`, it may be necessary to run: +> +> `strfile $ZSH/plugins/chucknorris/fortunes/chucknorris\n` +> +> (include the "\n" literally) to write the fortune data to the proper directory. From 1bae19973671dde75506c541ba576de4dae8cb29 Mon Sep 17 00:00:00 2001 From: Thomas Boyer Date: Thu, 23 Jan 2025 20:37:00 +0100 Subject: [PATCH 373/453] fix(direnv): warn user if command not found (#12840) Co-authored-by: Carlo Sala --- plugins/direnv/direnv.plugin.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/direnv/direnv.plugin.zsh b/plugins/direnv/direnv.plugin.zsh index 0a33194dd..c026dbe76 100644 --- a/plugins/direnv/direnv.plugin.zsh +++ b/plugins/direnv/direnv.plugin.zsh @@ -1,5 +1,8 @@ -# Don't continue if direnv is not found -command -v direnv &>/dev/null || return +# If direnv is not found, don't continue and print a warning +if (( ! $+commands[direnv] )); then + echo "Warning: direnv not found. Please install direnv and ensure it's in your PATH before using this plugin." + return +fi _direnv_hook() { trap -- '' SIGINT; From 4e29c670a48a17276d04b3e47262b10f28dfcc0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 23 Jan 2025 20:38:12 +0100 Subject: [PATCH 374/453] fix(changelog): show if there are no changes (#12934) --- tools/changelog.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tools/changelog.sh b/tools/changelog.sh index c4b26079e..ff409115f 100755 --- a/tools/changelog.sh +++ b/tools/changelog.sh @@ -400,6 +400,9 @@ function display-release { function display:breaking { (( $#breaking != 0 )) || return 0 + # If we reach here we have shown commits, set flag + shown_commits=1 + case "$output" in text) printf '\e[31m'; fmt:header "BREAKING CHANGES" 3 ;; raw) fmt:header "BREAKING CHANGES" 3 ;; @@ -427,6 +430,9 @@ function display-release { # If no commits found of type $type, go to next type (( $#hashes != 0 )) || return 0 + # If we reach here we have shown commits, set flag + shown_commits=1 + fmt:header "${TYPES[$type]}" 3 for hash in $hashes; do echo " - $(fmt:hash) $(fmt:scope)$(fmt:subject)" @@ -444,6 +450,9 @@ function display-release { # If no commits found under "other" types, don't display anything (( $#changes != 0 )) || return 0 + # If we reach here we have shown commits, set flag + shown_commits=1 + fmt:header "Other changes" 3 for hash type in ${(kv)changes}; do case "$type" in @@ -498,7 +507,7 @@ function main { # Commit classification arrays local -A types subjects scopes breaking reverts - local truncate=0 read_commits=0 + local truncate=0 read_commits=0 shown_commits=0 local version tag local hash refs subject body @@ -569,6 +578,10 @@ function main { echo " ...more commits omitted" echo fi + + if (( ! shown_commits )); then + echo "No changes to mention." + fi } # Use raw output if stdout is not a tty From 69410e702014b6f6f09f659a5747c5a6ace7a09a Mon Sep 17 00:00:00 2001 From: fossdd Date: Thu, 23 Jan 2025 20:43:27 +0100 Subject: [PATCH 375/453] feat(foot): add foot plugin (#12849) --- plugins/foot/README.md | 35 +++++++++++++++++++++++++++++++++++ plugins/foot/foot.plugin.zsh | 10 ++++++++++ 2 files changed, 45 insertions(+) create mode 100644 plugins/foot/README.md create mode 100644 plugins/foot/foot.plugin.zsh diff --git a/plugins/foot/README.md b/plugins/foot/README.md new file mode 100644 index 000000000..67777d9fa --- /dev/null +++ b/plugins/foot/README.md @@ -0,0 +1,35 @@ +# foot + +This plugin adds shell integration for [foot, a fast, lightweight and +minimalistic Wayland terminal emulator](https://codeberg.org/dnkl/foot). + +To use, add `foot` to the list of plugins in your `.zshrc` file: + +```zsh +plugins=(... foot) +``` + +## Spawning new terminal instances in the current working directory + +When spawning a new terminal instance (with `ctrl+shift+n` by default), the new +instance will start in the current working directory. + +## Jumping between prompts + +Foot can move the current viewport to focus prompts of already executed +commands (bound to ctrl+shift+z/x by default). + +## Piping last command's output + +The key binding `pipe-command-output` can pipe the last command's output to an +application of your choice (similar to the other `pipe-*` key bindings): + +``` +[key-bindings] +pipe-command-output=[sh -c "f=$(mktemp); cat - > $f; footclient emacsclient -nw $f; rm $f"] Control+Shift+g +``` + +When pressing ctrl+shift+g, the last command's output is written to a +temporary file, then an emacsclient is started in a new footclient instance. +The temporary file is removed after the footclient instance has closed. + diff --git a/plugins/foot/foot.plugin.zsh b/plugins/foot/foot.plugin.zsh new file mode 100644 index 000000000..c1d077e26 --- /dev/null +++ b/plugins/foot/foot.plugin.zsh @@ -0,0 +1,10 @@ +function precmd { + print -Pn "\e]133;A\e\\" + if ! builtin zle; then + print -n "\e]133;D\e\\" + fi +} + +function preexec { + print -n "\e]133;C\e\\" +} From d2e79501b252ffafa2a25b541f67332c3e186807 Mon Sep 17 00:00:00 2001 From: shun095 <8069181+shun095@users.noreply.github.com> Date: Fri, 24 Jan 2025 05:04:45 +0900 Subject: [PATCH 376/453] fix(timer): minutes calculation logic (#12857) --- plugins/timer/timer.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh index d21d59989..6baf1f681 100644 --- a/plugins/timer/timer.plugin.zsh +++ b/plugins/timer/timer.plugin.zsh @@ -6,7 +6,7 @@ __timer_current_time() { } __timer_format_duration() { - local mins=$(printf '%.0f' $(($1 / 60))) + local mins=$(printf '%.0f' $(($(IFS='.' read int dec <<< "$1"; echo $int) / 60))) local secs=$(printf "%.${TIMER_PRECISION:-1}f" $(($1 - 60 * mins))) local duration_str=$(echo "${mins}m${secs}s") local format="${TIMER_FORMAT:-/%d}" From 85c49414926ad86f76d7bad3635f948bb5f883cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 23 Jan 2025 21:06:00 +0100 Subject: [PATCH 377/453] fix(cli)!: remove harmful `--unattended` flag for `omz update` (#12935) Co-authored-by: Carlo Sala --- README.md | 11 +++++++++++ lib/cli.zsh | 15 +++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 58828cf7f..f7455228a 100644 --- a/README.md +++ b/README.md @@ -487,6 +487,17 @@ wait a week?) you just need to run: omz update ``` +> [!NOTE] +> If you want to automate this process in a script, you should call directly the `upgrade` script, like this: +> +> ```sh +> $ZSH/tools/upgrade.sh +> ``` +> +> See more options in the [FAQ: How do I update Oh My Zsh?](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#how-do-i-update-oh-my-zsh). +> +> **USE OF `omz update --unattended` HAS BEEN REMOVED, AS IT HAS SIDE EFFECTS**. + Magic! 🎉 ## Uninstalling Oh My Zsh diff --git a/lib/cli.zsh b/lib/cli.zsh index c63185a3d..aed86e758 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -823,6 +823,13 @@ function _omz::update { return 1 } + # Check if --unattended was passed + [[ "$1" != --unattended ]] || { + _omz::log error "the \`\e[2m--unattended\e[0m\` flag is no longer supported, use the \`\e[2mupgrade.sh\e[0m\` script instead." + _omz::log error "for more information see https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#how-do-i-update-oh-my-zsh" + return 1 + } + local last_commit=$(builtin cd -q "$ZSH"; git rev-parse HEAD 2>/dev/null) [[ $? -eq 0 ]] || { _omz::log error "\`$ZSH\` is not a git directory. Aborting..." @@ -831,11 +838,7 @@ function _omz::update { # Run update script zstyle -s ':omz:update' verbose verbose_mode || verbose_mode=default - if [[ "$1" != --unattended ]]; then - ZSH="$ZSH" command zsh -f "$ZSH/tools/upgrade.sh" -i -v $verbose_mode || return $? - else - ZSH="$ZSH" command zsh -f "$ZSH/tools/upgrade.sh" -v $verbose_mode || return $? - fi + ZSH="$ZSH" command zsh -f "$ZSH/tools/upgrade.sh" -i -v $verbose_mode || return $? # Update last updated file zmodload zsh/datetime @@ -844,7 +847,7 @@ function _omz::update { command rm -rf "$ZSH/log/update.lock" # Restart the zsh session if there were changes - if [[ "$1" != --unattended && "$(builtin cd -q "$ZSH"; git rev-parse HEAD)" != "$last_commit" ]]; then + if [[ "$(builtin cd -q "$ZSH"; git rev-parse HEAD)" != "$last_commit" ]]; then # Old zsh versions don't have ZSH_ARGZERO local zsh="${ZSH_ARGZERO:-${functrace[-1]%:*}}" # Check whether to run a login shell From 5fd2059e5eda17ee07501a21d47189d4b96d6ff3 Mon Sep 17 00:00:00 2001 From: Ken van der Eerden <15888558+Ken-vdE@users.noreply.github.com> Date: Thu, 23 Jan 2025 21:08:55 +0100 Subject: [PATCH 378/453] feat(jira): allow branch name customization (#12850) Co-authored-by: Carlo Sala --- plugins/jira/README.md | 16 ++++++++++++++ plugins/jira/jira.plugin.zsh | 43 +++++++++++++++++++++--------------- 2 files changed, 41 insertions(+), 18 deletions(-) diff --git a/plugins/jira/README.md b/plugins/jira/README.md index 7cfb81b19..19266e7f0 100644 --- a/plugins/jira/README.md +++ b/plugins/jira/README.md @@ -43,6 +43,22 @@ starting with "_": "MP-1234_fix_dashboard". In both these cases, the issue opene This is also checks if the prefix is in the name, and adds it if not, so: "MP-1234" opens the issue "MP-1234", "mp-1234" opens the issue "mp-1234", and "1234" opens the issue "MP-1234". +If your branch naming convention deviates, you can overwrite the jira_branch function to determine and echo the Jira issue key yourself. +Define a function `jira_branch` after sourcing `oh-my-zsh.sh` in your `.zshrc`. +Example: +```zsh +# Determine branch name from naming convention 'type/KEY-123/description'. +function jira_branch() { + # Get name of the branch + issue_arg=$(git rev-parse --abbrev-ref HEAD) + # Strip prefixes like feature/ or bugfix/ + issue_arg=${issue_arg#*/} + # Strip suffixes like /some-branch-description + issue_arg=${issue_arg%%/*} + # Return the value + echo $issue_arg +} +``` #### Debugging usage diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh index 9bcf4cc7b..22e0c82c7 100644 --- a/plugins/jira/jira.plugin.zsh +++ b/plugins/jira/jira.plugin.zsh @@ -17,6 +17,30 @@ jira branch Opens an existing issue matching the current bra EOF } +# If your branch naming convention deviates, you can partially override this plugin function +# to determine the jira issue key based on your formatting. +# See https://github.com/ohmyzsh/ohmyzsh/wiki/Customization#partially-overriding-an-existing-plugin +function jira_branch() { + # Get name of the branch + issue_arg=$(git rev-parse --abbrev-ref HEAD) + # Strip prefixes like feature/ or bugfix/ + issue_arg=${issue_arg##*/} + # Strip suffixes starting with _ + issue_arg=(${(s:_:)issue_arg}) + # If there is only one part, it means that there is a different delimiter. Try with - + if [[ ${#issue_arg[@]} = 1 && ${issue_arg} == *-* ]]; then + issue_arg=(${(s:-:)issue_arg}) + issue_arg="${issue_arg[1]}-${issue_arg[2]}" + else + issue_arg=${issue_arg[1]} + fi + if [[ "${issue_arg:l}" = ${jira_prefix:l}* ]]; then + echo "${issue_arg}" + else + echo "${jira_prefix}${issue_arg}" + fi +} + function jira() { emulate -L zsh local action jira_url jira_prefix @@ -91,24 +115,7 @@ function jira() { # but `branch` is a special case that will parse the current git branch local issue_arg issue if [[ "$action" == "branch" ]]; then - # Get name of the branch - issue_arg=$(git rev-parse --abbrev-ref HEAD) - # Strip prefixes like feature/ or bugfix/ - issue_arg=${issue_arg##*/} - # Strip suffixes starting with _ - issue_arg=(${(s:_:)issue_arg}) - # If there is only one part, it means that there is a different delimiter. Try with - - if [[ ${#issue_arg[@]} = 1 && ${issue_arg} == *-* ]]; then - issue_arg=(${(s:-:)issue_arg}) - issue_arg="${issue_arg[1]}-${issue_arg[2]}" - else - issue_arg=${issue_arg[1]} - fi - if [[ "${issue_arg:l}" = ${jira_prefix:l}* ]]; then - issue="${issue_arg}" - else - issue="${jira_prefix}${issue_arg}" - fi + issue=$(jira_branch) else issue_arg=${(U)action} issue="${jira_prefix}${issue_arg}" From 3bd48b12c8047a12986c79b825ea2451fe5f0ddb Mon Sep 17 00:00:00 2001 From: Eduardo Roberto Date: Fri, 24 Jan 2025 20:39:17 +0000 Subject: [PATCH 379/453] chore: ignore `.zwc` files (#12936) --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 10bd4bebc..a53da3b3e 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,6 @@ log/ # editor configs .vscode .idea + +# zcompile cached files +*.zwc From cc9259d6ad6b1d3cab488cc02f705be1c840c785 Mon Sep 17 00:00:00 2001 From: Marcus Voltolim <9442331+marcusvoltolim@users.noreply.github.com> Date: Fri, 24 Jan 2025 17:40:58 -0300 Subject: [PATCH 380/453] docs(git-auto-fetch): fix typo (#12937) --- plugins/git-auto-fetch/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git-auto-fetch/README.md b/plugins/git-auto-fetch/README.md index e96ab42a3..0d7431bba 100644 --- a/plugins/git-auto-fetch/README.md +++ b/plugins/git-auto-fetch/README.md @@ -18,7 +18,7 @@ You can change the fetch interval in your .zshrc: GIT_AUTO_FETCH_INTERVAL=1200 # in seconds ``` -A log of `git fetch --all` will be saved in `.git/FETCH_LOG`. +A log of `git-fetch-all` will be saved in `.git/FETCH_LOG`. ## Toggle auto-fetch per folder From 9ffc14c3e1de2054fa113e2c7d42cbdac542769b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 26 Jan 2025 14:11:35 +0100 Subject: [PATCH 381/453] chore(deps): bump semver from 3.0.3 to 3.0.4 in /.github/workflows/dependencies (#12938) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependencies/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt index d8149743c..0471ccc4a 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -3,5 +3,5 @@ charset-normalizer==3.4.1 idna==3.10 PyYAML==6.0.2 requests==2.32.3 -semver==3.0.3 +semver==3.0.4 urllib3==2.3.0 From ce9a4a0196a372b153a592ecd61b728cd88bb767 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Sun, 26 Jan 2025 14:21:14 +0100 Subject: [PATCH 382/453] feat(dnf): add `dnf5` completion Closes #12939 --- plugins/dnf/_dnf5 | 570 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 570 insertions(+) create mode 100644 plugins/dnf/_dnf5 diff --git a/plugins/dnf/_dnf5 b/plugins/dnf/_dnf5 new file mode 100644 index 000000000..e194dd5a7 --- /dev/null +++ b/plugins/dnf/_dnf5 @@ -0,0 +1,570 @@ +#compdef dnf5 +# based on dnf-5.2.6.2 + +# utility functions + +_dnf5_helper() { + _call_program specs $service "${(q-)@}" "${(q-)PREFIX}\*" \ + -qC --assumeno --nogpgcheck 2>/dev/null command' '*:: :->cmd_args' && ret=0 + + case $state in + command) _dnf5_commands && ret=0 ;; + cmd_args) _dnf5_subcmds_opts && ret=0 ;; + esac + return ret +} + +_dnf5 "$@" From 33d4db7feeacaf82c8e277555010cd6f5d9f1c7c Mon Sep 17 00:00:00 2001 From: Guspan Tanadi <36249910+guspan-tanadi@users.noreply.github.com> Date: Wed, 29 Jan 2025 20:59:04 +0700 Subject: [PATCH 383/453] docs(ember-cli): fix typo (#12945) --- plugins/ember-cli/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ember-cli/README.md b/plugins/ember-cli/README.md index 419704ade..1532eea9c 100644 --- a/plugins/ember-cli/README.md +++ b/plugins/ember-cli/README.md @@ -29,5 +29,5 @@ plugins=(... ember-cli) - [BilalBudhani](https://github.com/BilalBudhani) - [eubenesa](https://github.com/eubenesa) -- [scottkidder](https://github.com/scottkidder] +- [scottkidder](https://github.com/scottkidder) - [t-sauer](https://www.github.com/t-sauer) From 1c34b0e67d4f1dff36a079f31d7dafe8bcf92f6e Mon Sep 17 00:00:00 2001 From: soemiran Date: Thu, 30 Jan 2025 16:14:04 +0100 Subject: [PATCH 384/453] feat(terraform): support `TF_DATA_DIR` in `tf_prompt_info` (#12949) --- plugins/terraform/terraform.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/terraform/terraform.plugin.zsh b/plugins/terraform/terraform.plugin.zsh index 1c1d1b37e..046fabb03 100644 --- a/plugins/terraform/terraform.plugin.zsh +++ b/plugins/terraform/terraform.plugin.zsh @@ -2,9 +2,9 @@ function tf_prompt_info() { # dont show 'default' workspace in home dir [[ "$PWD" != ~ ]] || return # check if in terraform dir and file exists - [[ -d .terraform && -r .terraform/environment ]] || return + [[ -d "${TF_DATA_DIR:-.terraform}" && -r "${TF_DATA_DIR:-.terraform}/environment" ]] || return - local workspace="$(< .terraform/environment)" + local workspace="$(< "${TF_DATA_DIR:-.terraform}/environment")" echo "${ZSH_THEME_TF_PROMPT_PREFIX-[}${workspace:gs/%/%%}${ZSH_THEME_TF_PROMPT_SUFFIX-]}" } From 2343ad517d3439877e85c03846a38e4b3bf6d984 Mon Sep 17 00:00:00 2001 From: "ohmyzsh[bot]" <54982679+ohmyzsh[bot]@users.noreply.github.com> Date: Sun, 2 Feb 2025 07:50:33 +0100 Subject: [PATCH 385/453] feat(wd): update to v0.9.3 (#12954) Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com> --- .github/dependencies.yml | 2 +- plugins/wd/wd.sh | 53 ++++++++++++++++++++++++++++++++++------ 2 files changed, 47 insertions(+), 8 deletions(-) diff --git a/.github/dependencies.yml b/.github/dependencies.yml index 02995d6cd..46e7727b8 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -30,7 +30,7 @@ dependencies: plugins/wd: repo: mfaerevaag/wd branch: master - version: tag:v0.9.2 + version: tag:v0.9.3 precopy: | set -e rm -r test diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh index 962ad9afa..f8b27828f 100755 --- a/plugins/wd/wd.sh +++ b/plugins/wd/wd.sh @@ -8,7 +8,7 @@ # @github.com/mfaerevaag/wd # version -readonly WD_VERSION=0.9.2 +readonly WD_VERSION=0.9.3 # colors readonly WD_BLUE="\033[96m" @@ -256,20 +256,47 @@ wd_remove() } wd_browse() { + # Check if fzf is installed if ! command -v fzf >/dev/null; then - echo "This functionality requires fzf. Please install fzf first." + wd_print_msg "$WD_RED" "This functionality requires fzf. Please install fzf first." return 1 fi + + # Ensure wd_config_file is properly set + if [[ -z $wd_config_file ]]; then + wd_config_file="${WD_CONFIG:-$HOME/.warprc}" + fi + + # Check if config file exists + if [[ ! -f $wd_config_file ]]; then + wd_print_msg "$WD_RED" "Config file $wd_config_file does not exist. Please create it first." + return 1 + fi + + # Read entries from the config file local entries=("${(@f)$(sed "s:${HOME}:~:g" "$wd_config_file" | awk -F ':' '{print $1 " -> " $2}')}") + if [[ -z $entries ]]; then + wd_print_msg "$WD_YELLOW" "You don't have any warp points to browse" + return 1 + fi + + # Temp file for remove operations local script_path="${${(%):-%x}:h}" local wd_remove_output=$(mktemp "${TMPDIR:-/tmp}/wd.XXXXXXXXXX") + + # Create fzf bindings entries=("All warp points:" "Press enter to select. Press delete to remove" "${entries[@]}") - local fzf_bind="delete:execute(echo {} | awk -F ' -> ' '{print \$1}' | xargs -I {} "$script_path/wd.sh" rm {} > "$wd_remove_output")+abort" + local fzf_bind="delete:execute(echo {} | awk -F ' -> ' '{print \$1}' | xargs -I {} \"$script_path/wd.sh\" rm {} > \"$wd_remove_output\")+abort" + + # Run fzf local selected_entry=$(printf '%s\n' "${entries[@]}" | fzf --height 100% --reverse --header-lines=2 --bind="$fzf_bind") + + # Handle selection if [[ -e $wd_remove_output ]]; then cat "$wd_remove_output" - rm "$wd_remove_output" + rm -f "$wd_remove_output" fi + if [[ -n $selected_entry ]]; then local selected_point="${selected_entry%% ->*}" selected_point=$(echo "$selected_point" | xargs) @@ -278,14 +305,26 @@ wd_browse() { } wd_browse_widget() { - if [[ -e $wd_config_file ]]; then + # Ensure wd_config_file is properly set + if [[ -z $wd_config_file ]]; then + wd_config_file="${WD_CONFIG:-$HOME/.warprc}" + fi + + # Check if config file exists + if [[ ! -f $wd_config_file ]]; then + wd_print_msg "$WD_RED" "Config file $wd_config_file does not exist. Please create it first." + return 1 + fi + + # Call wd_browse to handle the selection wd_browse + + # Restore the zsh buffer and cursor after running wd_browse saved_buffer=$BUFFER saved_cursor=$CURSOR BUFFER= zle redisplay zle accept-line - fi } wd_restore_buffer() { @@ -578,7 +617,7 @@ unset wd_print_msg unset wd_yesorno unset wd_print_usage unset wd_alt_config -unset wd_config_file +#unset wd_config_file do not unset this - breaks keybind unset wd_quiet_mode unset wd_print_version unset wd_force_mode From 2b547d113b7e55a556b695c9372f1beb721efd67 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 2 Feb 2025 13:38:22 +0100 Subject: [PATCH 386/453] chore(deps): bump certifi in /.github/workflows/dependencies (#12955) Bumps [certifi](https://github.com/certifi/python-certifi) from 2024.12.14 to 2025.1.31. - [Commits](https://github.com/certifi/python-certifi/compare/2024.12.14...2025.01.31) --- updated-dependencies: - dependency-name: certifi dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependencies/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt index 0471ccc4a..910db7bac 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -1,4 +1,4 @@ -certifi==2024.12.14 +certifi==2025.1.31 charset-normalizer==3.4.1 idna==3.10 PyYAML==6.0.2 From db32c6ccce91e0b36873c8bfccd1e40f452a2060 Mon Sep 17 00:00:00 2001 From: Daniel Mensinger Date: Tue, 4 Feb 2025 13:37:02 +0100 Subject: [PATCH 387/453] fix(mvn): handle directories in `` (#12957) --- plugins/mvn/mvn.plugin.zsh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index a569a87fa..7bffce36e 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -101,8 +101,14 @@ function listMavenCompletions { new_file="../pom.xml" fi - # if file doesn't exist break file="${file:h}/${new_file}" + + # if the file points to a directory, assume it is a pom.xml in that directory + if [[ -d "$file" ]]; then + file="${file}/pom.xml" + fi + + # if file doesn't exist break if ! [[ -e "$file" ]]; then break fi From 4d9d346718caa6efdf6f350ed803e70d34fc6577 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Wed, 12 Feb 2025 20:15:25 +0100 Subject: [PATCH 388/453] feat(asdf): support asdf v0.16 ahead Co-authored-by: Valgard Trontheim Closes #12964 Closes #12967 --- plugins/asdf/asdf.plugin.zsh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/plugins/asdf/asdf.plugin.zsh b/plugins/asdf/asdf.plugin.zsh index 7635d20c3..4367e8ca3 100644 --- a/plugins/asdf/asdf.plugin.zsh +++ b/plugins/asdf/asdf.plugin.zsh @@ -1,3 +1,21 @@ +if (( $+commands[asdf] )); then + export ASDF_DATA_DIR="${ASDF_DATA_DIR:-$HOME/.asdf}" + path=("$ASDF_DATA_DIR/shims" $path) + + # If the completion file doesn't exist yet, we need to autoload it and + # bind it to `asdf`. Otherwise, compinit will have already done that. + if [[ ! -f "$ZSH_CACHE_DIR/completions/_asdf" ]]; then + typeset -g -A _comps + autoload -Uz _asdf + _comps[asdf]=_asdf + fi + asdf completion zsh >| "$ZSH_CACHE_DIR/completions/_asdf" &| + + return +fi + +# TODO:(2025-02-12): remove deprecated asdf <0.16 code + # Find where asdf should be installed ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}" ASDF_COMPLETIONS="$ASDF_DIR/completions" From 8074eb8b46d20a2f3ad2b99201388900a2e33450 Mon Sep 17 00:00:00 2001 From: Dennis Dashkevich Date: Wed, 12 Feb 2025 22:24:56 +0300 Subject: [PATCH 389/453] fix(chruby): update brew sourcing for Apple Silicon (#12941) Co-authored-by: Carlo Sala --- plugins/chruby/chruby.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/chruby/chruby.plugin.zsh b/plugins/chruby/chruby.plugin.zsh index 1210897c4..06afef189 100644 --- a/plugins/chruby/chruby.plugin.zsh +++ b/plugins/chruby/chruby.plugin.zsh @@ -22,6 +22,8 @@ _source-from-homebrew() { # check default brew prefix if [[ -h /usr/local/opt/chruby ]];then _brew_prefix="/usr/local/opt/chruby" + elif [[ -h /opt/homebrew/opt/chruby ]]; then + _brew_prefix="/opt/homebrew/opt/chruby" else # ok , it is not default prefix # this call to brew is expensive ( about 400 ms ), so at least let's make it only once From 0e99f402cd5a335042559396ae300a7668bac933 Mon Sep 17 00:00:00 2001 From: Stephen Gelman Date: Wed, 12 Feb 2025 13:33:35 -0600 Subject: [PATCH 390/453] feat(agnoster): add color config and add some git stuff (#12505) Co-authored-by: Kilobyte22 Co-authored-by: Carlo Sala --- themes/agnoster.zsh-theme | 147 ++++++++++++++++++++++++++++++-------- 1 file changed, 118 insertions(+), 29 deletions(-) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index c2a542163..67db2cf46 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -39,6 +39,63 @@ case ${SOLARIZED_THEME:-dark} in *) CURRENT_FG='black';; esac +### Theme Configuration Initialization +# +# Override these settings in your ~/.zshrc + +# Current working directory +: ${AGNOSTER_DIR_FG:=${CURRENT_FG}} +: ${AGNOSTER_DIR_BG:=blue} + +# user@host +: ${AGNOSTER_CONTEXT_FG:=default} +: ${AGNOSTER_CONTEXT_BG:=black} + +# Git related +: ${AGNOSTER_GIT_CLEAN_FG:=${CURRENT_FG}} +: ${AGNOSTER_GIT_CLEAN_BG:=green} +: ${AGNOSTER_GIT_DIRTY_FG:=black} +: ${AGNOSTER_GIT_DIRTY_BG:=yellow} + +# Bazaar related +: ${AGNOSTER_BZR_CLEAN_FG:=${CURRENT_FG}} +: ${AGNOSTER_BZR_CLEAN_BG:=green} +: ${AGNOSTER_BZR_DIRTY_FG:=black} +: ${AGNOSTER_BZR_DIRTY_BG:=yellow} + +# Mercurial related +: ${AGNOSTER_HG_NEWFILE_FG:=white} +: ${AGNOSTER_HG_NEWFILE_BG:=red} +: ${AGNOSTER_HG_CHANGED_FG:=black} +: ${AGNOSTER_HG_CHANGED_BG:=yellow} +: ${AGNOSTER_HG_CLEAN_FG:=${CURRENT_FG}} +: ${AGNOSTER_HG_CLEAN_BG:=green} + +# VirtualEnv colors +: ${AGNOSTER_VENV_FG:=black} +: ${AGNOSTER_VENV_BG:=blue} + +# AWS Profile colors +: ${AGNOSTER_AWS_PROD_FG:=yellow} +: ${AGNOSTER_AWS_PROD_BG:=red} +: ${AGNOSTER_AWS_FG:=black} +: ${AGNOSTER_AWS_BG:=green} + +# Status symbols +: ${AGNOSTER_STATUS_RETVAL_FG:=red} +: ${AGNOSTER_STATUS_ROOT_FG:=yellow} +: ${AGNOSTER_STATUS_JOB_FG:=cyan} +: ${AGNOSTER_STATUS_BG:=black} + +## Non-Color settings - set to 'true' to enable +# Show the actual numeric return value rather than a cross symbol. +: ${AGNOSTER_STATUS_RETVAL_NUMERIC:=false} +# Show git working dir in the style "/git/root   master  relative/dir" instead of "/git/root/relative/dir   master" +: ${AGNOSTER_GIT_INLINE:=false} +# Show the git branch status in the prompt rather than the generic branch symbol +: ${AGNOSTER_GIT_BRANCH_STATUS:=true} + + # Special Powerline characters () { @@ -83,16 +140,36 @@ prompt_end() { CURRENT_BG='' } +git_toplevel() { + local repo_root=$(git rev-parse --show-toplevel) + if [[ $repo_root = '' ]]; then + # We are in a bare repo. Use git dir as root + repo_root=$(git rev-parse --git-dir) + if [[ $repo_root = '.' ]]; then + repo_root=$PWD + fi + fi + echo -n $repo_root +} + ### Prompt components # Each component will draw itself, and hide itself if no information needs to be shown # Context: user@hostname (who am I and where am I) prompt_context() { if [[ "$USERNAME" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then - prompt_segment black default "%(!.%{%F{yellow}%}.)%n@%m" + prompt_segment "$AGNOSTER_CONTEXT_BG" "$AGNOSTER_CONTEXT_FG" "%(!.%{%F{$AGNOSTER_STATUS_ROOT_FG}%}.)%n@%m" fi } +prompt_git_relative() { + local repo_root=$(git_toplevel) + local path_in_repo=$(pwd | sed "s/^$(echo "$repo_root" | sed 's:/:\\/:g;s/\$/\\$/g')//;s:^/::;s:/$::;") + if [[ $path_in_repo != '' ]]; then + prompt_segment "$AGNOSTER_DIR_BG" "$AGNOSTER_DIR_FG" "$path_in_repo" + fi; +} + # Git: branch/detached head, dirty status prompt_git() { (( $+commands[git] )) || return @@ -113,20 +190,22 @@ prompt_git() { ref="◈ $(command git describe --exact-match --tags HEAD 2> /dev/null)" || \ ref="➦ $(command git rev-parse --short HEAD 2> /dev/null)" if [[ -n $dirty ]]; then - prompt_segment yellow black + prompt_segment "$AGNOSTER_GIT_DIRTY_BG" "$AGNOSTER_GIT_DIRTY_FG" else - prompt_segment green $CURRENT_FG + prompt_segment "$AGNOSTER_GIT_CLEAN_BG" "$AGNOSTER_GIT_CLEAN_FG" fi - local ahead behind - ahead=$(command git log --oneline @{upstream}.. 2>/dev/null) - behind=$(command git log --oneline ..@{upstream} 2>/dev/null) - if [[ -n "$ahead" ]] && [[ -n "$behind" ]]; then - PL_BRANCH_CHAR=$'\u21c5' - elif [[ -n "$ahead" ]]; then - PL_BRANCH_CHAR=$'\u21b1' - elif [[ -n "$behind" ]]; then - PL_BRANCH_CHAR=$'\u21b0' + if [[ $AGNOSTER_GIT_BRANCH_STATUS == 'true' ]]; then + local ahead behind + ahead=$(command git log --oneline @{upstream}.. 2>/dev/null) + behind=$(command git log --oneline ..@{upstream} 2>/dev/null) + if [[ -n "$ahead" ]] && [[ -n "$behind" ]]; then + PL_BRANCH_CHAR=$'\u21c5' + elif [[ -n "$ahead" ]]; then + PL_BRANCH_CHAR=$'\u21b1' + elif [[ -n "$behind" ]]; then + PL_BRANCH_CHAR=$'\u21b0' + fi fi if [[ -e "${repo_path}/BISECT_LOG" ]]; then @@ -149,6 +228,7 @@ prompt_git() { zstyle ':vcs_info:*' actionformats ' %u%c' vcs_info echo -n "${${ref:gs/%/%%}/refs\/heads\//$PL_BRANCH_CHAR }${vcs_info_msg_0_%% }${mode}" + [[ $AGNOSTER_GIT_INLINE == 'true' ]] && prompt_git_relative fi } @@ -168,12 +248,12 @@ prompt_bzr() { status_all=$(echo -n "$bzr_status" | head -n1 | wc -m) revision=${$(command bzr log -r-1 --log-format line | cut -d: -f1):gs/%/%%} if [[ $status_mod -gt 0 ]] ; then - prompt_segment yellow black "bzr@$revision ✚" + prompt_segment "$AGNOSTER_BZR_DIRTY_BG" "$AGNOSTER_BZR_DIRTY_FG" "bzr@$revision ✚" else if [[ $status_all -gt 0 ]] ; then - prompt_segment yellow black "bzr@$revision" + prompt_segment "$AGNOSTER_BZR_DIRTY_BG" "$AGNOSTER_BZR_DIRTY_FG" "bzr@$revision" else - prompt_segment green black "bzr@$revision" + prompt_segment "$AGNOSTER_BZR_CLEAN_BG" "$AGNOSTER_BZR_CLEAN_FG" "bzr@$revision" fi fi fi @@ -186,15 +266,15 @@ prompt_hg() { if $(command hg prompt >/dev/null 2>&1); then if [[ $(command hg prompt "{status|unknown}") = "?" ]]; then # if files are not added - prompt_segment red white + prompt_segment "$AGNOSTER_HG_NEWFILE_BG" "$AGNOSTER_HG_NEWFILE_FG" st='±' elif [[ -n $(command hg prompt "{status|modified}") ]]; then # if any modification - prompt_segment yellow black + prompt_segment "$AGNOSTER_HG_CHANGED_BG" "$AGNOSTER_HG_CHANGED_FG" st='±' else # if working copy is clean - prompt_segment green $CURRENT_FG + prompt_segment "$AGNOSTER_HG_CLEAN_BG" "$AGNOSTER_HG_CLEAN_FG" fi echo -n ${$(command hg prompt "☿ {rev}@{branch}"):gs/%/%%} $st else @@ -202,13 +282,13 @@ prompt_hg() { rev=$(command hg id -n 2>/dev/null | sed 's/[^-0-9]//g') branch=$(command hg id -b 2>/dev/null) if command hg st | command grep -q "^\?"; then - prompt_segment red black + prompt_segment "$AGNOSTER_HG_NEWFILE_BG" "$AGNOSTER_HG_NEWFILE_FG" st='±' elif command hg st | command grep -q "^[MA]"; then - prompt_segment yellow black + prompt_segment "$AGNOSTER_HG_CHANGED_BG" "$AGNOSTER_HG_CHANGED_FG" st='±' else - prompt_segment green $CURRENT_FG + prompt_segment "$AGNOSTER_HG_CLEAN_BG" "$AGNOSTER_HG_CLEAN_FG" fi echo -n "☿ ${rev:gs/%/%%}@${branch:gs/%/%%}" $st fi @@ -217,13 +297,18 @@ prompt_hg() { # Dir: current working directory prompt_dir() { - prompt_segment blue $CURRENT_FG '%~' + if [[ $AGNOSTER_GIT_INLINE == 'true' ]] && $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then + # Git repo and inline path enabled, hence only show the git root + prompt_segment "$AGNOSTER_DIR_BG" "$AGNOSTER_DIR_FG" "$(git_toplevel | sed "s:^$HOME:~:")" + else + prompt_segment "$AGNOSTER_DIR_BG" "$AGNOSTER_DIR_FG" '%~' + fi } # Virtualenv: current working virtualenv prompt_virtualenv() { if [[ -n "$VIRTUAL_ENV" && -n "$VIRTUAL_ENV_DISABLE_PROMPT" ]]; then - prompt_segment blue black "(${VIRTUAL_ENV:t:gs/%/%%})" + prompt_segment "$AGNOSTER_VENV_BG" "$AGNOSTER_VENV_FG" "(${VIRTUAL_ENV:t:gs/%/%%})" fi } @@ -234,11 +319,15 @@ prompt_virtualenv() { prompt_status() { local -a symbols - [[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}✘" - [[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡" - [[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙" + if [[ $AGNOSTER_STATUS_RETVAL_NUMERIC == 'true' ]]; then + [[ $RETVAL -ne 0 ]] && symbols+="%{%F{$AGNOSTER_STATUS_RETVAL_FG}%}$RETVAL" + else + [[ $RETVAL -ne 0 ]] && symbols+="%{%F{$AGNOSTER_STATUS_RETVAL_FG}%}✘" + fi + [[ $UID -eq 0 ]] && symbols+="%{%F{$AGNOSTER_STATUS_ROOT_FG}%}⚡" + [[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{$AGNOSTER_STATUS_JOB_FG}%}⚙" - [[ -n "$symbols" ]] && prompt_segment black default "$symbols" + [[ -n "$symbols" ]] && prompt_segment "$AGNOSTER_STATUS_BG" default "$symbols" } #AWS Profile: @@ -249,8 +338,8 @@ prompt_status() { prompt_aws() { [[ -z "$AWS_PROFILE" || "$SHOW_AWS_PROMPT" = false ]] && return case "$AWS_PROFILE" in - *-prod|*production*) prompt_segment red yellow "AWS: ${AWS_PROFILE:gs/%/%%}" ;; - *) prompt_segment green black "AWS: ${AWS_PROFILE:gs/%/%%}" ;; + *-prod|*production*) prompt_segment "$AGNOSTER_AWS_PROD_BG" "$AGNOSTER_AWS_PROD_FG" "AWS: ${AWS_PROFILE:gs/%/%%}" ;; + *) prompt_segment "$AGNOSTER_AWS_BG" "$AGNOSTER_AWS_FG" "AWS: ${AWS_PROFILE:gs/%/%%}" ;; esac } From 7d32e7fc3fb56032252548a690744a26c3ac3059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 13 Feb 2025 12:22:23 +0100 Subject: [PATCH 391/453] fix(updater): detect p10k instant prompt (#12971) Fixes #12781 --- tools/check_for_upgrade.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index 1ecab5c0b..35391ea70 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -27,7 +27,7 @@ zstyle -s ':omz:update' mode update_mode || { # - $ZSH is not a git repository if [[ "$update_mode" = disabled ]] \ || [[ ! -w "$ZSH" || ! -O "$ZSH" ]] \ - || [[ ! -t 1 ]] \ + || [[ ! -t 1 && ${POWERLEVEL9K_INSTANT_PROMPT:-off} == off ]] \ || ! command git --version 2>&1 >/dev/null \ || (builtin cd -q "$ZSH"; ! command git rev-parse --is-inside-work-tree &>/dev/null); then unset update_mode @@ -112,6 +112,11 @@ function update_ohmyzsh() { local verbose_mode zstyle -s ':omz:update' verbose verbose_mode || verbose_mode=default + # Force verbose mode to silent if p10k instant prompt is enabled + if [[ ${POWERLEVEL9K_INSTANT_PROMPT:-off} != "off" ]]; then + verbose_mode=silent + fi + if [[ "$update_mode" != background-alpha ]] \ && LANG= ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh" -i -v $verbose_mode; then update_last_updated_file From 92da3108b52be506dc1334e8f0dc67c5d1c13d57 Mon Sep 17 00:00:00 2001 From: Adrien Plazas Date: Fri, 14 Feb 2025 10:18:01 +0100 Subject: [PATCH 392/453] fix(agnoster): print white text over black (#12525) --- themes/agnoster.zsh-theme | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 67db2cf46..b48bac56a 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -48,7 +48,7 @@ esac : ${AGNOSTER_DIR_BG:=blue} # user@host -: ${AGNOSTER_CONTEXT_FG:=default} +: ${AGNOSTER_CONTEXT_FG:=white} : ${AGNOSTER_CONTEXT_BG:=black} # Git related @@ -85,6 +85,7 @@ esac : ${AGNOSTER_STATUS_RETVAL_FG:=red} : ${AGNOSTER_STATUS_ROOT_FG:=yellow} : ${AGNOSTER_STATUS_JOB_FG:=cyan} +: ${AGNOSTER_STATUS_FG:=white} : ${AGNOSTER_STATUS_BG:=black} ## Non-Color settings - set to 'true' to enable @@ -327,7 +328,7 @@ prompt_status() { [[ $UID -eq 0 ]] && symbols+="%{%F{$AGNOSTER_STATUS_ROOT_FG}%}⚡" [[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{$AGNOSTER_STATUS_JOB_FG}%}⚙" - [[ -n "$symbols" ]] && prompt_segment "$AGNOSTER_STATUS_BG" default "$symbols" + [[ -n "$symbols" ]] && prompt_segment "$AGNOSTER_STATUS_BG" "$AGNOSTER_STATUS_FG" "$symbols" } #AWS Profile: From 6e7ac0544e71c7b777746cb50f70de68c6495b86 Mon Sep 17 00:00:00 2001 From: tuzi3040 <28290621+tuzi3040@users.noreply.github.com> Date: Wed, 19 Feb 2025 19:37:18 +0800 Subject: [PATCH 393/453] fix(agnoster): print white text over black for light theme only (#12983) --- themes/agnoster.zsh-theme | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index b48bac56a..adeffe8c2 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -35,8 +35,14 @@ CURRENT_BG='NONE' case ${SOLARIZED_THEME:-dark} in - light) CURRENT_FG='white';; - *) CURRENT_FG='black';; + light) + CURRENT_FG='white' + CURRENT_DEFAULT_FG='white' + ;; + *) + CURRENT_FG='black' + CURRENT_DEFAULT_FG='default' + ;; esac ### Theme Configuration Initialization @@ -48,7 +54,7 @@ esac : ${AGNOSTER_DIR_BG:=blue} # user@host -: ${AGNOSTER_CONTEXT_FG:=white} +: ${AGNOSTER_CONTEXT_FG:=${CURRENT_DEFAULT_FG}} : ${AGNOSTER_CONTEXT_BG:=black} # Git related @@ -85,7 +91,7 @@ esac : ${AGNOSTER_STATUS_RETVAL_FG:=red} : ${AGNOSTER_STATUS_ROOT_FG:=yellow} : ${AGNOSTER_STATUS_JOB_FG:=cyan} -: ${AGNOSTER_STATUS_FG:=white} +: ${AGNOSTER_STATUS_FG:=${CURRENT_DEFAULT_FG}} : ${AGNOSTER_STATUS_BG:=black} ## Non-Color settings - set to 'true' to enable From 30e516a3aa47d90b5f507d5ddacb1b9b69567975 Mon Sep 17 00:00:00 2001 From: nasso <11479594+nasso@users.noreply.github.com> Date: Mon, 3 Mar 2025 17:15:43 +0100 Subject: [PATCH 394/453] feat(jj): add jujutsu plugin (#12292) --- plugins/jj/README.md | 89 ++++++++++++++++++++++++++++++++++++++++ plugins/jj/jj.plugin.zsh | 53 ++++++++++++++++++++++++ 2 files changed, 142 insertions(+) create mode 100644 plugins/jj/README.md create mode 100644 plugins/jj/jj.plugin.zsh diff --git a/plugins/jj/README.md b/plugins/jj/README.md new file mode 100644 index 000000000..cd43ed11b --- /dev/null +++ b/plugins/jj/README.md @@ -0,0 +1,89 @@ +# jj - Jujutsu CLI + +This plugin provides autocompletion for [jj](https://martinvonz.github.io/jj). + +To use it, add `jj` to the plugins array of your zshrc file: + +```zsh +plugins=(... jj) +``` + +## Aliases + +| Alias | Command | +| ------ | ----------------------------- | +| jjc | `jj commit` | +| jjcmsg | `jj commit --message` | +| jjd | `jj diff` | +| jjdmsg | `jj desc --message` | +| jjds | `jj desc` | +| jje | `jj edit` | +| jjgcl | `jj git clone` | +| jjgf | `jj git fetch` | +| jjgp | `jj git push` | +| jjl | `jj log` | +| jjla | `jj log -r "all()"` | +| jjn | `jj new` | +| jjrb | `jj rebase` | +| jjrs | `jj restore` | +| jjrt | `cd "$(jj root \|\| echo .)"` | +| jjsp | `jj split` | +| jjsq | `jj squash` | + +## Prompt usage + +Because `jj` has a very powerful [template syntax](https://martinvonz.github.io/jj/latest/templates/), this +plugin only exposes a convenience function `jj_prompt_template` to read information from the current change. +It is basically the same as `jj log --no-graph -r @ -T $1`: + +```sh +_my_theme_jj_info() { + jj_prompt_template 'self.change_id().shortest(3)' +} + +PROMPT='$(_my_theme_jj_info) $' +``` + +`jj_prompt_template` escapes `%` signs in the output. Use `jj_prompt_template_raw` if you don't want that +(e.g. to colorize the output). + +However, because `jj` can be used inside a Git repository, some themes might clash with it. Generally, you can +fix it with a wrapper function that tries `jj` first and then falls back to `git` if it didn't work: + +```sh +_my_theme_vcs_info() { + jj_prompt_template 'self.change_id().shortest(3)' \ + || git_prompt_info +} + +PROMPT='$(_my_theme_vcs_info) $' +``` + +You can find an example +[here](https://github.com/nasso/omzsh/blob/e439e494f22f4fd4ef1b6cb64626255f4b341c1b/themes/sunakayu.zsh-theme). + +### Performance + +Sometimes `jj` can be slower than `git`. + +If you feel slowdowns, consider using the following: + +``` +zstyle :omz:plugins:jj ignore-working-copy yes +``` + +This will add `--ignore-working-copy` to all `jj` commands executed by your prompt. The downside here is that +your prompt might be out-of-sync until the next time `jj` gets a chance to _not_ ignore the working copy (i.e. +you manually run a `jj` command). + +If you prefer to keep your prompt always up-to-date but still don't want to _feel_ the slowdown, you can make +your prompt asynchronous. This plugin doesn't do this automatically so you'd have to hack your theme a bit for +that. + +## See Also + +- [martinvonz/jj](https://github.com/martinvonz/jj) + +## Contributors + +- [nasso](https://github.com/nasso) - Plugin Author diff --git a/plugins/jj/jj.plugin.zsh b/plugins/jj/jj.plugin.zsh new file mode 100644 index 000000000..9f683923d --- /dev/null +++ b/plugins/jj/jj.plugin.zsh @@ -0,0 +1,53 @@ +# if jj is not found, don't do the rest of the script +if (( ! $+commands[jj] )); then + return +fi + +# If the completion file doesn't exist yet, we need to autoload it and +# bind it to `jj`. Otherwise, compinit will have already done that. +if [[ ! -f "$ZSH_CACHE_DIR/completions/_jj" ]]; then + typeset -g -A _comps + autoload -Uz _jj + _comps[jj]=_jj +fi + +jj util completion zsh >| "$ZSH_CACHE_DIR/completions/_jj" &| + +function __jj_prompt_jj() { + local -a flags + flags=("--no-pager") + if zstyle -t ':omz:plugins:jj' ignore-working-copy; then + flags+=("--ignore-working-copy") + fi + command jj $flags "$@" +} + +# convenience functions for themes +function jj_prompt_template_raw() { + __jj_prompt_jj log --no-graph -r @ -T "$@" 2> /dev/null +} + +function jj_prompt_template() { + local out + out=$(jj_prompt_template_raw "$@") || return 1 + echo "${out:gs/%/%%}" +} + +# Aliases (sorted alphabetically) +alias jjc='jj commit' +alias jjcmsg='jj commit --message' +alias jjd='jj diff' +alias jjdmsg='jj desc --message' +alias jjds='jj desc' +alias jje='jj edit' +alias jjgcl='jj git clone' +alias jjgf='jj git fetch' +alias jjgp='jj git push' +alias jjl='jj log' +alias jjla='jj log -r "all()"' +alias jjn='jj new' +alias jjrb='jj rebase' +alias jjrs='jj restore' +alias jjrt='cd "$(jj root || echo .)"' +alias jjsp='jj split' +alias jjsq='jj squash' From 1c2127727af0ac452292f844ee32306f12906d03 Mon Sep 17 00:00:00 2001 From: nasso <11479594+nasso@users.noreply.github.com> Date: Tue, 4 Mar 2025 11:46:29 +0100 Subject: [PATCH 395/453] feat(jj): enable dynamic completion (#13003) --- plugins/jj/jj.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/jj/jj.plugin.zsh b/plugins/jj/jj.plugin.zsh index 9f683923d..06c04958b 100644 --- a/plugins/jj/jj.plugin.zsh +++ b/plugins/jj/jj.plugin.zsh @@ -11,7 +11,7 @@ if [[ ! -f "$ZSH_CACHE_DIR/completions/_jj" ]]; then _comps[jj]=_jj fi -jj util completion zsh >| "$ZSH_CACHE_DIR/completions/_jj" &| +COMPLETE=zsh jj >| "$ZSH_CACHE_DIR/completions/_jj" &| function __jj_prompt_jj() { local -a flags From f97e871c33da57d20e1b0411da6b1674126192a9 Mon Sep 17 00:00:00 2001 From: Gary Wei <33930674+garywei944@users.noreply.github.com> Date: Tue, 11 Mar 2025 01:51:15 -0700 Subject: [PATCH 396/453] fix(conda): correct typo in alias parameter (#13010) Closes #13009 --- plugins/conda/conda.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/conda/conda.plugin.zsh b/plugins/conda/conda.plugin.zsh index a93ceeb95..7a130ba7b 100644 --- a/plugins/conda/conda.plugin.zsh +++ b/plugins/conda/conda.plugin.zsh @@ -14,8 +14,8 @@ alias cnl='conda list' alias cnle='conda list --export' alias cnles='conda list --explicit > spec-file.txt' alias cnr='conda remove' -alias cnrn='conda remove -y -all -n' -alias cnrp='conda remove -y -all -p' +alias cnrn='conda remove -y --all -n' +alias cnrp='conda remove -y --all -p' alias cnry='conda remove -y' alias cnsr='conda search' alias cnu='conda update' From 34e9830dd399b6e068e41907def76a7e97653219 Mon Sep 17 00:00:00 2001 From: Linda TJ Date: Thu, 20 Mar 2025 11:22:12 +0100 Subject: [PATCH 397/453] fix(ranq-quote): use https for quote retrieval (#13021) --- plugins/rand-quote/rand-quote.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/rand-quote/rand-quote.plugin.zsh b/plugins/rand-quote/rand-quote.plugin.zsh index 23c21dc8f..1eda54caa 100644 --- a/plugins/rand-quote/rand-quote.plugin.zsh +++ b/plugins/rand-quote/rand-quote.plugin.zsh @@ -8,7 +8,7 @@ function quote { # Get random quote data local data - data="$(command curl -s --connect-timeout 2 "http://www.quotationspage.com/random.php" \ + data="$(command curl -s --connect-timeout 2 "https://www.quotationspage.com/random.php" \ | iconv -c -f ISO-8859-1 -t UTF-8 \ | command grep -a -m 1 'dt class="quote"')" From bea0dd2ca02cdb2c6cc88f2478aafe87a743f42a Mon Sep 17 00:00:00 2001 From: Robert Dober Date: Thu, 20 Mar 2025 11:30:05 +0100 Subject: [PATCH 398/453] feat(mix): autocomplete `format` command (#13012) --- plugins/mix/_mix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/mix/_mix b/plugins/mix/_mix index 656c7fe19..346fc8c4f 100644 --- a/plugins/mix/_mix +++ b/plugins/mix/_mix @@ -146,6 +146,16 @@ case $state in (help) _arguments ':feature:__task_list' ;; + (format) + _arguments -C \ + '--check-formatted' \ + '--dot-formatter' \ + '--dry-run' \ + '--force' \ + '--migrate' \ + '--no-exit' \ + '*::file:_files' + ;; (test) _files ;; From da2510c199edfd3fd28d6297b38ff129b20d3d91 Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Thu, 20 Mar 2025 11:41:27 -0700 Subject: [PATCH 399/453] fix(nicoluaj): avoid overriding customization params (#12859) --- themes/nicoulaj.zsh-theme | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) mode change 100644 => 100755 themes/nicoulaj.zsh-theme diff --git a/themes/nicoulaj.zsh-theme b/themes/nicoulaj.zsh-theme old mode 100644 new mode 100755 index 685cd1ade..6435c3833 --- a/themes/nicoulaj.zsh-theme +++ b/themes/nicoulaj.zsh-theme @@ -12,12 +12,12 @@ # ------------------------------------------------------------------------------ # Customizable parameters. -PROMPT_PATH_MAX_LENGTH=30 -PROMPT_DEFAULT_END=❯ -PROMPT_ROOT_END=❯❯❯ -PROMPT_SUCCESS_COLOR=$FG[071] -PROMPT_FAILURE_COLOR=$FG[124] -PROMPT_VCS_INFO_COLOR=$FG[242] +PROMPT_PATH_MAX_LENGTH=${PROMPT_PATH_MAX_LENGTH:-30} +PROMPT_DEFAULT_END=${PROMPT_DEFAULT_END:-❯} +PROMPT_ROOT_END=${PROMPT_ROOT_END:-❯❯❯} +PROMPT_SUCCESS_COLOR=${PROMPT_SUCCESS_COLOR:-$FG[071]} +PROMPT_FAILURE_COLOR=${PROMPT_FAILURE_COLOR:-$FG[124]} +PROMPT_VCS_INFO_COLOR=${PROMPT_VCS_INFO_COLOR:-$FG[242]} # Set required options. setopt promptsubst From 6591606d566cb37d53a7b996f0ff05a59998dc16 Mon Sep 17 00:00:00 2001 From: Ken van der Eerden <15888558+Ken-vdE@users.noreply.github.com> Date: Thu, 20 Mar 2025 19:43:08 +0100 Subject: [PATCH 400/453] feat(jira): add `project` command to open project (#12851) --- plugins/jira/README.md | 1 + plugins/jira/_jira | 1 + plugins/jira/jira.plugin.zsh | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/plugins/jira/README.md b/plugins/jira/README.md index 19266e7f0..f6e2e26f4 100644 --- a/plugins/jira/README.md +++ b/plugins/jira/README.md @@ -26,6 +26,7 @@ This plugin supplies one command, `jira`, through which all its features are exp | `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 project ABC` | Opens JIRA project summary | | `jira dashboard [rapid_view]` | Opens your JIRA dashboard | | `jira mine` | Queries for your own issues | | `jira tempo` | Opens your JIRA Tempo | diff --git a/plugins/jira/_jira b/plugins/jira/_jira index 5f7dcd09d..617a3e501 100644 --- a/plugins/jira/_jira +++ b/plugins/jira/_jira @@ -5,6 +5,7 @@ local -a _1st_arguments _1st_arguments=( 'new:create a new issue' 'mine:open my issues' + 'project:open the project' 'dashboard:open the dashboard' 'tempo:open the tempo' 'reported:search for issues reported by a user' diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh index 22e0c82c7..0c90544d5 100644 --- a/plugins/jira/jira.plugin.zsh +++ b/plugins/jira/jira.plugin.zsh @@ -8,6 +8,7 @@ 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 project ABC Opens JIRA project summary jira dashboard [rapid_view] Opens your JIRA dashboard jira mine Queries for your own issues jira tempo Opens your JIRA Tempo @@ -88,6 +89,9 @@ function jira() { elif [[ "$action" == "mine" ]]; then echo "Opening my issues" open_command "${jira_url}/issues/?filter=-1" + elif [[ "$action" == "project" ]]; then + echo "Opening project" + open_command "${jira_url}/jira/software/c/projects/${2}/summary" elif [[ "$action" == "dashboard" ]]; then echo "Opening dashboard" if [[ "$JIRA_RAPID_BOARD" == "true" ]]; then From 070f823a84642ba93b844fa80382e8375ca941c8 Mon Sep 17 00:00:00 2001 From: bretello Date: Thu, 20 Mar 2025 19:44:01 +0100 Subject: [PATCH 401/453] feat(uv): alias `uv` with `noglob` (#12866) --- plugins/uv/uv.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/uv/uv.plugin.zsh b/plugins/uv/uv.plugin.zsh index f1ad37e15..abcbc117e 100644 --- a/plugins/uv/uv.plugin.zsh +++ b/plugins/uv/uv.plugin.zsh @@ -3,6 +3,8 @@ if (( ! ${+commands[uv]} )); then return fi +alias uv="noglob uv" + alias uva='uv add' alias uvexp='uv export --format requirements-txt --no-hashes --output-file requirements.txt --quiet' alias uvl='uv lock' From 85d60d489c54150cc9df5cef0504f6af90638fbd Mon Sep 17 00:00:00 2001 From: Kristijan Date: Fri, 21 Mar 2025 05:47:01 +1100 Subject: [PATCH 402/453] feat(dirhistory): add support for ghostty (#12868) --- plugins/dirhistory/dirhistory.plugin.zsh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/dirhistory/dirhistory.plugin.zsh b/plugins/dirhistory/dirhistory.plugin.zsh index 8d67c6188..8d66de7f5 100644 --- a/plugins/dirhistory/dirhistory.plugin.zsh +++ b/plugins/dirhistory/dirhistory.plugin.zsh @@ -137,6 +137,7 @@ for keymap in emacs vicmd viins; do case "$TERM_PROGRAM" in Apple_Terminal) bindkey -M $keymap "^[b" dirhistory_zle_dirhistory_back ;; # Terminal.app iTerm.app) bindkey -M $keymap "^[^[[D" dirhistory_zle_dirhistory_back ;; # iTerm2 + ghostty) bindkey -M $keymap "^[b" dirhistory_zle_dirhistory_back ;; # ghostty esac if (( ${+terminfo[kcub1]} )); then @@ -152,6 +153,7 @@ for keymap in emacs vicmd viins; do case "$TERM_PROGRAM" in Apple_Terminal) bindkey -M $keymap "^[f" dirhistory_zle_dirhistory_future ;; # Terminal.app iTerm.app) bindkey -M $keymap "^[^[[C" dirhistory_zle_dirhistory_future ;; # iTerm2 + ghostty) bindkey -M $keymap "^[f" dirhistory_zle_dirhistory_future ;; # ghostty esac if (( ${+terminfo[kcuf1]} )); then @@ -200,6 +202,7 @@ for keymap in emacs vicmd viins; do case "$TERM_PROGRAM" in Apple_Terminal) bindkey -M $keymap "^[[A" dirhistory_zle_dirhistory_up ;; # Terminal.app iTerm.app) bindkey -M $keymap "^[^[[A" dirhistory_zle_dirhistory_up ;; # iTerm2 + ghostty) bindkey -M $keymap "^[[1;3A" dirhistory_zle_dirhistory_up ;; # ghostty esac if (( ${+terminfo[kcuu1]} )); then @@ -215,6 +218,7 @@ for keymap in emacs vicmd viins; do case "$TERM_PROGRAM" in Apple_Terminal) bindkey -M $keymap "^[[B" dirhistory_zle_dirhistory_down ;; # Terminal.app iTerm.app) bindkey -M $keymap "^[^[[B" dirhistory_zle_dirhistory_down ;; # iTerm2 + ghostty) bindkey -M $keymap "^[[1;3B" dirhistory_zle_dirhistory_down ;; # ghostty esac if (( ${+terminfo[kcud1]} )); then From 5eaebdf0fe870a8c599c89c6b70a0c5ee8c78b42 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 20 Mar 2025 20:02:34 +0100 Subject: [PATCH 403/453] fix(termsupport): ensure ohmyzsh can run with `set -eu` Closes #12870 --- lib/async_prompt.zsh | 3 ++- lib/termsupport.zsh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/async_prompt.zsh b/lib/async_prompt.zsh index db48446e7..151e24b8c 100644 --- a/lib/async_prompt.zsh +++ b/lib/async_prompt.zsh @@ -26,7 +26,7 @@ autoload -Uz is-at-least # This API is subject to change and optimization. Rely on it at your own risk. function _omz_register_handler { - setopt localoptions noksharrays + setopt localoptions noksharrays unset typeset -ga _omz_async_functions # we want to do nothing if there's no $1 function or we already set it up if [[ -z "$1" ]] || (( ! ${+functions[$1]} )) \ @@ -44,6 +44,7 @@ function _omz_register_handler { # Set up async handlers and callbacks function _omz_async_request { + setopt localoptions noksharrays unset local -i ret=$? typeset -gA _OMZ_ASYNC_FDS _OMZ_ASYNC_PIDS _OMZ_ASYNC_OUTPUT diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 087bae9bb..d2fbf42cd 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -47,7 +47,7 @@ fi # Runs before showing the prompt function omz_termsupport_precmd { - [[ "${DISABLE_AUTO_TITLE:-}" != true ]] || return + [[ "${DISABLE_AUTO_TITLE:-}" != true ]] || return 0 title "$ZSH_THEME_TERM_TAB_TITLE_IDLE" "$ZSH_THEME_TERM_TITLE_IDLE" } @@ -145,6 +145,7 @@ esac # Identifies the directory using a file: URI scheme, including # the host name to disambiguate local vs. remote paths. function omz_termsupport_cwd { + setopt localoptions unset # Percent-encode the host and path names. local URL_HOST URL_PATH URL_HOST="$(omz_urlencode -P $HOST)" || return 1 From 068299685ceac5af570232ca5daa0ecd4d1f7d62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 20 Mar 2025 20:07:36 +0100 Subject: [PATCH 404/453] fix(dirhistory): support iTerm2 natural text key bindings (#11026) Fixes #11026 Fixes #11407 --- plugins/dirhistory/dirhistory.plugin.zsh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/dirhistory/dirhistory.plugin.zsh b/plugins/dirhistory/dirhistory.plugin.zsh index 8d66de7f5..4650666be 100644 --- a/plugins/dirhistory/dirhistory.plugin.zsh +++ b/plugins/dirhistory/dirhistory.plugin.zsh @@ -136,8 +136,11 @@ for keymap in emacs vicmd viins; do case "$TERM_PROGRAM" in Apple_Terminal) bindkey -M $keymap "^[b" dirhistory_zle_dirhistory_back ;; # Terminal.app - iTerm.app) bindkey -M $keymap "^[^[[D" dirhistory_zle_dirhistory_back ;; # iTerm2 ghostty) bindkey -M $keymap "^[b" dirhistory_zle_dirhistory_back ;; # ghostty + iTerm.app) + bindkey -M $keymap "^[^[[D" dirhistory_zle_dirhistory_back + bindkey -M $keymap "^[b" dirhistory_zle_dirhistory_back + ;; esac if (( ${+terminfo[kcub1]} )); then @@ -152,8 +155,11 @@ for keymap in emacs vicmd viins; do case "$TERM_PROGRAM" in Apple_Terminal) bindkey -M $keymap "^[f" dirhistory_zle_dirhistory_future ;; # Terminal.app - iTerm.app) bindkey -M $keymap "^[^[[C" dirhistory_zle_dirhistory_future ;; # iTerm2 ghostty) bindkey -M $keymap "^[f" dirhistory_zle_dirhistory_future ;; # ghostty + iTerm.app) + bindkey -M $keymap "^[^[[C" dirhistory_zle_dirhistory_future + bindkey -M $keymap "^[f" dirhistory_zle_dirhistory_future + ;; esac if (( ${+terminfo[kcuf1]} )); then From ec07c79d7ef9f30d4f7aef7eb54b605cd78bfb3d Mon Sep 17 00:00:00 2001 From: Xin Li Date: Thu, 20 Mar 2025 12:25:40 -0700 Subject: [PATCH 405/453] feat(tmux): refresh global environments automatically (#5282) --- plugins/tmux/tmux.plugin.zsh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 51cc7d6a5..f6de9166f 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -15,6 +15,8 @@ fi : ${ZSH_TMUX_AUTOQUIT:=$ZSH_TMUX_AUTOSTART} # Automatically name the new session based on the basename of PWD : ${ZSH_TMUX_AUTONAME_SESSION:=false} +# Automatically pick up tmux environments +: ${ZSH_TMUX_AUTOREFRESH:=true} # Set term to screen or screen-256color based on current terminal support : ${ZSH_TMUX_DETACHED:=false} # Set detached mode @@ -158,6 +160,15 @@ function _zsh_tmux_plugin_run() { fi } +# Refresh tmux environment variables. +function _zsh_tmux_plugin_preexec() +{ + local -a tmux_cmd + tmux_cmd=(command tmux) + + eval $($tmux_cmd show-environment -s) +} + # Use the completions for tmux for our function compdef _tmux _zsh_tmux_plugin_run # Alias tmux to our wrapper function. @@ -184,3 +195,9 @@ if [[ -z "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" && -z "$INSIDE_EMACS" && -z _zsh_tmux_plugin_run fi fi + +# Automatically refresh tmux environments if tmux is running. +if [[ -n "$TMUX" && "$ZSH_TMUX_AUTOREFRESH" == "true" ]] && tmux ls >/dev/null 2>/dev/null; then + autoload -U add-zsh-hook + add-zsh-hook preexec _zsh_tmux_plugin_preexec +fi From 0c8c7bf2a8efa66b504d17e3b56881925a580b40 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 20 Mar 2025 20:23:47 +0100 Subject: [PATCH 406/453] docs(tmux): add note to README for #5282 --- plugins/tmux/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/tmux/README.md b/plugins/tmux/README.md index 28ad3558a..53607b8ad 100644 --- a/plugins/tmux/README.md +++ b/plugins/tmux/README.md @@ -31,6 +31,7 @@ The plugin also supports the following: | Variable | Description | | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | +| `ZSH_TMUX_AUTOREFRESH` | Automatically refresh global environments (default: `true`) | | `ZSH_TMUX_AUTOSTART` | Automatically starts tmux (default: `false`) | | `ZSH_TMUX_AUTOSTART_ONCE` | Autostart only if tmux hasn't been started previously (default: `true`) | | `ZSH_TMUX_AUTOCONNECT` | Automatically connect to a previous session if it exits (default: `true`) | From 22ec00d1f62ffe9c5e04d6eefc49be40e082407d Mon Sep 17 00:00:00 2001 From: Gurram Siddarth Reddy <73605274+siddarthreddygsr@users.noreply.github.com> Date: Fri, 21 Mar 2025 00:59:33 +0530 Subject: [PATCH 407/453] chore(install): option case matching (#12881) --- tools/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/install.sh b/tools/install.sh index e5f126915..5c9b2c18d 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -399,8 +399,8 @@ EOF "$FMT_YELLOW" "$FMT_RESET" read -r opt case $opt in - y*|Y*|"") ;; - n*|N*) echo "Shell change skipped."; return ;; + [Yy]*|"") ;; + [Nn]*) echo "Shell change skipped."; return ;; *) echo "Invalid choice. Shell change skipped."; return ;; esac From 407be8f0368379892f7c0d5a3994bfca74e06969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 20 Mar 2025 20:28:39 +0100 Subject: [PATCH 408/453] feat(dirhistory): preserve forward directories with `cde` alias (#9328) Closes #11954 Co-authored-by: Jeff Williams --- plugins/dirhistory/README.md | 43 ++++++++++++++++++++++++ plugins/dirhistory/dirhistory.plugin.zsh | 3 +- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/plugins/dirhistory/README.md b/plugins/dirhistory/README.md index ede9b5410..66e3e0469 100644 --- a/plugins/dirhistory/README.md +++ b/plugins/dirhistory/README.md @@ -60,3 +60,46 @@ to `/usr` again. After that, Alt + Down will probably go to `/usr/bin` if `bin` is the first directory in alphabetical order (depends on your `/usr` folder structure). Alt + Up will return to `/usr`, and once more will get you to the root folder (`/`). + +### cde + +This plugin also provides a `cde` alias that allows you to change to a directory without clearing the next directory stack. +This changes the default behavior of `dirhistory`, which is to clear the next directory stack when changing directories. + +For example, if the shell was started, and the following commands were entered: + +```shell +cd ~ +cd /usr +cd share +cd doc + +# +# +``` + +The directory stack would look like this: + +```sh +➜ /usr typeset -pm dirhistory_\* +typeset -ax dirhistory_past=( /home/user /usr ) +typeset -ax dirhistory_future=( /usr/share/doc /usr/share ) +``` + +This means that pressing Alt + Right, you'd go to `/usr/share` and `/usr/share/doc` (the "future" directories). + +If you run `cd /usr/bin`, the "future" directories will be removed, and you won't be able to access them with Alt + Right: + +```sh +➜ /u/bin typeset -pm dirhistory_\* +typeset -ax dirhistory_past=( /home/user /usr ) +typeset -ax dirhistory_future=( /usr/bin ) +``` + +If you instead run `cde /usr/bin`, the "future" directories will be preserved: + +```sh +➜ /u/bin typeset -pm dirhistory_\* +typeset -ax dirhistory_past=( /home/user /usr /usr/bin ) +typeset -ax dirhistory_future=( /usr/share/doc /usr/share ) +``` diff --git a/plugins/dirhistory/dirhistory.plugin.zsh b/plugins/dirhistory/dirhistory.plugin.zsh index 4650666be..706bb6fb2 100644 --- a/plugins/dirhistory/dirhistory.plugin.zsh +++ b/plugins/dirhistory/dirhistory.plugin.zsh @@ -11,9 +11,10 @@ dirhistory_past=($PWD) dirhistory_future=() export dirhistory_past export dirhistory_future - export DIRHISTORY_SIZE=30 +alias cde='dirhistory_cd' + # Pop the last element of dirhistory_past. # Pass the name of the variable to return the result in. # Returns the element if the array was not empty, From ac1335125cb7fe742d825a95bb288ff8a8bfadd9 Mon Sep 17 00:00:00 2001 From: Adil Erchouk Date: Thu, 20 Mar 2025 20:36:07 +0100 Subject: [PATCH 409/453] feat(macos): add support for Ghostty (#12890) --- plugins/macos/README.md | 1 + plugins/macos/macos.plugin.zsh | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/plugins/macos/README.md b/plugins/macos/README.md index 8245e211f..ccc4331e5 100644 --- a/plugins/macos/README.md +++ b/plugins/macos/README.md @@ -13,6 +13,7 @@ plugins=(... macos) - [iTerm2](https://iterm2.com/) - [Hyper](https://hyper.is/) - [Tabby](https://tabby.sh/) +- [Ghostty](https://ghostty.org) ## Commands diff --git a/plugins/macos/macos.plugin.zsh b/plugins/macos/macos.plugin.zsh index b951a289f..6ddf31ecf 100644 --- a/plugins/macos/macos.plugin.zsh +++ b/plugins/macos/macos.plugin.zsh @@ -85,6 +85,12 @@ EOF tell application "System Events" tell process "Tabby" to keystroke "t" using command down end tell +EOF + elif [[ "$the_app" == 'ghostty' ]]; then + osascript >/dev/null <&2 @@ -139,6 +145,12 @@ EOF tell application "System Events" tell process "Tabby" to keystroke "D" using command down end tell +EOF + elif [[ "$the_app" == 'ghostty' ]]; then + osascript >/dev/null <&2 @@ -194,6 +206,12 @@ EOF tell application "System Events" tell process "Tabby" to keystroke "d" using command down end tell +EOF + elif [[ "$the_app" == 'ghostty' ]]; then + osascript >/dev/null <&2 From 899af6328b395f1db2e74d09880a1af435a188ca Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Fri, 21 Mar 2025 12:47:25 +0100 Subject: [PATCH 410/453] fix(bgnotify): detect if sway is running and not just installed (#12989) Co-authored-by: Carlo Sala --- plugins/bgnotify/bgnotify.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bgnotify/bgnotify.plugin.zsh b/plugins/bgnotify/bgnotify.plugin.zsh index f6ffb6ed5..dca8250be 100644 --- a/plugins/bgnotify/bgnotify.plugin.zsh +++ b/plugins/bgnotify/bgnotify.plugin.zsh @@ -62,7 +62,7 @@ function bgnotify_formatted { function bgnotify_appid { if (( ${+commands[osascript]} )); then osascript -e "tell application id \"$(bgnotify_programid)\" to get the {id, frontmost, id of front window, visible of front window}" 2>/dev/null - elif [[ -n $WAYLAND_DISPLAY ]] && (( ${+commands[swaymsg]} )); then # wayland+sway + elif [[ -n $WAYLAND_DISPLAY ]] && ([[ -n $SWAYSOCK ]] || [[ -n $I3SOCK ]]) && (( ${+commands[swaymsg]} )); then # wayland+sway local app_id=$(bgnotify_find_sway_appid) [[ -n "$app_id" ]] && echo "$app_id" || echo $EPOCHSECONDS elif [[ -z $WAYLAND_DISPLAY ]] && [[ -n $DISPLAY ]] && (( ${+commands[xprop]} )); then From eeaf9f89b0e8b10a02f16cb6cdd93779c28eb2ea Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Mon, 24 Mar 2025 20:52:31 +0100 Subject: [PATCH 411/453] fix(tmux): disable AUTOREFRESH by default (#13034) --- plugins/tmux/README.md | 2 +- plugins/tmux/tmux.plugin.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/tmux/README.md b/plugins/tmux/README.md index 53607b8ad..39c57f846 100644 --- a/plugins/tmux/README.md +++ b/plugins/tmux/README.md @@ -31,7 +31,7 @@ The plugin also supports the following: | Variable | Description | | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | -| `ZSH_TMUX_AUTOREFRESH` | Automatically refresh global environments (default: `true`) | +| `ZSH_TMUX_AUTOREFRESH` | Automatically refresh global environments (default: `false`) | | `ZSH_TMUX_AUTOSTART` | Automatically starts tmux (default: `false`) | | `ZSH_TMUX_AUTOSTART_ONCE` | Autostart only if tmux hasn't been started previously (default: `true`) | | `ZSH_TMUX_AUTOCONNECT` | Automatically connect to a previous session if it exits (default: `true`) | diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index f6de9166f..d2729ec09 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -16,7 +16,7 @@ fi # Automatically name the new session based on the basename of PWD : ${ZSH_TMUX_AUTONAME_SESSION:=false} # Automatically pick up tmux environments -: ${ZSH_TMUX_AUTOREFRESH:=true} +: ${ZSH_TMUX_AUTOREFRESH:=false} # Set term to screen or screen-256color based on current terminal support : ${ZSH_TMUX_DETACHED:=false} # Set detached mode From 1de190e4391ce6c2fbe2bdf0025104cf3cb98231 Mon Sep 17 00:00:00 2001 From: Roeniss Moon Date: Wed, 26 Mar 2025 01:56:06 +0900 Subject: [PATCH 412/453] fix(alias-finder): early return on cmd len <2 (#13030) --- plugins/alias-finder/alias-finder.plugin.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/alias-finder/alias-finder.plugin.zsh b/plugins/alias-finder/alias-finder.plugin.zsh index 5fdfbc835..4786431f3 100644 --- a/plugins/alias-finder/alias-finder.plugin.zsh +++ b/plugins/alias-finder/alias-finder.plugin.zsh @@ -36,7 +36,11 @@ alias-finder() { # make filter to find only shorter results than current cmd if [[ $cheaper == true ]]; then cmdLen=$(echo -n "$cmd" | wc -c) - filter="^'{0,1}.{0,$((cmdLen - 1))}=" + if [[ $cmdLen -le 1 ]]; then + return + fi + + filter="^'?.{1,$((cmdLen - 1))}'?=" # some aliases is surrounded by single quotes fi alias | grep -E "$filter" | grep -E "=$finder" From 4efdc90dba95200b010def504c471f0e191fea84 Mon Sep 17 00:00:00 2001 From: Roeniss Moon Date: Wed, 26 Mar 2025 02:03:02 +0900 Subject: [PATCH 413/453] docs(docker): add section for podman's docker wrapper (#13024) --- plugins/docker/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/docker/README.md b/plugins/docker/README.md index 8619125a2..a9f842db2 100644 --- a/plugins/docker/README.md +++ b/plugins/docker/README.md @@ -39,6 +39,10 @@ following setting. See https://github.com/ohmyzsh/ohmyzsh/issues/11789 for more zstyle ':omz:plugins:docker' legacy-completion yes ``` +### For Podman's Docker wrapper users + +If you use Podman's Docker wrapper, you need to enable legacy completion. See above section. + ## Aliases | Alias | Command | Description | From fa396ad7718af77e896472772bffd4a7e9110193 Mon Sep 17 00:00:00 2001 From: Chriss <77172965+realChriss@users.noreply.github.com> Date: Tue, 25 Mar 2025 18:04:39 +0100 Subject: [PATCH 414/453] feat(docker): add alias for stats (#12988) --- plugins/docker/README.md | 1 + plugins/docker/docker.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/docker/README.md b/plugins/docker/README.md index a9f842db2..0bc24b54a 100644 --- a/plugins/docker/README.md +++ b/plugins/docker/README.md @@ -77,6 +77,7 @@ If you use Podman's Docker wrapper, you need to enable legacy completion. See ab | drs | `docker container restart` | Restart one or more containers | | dsta | `docker stop $(docker ps -q)` | Stop all running containers | | dstp | `docker container stop` | Stop one or more running containers | +| dsts | `docker stats` | Display real-time streaming statistics for containers | | dtop | `docker top` | Display the running processes of a container | | dvi | `docker volume inspect` | Display detailed information about one or more volumes | | dvls | `docker volume ls` | List all the volumes known to docker | diff --git a/plugins/docker/docker.plugin.zsh b/plugins/docker/docker.plugin.zsh index 16db77df6..5268f6cd6 100644 --- a/plugins/docker/docker.plugin.zsh +++ b/plugins/docker/docker.plugin.zsh @@ -28,6 +28,7 @@ alias dst='docker container start' alias drs='docker container restart' alias dsta='docker stop $(docker ps -q)' alias dstp='docker container stop' +alias dsts='docker stats' alias dtop='docker top' alias dvi='docker volume inspect' alias dvls='docker volume ls' From 506cedb7ca1f4ba91a0ad102e8395d194c0b1a59 Mon Sep 17 00:00:00 2001 From: Roeniss Moon Date: Sat, 29 Mar 2025 18:38:29 +0900 Subject: [PATCH 415/453] chore(alias-finder): code style (#13038) --- plugins/alias-finder/alias-finder.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/alias-finder/alias-finder.plugin.zsh b/plugins/alias-finder/alias-finder.plugin.zsh index 4786431f3..2351a439e 100644 --- a/plugins/alias-finder/alias-finder.plugin.zsh +++ b/plugins/alias-finder/alias-finder.plugin.zsh @@ -47,7 +47,7 @@ alias-finder() { if [[ $exact == true ]]; then break # because exact case is only one - elif [[ $longer = true ]]; then + elif [[ $longer == true ]]; then break # because above grep command already found every longer aliases during first cycle fi From 346c09d469c9d2681399b0938e9af883ebdae829 Mon Sep 17 00:00:00 2001 From: Mikrz Date: Sat, 29 Mar 2025 05:40:25 -0400 Subject: [PATCH 416/453] fix(dnf): function name typo (#13040) --- plugins/dnf/_dnf5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/dnf/_dnf5 b/plugins/dnf/_dnf5 index e194dd5a7..9cbf451a8 100644 --- a/plugins/dnf/_dnf5 +++ b/plugins/dnf/_dnf5 @@ -38,7 +38,7 @@ _dnf5_rpm_files() { _dnf5_packages_or_rpms() { if [[ "$words[CURRENT]" = (*/*|\~*) ]]; then # if looks like a path name - _dnf_rpm_files + _dnf5_rpm_files else _dnf5_packages "$@" fi From 2f3a141f65ba082e1eb42ea3123fc2bd978c0c83 Mon Sep 17 00:00:00 2001 From: Kartik Vashistha Date: Sat, 29 Mar 2025 02:42:46 -0700 Subject: [PATCH 417/453] docs(asdf): match README with 0.16 (#13026) Co-authored-by: Carlo Sala --- plugins/asdf/README.md | 49 ++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/plugins/asdf/README.md b/plugins/asdf/README.md index 4af69a75c..e8ff2d740 100644 --- a/plugins/asdf/README.md +++ b/plugins/asdf/README.md @@ -1,32 +1,39 @@ -## asdf +# asdf Adds integration with [asdf](https://github.com/asdf-vm/asdf), the extendable version manager, with support for Ruby, Node.js, Elixir, Erlang and more. -### Installation +## Installation -1. [Download asdf](https://asdf-vm.com/guide/getting-started.html#_2-download-asdf) by running the following: - - ``` - git clone https://github.com/asdf-vm/asdf.git ~/.asdf - ``` - -2. [Enable asdf](https://asdf-vm.com/guide/getting-started.html#_3-install-asdf) by adding it to your `plugins` definition in `~/.zshrc`. - - ``` - plugins=(asdf) - ``` - -### Usage - -See the [asdf documentation](https://asdf-vm.com/guide/getting-started.html#_4-install-a-plugin) for information on how to use asdf: +1. [Install](https://asdf-vm.com/guide/getting-started.html#_1-install-asdf) asdf and ensure that's it's discoverable on `$PATH`; +2. Enable it by adding it to your `plugins` definition in `~/.zshrc`: +```sh +plugins=(asdf) ``` -asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git + +## Usage + +Refer to the [asdf plugin documentation](https://asdf-vm.com/guide/getting-started.html#_4-install-a-plugin) for information on how to add a plugin and install the many runtime versions for it. + +Example for installing the nodejs plugin and the many runtimes for it: + +```sh +# Add plugin to asdf +asdf plugin add nodejs + +# Install the latest available nodejs runtime version asdf install nodejs latest -asdf global nodejs latest -asdf local nodejs latest + +# Install nodejs v16.5.0 runtime version +asdf install nodejs 16.5.0 + +# Set the latest version in .tools-version in the current working directory +asdf set nodejs latest + +# Set a version globally that will apply to all directories under $HOME +asdf set -u nodejs 16.5.0 ``` -### Maintainer +## Maintainer - [@RobLoach](https://github.com/RobLoach) From a78d006faa022a5104b542d7dec5a3439e72046e Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Sat, 29 Mar 2025 10:47:03 +0100 Subject: [PATCH 418/453] fix(asdf)!: remove legacy <0.16 integration `asdf` plugin only supports asdf 0.16 and ahead from now on. --- plugins/asdf/asdf.plugin.zsh | 55 +++++++----------------------------- 1 file changed, 10 insertions(+), 45 deletions(-) diff --git a/plugins/asdf/asdf.plugin.zsh b/plugins/asdf/asdf.plugin.zsh index 4367e8ca3..318267dcb 100644 --- a/plugins/asdf/asdf.plugin.zsh +++ b/plugins/asdf/asdf.plugin.zsh @@ -1,48 +1,13 @@ -if (( $+commands[asdf] )); then - export ASDF_DATA_DIR="${ASDF_DATA_DIR:-$HOME/.asdf}" - path=("$ASDF_DATA_DIR/shims" $path) +(( ! $+commands[asdf] )) && return - # If the completion file doesn't exist yet, we need to autoload it and - # bind it to `asdf`. Otherwise, compinit will have already done that. - if [[ ! -f "$ZSH_CACHE_DIR/completions/_asdf" ]]; then - typeset -g -A _comps - autoload -Uz _asdf - _comps[asdf]=_asdf - fi - asdf completion zsh >| "$ZSH_CACHE_DIR/completions/_asdf" &| +export ASDF_DATA_DIR="${ASDF_DATA_DIR:-$HOME/.asdf}" +path=("$ASDF_DATA_DIR/shims" $path) - return -fi - -# TODO:(2025-02-12): remove deprecated asdf <0.16 code - -# Find where asdf should be installed -ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}" -ASDF_COMPLETIONS="$ASDF_DIR/completions" - -if [[ ! -f "$ASDF_DIR/asdf.sh" || ! -f "$ASDF_COMPLETIONS/_asdf" ]]; then - # If not found, check for archlinux/AUR package (/opt/asdf-vm/) - if [[ -f "/opt/asdf-vm/asdf.sh" ]]; then - ASDF_DIR="/opt/asdf-vm" - ASDF_COMPLETIONS="$ASDF_DIR" - # If not found, check for Homebrew package - elif (( $+commands[brew] )); then - _ASDF_PREFIX="$(brew --prefix asdf)" - ASDF_DIR="${_ASDF_PREFIX}/libexec" - ASDF_COMPLETIONS="${_ASDF_PREFIX}/share/zsh/site-functions" - unset _ASDF_PREFIX - else - return - fi -fi - -# Load command -if [[ -f "$ASDF_DIR/asdf.sh" ]]; then - source "$ASDF_DIR/asdf.sh" - # Load completions - if [[ -f "$ASDF_COMPLETIONS/_asdf" ]]; then - fpath+=("$ASDF_COMPLETIONS") - autoload -Uz _asdf - compdef _asdf asdf # compdef is already loaded before loading plugins - fi +# If the completion file doesn't exist yet, we need to autoload it and +# bind it to `asdf`. Otherwise, compinit will have already done that. +if [[ ! -f "$ZSH_CACHE_DIR/completions/_asdf" ]]; then + typeset -g -A _comps + autoload -Uz _asdf + _comps[asdf]=_asdf fi +asdf completion zsh >| "$ZSH_CACHE_DIR/completions/_asdf" &| From f81259fb344685e2dc8b67f8ad8764ccd4e8502e Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Sat, 29 Mar 2025 12:55:20 +0100 Subject: [PATCH 419/453] fix(cli): support `noexec` environments (#13042) Closes #13032 --- lib/cli.zsh | 2 +- tools/upgrade.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cli.zsh b/lib/cli.zsh index aed86e758..3b6308313 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -193,7 +193,7 @@ EOF return 1 fi - "$ZSH/tools/changelog.sh" "$version" "${2:-}" "$format" + ZSH="$ZSH" command zsh -f "$ZSH/tools/changelog.sh" "$version" "${2:-}" "$format" } function _omz::plugin { diff --git a/tools/upgrade.sh b/tools/upgrade.sh index c586610c4..1aa3d8af4 100755 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -254,7 +254,7 @@ if LANG= git pull --quiet --rebase $remote $branch; then # Print changelog to the terminal if [[ $interactive == true && $verbose_mode == default ]]; then - "$ZSH/tools/changelog.sh" HEAD "$last_commit" + ZSH="$ZSH" command zsh -f "$ZSH/tools/changelog.sh" HEAD "$last_commit" fi if [[ $verbose_mode != silent ]]; then From 750d3ac4b493dca13ef0ced55fa6a2cd02dc7ee8 Mon Sep 17 00:00:00 2001 From: Sidar <65621366+Maple38@users.noreply.github.com> Date: Thu, 3 Apr 2025 17:38:51 +0300 Subject: [PATCH 420/453] fix(macos): use `command man` instead of `man` (#13046) --- plugins/macos/macos.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/macos/macos.plugin.zsh b/plugins/macos/macos.plugin.zsh index 6ddf31ecf..4d73d22c3 100644 --- a/plugins/macos/macos.plugin.zsh +++ b/plugins/macos/macos.plugin.zsh @@ -271,7 +271,7 @@ function man-preview() { [[ $# -eq 0 ]] && >&2 echo "Usage: $0 command1 [command2 ...]" && return 1 local page - for page in "${(@f)"$(man -w $@)"}"; do + for page in "${(@f)"$(command man -w $@)"}"; do command mandoc -Tpdf $page | open -f -a Preview done } From a84a0332a822a78ddf3f66d0e1ed3990d4badd12 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 13 Apr 2025 23:11:55 +0200 Subject: [PATCH 421/453] chore(deps): bump urllib3 in /.github/workflows/dependencies (#13065) Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.3.0 to 2.4.0. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst) - [Commits](https://github.com/urllib3/urllib3/compare/2.3.0...2.4.0) --- updated-dependencies: - dependency-name: urllib3 dependency-version: 2.4.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependencies/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt index 910db7bac..f2044a5f5 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -4,4 +4,4 @@ idna==3.10 PyYAML==6.0.2 requests==2.32.3 semver==3.0.4 -urllib3==2.3.0 +urllib3==2.4.0 From c1e5ff31693f391a0bbb30b12c8e7bc1cc976b7b Mon Sep 17 00:00:00 2001 From: swivelmargarita <55573157+swivelmargarita@users.noreply.github.com> Date: Thu, 17 Apr 2025 19:57:53 +0500 Subject: [PATCH 422/453] fix(branch): handle branches with `/` properly (#13063) Co-authored-by: Takha Polat --- plugins/branch/branch.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/branch/branch.plugin.zsh b/plugins/branch/branch.plugin.zsh index dd5871fdc..c24f9098e 100644 --- a/plugins/branch/branch.plugin.zsh +++ b/plugins/branch/branch.plugin.zsh @@ -8,7 +8,7 @@ function branch_prompt_info() { while [[ "$dir" != '/' ]]; do # Found .git directory if [[ -d "${dir}/.git" ]]; then - branch="${"$(<"${dir}/.git/HEAD")"##*/}" + branch="${"$(<"${dir}/.git/HEAD")"##ref: refs/heads/}" echo '±' "${branch:gs/%/%%}" return fi From a7426f0b38817bf7cd7000a5d378b7cfb059884f Mon Sep 17 00:00:00 2001 From: "Kat R." Date: Sat, 19 Apr 2025 10:49:16 -0700 Subject: [PATCH 423/453] fix(git-prompt): use `--git-common-dir` to load stash count (#13072) --- plugins/git-prompt/gitstatus.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/git-prompt/gitstatus.py b/plugins/git-prompt/gitstatus.py index 94774d828..7cd8f54e2 100644 --- a/plugins/git-prompt/gitstatus.py +++ b/plugins/git-prompt/gitstatus.py @@ -23,9 +23,10 @@ def get_tagname_or_hash(): return hash_ return None -# Re-use method from https://github.com/magicmonty/bash-git-prompt to get stashs count +# Re-use method from https://github.com/magicmonty/bash-git-prompt to get stash count +# Use `--git-common-dir` to avoid problems with git worktrees, which don't have individual stashes def get_stash(): - cmd = Popen(['git', 'rev-parse', '--git-dir'], stdout=PIPE, stderr=PIPE) + cmd = Popen(['git', 'rev-parse', '--git-common-dir'], stdout=PIPE, stderr=PIPE) so, se = cmd.communicate() stash_file = '%s%s' % (so.decode('utf-8').rstrip(), '/logs/refs/stash') @@ -35,7 +36,6 @@ def get_stash(): except IOError: return 0 - # `git status --porcelain --branch` can collect all information # branch, remote_branch, untracked, staged, changed, conflicts, ahead, behind po = Popen(['git', 'status', '--porcelain', '--branch'], env=dict(os.environ, LANG="C"), stdout=PIPE, stderr=PIPE) From afbbdd6099085fbc6a3d06cc44f90b566302bd43 Mon Sep 17 00:00:00 2001 From: Nicholas Wilson Date: Sat, 19 Apr 2025 12:58:05 -0500 Subject: [PATCH 424/453] docs: fix typos (#13061) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f7455228a..7f57ed55e 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,7 @@ adds any) and extra goodies that are included in that particular plugin. ### Themes -We'll admit it. Early in the Oh My Zsh world, we may have gotten a bit too theme happy. We have over one +We'll admit it. Early in the Oh My Zsh world, we may have gotten a bit too theme-happy. We have over one hundred and fifty themes now bundled. Most of them have [screenshots](https://github.com/ohmyzsh/ohmyzsh/wiki/Themes) on the wiki (We are working on updating this!). Check them out! @@ -218,7 +218,7 @@ terminal window. ZSH_THEME="random" # (...please let it be pie... please be some pie..) ``` -And if you want to pick random theme from a list of your favorite themes: +And if you want to pick a random theme from a list of your favorite themes: ```sh ZSH_THEME_RANDOM_CANDIDATES=( @@ -426,7 +426,7 @@ turn it off by setting the following in your .zshrc file, before Oh My Zsh is so zstyle ':omz:alpha:lib:git' async-prompt no ``` -If your problem is that the git prompt just stopped appearing, you can try to force it setting the following +If your problem is that the git prompt just stopped appearing, you can try to force it by setting the following configuration before `oh-my-zsh.sh` is sourced. If it still does not work, please open an issue with your case. From 95a0ece8d39a7797850ef7a4cc8849b6e1158706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20A=2E=20Aranda=20Guti=C3=A9rrez?= Date: Sat, 19 Apr 2025 20:19:23 +0200 Subject: [PATCH 425/453] fix(agnoster): respect bg / fg user envs (#12897) Co-authored-by: Carlo Sala --- themes/agnoster.zsh-theme | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index adeffe8c2..21c9cf7d5 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -36,12 +36,12 @@ CURRENT_BG='NONE' case ${SOLARIZED_THEME:-dark} in light) - CURRENT_FG='white' - CURRENT_DEFAULT_FG='white' + CURRENT_FG=${CURRENT_FG:-'white'} + CURRENT_DEFAULT_FG=${CURRENT_DEFAULT_FG:-'white'} ;; *) - CURRENT_FG='black' - CURRENT_DEFAULT_FG='default' + CURRENT_FG=${CURRENT_FG:-'black'} + CURRENT_DEFAULT_FG=${CURRENT_DEFAULT_FG:-'default'} ;; esac From b92874c716776bc8a19773d12354b77d08349d7b Mon Sep 17 00:00:00 2001 From: deimosian <616215+deimosian@users.noreply.github.com> Date: Sat, 19 Apr 2025 14:44:45 -0400 Subject: [PATCH 426/453] fix(archlinux): properly check keyring version (#12979) --- plugins/archlinux/archlinux.plugin.zsh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index e20a31156..7abd7c2f6 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -178,26 +178,27 @@ fi # Check Arch Linux PGP Keyring before System Upgrade to prevent failure. function upgrade() { + sudo pacman -Sy echo ":: Checking Arch Linux PGP Keyring..." 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." - sudo pacman -Sy --needed --noconfirm archlinux-keyring + sudo pacman -S --needed --noconfirm archlinux-keyring else echo " Arch Linux PGP Keyring is up to date." echo " Proceeding with full system upgrade." fi if (( $+commands[yay] )); then - yay -Syu + yay -Su elif (( $+commands[trizen] )); then - trizen -Syu + trizen -Su elif (( $+commands[pacaur] )); then - pacaur -Syu + pacaur -Su elif (( $+commands[aura] )); then - sudo aura -Syu + sudo aura -Su else - sudo pacman -Syu + sudo pacman -Su fi } From 9957e4e8be9d63b9c42673f0eb86fa2dea845b32 Mon Sep 17 00:00:00 2001 From: Roeniss Moon Date: Sun, 20 Apr 2025 03:48:34 +0900 Subject: [PATCH 427/453] feat(git): add gcfu alias for `commit --fixup` (#13027) --- plugins/git/README.md | 1 + plugins/git/git.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/git/README.md b/plugins/git/README.md index bcadc4713..edddc8cd8 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -79,6 +79,7 @@ plugins=(... git) | `gcss` | `git commit -S -s` | | `gcssm` | `git commit -S -s -m` | | `gcf` | `git config --list` | +| `gcfu` | `git commit --fixup` | | `gdct` | `git describe --tags $(git rev-list --tags --max-count=1)` | | `gd` | `git diff` | | `gdca` | `git diff --cached` | diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index f34c0726b..1d043da35 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -200,6 +200,7 @@ alias gc!='git commit --verbose --amend' alias gcn='git commit --verbose --no-edit' alias gcn!='git commit --verbose --no-edit --amend' alias gcf='git config --list' +alias gcfu='git commit --fixup' alias gdct='git describe --tags $(git rev-list --tags --max-count=1)' alias gd='git diff' alias gdca='git diff --cached' From 92bad89f8a9141fcdc0b682941ee46729b6e4cb6 Mon Sep 17 00:00:00 2001 From: Arthur <82575487+arthur-mountain@users.noreply.github.com> Date: Sun, 20 Apr 2025 02:55:23 +0800 Subject: [PATCH 428/453] docs(asdf): update usage example (#13055) --- plugins/asdf/README.md | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/plugins/asdf/README.md b/plugins/asdf/README.md index e8ff2d740..69db6930a 100644 --- a/plugins/asdf/README.md +++ b/plugins/asdf/README.md @@ -19,21 +19,30 @@ Example for installing the nodejs plugin and the many runtimes for it: ```sh # Add plugin to asdf -asdf plugin add nodejs +asdf plugin add nodejs -# Install the latest available nodejs runtime version +# Install the latest available version asdf install nodejs latest -# Install nodejs v16.5.0 runtime version +# Uninstall the latest version +asdf uninstall nodejs latest + +# Install a specific version asdf install nodejs 16.5.0 -# Set the latest version in .tools-version in the current working directory +# Set the latest version in .tool-versions of the `current directory` asdf set nodejs latest -# Set a version globally that will apply to all directories under $HOME -asdf set -u nodejs 16.5.0 +# Set a specific version in the `parent directory` +asdf set -p nodejs 16.5.0 # -p is shorthand for --parent + +# Set a global version under `$HOME` +asdf set -u nodejs 16.5.0 # -u is shorthand for --home ``` +For more commands, run `asdf help` or refer to the +[asdf CLI documentation](https://asdf-vm.com/manage/commands.html#all-commands). + ## Maintainer - [@RobLoach](https://github.com/RobLoach) From de1ca65dcaebd19f5ca6626616bb79b529362458 Mon Sep 17 00:00:00 2001 From: Adam Page Date: Sat, 19 Apr 2025 15:08:03 -0400 Subject: [PATCH 429/453] feat(procs): support completion for `procs<0.14` (#13053) Co-authored-by: Carlo Sala --- plugins/procs/procs.plugin.zsh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/procs/procs.plugin.zsh b/plugins/procs/procs.plugin.zsh index 332985bf9..8b15f1d5d 100644 --- a/plugins/procs/procs.plugin.zsh +++ b/plugins/procs/procs.plugin.zsh @@ -3,11 +3,19 @@ if (( ! $+commands[procs] )); then fi # If the completion file doesn't exist yet, we need to autoload it and -# bind it to `minikube`. Otherwise, compinit will have already done that. +# bind it to `procs`. Otherwise, compinit will have already done that. if [[ ! -f "$ZSH_CACHE_DIR/completions/_procs" ]]; then typeset -g -A _comps autoload -Uz _procs _comps[procs]=_procs fi -procs --gen-completion-out zsh >| "$ZSH_CACHE_DIR/completions/_procs" &| +{ + autoload -Uz is-at-least + local _version=$(procs --version) + if is-at-least "0.14" "${_version#procs }"; then + procs --gen-completion-out zsh >| "$ZSH_CACHE_DIR/completions/_procs" + else + procs --completion-out zsh >| "$ZSH_CACHE_DIR/completions/_procs" + fi +} &| From 959b6cf5eed78f108dc6e0f46b53816f5168dd3a Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 24 Apr 2025 15:42:26 +0200 Subject: [PATCH 430/453] fix(emacs): do not emit ANSI escape codes in vterm Closes #13067 --- plugins/emacs/emacs.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/emacs/emacs.plugin.zsh b/plugins/emacs/emacs.plugin.zsh index 5aa621803..3ed6cee19 100644 --- a/plugins/emacs/emacs.plugin.zsh +++ b/plugins/emacs/emacs.plugin.zsh @@ -35,7 +35,7 @@ alias eeval="$EMACS_PLUGIN_LAUNCHER --eval" alias eframe='emacsclient --alternate-editor="" --create-frame' # Emacs ANSI Term tracking -if [[ -n "$INSIDE_EMACS" ]]; then +if [[ -n "$INSIDE_EMACS" ]] && [[ "$INSIDE_EMACS" != "vterm" ]]; then chpwd_emacs() { print -P "\033AnSiTc %d"; } print -P "\033AnSiTc %d" # Track current working directory print -P "\033AnSiTu %n" # Track username From 44913a1f16424f21b5989a0dd7d2c95d02047cec Mon Sep 17 00:00:00 2001 From: "ohmyzsh[bot]" <54982679+ohmyzsh[bot]@users.noreply.github.com> Date: Sun, 27 Apr 2025 10:25:02 +0200 Subject: [PATCH 431/453] feat(wd): update to v0.10.0 (#13093) Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com> --- .github/dependencies.yml | 2 +- plugins/wd/_wd.sh | 4 ++++ plugins/wd/wd.sh | 24 ++++++++++++++++++++++-- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/dependencies.yml b/.github/dependencies.yml index 46e7727b8..70f3d03da 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -30,7 +30,7 @@ dependencies: plugins/wd: repo: mfaerevaag/wd branch: master - version: tag:v0.9.3 + version: tag:v0.10.0 precopy: | set -e rm -r test diff --git a/plugins/wd/_wd.sh b/plugins/wd/_wd.sh index 46b032f78..7c416086d 100644 --- a/plugins/wd/_wd.sh +++ b/plugins/wd/_wd.sh @@ -37,6 +37,7 @@ function _wd() { 'rm:Removes the given warp point' 'list:Outputs all stored warp points' 'ls:Show files from given warp point' + 'open:Open warp point in the default file explorer' 'path:Show path to given warp point' 'show:Outputs all warp points that point to the current directory or shows a specific target directory for a point' 'help:Show this extremely helpful text' @@ -73,6 +74,9 @@ function _wd() { ls) _describe -t points "Warp points" warp_points && ret=0 ;; + open) + _describe -t points "Warp points" warp_points && ret=0 + ;; path) _describe -t points "Warp points" warp_points && ret=0 ;; diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh index f8b27828f..f7a22ff7d 100755 --- a/plugins/wd/wd.sh +++ b/plugins/wd/wd.sh @@ -8,7 +8,7 @@ # @github.com/mfaerevaag/wd # version -readonly WD_VERSION=0.9.3 +readonly WD_VERSION=0.10.0 # colors readonly WD_BLUE="\033[96m" @@ -86,6 +86,7 @@ Commands: show Print warp points to current directory list Print all stored warp points ls Show files from given warp point (ls) + open Open the warp point in the default file explorer (open / xdg-open) path Show the path to given warp point (pwd) clean Remove points warping to nonexistent directories (will prompt unless --force is used) @@ -377,6 +378,21 @@ wd_ls() ls "${dir/#\~/$HOME}" } +wd_open() +{ + wd_getdir "$1" + if command -v open >/dev/null 2>&1; then + # MacOS, Ubuntu (alias) + open "${dir/#\~/$HOME}" + elif command -v xdg-open >/dev/null 2>&1; then + # Most Linux desktops + xdg-open "${dir/#\~/$HOME}" + else + echo "No known file opener found (need 'open' or 'xdg-open')." >&2 + exit 1 + fi +} + wd_path() { wd_getdir "$1" @@ -521,7 +537,7 @@ do done < "$wd_config_file" # get opts -args=$(getopt -o a:r:c:lhs -l add:,rm:,clean,list,ls:,path:,help,show -- $*) +args=$(getopt -o a:r:c:lhs -l add:,rm:,clean,list,ls:,open:,path:,help,show -- $*) # check if no arguments were given, and that version is not set if [[ ($? -ne 0 || $#* -eq 0) && -z $wd_print_version ]] @@ -571,6 +587,10 @@ else wd_ls "$2" break ;; + "-o"|"--open"|"open") + wd_open "$2" + break + ;; "-p"|"--path"|"path") wd_path "$2" break From 476a7fc89e38a0fdc483ec6452394f2f2e0413bf Mon Sep 17 00:00:00 2001 From: Michael Elliot Date: Sun, 27 Apr 2025 16:26:11 +0800 Subject: [PATCH 432/453] chore: fix typo (#13089) --- oh-my-zsh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index b1032841c..2e885219c 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -192,7 +192,7 @@ _omz_source() { fi } -# Load all of the lib files in ~/oh-my-zsh/lib that end in .zsh +# Load all of the lib files in ~/.oh-my-zsh/lib that end in .zsh # TIP: Add files you don't want in git to .gitignore for lib_file ("$ZSH"/lib/*.zsh); do _omz_source "lib/${lib_file:t}" From 137bfbbfd1e39897f02ca47e9f010b0d81cc15ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 27 Apr 2025 14:55:23 +0200 Subject: [PATCH 433/453] chore(deps): bump certifi in /.github/workflows/dependencies (#13094) Bumps [certifi](https://github.com/certifi/python-certifi) from 2025.1.31 to 2025.4.26. - [Commits](https://github.com/certifi/python-certifi/compare/2025.01.31...2025.04.26) --- updated-dependencies: - dependency-name: certifi dependency-version: 2025.4.26 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependencies/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt index f2044a5f5..63eadd07d 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -1,4 +1,4 @@ -certifi==2025.1.31 +certifi==2025.4.26 charset-normalizer==3.4.1 idna==3.10 PyYAML==6.0.2 From 2ee4f9808ff50bf35f36b28657933afd6d80e268 Mon Sep 17 00:00:00 2001 From: Anand Buddhdev Date: Tue, 29 Apr 2025 10:34:33 +0200 Subject: [PATCH 434/453] docs(python): fix typo (#13096) --- plugins/python/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/python/README.md b/plugins/python/README.md index 490cf88f1..ca424ea55 100644 --- a/plugins/python/README.md +++ b/plugins/python/README.md @@ -34,7 +34,7 @@ virtual environments: `/bin/activate`, and automatically deactivate it when navigating out of it (keeps venv activated in subdirectories). - To enable the feature, set `PYTHON_AUTO_VRUN=true` before sourcing oh-my-zsh. - - The plugin activates the first existing virtual environment, in order, appearing in `$PYTON_VENV_NAMES`. + - The plugin activates the first existing virtual environment, in order, appearing in `$PYTHON_VENV_NAMES`. The default virtual environment name is `venv`. To use a different name, set `PYTHON_VENV_NAME=`. For example: `PYTHON_VENV_NAME=".venv"` From f6a7bbf81a18d30f75bad72de3398d0f55c8792b Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Tue, 29 Apr 2025 10:42:26 +0200 Subject: [PATCH 435/453] fix(debian): avoid `aptitude` hardcoding Closes #13095 --- plugins/debian/debian.plugin.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh index 5ef4cfb67..980440c0f 100644 --- a/plugins/debian/debian.plugin.zsh +++ b/plugins/debian/debian.plugin.zsh @@ -83,9 +83,9 @@ else } alias ac="su -ls '$apt_pref clean' root" alias ad="su -lc '$apt_pref update' root" - alias adg="su -lc '$apt_pref update && aptitude $apt_upgr' root" - alias adu="su -lc '$apt_pref update && aptitude dist-upgrade' root" - alias afu="su -lc '$apt-file update'" + alias adg="su -lc '$apt_pref update && $apt_pref $apt_upgr' root" + alias adu="su -lc '$apt_pref update && $apt_pref dist-upgrade' root" + alias afu="su -lc 'apt-file update'" alias au="su -lc '$apt_pref $apt_upgr' root" function ai() { cmd="su -lc '$apt_pref install $@' root" From 8648cd640b428bdd7dea65886c2671ef1e8ffe32 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 4 May 2025 17:22:51 +0200 Subject: [PATCH 436/453] chore(deps): bump charset-normalizer in /.github/workflows/dependencies (#13100) Bumps [charset-normalizer](https://github.com/jawah/charset_normalizer) from 3.4.1 to 3.4.2. - [Release notes](https://github.com/jawah/charset_normalizer/releases) - [Changelog](https://github.com/jawah/charset_normalizer/blob/master/CHANGELOG.md) - [Commits](https://github.com/jawah/charset_normalizer/compare/3.4.1...3.4.2) --- updated-dependencies: - dependency-name: charset-normalizer dependency-version: 3.4.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependencies/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt index 63eadd07d..e73c1b5ca 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -1,5 +1,5 @@ certifi==2025.4.26 -charset-normalizer==3.4.1 +charset-normalizer==3.4.2 idna==3.10 PyYAML==6.0.2 requests==2.32.3 From 51d0e0aa1de9c7f96012b9a0feda6509ed2a025b Mon Sep 17 00:00:00 2001 From: Hanashiko <129686115+Hanashiko@users.noreply.github.com> Date: Mon, 5 May 2025 14:00:29 +0300 Subject: [PATCH 437/453] docs(pip): add explanation for aliases (#13103) --- plugins/pip/README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/plugins/pip/README.md b/plugins/pip/README.md index 70d40c79f..9d1daca9f 100644 --- a/plugins/pip/README.md +++ b/plugins/pip/README.md @@ -20,17 +20,17 @@ the next time you autocomplete `pip install`. ## Aliases -| Alias | Description | -| :------- | :-------------------------------------------- | -| pipi | Install packages | -| pipig | Install package from GitHub repository | -| pipigb | Install package from GitHub branch | -| pipigp | Install package from GitHub pull request | -| pipu | Upgrade packages | -| pipun | Uninstall packages | -| pipgi | Grep through installed packages | -| piplo | List outdated packages | -| pipreq | Create requirements file | -| pipir | Install packages from `requirements.txt` file | -| pipupall | Update all installed packages | -| pipunall | Uninstall all installed packages | +| Alias | Command | Description | +| :--------|:----------------------------------------------------------------------------------|:--------------------------------------------- | +| pipi | `pip install` | Install packages | +| pipig | `pip install "git+https://github.com/user/repo.git"` | Install package from GitHub repository | +| pipigb | `pip install "git+https://github.com/user/repo.git@branch"` | Install package from GitHub branch | +| pipigp | `pip install "git+https://github.com/user/repo.git@refs/pull/PR_NUMBER/head"` | Install package from GitHub pull request | +| pipu | `pip install --upgrade` | Upgrade packages | +| pipun | `pip uninstall` | Uninstall packages | +| pipgi | `pip freeze \| grep` | Grep through installed packages | +| piplo | `pip list --outdated` | List outdated packages | +| pipreq | `pip freeze > requirements.txt` | Create requirements file | +| pipir | `pip install -r requirements.txt` | Install packages from `requirements.txt` file | +| pipupall | `pip list --outdated \| awk 'NR > 2 { print $1 }' \| xargs pip install --upgrade` | Update all installed packages | +| pipunall | `pip list --format freeze \| cut -d= -f1 \| xargs pip uninstall` | Uninstall all installed packages | From 62afbdebb96bf91c044a92b75d86f85a67da67a7 Mon Sep 17 00:00:00 2001 From: Cyril Plisko Date: Tue, 6 May 2025 18:27:04 +0300 Subject: [PATCH 438/453] feat(jj): add `jjgfa` alias (#13105) --- plugins/jj/README.md | 1 + plugins/jj/jj.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/jj/README.md b/plugins/jj/README.md index cd43ed11b..541b8f907 100644 --- a/plugins/jj/README.md +++ b/plugins/jj/README.md @@ -20,6 +20,7 @@ plugins=(... jj) | jje | `jj edit` | | jjgcl | `jj git clone` | | jjgf | `jj git fetch` | +| jjgfa | `jj git fetch --all-remotes` | | jjgp | `jj git push` | | jjl | `jj log` | | jjla | `jj log -r "all()"` | diff --git a/plugins/jj/jj.plugin.zsh b/plugins/jj/jj.plugin.zsh index 06c04958b..825460517 100644 --- a/plugins/jj/jj.plugin.zsh +++ b/plugins/jj/jj.plugin.zsh @@ -42,6 +42,7 @@ alias jjds='jj desc' alias jje='jj edit' alias jjgcl='jj git clone' alias jjgf='jj git fetch' +alias jjgfa='jj git fetch --all-remotes' alias jjgp='jj git push' alias jjl='jj log' alias jjla='jj log -r "all()"' From 3f8ea81b89cda583acea098c9b7353c295619d4d Mon Sep 17 00:00:00 2001 From: "ohmyzsh[bot]" <54982679+ohmyzsh[bot]@users.noreply.github.com> Date: Sun, 11 May 2025 11:06:03 +0200 Subject: [PATCH 439/453] feat(z): update to cf9225fe (#13115) Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com> --- .github/dependencies.yml | 2 +- plugins/z/LICENSE | 2 +- plugins/z/z.plugin.zsh | 13 +++++++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/dependencies.yml b/.github/dependencies.yml index 70f3d03da..23168b91a 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -38,7 +38,7 @@ dependencies: plugins/z: branch: master repo: agkozak/zsh-z - version: dd94ef04acc41748ba171eb219971cb455e0040b + version: cf9225feebfae55e557e103e95ce20eca5eff270 precopy: | set -e test -e README.md && mv -f README.md MANUAL.md diff --git a/plugins/z/LICENSE b/plugins/z/LICENSE index 162cba8d1..b36aeb408 100644 --- a/plugins/z/LICENSE +++ b/plugins/z/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018-2024 Alexandros Kozak +Copyright (c) 2018-2025 Alexandros Kozak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/plugins/z/z.plugin.zsh b/plugins/z/z.plugin.zsh index bf15b01de..39b832292 100644 --- a/plugins/z/z.plugin.zsh +++ b/plugins/z/z.plugin.zsh @@ -4,7 +4,7 @@ # # https://github.com/agkozak/zsh-z # -# Copyright (c) 2018-2024 Alexandros Kozak +# Copyright (c) 2018-2025 Alexandros Kozak # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -294,7 +294,16 @@ zshz() { owner=${ZSHZ_OWNER:-${_Z_OWNER}} if (( ZSHZ[USE_FLOCK] )); then - ${ZSHZ[MV]} "$tempfile" "$datafile" 2> /dev/null || ${ZSHZ[RM]} -f "$tempfile" + # An unsual case: if inside Docker container where datafile could be bind + # mounted + if [[ -r '/proc/1/cgroup' && "$(< '/proc/1/cgroup')" == *docker* ]]; then + print "$(< "$tempfile")" > "$datafile" 2> /dev/null + ${ZSHZ[RM]} -f "$tempfile" + # All other cases + else + ${ZSHZ[MV]} "$tempfile" "$datafile" 2> /dev/null || + ${ZSHZ[RM]} -f "$tempfile" + fi if [[ -n $owner ]]; then ${ZSHZ[CHOWN]} ${owner}:"$(id -ng ${owner})" "$datafile" From c34c1da736f4f162206e1153e66850788f3e2e16 Mon Sep 17 00:00:00 2001 From: Lorenzo Bettini Date: Mon, 12 May 2025 09:56:26 +0200 Subject: [PATCH 440/453] docs(vi-mode): explaination for text objects (#13116) --- plugins/vi-mode/README.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/plugins/vi-mode/README.md b/plugins/vi-mode/README.md index 6e781f296..bc78cfa3d 100644 --- a/plugins/vi-mode/README.md +++ b/plugins/vi-mode/README.md @@ -46,7 +46,7 @@ hasn't been defined by theme, *Insert mode* is not displayed by default. You can change these indicators by setting the `MODE_INDICATOR` (*Normal mode*) and `INSERT_MODE_INDICATORS` (*Insert mode*) variables. -This settings support Prompt Expansion sequences. For example: +These settings support Prompt Expansion sequences. For example: ```zsh MODE_INDICATOR="%F{white}+%f" @@ -157,6 +157,27 @@ NOTE: delete/kill commands (`dd`, `D`, `c{motion}`, `C`, `x`,`X`) and yank comma (`y`, `Y`) will copy to the clipboard. Contents can then be put back using paste commands (`P`, `p`). +## Text objects + +Standard text objects are supported with `i` ("inside") and `a` ("around"), e.g., for words; thus, you can select the word the cursor is in with `viw`, or delete the current word, including surrounding spaces, with `daw`. + +For other text objects, you can rely on the built-in functionality of Zsh and enable it accordingly. +For example, for quoted strings, you can copy the commented snippet of : place this in your `.zsrhc` file, e.g., after sourcing oh-my-zsh: + +```sh +autoload -U select-quoted +zle -N select-quoted +for m in visual viopp; do + for c in {a,i}{\',\",\`}; do + bindkey -M $m $c select-quoted + done +done +``` + +Now, in normal mode, you can select everything inside a double-quoted string with `vi"`. +Note that this works even if you're not already inside a quoted string. +For example, you can replace everything inside a single-quoted string in the current line, from wherever the cursor is, with `ci'`. + ## Known issues ### Low `$KEYTIMEOUT` From c95509ebfdbcc3c497f12697cfd2717bcb0a528b Mon Sep 17 00:00:00 2001 From: Igor Aleksandrov Date: Thu, 15 May 2025 01:48:50 +0400 Subject: [PATCH 441/453] feat(kamal): add autocomplete support and aliases for Kamal (https://kamal-deploy.org/) (#13080) --- plugins/kamal/README.md | 16 + plugins/kamal/_kamal | 691 +++++++++++++++++++++++++++++++++ plugins/kamal/kamal.plugin.zsh | 25 ++ 3 files changed, 732 insertions(+) create mode 100644 plugins/kamal/README.md create mode 100644 plugins/kamal/_kamal create mode 100644 plugins/kamal/kamal.plugin.zsh diff --git a/plugins/kamal/README.md b/plugins/kamal/README.md new file mode 100644 index 000000000..af5716826 --- /dev/null +++ b/plugins/kamal/README.md @@ -0,0 +1,16 @@ +# Kamal + +This plugin provides completion for [Kamal](https://kamal-deploy.org/) as well as some +aliases for frequent Kamal commands. + +To use it, add kamal to the plugins array of your zshrc file: + +```zsh +plugins=(... kamal) +``` + +## Aliase + +| Alias | Command | Description | +|-----------|----------------------------------|----------------------------------------------------------------------------------| +| kad | `kamal deploy` | Deploy app to servers | diff --git a/plugins/kamal/_kamal b/plugins/kamal/_kamal new file mode 100644 index 000000000..52b29e814 --- /dev/null +++ b/plugins/kamal/_kamal @@ -0,0 +1,691 @@ +#compdef kamal + +# Description +# ----------- +# zsh completion for Kamal (https://kamal-deploy.org/) +# ------------------------------------------------------------------------- +# Authors +# ------- +# * Igor Aleksandrov +# ------------------------------------------------------------------------- +# Inspiration +# ----------- +# * docker-compose ohmyzsh completion script by @sdurrheimer Steve Durrheimer +# ------------------------------------------------------------------------- + +# _kamal_commands() { +# # Only initialize if empty +# if (( ${#kamal_commands} == 0 )); then +# kamal_commands=( +# accessory +# app +# audit +# build +# config +# deploy +# details +# docs +# help +# init +# lock +# proxy +# prune +# redeploy +# registry +# remove +# rollback +# secrets +# server +# setup +# upgrade +# version +# ) +# fi + +# _values 'Kamal commands' $kamal_commands +# } + +typeset -gr _kamal_commands=( + 'accessory:Control accessory services' + 'app:Control application deployment' + 'audit:Audit security of deployment' + 'build:Build and manage app images' + 'config:Show effective configuration' + 'deploy:Deploy app to servers' + 'details:Show details about deployment' + 'docs:Open documentation in browser' + 'help:Show command help' + 'init:Initialize new Kamal project' + 'lock:Manage deployment locks' + 'proxy:Control reverse proxy' + 'prune:Clean up containers and images' + 'redeploy:Redeploy current version' + 'registry:Manage Docker registry access' + 'remove:Remove app from servers' + 'rollback:Rollback to a previous version' + 'secrets:Manage deployment secrets' + 'server:Control server configuration' + 'setup:Setup initial deployment' + 'upgrade:Upgrade deployment' + 'version:Show Kamal version' +) + +# Helper function to display messages +_kamal_message() { + local msg="$1" + _kamal_message "==> $msg" +} + +# Helper function to extract destination names from ./config/deploy.*.yml +_kamal_destinations() { + local -a dests + local file + + # Check if config directory exists + if [[ ! -d "config" ]]; then + _kamal_message "Cannot find Kamal configuration directory at ./config" && return 1 + fi + + for file in config/deploy.*.yml(N); do + [[ $file =~ config/deploy\.(.+)\.yml ]] && dests+=("${match[1]}") + done + + _values 'Destination' $dests +} + +# Define global _kamal_flags array +typeset -ga _kamal_flags +_kamal_flags=( + '(-v --verbose )'{-v,--verbose}'[Detailed logging]' + '(--no-verbose --skip-verbose)'{--no-verbose,--skip-verbose}'[No detailed logging]' + '(-q --quiet --no-quiet --skip-quiet)'{-q,--quiet}'[Minimal logging]' + '(-q --quiet --no-quiet --skip-quiet)'{--no-quiet,--skip-quiet}'[No minimal logging]' + '--version=[Run commands against a specific app version]:version' + '(-p --primary --no-primary --skip-primary)'{-p,--primary}'[Run commands only on primary host instead of all]' + '(-p --primary --no-primary --skip-primary)'{--no-primary,--skip-primary}'[Do not run commands only on primary host]' + '(-h --hosts)'{-h,--hosts=}'[Run commands on these hosts instead of all]:hosts' + '(-r --roles)'{-r,--roles=}'[Run commands on these roles instead of all]:roles' + '(-c --config-file)'{-c,--config-file=}'[Path to config file]:config file:_files' + '(-d --destination)'{-d,--destination=}'[Specify destination to be used for config file]:destination:_kamal_destinations' + '(-H --skip-hooks)'{-H,--skip-hooks}'[Do not run hooks]' +) + +_kamal() { + local context state state_descr line curcontext="$curcontext" + typeset -A opt_args + + local ret=1 + + _arguments -C \ + $_kamal_flags \ + '1: :->command' \ + '*:: :->args' && ret=0 + + case $state in + (command) + # First argument - show available commands + _describe -t kamal-commands "Kamal commands" _kamal_commands && ret=0 + ;; + (args) + # Subsequent arguments - handle based on the command + case $words[1] in + (accessory) + _kamal_accessory && ret=0 + ;; + (app) + _kamal_app && ret=0 + ;; + (audit) + _arguments $_kamal_flags && ret=0 + ;; + (build) + _kamal_build && ret=0 + ;; + (config) + _arguments $_kamal_flags && ret=0 + ;; + (deploy) + _arguments $_kamal_flags && ret=0 + ;; + (details) + _arguments $_kamal_flags && ret=0 + ;; + (docs) + _arguments $_kamal_flags && ret=0 + ;; + (help) + _kamal_help && ret=0 + ;; + (init) + local -a init_flags + init_flags=( + $_kamal_flags + '(--bundle --no-bundle --skip-bundle)--bundle[Add Kamal to the Gemfile and create a bin/kamal binstub]' + '(--bundle --no-bundle --skip-bundle)--no-bundle[Do not add Kamal to the Gemfile and create a bin/kamal binstub]' + '(--bundle --no-bundle --skip-bundle)--skip-bundle[Skip add Kamal to the Gemfile and create a bin/kamal binstub]' + ) + _arguments $init_flags && ret=0 + ;; + (lock) + _kamal_lock && ret=0 + ;; + (proxy) + _kamal_proxy && ret=0 + ;; + (prune) + _kamal_prune && ret=0 + ;; + (redeploy) + _arguments $_kamal_flags && ret=0 + ;; + (registry) + _kamal_registry && ret=0 + ;; + (remove) + local -a remove_flags + remove_flags=( + $_kamal_flags + '(-y --confirmed --no-confirmed --skip-confirmed)'{-y,--confirmed}'[Proceed without confirmation question]' + '(-y --confirmed --no-confirmed --skip-confirmed)--no-confirmed[Proceed without confirmation question]' + '(-y --confirmed --no-confirmed --skip-confirmed)--skip-confirmed[Proceed without confirmation question]' + ) + _arguments $remove_flags && ret=0 + ;; + (rollback) + if (( CURRENT == 2 )); then + _kamal_message "Enter the version to rollback to" && ret=0 + else + _values $_kamal_flags && ret=0 + fi + ;; + (secrets) + _kamal_secrets && ret=0 + ;; + (server) + _kamal_server && ret=0 + ;; + (setup) + local -a setup_flags + setup_flags=( + $_kamal_flags + '(-P --skip-push)'{-P,--skip-push}'[Skip image build and push]' + ) + _arguments $setup_flags && ret=0 + ;; + (upgrade) + local -a upgrade_flags + upgrade_flags=( + $_kamal_flags + '(-y --confirmed --no-confirmed --skip-confirmed)'{-y,--confirmed}'[Proceed without confirmation question]' + '(-y --confirmed --no-confirmed --skip-confirmed)--no-confirmed[Do not proceed without confirmation question]' + '(-y --confirmed --no-confirmed --skip-confirmed)--skip-confirmed[Skip confirmation question]' + '(--rolling --no-rolling --skip-rolling)--rolling[Upgrade one host at a time]' + '(--rolling --no-rolling --skip-rolling)--no-rolling[Do not upgrade one host at a time]' + '(--rolling --no-rolling --skip-rolling)--skip-rolling[Skip rolling upgrade]' + ) + _arguments $upgrade_flags && ret=0 + ;; + (version) + _arguments $_kamal_flags && ret=0 + esac + ;; + esac + + return ret +} + +_kamal_accessory() { + local context state line + typeset -A opt_args + local ret=1 + + # Define accessory subcommands + local -a accessory_subcommands + accessory_subcommands=( + "boot:Boot new accessory service on host (use NAME=all to boot all accessories)" + "details:Show details about accessory on host (use NAME=all to show all accessories)" + "exec:Execute a custom command on servers within the accessory container (use --help to show options)" + "help:Describe subcommands or one specific subcommand" + "logs:Show log lines from accessory on host (use --help to show options)" + "reboot:Reboot existing accessory on host (stop container, remove container, start new container; use NAME=all to boot all accessories)" + "remove:Remove accessory container, image and data directory from host (use NAME=all to remove all accessories)" + "restart:Restart existing accessory container on host" + "start:Start existing accessory container on host" + "stop:Stop existing accessory container on host" + "upgrade:Upgrade accessories from Kamal 1.x to 2.0 (restart them in 'kamal' network)" + ) + + _arguments -C \ + '1: :->subcmd' \ + '*:: :->args' && ret=0 + + case $state in + (subcmd) + _describe -t accessory-commands "Kamal accessory commands" accessory_subcommands && ret=0 + ;; + (args) + case $words[1] in + (boot|details|exec|logs|reboot|remove|restart|start|stop) + # These commands require a NAME parameter + if (( CURRENT == 2 )); then + # At the NAME position - we could add accessory name completion here + # if we had a way to list available accessories + _kamal_message "Specify an accessory name (or 'all' for all accessories)" && ret=0 + elif [[ "$words[1]" == "exec" && CURRENT == 3 ]]; then + # For exec, the 3rd argument is a command + _kamal_message "Enter a command to execute" && ret=0 + elif (( CURRENT > 2 )) && [[ "$words[1]" != "exec" || CURRENT > 3 ]]; then + _values $_kamal_flags && ret=0 + fi + ;; + (help) + # Remove help itself from the list of commands + accessory_subcommands=("${(@)accessory_subcommands:#help*}") + _describe -t accessory-help-commands "Kamal accessory help commands" accessory_subcommands + ;; + (upgrade) + # For upgrade, show flags immediately + _arguments $_kamal_flags && ret=0 + ;; + esac + ;; + esac + + return ret +} + +_kamal_app() { + local context state line + typeset -A opt_args + local ret=1 + + local -a app_subcommands + app_subcommands=( + "boot:Boot app on servers (or reboot app if already running)" + "containers:Show app containers on servers" + "details:Show details about app containers" + "exec:Execute a custom command on servers within the app container (use --help to show options)" + "help:Describe subcommands or one specific subcommand" + "images:Show app images on servers" + "logs:Show log lines from app on servers (use --help to show options)" + "remove:Remove app containers and images from servers" + "stale_containers:Detect app stale containers" + "start:Start existing app container on servers" + "stop:Stop app container on servers" + "version:Show app version currently running on servers" + ) + + _arguments -C \ + '1: :->subcmd' \ + '*:: :->args' && ret=0 + + case $state in + (subcmd) + _describe -t app-commands "Kamal app commands" app_subcommands && ret=0 + ;; + (args) + case $words[1] in + (boot|containers|details|images|logs|remove|stale_containers|start|stop) + _arguments $_kamal_flags && ret=0 + ;; + (exec) + # For exec, the next argument is a command + if (( CURRENT == 2 )); then + _kamal_message "Enter a command to execute" && ret=0 + else + _values $_kamal_flags && ret=0 + fi + ;; + (help) + # Remove help itself from the list of commands + app_subcommands=("${(@)app_subcommands:#help*}") + _describe -t app-help-commands "Kamal app help commands" app_subcommands + ;; + esac + ;; + esac + + return ret +} + +_kamal_build() { + local context state line + typeset -A opt_args + local ret=1 + + local -a build_subcommands + build_subcommands=( + "create:Create a build setup" + "deliver:Build app and push app image to registry then pull image on servers" + "details:Show build setup" + "dev:Build using the working directory, tag it as dirty, and push to local image store." + "help:Describe subcommands or one specific subcommand" + "pull:Pull app image from registry onto servers" + "push:Build and push app image to registry" + "remove:Remove build setup" + ) + + _arguments -C \ + '1: :->subcmd' \ + '*:: :->args' && ret=0 + + case $state in + (subcmd) + _describe -t build-commands "Kamal build commands" build_subcommands && ret=0 + ;; + (args) + case $words[1] in + (create|deliver|details|dev|pull|push|remove) + _arguments $_kamal_flags && ret=0 + ;; + (help) + # Remove help itself from the list of commands + build_subcommands=("${(@)build_subcommands:#help*}") + _describe -t build-help-commands "Kamal build help commands" build_subcommands + ;; + esac + ;; + esac + + return ret +} + +_kamal_help() { + local ret=1 + + # Make sure kamal_commands is initialized properly + # if (( ${#kamal_commands} == 0 )); then + # _kamal_commands >/dev/null + # fi + + # If we already have a command after "help", return without suggestions + if (( CURRENT > 2 )); then + ret=0 + else + local -a help_commands + # Filter out help from the list of commands + help_commands=("${(@)_kamal_commands:#help}") + + _values 'Kamal help' $help_commands && ret=0 + fi + + return ret +} + +_kamal_lock() { + local context state line + typeset -A opt_args + local ret=1 + + local -a lock_subcommands + lock_subcommands=( + "acquire:Acquire the deploy lock" + "help:Describe subcommands or one specific subcommand" + "release:Release the deploy lock" + "status:Report lock status" + ) + + _arguments -C \ + '1: :->subcmd' \ + '*:: :->args' && ret=0 + + case $state in + (subcmd) + _describe -t lock-commands "Kamal lock commands" lock_subcommands && ret=0 + ;; + (args) + case $words[1] in + (acquire) + local -a acquire_flags + acquire_flags=( + $_kamal_flags + '(-m --message)'{-m,--message=}'[A lock message]:message:' # Required flag + ) + _arguments $acquire_flags && ret=0 + ;; + (release|status) + _arguments $_kamal_flags && ret=0 + ;; + (help) + # Remove help itself from the list of commands + lock_subcommands=("${(@)lock_subcommands:#help*}") + _describe -t lock-help-commands "Kamal lock help commands" lock_subcommands + ;; + esac + ;; + esac + + return ret +} + +_kamal_proxy() { + local context state line + typeset -A opt_args + local ret=1 + + local -a proxy_subcommands + proxy_subcommands=( + "boot:Boot proxy on servers" + "boot_config:Manage kamal-proxy boot configuration" + "details:Show details about proxy container from servers" + "help:Describe subcommands or one specific subcommand" + "logs:Show log lines from proxy on servers" + "reboot:Reboot proxy on servers (stop container, remove container, start new container)" + "remove:Remove proxy container and image from servers" + "restart:Restart existing proxy container on servers" + "start:Start existing proxy container on servers" + "stop:Stop existing proxy container on servers" + ) + + _arguments -C \ + '1: :->subcmd' \ + '*:: :->args' && ret=0 + + case $state in + (subcmd) + _describe -t proxy-commands "Kamal proxy commands" proxy_subcommands && ret=0 + ;; + (args) + case $words[1] in + (boot|details|logs|reboot|remove|restart|start|stop) + _arguments $_kamal_flags && ret=0 + ;; + (boot_config) + if (( CURRENT == 2 )); then + local -a boot_config_commands=( + "set:Set boot configuration" + "get:Get boot configuration" + "reset:Reset boot configuration" + ) + _describe -t boot-config-commands "Boot config commands" boot_config_commands && ret=0 + else + _values $_kamal_flags && ret=0 + fi + ;; + (help) + # Remove help itself from the list of commands + proxy_subcommands=("${(@)proxy_subcommands:#help*}") + _describe -t proxy-help-commands "Kamal proxy help commands" proxy_subcommands + ;; + esac + ;; + esac + + return ret +} + +_kamal_prune() { + local context state line + typeset -A opt_args + local ret=1 + + local -a prune_subcommands + prune_subcommands=( + "all:Prune unused images and stopped containers" + "containers:Prune all stopped containers, except the last n (default 5)" + "help:Describe subcommands or one specific subcommand" + "images:Prune unused images" + ) + + _arguments -C \ + '1: :->subcmd' \ + '*:: :->args' && ret=0 + + case $state in + (subcmd) + _describe -t prune-commands "Kamal prune commands" prune_subcommands && ret=0 + ;; + (args) + case $words[1] in + (all|containers|images) + _arguments $_kamal_flags && ret=0 + ;; + (help) + # Remove help itself from the list of commands + prune_subcommands=("${(@)prune_subcommands:#help*}") + _describe -t prune-help-commands "Kamal prune help commands" prune_subcommands + ;; + esac + ;; + esac + + return ret +} + +_kamal_registry() { + local context state line + typeset -A opt_args + local ret=1 + + local -a registry_subcommands + registry_subcommands=( + "help:Describe subcommands or one specific subcommand" + "login:Log in to registry locally and remotely" + "logout:Log out of registry locally and remotely" + ) + + _arguments -C \ + '1: :->subcmd' \ + '*:: :->args' && ret=0 + + case $state in + (subcmd) + _describe -t registry-commands "Kamal registry commands" registry_subcommands && ret=0 + ;; + (args) + case $words[1] in + (help) + # Remove help itself from the list of commands + registry_subcommands=("${(@)registry_subcommands:#help*}") + _describe -t registry-help-commands "Kamal registry help commands" registry_subcommands + ;; + (login|logout) + _arguments $_kamal_flags && ret=0 + ;; + esac + ;; + esac + + return ret +} + +_kamal_secrets() { + local context state line + typeset -A opt_args + local ret=1 + + local -a secrets_subcommands + secrets_subcommands=( + "extract:Extract a single secret from the results of a fetch call" + "fetch:Fetch secrets from a vault" + "help:Describe subcommands or one specific subcommand" + "print:Print the secrets (for debugging)" + ) + + _arguments -C \ + '1: :->subcmd' \ + '*:: :->args' && ret=0 + + case $state in + (subcmd) + _describe -t secrets-commands "Kamal secrets commands" secrets_subcommands && ret=0 + ;; + (args) + case $words[1] in + (fetch) + local -a fetch_flags + fetch_flags=( + $_kamal_flags + '(-a --adapter)'{-a,--adapter=}'[Secret storage adapter]:adapter:(aws-parameter-store)' + ) + _arguments $fetch_flags && ret=0 + ;; + (extract|print) + _arguments $_kamal_flags && ret=0 + ;; + (help) + # Remove help itself from the list of commands + secrets_subcommands=("${(@)secrets_subcommands:#help*}") + _describe -t secrets-help-commands "Kamal secrets help commands" secrets_subcommands + ;; + esac + ;; + esac + + return ret +} + +_kamal_server() { + local context state line + typeset -A opt_args + local ret=1 + + local -a server_subcommands + server_subcommands=( + "bootstrap:Set up Docker to run Kamal apps" + "exec:Run a custom command on the server (use --help to show options)" + "help:Describe subcommands or one specific subcommand" + ) + + local -a server_flags + server_flags=( + $_kamal_flags + '(-i --interactive --no-interactive --skip-interactive)'{-i,--interactive}'[Run the command interactively]' + '(-i --interactive --no-interactive --skip-interactive)--no-interactive[Do not run the command interactively]' + '(-i --interactive --no-interactive --skip-interactive)--skip-interactive[Skip interactive mode]' + ) + + _arguments -C \ + '1: :->subcmd' \ + '*:: :->args' && ret=0 + + case $state in + (subcmd) + _describe -t server-commands "Kamal server commands" server_subcommands && ret=0 + ;; + (args) + case $words[1] in + (bootstrap) + _arguments $server_flags && ret=0 + ;; + (exec) + if (( CURRENT == 2 )); then + # For exec, the next argument is a command + _kamal_message "Enter a command to execute" && ret=0 + else + _values $server_flags && ret=0 + fi + ;; + (help) + # Remove help itself from the list of commands + server_subcommands=("${(@)server_subcommands:#help*}") + _describe -t server-help-commands "Kamal server help commands" server_subcommands + ;; + esac + ;; + esac + + return ret +} + +_kamal "$@" \ No newline at end of file diff --git a/plugins/kamal/kamal.plugin.zsh b/plugins/kamal/kamal.plugin.zsh new file mode 100644 index 000000000..e21ab4f92 --- /dev/null +++ b/plugins/kamal/kamal.plugin.zsh @@ -0,0 +1,25 @@ +# Find kamal binary (local ./bin/kamal or global) +function _kamal_command () { + if [ -x "./bin/kamal" ]; then + ./bin/kamal "$@" + else + command kamal "$@" + fi +} + +function which-kamal() { + if [ -x "./bin/kamal" ]; then + echo "Using local ./bin/kamal" + else + echo "Using global $(command -v kamal)" + fi +} + +# Use `_kamal_command`` function for `kamal` command +alias kamal='_kamal_command' + +# Aliases +alias kad='kamal deploy' + +# Hook up completion +compdef _kamal_command=kamal From 881c8b78d3e3ade9bccfddb3e616842807d07a59 Mon Sep 17 00:00:00 2001 From: tobii-dev <77458451+tobii-dev@users.noreply.github.com> Date: Sun, 18 May 2025 19:14:44 +0200 Subject: [PATCH 442/453] feat(termsupport): add WezTerm support (#13121) Co-authored-by: Carlo Sala --- lib/termsupport.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index d2fbf42cd..994c9c322 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -17,7 +17,7 @@ function title { : ${2=$1} case "$TERM" in - cygwin|xterm*|putty*|rxvt*|konsole*|ansi|mlterm*|alacritty*|st*|foot*|contour*) + cygwin|xterm*|putty*|rxvt*|konsole*|ansi|mlterm*|alacritty*|st*|foot*|contour*|wezterm*) print -Pn "\e]2;${2:q}\a" # set window name print -Pn "\e]1;${1:q}\a" # set tab name ;; From 40c2a72e03b1df100b3937dd44a9754f17c06c6d Mon Sep 17 00:00:00 2001 From: Kirill Fedorov Date: Thu, 22 May 2025 12:23:50 +0300 Subject: [PATCH 443/453] fix(history): handle HIST_STAMPS with whitespace in timestamp format (#13099) Co-authored-by: Kirill Fedorov --- lib/history.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/history.zsh b/lib/history.zsh index 35da57de2..781a0e9de 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -18,10 +18,10 @@ function omz_history { print -u2 History file deleted. elif [[ $# -eq 0 ]]; then # if no arguments provided, show full history starting from 1 - builtin fc $stamp -l 1 + builtin fc "${stamp[@]}" -l 1 else # otherwise, run `fc -l` with a custom format - builtin fc $stamp -l "$@" + builtin fc "${stamp[@]}" -l "$@" fi } From 0354add542b6d769dbe39e10eb0caa0a11b2b716 Mon Sep 17 00:00:00 2001 From: G'lek Tarssza Date: Thu, 22 May 2025 03:27:34 -0600 Subject: [PATCH 444/453] fix(blinks)!: use `default` instead of `black` color (#13123) --- themes/blinks.zsh-theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/blinks.zsh-theme b/themes/blinks.zsh-theme index ddb32f7c3..736683c9a 100644 --- a/themes/blinks.zsh-theme +++ b/themes/blinks.zsh-theme @@ -11,11 +11,11 @@ function _prompt_char() { # This theme works with both the "dark" and "light" variants of the # Solarized color schema. Set the SOLARIZED_THEME variable to one of # these two values to choose. If you don't specify, we'll assume you're -# using the "dark" variant. +# using neither variant. case ${SOLARIZED_THEME:-dark} in light) bkg=white;; - *) bkg=black;; + *) bkg=default;; esac ZSH_THEME_GIT_PROMPT_PREFIX=" [%{%B%F{blue}%}" From 1ed17ac0523ebc4d12e4e5324fd5f5ce5dafc668 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalle=20Ahlstr=C3=B6m?= <71292737+kahlstrm@users.noreply.github.com> Date: Fri, 23 May 2025 16:43:53 +0300 Subject: [PATCH 445/453] feat(terraform): add `init -reconfigure` aliases` (#13129) --- plugins/terraform/README.md | 39 +++++++++++++------------- plugins/terraform/terraform.plugin.zsh | 2 ++ 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/plugins/terraform/README.md b/plugins/terraform/README.md index feaf21d40..6c139ac51 100644 --- a/plugins/terraform/README.md +++ b/plugins/terraform/README.md @@ -15,25 +15,26 @@ plugins=(... terraform) ## Aliases -| Alias | Command | -|---------|----------------------------------| -| `tf` | `terraform` | -| `tfa` | `terraform apply` | -| `tfaa` | `terraform apply -auto-approve` | -| `tfc` | `terraform console` | -| `tfd` | `terraform destroy` | -| `tfd!` | `terraform destroy -auto-approve`| -| `tff` | `terraform fmt` | -| `tffr` | `terraform fmt -recursive` | -| `tfi` | `terraform init` | -| `tfiu` | `terraform init -upgrade` | -| `tfo` | `terraform output` | -| `tfp` | `terraform plan` | -| `tfv` | `terraform validate` | -| `tfs` | `terraform state` | -| `tft` | `terraform test` | -| `tfsh` | `terraform show` | - +| Alias | Command | +| ------- | -------------------------------------- | +| `tf` | `terraform` | +| `tfa` | `terraform apply` | +| `tfaa` | `terraform apply -auto-approve` | +| `tfc` | `terraform console` | +| `tfd` | `terraform destroy` | +| `tfd!` | `terraform destroy -auto-approve` | +| `tff` | `terraform fmt` | +| `tffr` | `terraform fmt -recursive` | +| `tfi` | `terraform init` | +| `tfir` | `terraform init -reconfigure` | +| `tfiu` | `terraform init -upgrade` | +| `tfiur` | `terraform init -upgrade -reconfigure` | +| `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 046fabb03..0982fa193 100644 --- a/plugins/terraform/terraform.plugin.zsh +++ b/plugins/terraform/terraform.plugin.zsh @@ -24,7 +24,9 @@ alias 'tfd!'='terraform destroy -auto-approve' alias tff='terraform fmt' alias tffr='terraform fmt -recursive' alias tfi='terraform init' +alias tfir='terraform init -reconfigure' alias tfiu='terraform init -upgrade' +alias tfiur='terraform init -upgrade -reconfigure' alias tfo='terraform output' alias tfp='terraform plan' alias tfv='terraform validate' From d39804a5a6ba208159356b6ecd8308b559c588d0 Mon Sep 17 00:00:00 2001 From: Hanashiko <129686115+Hanashiko@users.noreply.github.com> Date: Sat, 24 May 2025 10:30:14 +0300 Subject: [PATCH 446/453] docs(universalarchive): expand documentation (#13136) --- plugins/universalarchive/README.md | 88 ++++++++++++++++++++---------- 1 file changed, 59 insertions(+), 29 deletions(-) diff --git a/plugins/universalarchive/README.md b/plugins/universalarchive/README.md index 93a1bd9fc..bcd33cea0 100644 --- a/plugins/universalarchive/README.md +++ b/plugins/universalarchive/README.md @@ -1,46 +1,76 @@ # universalarchive plugin -Lets you compress files by a command `ua `, supporting various -compression formats (e.g. 7z, tar.gz, lzma, ...). +The `universalarchive` plugin provides a convenient command-line interface for archiving files and directories using a wide variety of compression formats - without having to remember the exact syntax for each tool. -To enable it, add `universalarchive` to the plugins array in your zshrc file: +To enable it, add `universalarchive` to the plugins array in your `.zshrc` file: ```zsh plugins=(... universalarchive) ``` +## Features + - Compress files and directories using a simple, unified command: ua + - Automatically detects file/directory names to generate appropriate output names + - Supports fallback naming if an output file already exists + - Works with many common and advanced compression formats + - Designed for simplicity and quick use in the terminal + ## Usage -Run `ua ` to compress `` into an archive file using ``. -For example: - +Basic command format: ```sh -ua xz *.html +ua +``` +- ``: the archive format to use (e.g., `zip`, `tar.gz`, `xz`, `7z`, etc.) +- ``: one or more files or directories to compress + +## Examples: + +Compresses `notes.txt` and `images` into `notes.zip` +```sh +ua zip notes.txt images/ ``` -this command will compress all `.html` files in directory `folder` into `folder.xz`. +Creates `myproject.tar.gz` +```sh +ua tar.gz myproject/ +``` -This plugin saves you from having to remember which command line arguments compress a file. +Compresses all .log files into `current_folder.xz` +```sh +ua xz *.log +``` -## Supported compression formats +The plugin will generate a default archive filename based on the input: + - For a file, the output is derived from the file name without its extension. + - For a directory, it uses the directory name. + - For multiple files, it uses the name of the common parent directory. -| Extension | Description | -|:-----------------|:-------------------------------| -| `7z` | 7zip file | -| `bz2` | Bzip2 file | -| `gz` | Gzip file | -| `lzma` | LZMA archive | -| `lzo` | LZO archive | -| `rar` | WinRAR archive | -| `tar` | Tarball | -| `tbz`/`tar.bz2` | Tarball with bzip2 compression | -| `tgz`/`tar.gz` | Tarball with gzip compression | -| `tlz`/`tar.lzma` | Tarball with lzma compression | -| `txz`/`tar.xz` | Tarball with lzma2 compression | -| `tZ`/`tar.Z` | Tarball with LZW compression | -| `xz` | LZMA2 archive | -| `Z` | Z archive (LZW) | -| `zip` | Zip archive | -| `zst` | Zstd archive | + If the output file already exists, a unique filename is generated using `mktemp`. -See [list of archive formats](https://en.wikipedia.org/wiki/List_of_archive_formats) for more information regarding the archive formats. +## Supported Archive Formats + +| Format | Description | Tool Used | +|:-----------------|:-------------------------------|:-----------------| +| `7z` | 7zip archive | `7z` | +| `bz2` | Bzip2-compressed file | `bzip2` | +| `gz` | Gzip-compressed file | `gzip` | +| `lzma` | LZMA-compressed file | `lzma` | +| `lzo` | LZO-compressed file | `lzop` | +| `rar` | WinRAR archive | `rar` | +| `tar` | Uncompressed tarball | `tar` | +| `tbz`,`tar.bz2` | Tarball compressed with Bzip2 | `tar + bzip2` | +| `tgz`,`tar.gz` | Tarball compressed with Gzip | `tar + gzip` | +| `tlz`,`tar.lzma` | Tarball compressed with LZMA | `tar + lzma` | +| `txz`,`tar.xz` | Tarball compressed with LZMA2 | `tar + xz` | +| `tZ`,`tar.Z` | Tarball compressed with LZW | `tar + compress` | +| `xz` | XZ-compressed file | `xz` | +| `Z` | LZW-compressed file | `compress` | +| `zip` | Standard Zip archive | `zip` | +| `zst` | Zstandard-compressed file | `zstd` | + + > Note: Some formats may require specific tools to be installed on your system (e.g. `7z`, `rar`, `lzop`, `zstd`). Make sure these tools are available in your `$PATH`. + +## Auto-Completion + +The plugin provides tab-completion for supported formats and input files. Type `ua ` to see available formats, and `ua ` to browse files. From 13c702964c0287059a75eaec98cd71de51f4f19c Mon Sep 17 00:00:00 2001 From: Ilia Burtsev Date: Sat, 24 May 2025 13:39:17 +0300 Subject: [PATCH 447/453] fix(async): ensure `git_prompt_status` can be registered (#13134) --- lib/git.zsh | 198 ++++++++++++++++++++++++++-------------------------- 1 file changed, 99 insertions(+), 99 deletions(-) diff --git a/lib/git.zsh b/lib/git.zsh index a1b4d1587..f4d4229cb 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -39,6 +39,105 @@ function _omz_git_prompt_info() { echo "${ZSH_THEME_GIT_PROMPT_PREFIX}${ref:gs/%/%%}${upstream:gs/%/%%}$(parse_git_dirty)${ZSH_THEME_GIT_PROMPT_SUFFIX}" } +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 + # This cannot use the prompt constants, as they may be empty + local -A prefix_constant_map + prefix_constant_map=( + '\?\? ' 'UNTRACKED' + 'A ' 'ADDED' + 'M ' 'MODIFIED' + 'MM ' 'MODIFIED' + ' M ' 'MODIFIED' + 'AM ' 'MODIFIED' + ' T ' 'MODIFIED' + 'R ' 'RENAMED' + ' D ' 'DELETED' + 'D ' 'DELETED' + 'UU ' 'UNMERGED' + 'ahead' 'AHEAD' + 'behind' 'BEHIND' + 'diverged' 'DIVERGED' + 'stashed' 'STASHED' + ) + + # Maps the internal constant to the prompt theme + local -A constant_prompt_map + constant_prompt_map=( + 'UNTRACKED' "$ZSH_THEME_GIT_PROMPT_UNTRACKED" + 'ADDED' "$ZSH_THEME_GIT_PROMPT_ADDED" + 'MODIFIED' "$ZSH_THEME_GIT_PROMPT_MODIFIED" + 'RENAMED' "$ZSH_THEME_GIT_PROMPT_RENAMED" + 'DELETED' "$ZSH_THEME_GIT_PROMPT_DELETED" + 'UNMERGED' "$ZSH_THEME_GIT_PROMPT_UNMERGED" + 'AHEAD' "$ZSH_THEME_GIT_PROMPT_AHEAD" + 'BEHIND' "$ZSH_THEME_GIT_PROMPT_BEHIND" + 'DIVERGED' "$ZSH_THEME_GIT_PROMPT_DIVERGED" + 'STASHED' "$ZSH_THEME_GIT_PROMPT_STASHED" + ) + + # The order that the prompt displays should be added to the prompt + local status_constants + status_constants=( + UNTRACKED ADDED MODIFIED RENAMED DELETED + STASHED UNMERGED AHEAD BEHIND DIVERGED + ) + + local status_text + status_text="$(__git_prompt_git status --porcelain -b 2> /dev/null)" + + # Don't continue on a catastrophic failure + if [[ $? -eq 128 ]]; then + return 1 + fi + + # A lookup table of each git status encountered + local -A statuses_seen + + if __git_prompt_git rev-parse --verify refs/stash &>/dev/null; then + statuses_seen[STASHED]=1 + fi + + local status_lines + status_lines=("${(@f)${status_text}}") + + # If the tracking line exists, get and parse it + if [[ "$status_lines[1]" =~ "^## [^ ]+ \[(.*)\]" ]]; then + local branch_statuses + branch_statuses=("${(@s/,/)match}") + for branch_status in $branch_statuses; do + if [[ ! $branch_status =~ "(behind|diverged|ahead) ([0-9]+)?" ]]; then + continue + fi + local last_parsed_status=$prefix_constant_map[$match[1]] + statuses_seen[$last_parsed_status]=$match[2] + done + fi + + # For each status prefix, do a regex comparison + for status_prefix in ${(k)prefix_constant_map}; do + local status_constant="${prefix_constant_map[$status_prefix]}" + local status_regex=$'(^|\n)'"$status_prefix" + + if [[ "$status_text" =~ $status_regex ]]; then + statuses_seen[$status_constant]=1 + fi + done + + # Display the seen statuses in the order specified + local status_prompt + for status_constant in $status_constants; do + if (( ${+statuses_seen[$status_constant]} )); then + local next_display=$constant_prompt_map[$status_constant] + status_prompt="$next_display$status_prompt" + fi + done + + echo $status_prompt +} + # Use async version if setting is enabled, or unset but zsh version is at least 5.0.6. # This avoids async prompt issues caused by previous zsh versions: # - https://github.com/ohmyzsh/ohmyzsh/issues/12331 @@ -246,105 +345,6 @@ 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 _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 - # This cannot use the prompt constants, as they may be empty - local -A prefix_constant_map - prefix_constant_map=( - '\?\? ' 'UNTRACKED' - 'A ' 'ADDED' - 'M ' 'MODIFIED' - 'MM ' 'MODIFIED' - ' M ' 'MODIFIED' - 'AM ' 'MODIFIED' - ' T ' 'MODIFIED' - 'R ' 'RENAMED' - ' D ' 'DELETED' - 'D ' 'DELETED' - 'UU ' 'UNMERGED' - 'ahead' 'AHEAD' - 'behind' 'BEHIND' - 'diverged' 'DIVERGED' - 'stashed' 'STASHED' - ) - - # Maps the internal constant to the prompt theme - local -A constant_prompt_map - constant_prompt_map=( - 'UNTRACKED' "$ZSH_THEME_GIT_PROMPT_UNTRACKED" - 'ADDED' "$ZSH_THEME_GIT_PROMPT_ADDED" - 'MODIFIED' "$ZSH_THEME_GIT_PROMPT_MODIFIED" - 'RENAMED' "$ZSH_THEME_GIT_PROMPT_RENAMED" - 'DELETED' "$ZSH_THEME_GIT_PROMPT_DELETED" - 'UNMERGED' "$ZSH_THEME_GIT_PROMPT_UNMERGED" - 'AHEAD' "$ZSH_THEME_GIT_PROMPT_AHEAD" - 'BEHIND' "$ZSH_THEME_GIT_PROMPT_BEHIND" - 'DIVERGED' "$ZSH_THEME_GIT_PROMPT_DIVERGED" - 'STASHED' "$ZSH_THEME_GIT_PROMPT_STASHED" - ) - - # The order that the prompt displays should be added to the prompt - local status_constants - status_constants=( - UNTRACKED ADDED MODIFIED RENAMED DELETED - STASHED UNMERGED AHEAD BEHIND DIVERGED - ) - - local status_text - status_text="$(__git_prompt_git status --porcelain -b 2> /dev/null)" - - # Don't continue on a catastrophic failure - if [[ $? -eq 128 ]]; then - return 1 - fi - - # A lookup table of each git status encountered - local -A statuses_seen - - if __git_prompt_git rev-parse --verify refs/stash &>/dev/null; then - statuses_seen[STASHED]=1 - fi - - local status_lines - status_lines=("${(@f)${status_text}}") - - # If the tracking line exists, get and parse it - if [[ "$status_lines[1]" =~ "^## [^ ]+ \[(.*)\]" ]]; then - local branch_statuses - branch_statuses=("${(@s/,/)match}") - for branch_status in $branch_statuses; do - if [[ ! $branch_status =~ "(behind|diverged|ahead) ([0-9]+)?" ]]; then - continue - fi - local last_parsed_status=$prefix_constant_map[$match[1]] - statuses_seen[$last_parsed_status]=$match[2] - done - fi - - # For each status prefix, do a regex comparison - for status_prefix in ${(k)prefix_constant_map}; do - local status_constant="${prefix_constant_map[$status_prefix]}" - local status_regex=$'(^|\n)'"$status_prefix" - - if [[ "$status_text" =~ $status_regex ]]; then - statuses_seen[$status_constant]=1 - fi - done - - # Display the seen statuses in the order specified - local status_prompt - for status_constant in $status_constants; do - if (( ${+statuses_seen[$status_constant]} )); then - local next_display=$constant_prompt_map[$status_constant] - status_prompt="$next_display$status_prompt" - fi - done - - echo $status_prompt -} - # Outputs the name of the current user # Usage example: $(git_current_user_name) function git_current_user_name() { From 526969cad351fe85ff4a9a3949736bc08de2b12d Mon Sep 17 00:00:00 2001 From: Jonas Geiregat <288105+jonas-grgt@users.noreply.github.com> Date: Sat, 24 May 2025 12:40:40 +0200 Subject: [PATCH 448/453] feat(mvn): add verify aliases (#13133) --- plugins/mvn/README.md | 2 ++ plugins/mvn/mvn.plugin.zsh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/plugins/mvn/README.md b/plugins/mvn/README.md index 4181fedc5..bcb26482e 100644 --- a/plugins/mvn/README.md +++ b/plugins/mvn/README.md @@ -33,6 +33,8 @@ if it's found, or the mvn command otherwise. | `mvnct` | `mvn clean test` | | `mvncv` | `mvn clean verify` | | `mvncvst` | `mvn clean verify -DskipTests` | +| `mvnv` | `mvn verify` | +| `mvnvst` | `mvn verify -DskipTests` | | `mvndp` | `mvn deploy` | | `mvndocs` | `mvn dependency:resolve -Dclassifier=javadoc` | | `mvndt` | `mvn dependency:tree` | diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index 7bffce36e..8477722b0 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -62,6 +62,8 @@ alias mvncp='mvn clean package' alias mvnct='mvn clean test' alias mvncv='mvn clean verify' alias mvncvst='mvn clean verify -DskipTests' +alias mvnv='mvn verify' +alias mvnvst='mvn verify -DskipTests' alias mvndp='mvn deploy' alias mvndocs='mvn dependency:resolve -Dclassifier=javadoc' alias mvndt='mvn dependency:tree' From ecdc1e722a9f458b3b5c4900403ee77848e1dba2 Mon Sep 17 00:00:00 2001 From: Hanashiko <129686115+Hanashiko@users.noreply.github.com> Date: Sat, 24 May 2025 13:42:44 +0300 Subject: [PATCH 449/453] docs(rsync): improve README (#13137) --- plugins/rsync/README.md | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/plugins/rsync/README.md b/plugins/rsync/README.md index 032ee7f3b..04d16c88b 100644 --- a/plugins/rsync/README.md +++ b/plugins/rsync/README.md @@ -1,16 +1,26 @@ # rsync -This plugin adds aliases for frequent [rsync](https://rsync.samba.org/) commands. +This plugin adds aliases for frequent [rsync](https://rsync.samba.org/) commands, simplifying file transfer and synchronization tasks. -To use it add `rsync` to the plugins array in you zshrc file. +To use it add `rsync` to the plugins array in you `.zshrc` file. ```zsh plugins=(... rsync) ``` -| Alias | Command | -| ------------------- | ------------------------------------------------ | -| *rsync-copy* | `rsync -avz --progress -h` | -| *rsync-move* | `rsync -avz --progress -h --remove-source-files` | -| *rsync-update* | `rsync -avzu --progress -h` | -| *rsync-synchronize* | `rsync -avzu --delete --progress -h` | +| Alias | Command | Description | +| ------------------- | ------------------------------------------------ | ------------| +| `rsync-copy` | `rsync -avz --progress -h` | Recursively copy files and directories, preserving permissions, timestamps, and symbolic links. Compression is enabled for faster transfers. Progress is displayed in a human-readable format. | +| `rsync-move` | `rsync -avz --progress -h --remove-source-files` | Same as rsync-copy, but removes the source files after a successful transfer (effectively performing a move). | +| `rsync-update` | `rsync -avzu --progress -h` | Like rsync-copy, but only updates files if the source is newer than the destination (or if the destination file is missing). | +| `rsync-synchronize` | `rsync -avzu --delete --progress -h` | Performs bidirectional-style sync: updates files as in rsync-update and deletes files in the destination that no longer exist in the source. Useful for directory synchronization. | + +Explanation of Flags: + - -a: Archive mode; preserves symbolic links, permissions, timestamps, etc. + - -v: Verbose; shows details of the transfer process. + - -z: Compress file data during transfer for efficiency. + - -u: Skip files that are newer on the receiver. + - --progress: Show progress during file transfer. + - -h: Output numbers in human-readable format (e.g., 1K, 234M). + - --remove-source-files: Deletes source files after they are copied (used in rsync-move). + - --delete: Deletes files in the destination that are not present in the source (used in rsync-synchronize). From 095ac3ca8f4c3a89a69ff3b45cb67346f76babbd Mon Sep 17 00:00:00 2001 From: G'lek Tarssza Date: Sat, 24 May 2025 04:44:24 -0600 Subject: [PATCH 450/453] feat(cli): add `--enabled` flag to `omz plugin list` (#13128) --- lib/cli.zsh | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/lib/cli.zsh b/lib/cli.zsh index 3b6308313..0b144e4e7 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -72,6 +72,10 @@ function _omz { local -aU plugins plugins=("$ZSH"/plugins/*/{_*,*.plugin.zsh}(-.N:h:t) "$ZSH_CUSTOM"/plugins/*/{_*,*.plugin.zsh}(-.N:h:t)) _describe 'plugin' plugins ;; + plugin::list) + local -a opts + opts=('--enabled:List enabled plugins only') + _describe -o 'options' opts ;; theme::(set|use)) local -aU themes themes=("$ZSH"/themes/*.zsh-theme(-.N:t:r) "$ZSH_CUSTOM"/**/*.zsh-theme(-.N:r:gs:"$ZSH_CUSTOM"/themes/:::gs:"$ZSH_CUSTOM"/:::)) @@ -206,7 +210,7 @@ Available commands: disable Disable plugin(s) enable Enable plugin(s) info Get information of a plugin - list List all available Oh My Zsh plugins + list [--enabled] List Oh My Zsh plugins load Load plugin(s) EOF @@ -449,8 +453,21 @@ function _omz::plugin::info { function _omz::plugin::list { local -a custom_plugins builtin_plugins - custom_plugins=("$ZSH_CUSTOM"/plugins/*(-/N:t)) - builtin_plugins=("$ZSH"/plugins/*(-/N:t)) + + # If --enabled is provided, only list what's enabled + if [[ "$1" == "--enabled" ]]; then + local plugin + for plugin in "${plugins[@]}"; do + if [[ -d "${ZSH_CUSTOM}/plugins/${plugin}" ]]; then + custom_plugins+=("${plugin}") + elif [[ -d "${ZSH}/plugins/${plugin}" ]]; then + builtin_plugins+=("${plugin}") + fi + done + else + custom_plugins=("$ZSH_CUSTOM"/plugins/*(-/N:t)) + builtin_plugins=("$ZSH"/plugins/*(-/N:t)) + fi # If the command is being piped, print all found line by line if [[ ! -t 1 ]]; then From 6ef47526f852114209e36af87938075b4caa28e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Gamboa?= Date: Mon, 26 May 2025 07:27:53 -0400 Subject: [PATCH 451/453] feat(laravel): add `db:wipe` alias (#13071) --- plugins/laravel/README.md | 1 + plugins/laravel/laravel.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/laravel/README.md b/plugins/laravel/README.md index d722770c9..c5375f270 100644 --- a/plugins/laravel/README.md +++ b/plugins/laravel/README.md @@ -21,6 +21,7 @@ plugins=(... laravel) | `pamfs` | `php artisan migrate:fresh --seed` | | `pamr` | `php artisan migrate:rollback` | | `pads` | `php artisan db:seed` | +| `padw` | `php artisan db:wipe` | ## Makers diff --git a/plugins/laravel/laravel.plugin.zsh b/plugins/laravel/laravel.plugin.zsh index ef462b13c..20a1c473e 100644 --- a/plugins/laravel/laravel.plugin.zsh +++ b/plugins/laravel/laravel.plugin.zsh @@ -12,6 +12,7 @@ alias pamf='php artisan migrate:fresh' alias pamfs='php artisan migrate:fresh --seed' alias pamr='php artisan migrate:rollback' alias pads='php artisan db:seed' +alias padw='php artisan db:wipe' # Makers alias pamm='php artisan make:model' From 658240f49816bd6ae1e693a383e26b703ef2d0fb Mon Sep 17 00:00:00 2001 From: mm503 <182180598+mm503@users.noreply.github.com> Date: Thu, 29 May 2025 02:33:01 -0500 Subject: [PATCH 452/453] feat(kubectl): add aliases for `get events` (#13147) --- plugins/kubectl/README.md | 238 +++++++++++++++-------------- plugins/kubectl/kubectl.plugin.zsh | 2 + 2 files changed, 122 insertions(+), 118 deletions(-) diff --git a/plugins/kubectl/README.md b/plugins/kubectl/README.md index 28a502d11..6f347a8ee 100644 --- a/plugins/kubectl/README.md +++ b/plugins/kubectl/README.md @@ -11,124 +11,126 @@ plugins=(... kubectl) ## Aliases -| Alias | Command | Description | -| :------- | :------------------------------------------------- | :----------------------------------------------------------------------------------------------- | -| k | `kubectl` | The kubectl command | -| kca | `kubectl --all-namespaces` | The kubectl command targeting all namespaces | -| kaf | `kubectl apply -f` | Apply a YML file | -| keti | `kubectl exec -ti` | Drop into an interactive terminal on a container | -| | | **Manage configuration quickly to switch contexts between local, dev and staging** | -| kcuc | `kubectl config use-context` | Set the current-context in a kubeconfig file | -| kcsc | `kubectl config set-context` | Set a context entry in kubeconfig | -| kcdc | `kubectl config delete-context` | Delete the specified context from the kubeconfig | -| kccc | `kubectl config current-context` | Display the current-context | -| kcgc | `kubectl config get-contexts` | List of contexts available | -| | | **General aliases** | -| kdel | `kubectl delete` | Delete resources by filenames, stdin, resources and names, or by resources and label selector | -| kdelf | `kubectl delete -f` | Delete a pod using the type and name specified in -f argument | -| | | **Pod management** | -| kgp | `kubectl get pods` | List all pods in ps output format | -| kgpl | `kgp -l` | Get pods by label. Example: `kgpl "app=myapp" -n myns` | -| kgpn | `kgp -n` | Get pods by namespace. Example: `kgpn kube-system` | -| kgpsl | `kubectl get pods --show-labels` | List all pods in ps output format with labels | -| kgpw | `kgp --watch` | After listing/getting the requested object, watch for changes | -| kgpwide | `kgp -o wide` | Output in plain-text format with any additional information. For pods, the node name is included | -| kep | `kubectl edit pods` | Edit pods from the default editor | -| kdp | `kubectl describe pods` | Describe all pods | -| kdelp | `kubectl delete pods` | Delete all pods matching passed arguments | -| | | **Service management** | -| kgs | `kubectl get svc` | List all services in ps output format | -| kgsw | `kgs --watch` | After listing all services, watch for changes | -| kgswide | `kgs -o wide` | After listing all services, output in plain-text format with any additional information | -| kes | `kubectl edit svc` | Edit services(svc) from the default editor | -| kds | `kubectl describe svc` | Describe all services in detail | -| kdels | `kubectl delete svc` | Delete all services matching passed argument | -| | | **Ingress management** | -| kgi | `kubectl get ingress` | List ingress resources in ps output format | -| kei | `kubectl edit ingress` | Edit ingress resource from the default editor | -| kdi | `kubectl describe ingress` | Describe ingress resource in detail | -| kdeli | `kubectl delete ingress` | Delete ingress resources matching passed argument | -| | | **Namespace management** | -| kgns | `kubectl get namespaces` | List the current namespaces in a cluster | -| kcn | `kubectl config set-context --current --namespace` | Change current namespace | -| kens | `kubectl edit namespace` | Edit namespace resource from the default editor | -| kdns | `kubectl describe namespace` | Describe namespace resource in detail | -| kdelns | `kubectl delete namespace` | Delete the namespace. WARNING! This deletes everything in the namespace | -| | | **ConfigMap management** | -| kgcm | `kubectl get configmaps` | List the configmaps in ps output format | -| kecm | `kubectl edit configmap` | Edit configmap resource from the default editor | -| kdcm | `kubectl describe configmap` | Describe configmap resource in detail | -| kdelcm | `kubectl delete configmap` | Delete the configmap | -| | | **Secret management** | -| kgsec | `kubectl get secret` | Get secret for decoding | -| kdsec | `kubectl describe secret` | Describe secret resource in detail | -| kdelsec | `kubectl delete secret` | Delete the secret | -| | | **Deployment management** | -| kgd | `kubectl get deployment` | Get the deployment | -| kgdw | `kgd --watch` | After getting the deployment, watch for changes | -| kgdwide | `kgd -o wide` | After getting the deployment, output in plain-text format with any additional information | -| ked | `kubectl edit deployment` | Edit deployment resource from the default editor | -| kdd | `kubectl describe deployment` | Describe deployment resource in detail | -| kdeld | `kubectl delete deployment` | Delete the deployment | -| ksd | `kubectl scale deployment` | Scale a deployment | -| krsd | `kubectl rollout status deployment` | Check the rollout status of a deployment | -| kres | `kubectl set env $@ REFRESHED_AT=...` | Recreate all pods in deployment with zero-downtime | -| | | **Rollout management** | -| kgrs | `kubectl get replicaset` | List all ReplicaSets `rs` created by the deployment | -| kdrs | `kubectl describe replicaset` | Describe ReplicaSet in detail | -| kers | `kubectl edit replicaset` | Edit ReplicaSet from the default editor | -| krh | `kubectl rollout history` | Check the revisions of this deployment | -| kru | `kubectl rollout undo` | Rollback to the previous revision | -| | | **Port forwarding** | -| kpf | `kubectl port-forward` | Forward one or more local ports to a pod | -| | | **Tools for accessing all information** | -| kga | `kubectl get all` | List all resources in ps format | -| kgaa | `kubectl get all --all-namespaces` | List the requested object(s) across all namespaces | -| | | **Logs** | -| kl | `kubectl logs` | Print the logs for a container or resource | -| klf | `kubectl logs -f` | Stream the logs for a container or resource (follow) | -| | | **File copy** | -| kcp | `kubectl cp` | Copy files and directories to and from containers | -| | | **Node management** | -| kgno | `kubectl get nodes` | List the nodes in ps output format | -| kgnosl | `kubectl get nodes --show-labels` | List the nodes in ps output format with labels | -| keno | `kubectl edit node` | Edit nodes resource from the default editor | -| kdno | `kubectl describe node` | Describe node resource in detail | -| kdelno | `kubectl delete node` | Delete the node | -| | | **Persistent Volume Claim management** | -| kgpvc | `kubectl get pvc` | List all PVCs | -| kgpvcw | `kgpvc --watch` | After listing/getting the requested object, watch for changes | -| kepvc | `kubectl edit pvc` | Edit pvcs from the default editor | -| kdpvc | `kubectl describe pvc` | Describe all pvcs | -| kdelpvc | `kubectl delete pvc` | Delete all pvcs matching passed arguments | -| | | **StatefulSets management** | -| kgss | `kubectl get statefulset` | List the statefulsets in ps format | -| kgssw | `kgss --watch` | After getting the list of statefulsets, watch for changes | -| kgsswide | `kgss -o wide` | After getting the statefulsets, output in plain-text format with any additional information | -| kess | `kubectl edit statefulset` | Edit statefulset resource from the default editor | -| kdss | `kubectl describe statefulset` | Describe statefulset resource in detail | -| kdelss | `kubectl delete statefulset` | Delete the statefulset | -| ksss | `kubectl scale statefulset` | Scale a statefulset | -| krsss | `kubectl rollout status statefulset` | Check the rollout status of a deployment | -| | | **Service Accounts management** | -| kdsa | `kubectl describe sa` | Describe a service account in details | -| kdelsa | `kubectl delete sa` | Delete the service account | -| | | **DaemonSet management** | -| kgds | `kubectl get daemonset` | List all DaemonSets in ps output format | -| kgdsw | `kgds --watch` | After listing all DaemonSets, watch for changes | -| keds | `kubectl edit daemonset` | Edit DaemonSets from the default editor | -| kdds | `kubectl describe daemonset` | Describe all DaemonSets in detail | -| kdelds | `kubectl delete daemonset` | Delete all DaemonSets matching passed argument | -| | | **CronJob management** | -| kgcj | `kubectl get cronjob` | List all CronJobs in ps output format | -| kecj | `kubectl edit cronjob` | Edit CronJob from the default editor | -| kdcj | `kubectl describe cronjob` | Describe a CronJob in details | -| kdelcj | `kubectl delete cronjob` | Delete the CronJob | -| | | **Job management** | -| kgj | `kubectl get job` | List all Job in ps output format | -| kej | `kubectl edit job` | Edit a Job in details | -| kdj | `kubectl describe job` | Describe the Job | -| kdelj | `kubectl delete job` | Delete the Job | +| Alias | Command | Description | +| :------- | :------------------------------------------------------ | :----------------------------------------------------------------------------------------------- | +| k | `kubectl` | The kubectl command | +| kca | `kubectl --all-namespaces` | The kubectl command targeting all namespaces | +| kaf | `kubectl apply -f` | Apply a YML file | +| keti | `kubectl exec -ti` | Drop into an interactive terminal on a container | +| | | **Manage configuration quickly to switch contexts between local, dev and staging** | +| kcuc | `kubectl config use-context` | Set the current-context in a kubeconfig file | +| kcsc | `kubectl config set-context` | Set a context entry in kubeconfig | +| kcdc | `kubectl config delete-context` | Delete the specified context from the kubeconfig | +| kccc | `kubectl config current-context` | Display the current-context | +| kcgc | `kubectl config get-contexts` | List of contexts available | +| | | **General aliases** | +| kdel | `kubectl delete` | Delete resources by filenames, stdin, resources and names, or by resources and label selector | +| kdelf | `kubectl delete -f` | Delete a pod using the type and name specified in -f argument | +| kge | `kubectl get events --sort-by=".lastTimestamp"` | Get events (sorted by timestamp) | +| kgew | `kubectl get events --watch --sort-by=".lastTimestamp"` | Get events and watch as they occur (sorted by timestamp) | +| | | **Pod management** | +| kgp | `kubectl get pods` | List all pods in ps output format | +| kgpl | `kgp -l` | Get pods by label. Example: `kgpl "app=myapp" -n myns` | +| kgpn | `kgp -n` | Get pods by namespace. Example: `kgpn kube-system` | +| kgpsl | `kubectl get pods --show-labels` | List all pods in ps output format with labels | +| kgpw | `kgp --watch` | After listing/getting the requested object, watch for changes | +| kgpwide | `kgp -o wide` | Output in plain-text format with any additional information. For pods, the node name is included | +| kep | `kubectl edit pods` | Edit pods from the default editor | +| kdp | `kubectl describe pods` | Describe all pods | +| kdelp | `kubectl delete pods` | Delete all pods matching passed arguments | +| | | **Service management** | +| kgs | `kubectl get svc` | List all services in ps output format | +| kgsw | `kgs --watch` | After listing all services, watch for changes | +| kgswide | `kgs -o wide` | After listing all services, output in plain-text format with any additional information | +| kes | `kubectl edit svc` | Edit services(svc) from the default editor | +| kds | `kubectl describe svc` | Describe all services in detail | +| kdels | `kubectl delete svc` | Delete all services matching passed argument | +| | | **Ingress management** | +| kgi | `kubectl get ingress` | List ingress resources in ps output format | +| kei | `kubectl edit ingress` | Edit ingress resource from the default editor | +| kdi | `kubectl describe ingress` | Describe ingress resource in detail | +| kdeli | `kubectl delete ingress` | Delete ingress resources matching passed argument | +| | | **Namespace management** | +| kgns | `kubectl get namespaces` | List the current namespaces in a cluster | +| kcn | `kubectl config set-context --current --namespace` | Change current namespace | +| kens | `kubectl edit namespace` | Edit namespace resource from the default editor | +| kdns | `kubectl describe namespace` | Describe namespace resource in detail | +| kdelns | `kubectl delete namespace` | Delete the namespace. WARNING! This deletes everything in the namespace | +| | | **ConfigMap management** | +| kgcm | `kubectl get configmaps` | List the configmaps in ps output format | +| kecm | `kubectl edit configmap` | Edit configmap resource from the default editor | +| kdcm | `kubectl describe configmap` | Describe configmap resource in detail | +| kdelcm | `kubectl delete configmap` | Delete the configmap | +| | | **Secret management** | +| kgsec | `kubectl get secret` | Get secret for decoding | +| kdsec | `kubectl describe secret` | Describe secret resource in detail | +| kdelsec | `kubectl delete secret` | Delete the secret | +| | | **Deployment management** | +| kgd | `kubectl get deployment` | Get the deployment | +| kgdw | `kgd --watch` | After getting the deployment, watch for changes | +| kgdwide | `kgd -o wide` | After getting the deployment, output in plain-text format with any additional information | +| ked | `kubectl edit deployment` | Edit deployment resource from the default editor | +| kdd | `kubectl describe deployment` | Describe deployment resource in detail | +| kdeld | `kubectl delete deployment` | Delete the deployment | +| ksd | `kubectl scale deployment` | Scale a deployment | +| krsd | `kubectl rollout status deployment` | Check the rollout status of a deployment | +| kres | `kubectl set env $@ REFRESHED_AT=...` | Recreate all pods in deployment with zero-downtime | +| | | **Rollout management** | +| kgrs | `kubectl get replicaset` | List all ReplicaSets `rs` created by the deployment | +| kdrs | `kubectl describe replicaset` | Describe ReplicaSet in detail | +| kers | `kubectl edit replicaset` | Edit ReplicaSet from the default editor | +| krh | `kubectl rollout history` | Check the revisions of this deployment | +| kru | `kubectl rollout undo` | Rollback to the previous revision | +| | | **Port forwarding** | +| kpf | `kubectl port-forward` | Forward one or more local ports to a pod | +| | | **Tools for accessing all information** | +| kga | `kubectl get all` | List all resources in ps format | +| kgaa | `kubectl get all --all-namespaces` | List the requested object(s) across all namespaces | +| | | **Logs** | +| kl | `kubectl logs` | Print the logs for a container or resource | +| klf | `kubectl logs -f` | Stream the logs for a container or resource (follow) | +| | | **File copy** | +| kcp | `kubectl cp` | Copy files and directories to and from containers | +| | | **Node management** | +| kgno | `kubectl get nodes` | List the nodes in ps output format | +| kgnosl | `kubectl get nodes --show-labels` | List the nodes in ps output format with labels | +| keno | `kubectl edit node` | Edit nodes resource from the default editor | +| kdno | `kubectl describe node` | Describe node resource in detail | +| kdelno | `kubectl delete node` | Delete the node | +| | | **Persistent Volume Claim management** | +| kgpvc | `kubectl get pvc` | List all PVCs | +| kgpvcw | `kgpvc --watch` | After listing/getting the requested object, watch for changes | +| kepvc | `kubectl edit pvc` | Edit pvcs from the default editor | +| kdpvc | `kubectl describe pvc` | Describe all pvcs | +| kdelpvc | `kubectl delete pvc` | Delete all pvcs matching passed arguments | +| | | **StatefulSets management** | +| kgss | `kubectl get statefulset` | List the statefulsets in ps format | +| kgssw | `kgss --watch` | After getting the list of statefulsets, watch for changes | +| kgsswide | `kgss -o wide` | After getting the statefulsets, output in plain-text format with any additional information | +| kess | `kubectl edit statefulset` | Edit statefulset resource from the default editor | +| kdss | `kubectl describe statefulset` | Describe statefulset resource in detail | +| kdelss | `kubectl delete statefulset` | Delete the statefulset | +| ksss | `kubectl scale statefulset` | Scale a statefulset | +| krsss | `kubectl rollout status statefulset` | Check the rollout status of a deployment | +| | | **Service Accounts management** | +| kdsa | `kubectl describe sa` | Describe a service account in details | +| kdelsa | `kubectl delete sa` | Delete the service account | +| | | **DaemonSet management** | +| kgds | `kubectl get daemonset` | List all DaemonSets in ps output format | +| kgdsw | `kgds --watch` | After listing all DaemonSets, watch for changes | +| keds | `kubectl edit daemonset` | Edit DaemonSets from the default editor | +| kdds | `kubectl describe daemonset` | Describe all DaemonSets in detail | +| kdelds | `kubectl delete daemonset` | Delete all DaemonSets matching passed argument | +| | | **CronJob management** | +| kgcj | `kubectl get cronjob` | List all CronJobs in ps output format | +| kecj | `kubectl edit cronjob` | Edit CronJob from the default editor | +| kdcj | `kubectl describe cronjob` | Describe a CronJob in details | +| kdelcj | `kubectl delete cronjob` | Delete the CronJob | +| | | **Job management** | +| kgj | `kubectl get job` | List all Job in ps output format | +| kej | `kubectl edit job` | Edit a Job in details | +| kdj | `kubectl describe job` | Describe the Job | +| kdelj | `kubectl delete job` | Delete the Job | ## Wrappers diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index 33699bdf9..4a72c02af 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -36,6 +36,8 @@ alias kcgc='kubectl config get-contexts' # General aliases alias kdel='kubectl delete' alias kdelf='kubectl delete -f' +alias kge='kubectl get events --sort-by=".lastTimestamp"' +alias kgew='kubectl get events --sort-by=".lastTimestamp" --watch' # Pod management. alias kgp='kubectl get pods' From 95ef2516697aa764d1d4bb93ad3490584cc118ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yunus=20Emre=20Akbal=C4=B1k?= <58446763+YunusAkbalik@users.noreply.github.com> Date: Thu, 29 May 2025 13:49:56 +0300 Subject: [PATCH 453/453] feat(dotnet): add `restore` alias (#13146) --- plugins/dotnet/README.md | 1 + plugins/dotnet/dotnet.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/dotnet/README.md b/plugins/dotnet/README.md index a15e80577..217c46751 100644 --- a/plugins/dotnet/README.md +++ b/plugins/dotnet/README.md @@ -23,3 +23,4 @@ plugins=(... dotnet) | dp | dotnet pack | Create a NuGet package. | | dng | dotnet nuget | Provides additional NuGet commands. | | db | dotnet build | Build a .NET project | +| dres | dotnet restore | Restore dependencies and project-specific tools for a project. | \ No newline at end of file diff --git a/plugins/dotnet/dotnet.plugin.zsh b/plugins/dotnet/dotnet.plugin.zsh index ed7c55024..adc1ec678 100644 --- a/plugins/dotnet/dotnet.plugin.zsh +++ b/plugins/dotnet/dotnet.plugin.zsh @@ -24,3 +24,4 @@ alias da='dotnet add' alias dp='dotnet pack' alias dng='dotnet nuget' alias db='dotnet build' +alias dres='dotnet restore'