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/.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
diff --git a/.github/dependencies.yml b/.github/dependencies.yml
index 2be4cdfb0..02995d6cd 100644
--- a/.github/dependencies.yml
+++ b/.github/dependencies.yml
@@ -2,11 +2,13 @@ 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 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
@@ -28,7 +30,7 @@ dependencies:
plugins/wd:
repo: mfaerevaag/wd
branch: master
- version: tag:v0.9.0
+ version: tag:v0.9.2
precopy: |
set -e
rm -r test
@@ -36,7 +38,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/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt
index 05b2f27fe..d8149743c 100644
--- a/.github/workflows/dependencies/requirements.txt
+++ b/.github/workflows/dependencies/requirements.txt
@@ -1,7 +1,7 @@
-certifi==2024.8.30
-charset-normalizer==3.3.2
-idna==3.9
+certifi==2024.12.14
+charset-normalizer==3.4.1
+idna==3.10
PyYAML==6.0.2
requests==2.32.3
-semver==3.0.2
-urllib3==2.2.3
+semver==3.0.3
+urllib3==2.3.0
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
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"
}
]
diff --git a/README.md b/README.md
index 05bb5f644..723fb49c8 100644
--- a/README.md
+++ b/README.md
@@ -27,17 +27,22 @@ fi

-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).
[](https://github.com/ohmyzsh/ohmyzsh/actions?query=workflow%3ACI)
[](https://twitter.com/intent/follow?screen_name=ohmyzsh)
@@ -70,7 +75,7 @@ To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://x.c
- [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)
@@ -89,26 +94,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 |
| :-------- | :------------------------------------------------------------------------------------------------ |
@@ -116,38 +123,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
@@ -167,21 +180,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"
@@ -194,23 +214,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.
>
-> 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).
+> 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:

-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..)
@@ -233,7 +262,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
@@ -241,16 +271,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
@@ -258,32 +288,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:
@@ -329,16 +360,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
@@ -358,9 +394,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
@@ -399,27 +435,36 @@ 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 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
```
+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 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:
@@ -462,7 +507,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
@@ -474,25 +520,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!
@@ -511,7 +563,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
@@ -521,4 +575,6 @@ Oh My Zsh is released under the [MIT license](LICENSE.txt).

-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).
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
+}
diff --git a/lib/cli.zsh b/lib/cli.zsh
index 383b0cfb0..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
@@ -344,20 +345,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 }
"
@@ -397,8 +418,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
diff --git a/lib/git.zsh b/lib/git.zsh
index 8237af751..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
@@ -163,7 +179,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
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
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/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
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-/'
+}
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
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" &|
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() {
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'")
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
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
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.
#
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)
)
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:
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" &|
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'
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
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/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" &|
diff --git a/plugins/opentofu/README.md b/plugins/opentofu/README.md
index 9811e2751..45b98c3c9 100644
--- a/plugins/opentofu/README.md
+++ b/plugins/opentofu/README.md
@@ -15,30 +15,32 @@ 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` |
+| `ttd!` | `tofu destroy -auto-approve` |
+| `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
- `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:
diff --git a/plugins/opentofu/opentofu.plugin.zsh b/plugins/opentofu/opentofu.plugin.zsh
index aa6cac78a..bb65c12e3 100644
--- a/plugins/opentofu/opentofu.plugin.zsh
+++ b/plugins/opentofu/opentofu.plugin.zsh
@@ -29,8 +29,10 @@ 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 ttd!='tofu destroy -auto-approve'
alias ttf='tofu fmt'
alias ttfr='tofu fmt -recursive'
alias tti='tofu init'
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
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
}
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
diff --git a/plugins/poetry-env/poetry-env.plugin.zsh b/plugins/poetry-env/poetry-env.plugin.zsh
index be46717d8..dca388dfe 100644
--- a/plugins/poetry-env/poetry-env.plugin.zsh
+++ b/plugins/poetry-env/poetry-env.plugin.zsh
@@ -6,10 +6,10 @@ _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
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
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" &|
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
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
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
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'
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" &|
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'
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" &|
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" &|
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
}
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
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
diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh
index ddd31e6f6..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.0
+readonly WD_VERSION=0.9.2
# 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
@@ -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
@@ -344,6 +347,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 +362,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 +375,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
}
@@ -397,7 +401,7 @@ wd_clean() {
count=$((count+1))
fi
fi
- done < "$WD_CONFIG"
+ done < "$wd_config_file"
if [[ $count -eq 0 ]]
then
@@ -405,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"
@@ -416,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
@@ -441,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
@@ -472,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 -- $*)
@@ -483,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
@@ -571,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
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 81eb1c77d..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
@@ -50,7 +51,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 '//'
@@ -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'
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 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
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 9461f22a4..fea4799f8 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,
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
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="โ"
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}\
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%}"
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