nushell: changes
This commit is contained in:
parent
ac489db754
commit
0fe5d8e650
3 changed files with 184 additions and 21 deletions
|
@ -1 +1,49 @@
|
|||
# empty
|
||||
# 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 arg0_is_dir = (try {$arg0 | path expand | path type}) == 'dir'
|
||||
let path = if (($rest | length) <= 1) and ($arg0 == '-' or $arg0_is_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 ci = __zoxide_zi
|
||||
# =============================================================================
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue