Update Nullshell completion

This commit is contained in:
Luo Zhihao 2025-08-23 15:40:46 +00:00
parent 2299f2834b
commit 1e16092a16
1 changed files with 14 additions and 1 deletions

View File

@ -51,12 +51,25 @@ export-env {
{%- endif %}
def "nu-complete zoxide path" [context: string] {
let parts = $context | split row " " | skip 1
{
options: {
sort: false
completion_algorithm: prefix
positional: false
case_sensitive: false
}
completions: (zoxide query --list --exclude $env.PWD -- ...$parts | lines)
}
}
{{ section }}
# When using zoxide with --no-cmd, alias these internal functions as desired.
#
# Jump to a directory using only keywords.
def --env --wrapped __zoxide_z [...rest: string] {
def --env --wrapped __zoxide_z [...rest: string@"nu-complete zoxide path"] {
let path = match $rest {
[] => {'~'},
[ '-' ] => {'-'},