nu: export functions

This commit is contained in:
Ajeet D'Souza 2026-06-30 16:37:23 +05:30
parent efa22f644a
commit 84bd26ebe3
2 changed files with 5 additions and 4 deletions

View File

@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- `import` now auto-detects database files. - `import` now auto-detects database files.
- Nushell: export commands so the init script can be imported with `use`.
### Fixed ### Fixed

View File

@ -56,7 +56,7 @@ export-env {
# #
# Jump to a directory using only keywords. # Jump to a directory using only keywords.
def --env --wrapped __zoxide_z [...rest: string] { export def --env --wrapped __zoxide_z [...rest: string] {
let path = match $rest { let path = match $rest {
[] => {'~'}, [] => {'~'},
[ '-' ] => {'-'}, [ '-' ] => {'-'},
@ -72,7 +72,7 @@ def --env --wrapped __zoxide_z [...rest: string] {
} }
# Jump to a directory using interactive search. # Jump to a directory using interactive search.
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
@ -86,8 +86,8 @@ def --env --wrapped __zoxide_zi [...rest:string] {
{%- match cmd %} {%- match cmd %}
{%- when Some with (cmd) %} {%- when Some with (cmd) %}
alias {{cmd}} = __zoxide_z export alias {{cmd}} = __zoxide_z
alias {{cmd}}i = __zoxide_zi export alias {{cmd}}i = __zoxide_zi
{%- when None %} {%- when None %}