mirror of
https://github.com/youwen5/liminalOS.git
synced 2025-06-20 05:59:51 -07:00
feat(nushell): update fish and zoxide completer
This commit is contained in:
parent
3491e82dd8
commit
b9e5ae8afd
1 changed files with 6 additions and 8 deletions
|
@ -1,11 +1,9 @@
|
||||||
let fish_completer = {|spans|
|
let fish_completer = {|spans|
|
||||||
fish --command $'complete --escape "--do-complete=($spans | str join " ")"'
|
fish --command $'complete "--do-complete=($spans | str join " ")"'
|
||||||
| $"value(char tab)description(char newline)" + $in
|
| from tsv --flexible --noheaders --no-infer
|
||||||
| from tsv --flexible --no-infer
|
| rename value description
|
||||||
| each {|i|
|
| update value {
|
||||||
if '\' in $i.value {
|
if ($in | path exists) {$'"($in | str replace "\"" "\\\"" )"'} else {$in}
|
||||||
$i | merge {'value': $"\"($i.value | str replace -a '\' '')\""}
|
|
||||||
} else {$i}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +27,7 @@ let external_completer = {|spans|
|
||||||
|
|
||||||
match $spans.0 {
|
match $spans.0 {
|
||||||
# use zoxide completions for zoxide commands
|
# use zoxide completions for zoxide commands
|
||||||
__zoxide_z | __zoxide_zi => $zoxide_completer
|
z | zi => $zoxide_completer
|
||||||
_ => $fish_completer
|
_ => $fish_completer
|
||||||
} | do $in $spans
|
} | do $in $spans
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue