From 15ffbdd346daa58de6701d3421787012420aa6cc Mon Sep 17 00:00:00 2001 From: Julian <489233+naydichev@users.noreply.github.com> Date: Mon, 19 Feb 2024 10:29:37 +0100 Subject: [PATCH] feat(zoxide): add option to override cmd (#12218) --- plugins/zoxide/README.md | 3 +++ plugins/zoxide/zoxide.plugin.zsh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/zoxide/README.md b/plugins/zoxide/README.md index f326effe6..45f77bdf5 100644 --- a/plugins/zoxide/README.md +++ b/plugins/zoxide/README.md @@ -10,5 +10,8 @@ To use it, add `zoxide` to the plugins array in your `.zshrc` file: ```zsh plugins=(... zoxide) ``` +## Overriding `z` Alias + +You can set the `ZOXIDE_CMD_OVERRIDE`, which will be passed to the `--cmd` flag of `zoxide init`. This allows you to set your `z` command to a default of `cd`. **Note:** you have to [install zoxide](https://github.com/ajeetdsouza/zoxide#step-1-install-zoxide) first. diff --git a/plugins/zoxide/zoxide.plugin.zsh b/plugins/zoxide/zoxide.plugin.zsh index e5658b8f0..25d2e8377 100644 --- a/plugins/zoxide/zoxide.plugin.zsh +++ b/plugins/zoxide/zoxide.plugin.zsh @@ -1,5 +1,5 @@ if (( $+commands[zoxide] )); then - eval "$(zoxide init zsh)" + eval "$(zoxide init --cmd ${ZOXIDE_CMD_OVERRIDE:-z} zsh)" else echo '[oh-my-zsh] zoxide not found, please install it from https://github.com/ajeetdsouza/zoxide' fi