Nushell: complete only directories for `z`

This commit is contained in:
Ajeet D'Souza 2026-07-01 00:27:48 +05:30
parent b4d216fa43
commit ad5ea87783
2 changed files with 3 additions and 2 deletions

View File

@ -33,6 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Bash: avoid blanking the prompt when cancelling interactive Space-Tab completions. - Bash: avoid blanking the prompt when cancelling interactive Space-Tab completions.
- Bash/Fish/Zsh: avoid drawing a new line when Space-Tab completion finds no matches. - Bash/Fish/Zsh: avoid drawing a new line when Space-Tab completion finds no matches.
- Tcsh: preserve any existing `precmd` alias instead of overwriting it. - Tcsh: preserve any existing `precmd` alias instead of overwriting it.
- Nushell: complete only directories for `z`, instead of all files.
## [0.9.9] - 2026-01-31 ## [0.9.9] - 2026-01-31

View File

@ -56,7 +56,7 @@ export-env {
# #
# Jump to a directory using only keywords. # Jump to a directory using only keywords.
export def --env --wrapped __zoxide_z [...rest: string] { export def --env --wrapped __zoxide_z [...rest: directory] {
let path = match $rest { let path = match $rest {
[] => {'~'}, [] => {'~'},
[ '-' ] => {'-'}, [ '-' ] => {'-'},
@ -72,7 +72,7 @@ export def --env --wrapped __zoxide_z [...rest: string] {
} }
# Jump to a directory using interactive search. # Jump to a directory using interactive search.
export def --env --wrapped __zoxide_zi [...rest:string] { export def --env --wrapped __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