mirror of
https://github.com/skywind3000/z.lua
synced 2026-10-24 09:54:26 +00:00
feat(nushell)!: improve nushell support for nushell v0.96+
This commit is contained in:
1 parent
23aeabedd9
commit
ef8767c5f0
2 files changed
+7
-6
No files matched your search
@@ -122,12 +122,10 @@ z -b foo bar # replace foo with bar in cwd and cd there
|
||||
|
||||
Put something like this in your `env.nu`:
|
||||
|
||||
lua /path/to/z.lua --init nushell | save -f ~/.cache/zlua.nu
|
||||
mkdir ($nu.data-dir | path join "vendor/autoload")
|
||||
lua /path/to/z.lua --init nushell | save -f ($nu.data-dir | path join "vendor/autoload/zlua.nu")
|
||||
|
||||
Then put something like this in your `config.nu`:
|
||||
|
||||
source ~/.cache/zlua.nu
|
||||
alias z = _zlua
|
||||
Note: Only Nushell v0.96+ is supported
|
||||
|
||||
- Power Shell:
|
||||
|
||||
|
||||
@@ -2814,7 +2814,7 @@ end
|
||||
-- nushell
|
||||
-----------------------------------------------------------------------
|
||||
local script_zlua_nushell = [[
|
||||
def _zlua --env --wrapped [...args: string] {
|
||||
export def _zlua --env --wrapped [...args: string] {
|
||||
if ($args | length) != 0 and $args.0 == "--add" {
|
||||
with-env { _ZL_RANDOM: (random int) } { ^$env.ZLUA_LUAEXE $env.ZLUA_SCRIPT --add ...($args | skip 1) }
|
||||
} else if ($args | length) != 0 and $args.0 == "--complete" {
|
||||
@@ -2899,6 +2899,9 @@ if completer in $env.config.completions.external {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export alias z = _zlua
|
||||
|
||||
]]
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user