Comments (4)
You may need to upgrade zoxide - Nushell has not reached v1.0 yet, and makes a lot of backward-incompatible changes every release.
Also, you appear to be generating the source file manually, unlike the instructions in the README. If you update zoxide, the Nushell script may change, causing your config to break.
from zoxide.
@IlyaVassyutovich I had the same issue. Zoxide generates init nu-script which doesn't work.
Tested in nushell 0.92.2
To make it work I:
- Commented the line
zoxide init nushell | save -f ~/.zoxide.nu
in nu-env file to prevent script regeneration. - Changed
~/zoxide.nu
to
# Code generated by zoxide. DO NOT EDIT.
# =============================================================================
#
# Hook configuration for zoxide.
#
# Initialize hook to add new entries to the database.
if (not ($env | default false __zoxide_hooked | get __zoxide_hooked)) {
$env.__zoxide_hooked = true
$env.config = ($env | default {} config).config
$env.config = ($env.config | default {} hooks)
$env.config = ($env.config | update hooks ($env.config.hooks | default {} env_change))
$env.config = ($env.config | update hooks.env_change ($env.config.hooks.env_change | default [] PWD))
$env.config = ($env.config | update hooks.env_change.PWD ($env.config.hooks.env_change.PWD | append {|_, dir|
zoxide add -- $dir
}))
}
# =============================================================================
#
# When using zoxide with --no-cmd, alias these internal functions as desired.
#
# Jump to a directory using only keywords.
def --env --wrapped __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
}
# Jump to a directory using interactive search.
def --env --wrapped __zoxide_zi [...rest:string] {
cd $'(zoxide query --interactive -- ...$rest | str trim -r -c "\n")'
}
# =============================================================================
#
# Commands for zoxide. Disable these using --no-cmd.
#
alias cd = __zoxide_z
alias cdi = __zoxide_zi
# =============================================================================
#
# Add this to your env file (find it by running `$nu.env-path` in Nushell):
#
# zoxide init nushell | save -f ~/.zoxide.nu
#
# Now, add this to the end of your config file (find it by running
# `$nu.config-path` in Nushell):
#
# source ~/.zoxide.nu
#
# Note: zoxide only supports Nushell v0.73.0 and above.
- ???
- PROFIT
So, mainly changes were:
- Changing
def-env
todef --env --wrapped
- Adding spread to
$rest
variable - I've made alias to
cd
andcdi
- you may don't want to do that.
from zoxide.
@mrjackphil did you try upgrading zoxide?
from zoxide.
I just today installed the zoxide and tried to run it. So I was sure that I'm using the latest version.
But...
I installed it using chocolatey. Current version of zoxide in there is 0.9.2. Latest is 0.9.4.
I've updated zoxide manually and it seems to resolve the problem.
So, thank you @ajeetdsouza for reply and sorry for oversight.
from zoxide.
Related Issues (20)
- zoxide: no match found
- Error: zoxide has not yet been packaged for your architecture HOT 3
- Directory Color Issues in Interactive Mode HOT 3
- .zoxide.nu method breaks with the latest 0.94.0 release HOT 3
- Nushell failure on `z` for keyword not under $env.PWD HOT 1
- Interactive completions when using powershell
- error: unrecognized subcommand 'Documents' HOT 2
- Trying to implement a go back and go forward HOT 3
- Multidot navigation
- zoxide resets every time I shut off my mac HOT 1
- Cannot run shell installer on WSL2 Ubuntu 22.04 HOT 3
- Errors when accessing network drive on windows via git bash
- [Bug Report]: No directory history in the database, check out the `zoxide` docs to set it HOT 1
- `zi` doesn't work HOT 2
- `zoxide` does not work HOT 3
- no match found HOT 3
- Easier flow for bumping path to be top result for query
- Add support for bash autocd option HOT 1
- Support regexp
- Ability to disable cd-like behavior HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zoxide.