Update docs

This commit is contained in:
Ajeet D'Souza 2022-03-08 20:58:50 +05:30
parent 9e06d01e69
commit 3ca116ae6f
4 changed files with 29 additions and 9 deletions

View File

@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Manpages: moved to `man/man1/*.1`.
- Fzf: added `--keep-right` option by default, upgraded minimum version to v0.21.0.
- Bash: only enable completions on 4.4+.
- Nushell: upgrade minimum supported version to v0.59.0.
### Fixed

View File

@ -190,10 +190,17 @@ zoxide init fish | source
<details>
<summary>Nushell</summary>
Add this to your configuration (find it by running `$nu.config-path` in
First, generate the Nushell initialization script (you may need to do this
whenever you update Nushell):
```sh
zoxide init nushell --hook prompt | save ~/.zoxide.nu
```
Now, add this to your configuration (find it by running `$nu.config-path` in
Nushell):
```text
```sh
zoxide init nushell --hook prompt | save ~/.zoxide.nu
source ~/.zoxide.nu
```

View File

@ -30,7 +30,14 @@ Add this to your configuration (usually \fB~/.config/fish/config.fish\fR):
.fi
.TP
.B nushell
Add this to your configuration (find it by running \fB$nu.config-path\fR in
First, generate the Nushell initialization script (you may need to do this
whenever you update Nushell):
.sp
.nf
\fBzoxide init nushell --hook prompt | save ~/.zoxide.nu\fR
.fi
.sp
Now, add this to your configuration (find it by running \fB$nu.config-path\fR in
Nushell):
.sp
.nf

View File

@ -25,7 +25,7 @@ let-env __zoxide_oldprompt = (if '__zoxide_oldprompt' in (env).name {
# Hook to add new entries to the database.
def __zoxide_hook [] {
zoxide add -- $nu.cwd
zoxide add -- $env.PWD
}
# Initialize hook.
@ -51,11 +51,11 @@ def-env __zoxide_z [...rest:string] {
let path = if ($rest | length) <= 1 && ($arg0 | path expand | path type) == dir {
$arg0
} else {
(zoxide query --exclude $nu.cwd -- $rest | str trim -r -c (char newline))
(zoxide query --exclude $env.PWD -- $rest | str trim -r -c (char newline))
}
cd $path
{%- if echo %}
echo $nu.cwd
echo $env.PWD
{%- endif %}
}
@ -63,7 +63,7 @@ def-env __zoxide_z [...rest:string] {
def-env __zoxide_zi [...rest:string] {
cd $'(zoxide query -i -- $rest | str trim -r -c (char newline))'
{%- if echo %}
echo $nu.cwd
echo $env.PWD
{%- endif %}
}
@ -84,8 +84,13 @@ alias {{cmd}}i = __zoxide_zi
{%- endmatch %}
{{ section }}
# To initialize zoxide, add this to your configuration (find it by running
# `$nu.config-path` in Nushell):
# To initialize zoxide, first generate the Nushell initialization script (you
# may need to do this whenever you update Nushell):
#
# zoxide init nushell --hook prompt | save ~/.zoxide.nu
#
# Now, add this to your configuration (find it by running `$nu.config-path` in
# Nushell):
#
# zoxide init nushell --hook prompt | save ~/.zoxide.nu
# source ~/.zoxide.nu