Wrap nushell integration script in a module
This prevents the completion command "nu-complete __zoxide_z" from polluting the command namespace.
This commit is contained in:
parent
32ed3ec28a
commit
bdedc2a813
|
|
@ -1,11 +1,13 @@
|
|||
{%- let section = "# =============================================================================\n#" -%}
|
||||
{%- let section = "# =============================================================================" -%}
|
||||
{%- let not_configured = "# -- not configured --" -%}
|
||||
|
||||
# Code generated by zoxide. DO NOT EDIT.
|
||||
|
||||
module zoxide_integration {
|
||||
const homedir = if $nu.home-dir? != null { $nu.home-dir } else { $nu.home-path }
|
||||
|
||||
{{ section }}
|
||||
#
|
||||
# Hook configuration for zoxide.
|
||||
#
|
||||
|
||||
|
|
@ -54,6 +56,7 @@ export-env {
|
|||
{%- endif %}
|
||||
|
||||
{{ section }}
|
||||
#
|
||||
# Completion for __zoxide_z
|
||||
#
|
||||
|
||||
|
|
@ -84,6 +87,7 @@ def "nu-complete __zoxide_z" [context: string] {
|
|||
}
|
||||
|
||||
{{ section }}
|
||||
#
|
||||
# When using zoxide with --no-cmd, alias these internal functions as desired.
|
||||
#
|
||||
|
||||
|
|
@ -112,6 +116,7 @@ export def --env --wrapped __zoxide_zi [...rest: string] {
|
|||
}
|
||||
|
||||
{{ section }}
|
||||
#
|
||||
# Commands for zoxide. Disable these using --no-cmd.
|
||||
#
|
||||
|
||||
|
|
@ -126,8 +131,12 @@ export alias {{cmd}}i = __zoxide_zi
|
|||
{{ not_configured }}
|
||||
|
||||
{%- endmatch %}
|
||||
}
|
||||
|
||||
export use zoxide_integration *
|
||||
|
||||
{{ section }}
|
||||
#
|
||||
# Add this to your env file (find it by running `$nu.env-path` in Nushell):
|
||||
#
|
||||
# zoxide init nushell | save -f ~/.zoxide.nu
|
||||
|
|
|
|||
Loading…
Reference in New Issue