--cmd cd works on all shells

This commit is contained in:
Ajeet D'Souza 2024-02-16 02:31:47 +05:30
parent 90c66df2a8
commit cf34d02288
2 changed files with 2 additions and 2 deletions

View File

@ -372,7 +372,7 @@ When calling `zoxide init`, the following flags are available:
- `--cmd` - `--cmd`
- Changes the prefix of the `z` and `zi` commands. - Changes the prefix of the `z` and `zi` commands.
- `--cmd j` would change the commands to (`j`, `ji`). - `--cmd j` would change the commands to (`j`, `ji`).
- `--cmd cd` would replace the `cd` command (doesn't work on Nushell / POSIX shells). - `--cmd cd` would replace the `cd` command.
- `--hook <HOOK>` - `--hook <HOOK>`
- Changes how often zoxide increments a directory's score: - Changes how often zoxide increments a directory's score:
| Hook | Description | | Hook | Description |

View File

@ -53,7 +53,7 @@ def --env __zoxide_z [...rest:string] {
} }
# Jump to a directory using interactive search. # Jump to a directory using interactive search.
def --env __zoxide_zi [...rest:string] { def --env __zoxide_zi [...rest:string] {
cd $'(zoxide query --interactive -- ...$rest | str trim -r -c "\n")' cd $'(zoxide query --interactive -- ...$rest | str trim -r -c "\n")'
{%- if echo %} {%- if echo %}
echo $env.PWD echo $env.PWD