Giter VIP home page Giter VIP logo

Comments (10)

dtscherer avatar dtscherer commented on June 2, 2024 9

For now I'm just using this in my env.nu

zoxide init nushell | str replace "def-env" "def --env" --all | save -f ~/.config/nushell/modules/.zoxide.nu

from zoxide.

acidghost avatar acidghost commented on June 2, 2024 3

As far as I can see the only two places where zoxide needs to be updated are

def-env __zoxide_z [...rest:string] {
let arg0 = ($rest | append '~').0
let path = if (($rest | length) <= 1) and ($arg0 == '-' or ($arg0 | path expand | path type) == dir) {
$arg0
} else {
(zoxide query --exclude $env.PWD -- $rest | str trim -r -c "\n")
}
cd $path
{%- if echo %}
echo $env.PWD
{%- endif %}
}
# Jump to a directory using interactive search.
def-env __zoxide_zi [...rest:string] {
cd $'(zoxide query --interactive -- $rest | str trim -r -c "\n")'
{%- if echo %}
echo $env.PWD
{%- endif %}
}

I think it's just a matter of replacing def-env with def --env.

from zoxide.

Slushee-a avatar Slushee-a commented on June 2, 2024 3

When will this be pushed to crates.io? Currently having to install from git.

from zoxide.

fdncred avatar fdncred commented on June 2, 2024 2

@lpnh Just FYI - This last part has nothing to do with zoxide.

Error:   × Config record contains invalid values or unknown settings

Error:   × Error while applying config changes
     ╭─[/home/user/.config/nushell/config.nu:152:1]
 152 │
 153 │ ╭─▶     cd: {
 154 │ │           abbreviations: false # allows `cd s/o/f` to expand to `cd some/other/folder`
 155 │ ├─▶     }
     · ╰──── $env.config.cd is an unknown config setting
 156 │
     ╰────
  help: This value will not appear in your $env.config record.

$env.config.cd.abbreviations was removed from nushell in favor of using our path completions that work similarly now. You just need to comment that out of your config.nu (or remove that part).

from zoxide.

Aarkon avatar Aarkon commented on June 2, 2024 2

Nushell has just published their update, removing def-env altogether. As far as I understand, this breaks zoxide entirely in nu. Providing a fixed release on crates.rs anytime soon has become somewhat urgent now, I’d say.

from zoxide.

marcelarie avatar marcelarie commented on June 2, 2024 1

Thanks this was really helpful!

from zoxide.

lpnh avatar lpnh commented on June 2, 2024

After updating to the new nushell 0.87.0 release, I encountered the following error when opening a new terminal:

Error:   × Deprecated command
    ╭─[/home/user/.zoxide.nu:25:1]
 25 │ # Jump to a directory using only keywords.
 26 │ def-env __zoxide_z [...rest:string] {
    · ───┬───
    ·    ╰── `def-env` is deprecated and will be removed in 0.88.
 27 │   let arg0 = ($rest | append '~').0
    ╰────
  help: Use `def --env` instead


Error:   × Deprecated command
    ╭─[/home/user/.zoxide.nu:36:1]
 36 │ # Jump to a directory using interactive search.
 37 │ def-env __zoxide_zi  [...rest:string] {
    · ───┬───
    ·    ╰── `def-env` is deprecated and will be removed in 0.88.
 38 │   cd $'(zoxide query --interactive -- $rest | str trim -r -c "\n")'
    ╰────
  help: Use `def --env` instead


Error:   × Config record contains invalid values or unknown settings

Error:   × Error while applying config changes
     ╭─[/home/user/.config/nushell/config.nu:152:1]
 152 │
 153 │ ╭─▶     cd: {
 154 │ │           abbreviations: false # allows `cd s/o/f` to expand to `cd some/other/folder`
 155 │ ├─▶     }
     · ╰──── $env.config.cd is an unknown config setting
 156 │
     ╰────
  help: This value will not appear in your $env.config record.


I noticed that there are already two PRs that address this issue: #632 and #642.

from zoxide.

Mickychen00 avatar Mickychen00 commented on June 2, 2024

Hello. I have notice there is a fix commit "f537a4e6d2f8c2eb84c63f79e290a6d1b16eeb71" in zoxide. How can I install this dev version of zoxide?

from zoxide.

marcelarie avatar marcelarie commented on June 2, 2024

Not sure but it might be brew install --HEAD zoxide in macOS

$: brew install --HEAD zoxide
Error: No head is defined for zoxide

from zoxide.

dc740 avatar dc740 commented on June 2, 2024

Hey, the list of incompatibilities grew longer.

❯ z 3d_designs
Error:   × Automatically spreading lists is deprecated
    ╭─[/home/user1/.zoxide.nu:30:1]
 30 │   } else {
 31 │     (zoxide query --exclude $env.PWD -- $rest | str trim -r -c "\n")
    ·                                         ──┬──
    ·                                           ╰── Spreading lists automatically when calling external commands is deprecated and will be removed in 0.91.
 32 │   }
    ╰────
  help: Use the spread operator (put a '...' before the argument)


[WARN] - (starship::utils): Executing command "/usr/bin/git" timed out.
[WARN] - (starship::utils): You can set command_timeout in your config to a higher value to allow longer-running commands to keep executing.

Which can also be added as a workaround because there are two places where -- $rest is used

zoxide init nushell | str replace "-- $rest" "-- ...$rest" --all | str replace "def-env" "def --env" --all | save -f ~/.zoxide.nu

nevermind. I found the PR
#663

from zoxide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.