Skip to content

updated nushell zoxide.nu to support overlay use over source #985

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions templates/nushell.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export-env {
#

# 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 {
[] => {'~'},
[ '-' ] => {'-'},
Expand All @@ -72,7 +72,7 @@ def --env --wrapped __zoxide_z [...rest: string] {
}

# 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")'
{%- if echo %}
echo $env.PWD
Expand All @@ -86,8 +86,8 @@ def --env --wrapped __zoxide_zi [...rest:string] {
{%- match cmd %}
{%- when Some with (cmd) %}

alias {{cmd}} = __zoxide_z
alias {{cmd}}i = __zoxide_zi
export alias {{cmd}} = __zoxide_z
export alias {{cmd}}i = __zoxide_zi

{%- when None %}

Expand All @@ -103,6 +103,6 @@ alias {{cmd}}i = __zoxide_zi
# Now, add this to the end of your config file (find it by running
# `$nu.config-path` in Nushell):
#
# source ~/.zoxide.nu
# overlay use ~/.zoxide.nu as zoxide
#
# Note: zoxide only supports Nushell v0.89.0+.
Loading