15ffbdd346daa58de6701d3421787012420aa6cc

Author
Julian <489233+naydichev@users.noreply.github.com>
Committer
GitHub <noreply@github.com>
Date

Message

feat(zoxide): add option to override cmd (#12218)

Diff

 1diff --git a/plugins/zoxide/README.md b/plugins/zoxide/README.md
 2index f326effe668cbdce8dbd42564a5a93e7c236d967..45f77bdf584e5cb5741651d005d25c37da1bb3fa 100644
 3--- a/plugins/zoxide/README.md
 4+++ b/plugins/zoxide/README.md
 5@@ -10,5 +10,8 @@ To use it, add `zoxide` to the plugins array in your `.zshrc` file:
 6 ```zsh
 7 plugins=(... zoxide)
 8 ```
 9+## Overriding `z` Alias
10+
11+You can set the `ZOXIDE_CMD_OVERRIDE`, which will be passed to the `--cmd` flag of `zoxide init`. This allows you to set your `z` command to a default of `cd`.
12 
13 **Note:** you have to [install zoxide](https://github.com/ajeetdsouza/zoxide#step-1-install-zoxide) first.
14diff --git a/plugins/zoxide/zoxide.plugin.zsh b/plugins/zoxide/zoxide.plugin.zsh
15index e5658b8f0a5ea50a1f74e48766cdcb75b6704824..25d2e83778b78368ebd67ce1aec9a48904cca564 100644
16--- a/plugins/zoxide/zoxide.plugin.zsh
17+++ b/plugins/zoxide/zoxide.plugin.zsh
18@@ -1,5 +1,5 @@
19 if (( $+commands[zoxide] )); then
20-  eval "$(zoxide init zsh)"
21+  eval "$(zoxide init --cmd ${ZOXIDE_CMD_OVERRIDE:-z} zsh)"
22 else
23   echo '[oh-my-zsh] zoxide not found, please install it from https://github.com/ajeetdsouza/zoxide'
24 fi