nu: better zoxide integration

will not complain if zoxide missing
This commit is contained in:
dogeystamp 2024-07-31 14:44:13 -04:00
parent ae8c2a006a
commit 021e6670d6
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
4 changed files with 12 additions and 2 deletions

1
src/.config/nushell/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
zoxide.nu

View File

@ -713,4 +713,5 @@ $env.config = {
]
}
source ~/.config/nushell/zoxide.nu
const zoxide_conf = "~/.config/nushell/zoxide.nu"
source $zoxide_conf

View File

@ -95,4 +95,6 @@ $env.NU_PLUGIN_DIRS = [
# To load from a custom file you can use:
# source ($nu.default-config-dir | path join 'custom.nu')
zoxide init nushell | save -f ~/.config/nushell/zoxide.nu
if (which zoxide | length) > 0 {
zoxide init nushell | save -f ~/.config/nushell/zoxide.nu
}

View File

@ -0,0 +1,6 @@
# DUMMY FILE for systems that do not have zoxide installed
# nu doesn't like sourcing files conditionally, so we can't just have it ignore if zoxide.nu does not exist
# watch issue: https://github.com/nushell/nushell/issues/8214
# zoxide will overwrite this if it exists