Browse Source

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

Julian 2 months ago
parent
commit
15ffbdd346
2 changed files with 4 additions and 1 deletions
  1. 3 0
      plugins/zoxide/README.md
  2. 1 1
      plugins/zoxide/zoxide.plugin.zsh

+ 3 - 0
plugins/zoxide/README.md

@@ -10,5 +10,8 @@ To use it, add `zoxide` to the plugins array in your `.zshrc` file:
 ```zsh
 plugins=(... zoxide)
 ```
+## Overriding `z` Alias
+
+You can set the `ZOXIDE_CMD_OVERRIDE`, which will be passed to the `--cmd` flag of `zoxide init`. This allows you to set your `z` command to a default of `cd`.
 
 **Note:** you have to [install zoxide](https://github.com/ajeetdsouza/zoxide#step-1-install-zoxide) first.

+ 1 - 1
plugins/zoxide/zoxide.plugin.zsh

@@ -1,5 +1,5 @@
 if (( $+commands[zoxide] )); then
-  eval "$(zoxide init zsh)"
+  eval "$(zoxide init --cmd ${ZOXIDE_CMD_OVERRIDE:-z} zsh)"
 else
   echo '[oh-my-zsh] zoxide not found, please install it from https://github.com/ajeetdsouza/zoxide'
 fi