Updated some templates (bash,fish,zsh) to include command zw with the --workingdir flag
This commit is contained in:
parent
3c3b2bad01
commit
8fe450def4
|
|
@ -93,6 +93,12 @@ function __zoxide_zi() {
|
||||||
result="$(\command zoxide query -i -- "$@")" && __zoxide_cd "${result}"
|
result="$(\command zoxide query -i -- "$@")" && __zoxide_cd "${result}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Jump to sub directories of current directory.
|
||||||
|
function __zoxide_zw() {
|
||||||
|
\builtin local result
|
||||||
|
result="$(\command zoxide query --workingdir --exclude "$(__zoxide_pwd)" -- "$@")" && __zoxide_cd "${result}"
|
||||||
|
}
|
||||||
|
|
||||||
{{ section }}
|
{{ section }}
|
||||||
# Commands for zoxide. Disable these using --no-cmd.
|
# Commands for zoxide. Disable these using --no-cmd.
|
||||||
#
|
#
|
||||||
|
|
@ -110,6 +116,11 @@ function {{cmd}}i() {
|
||||||
__zoxide_zi "$@"
|
__zoxide_zi "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
\builtin unalias {{cmd}}w &>/dev/null || \builtin true
|
||||||
|
function {{cmd}}w() {
|
||||||
|
__zoxide_zw "$@"
|
||||||
|
}
|
||||||
|
|
||||||
# Load completions.
|
# Load completions.
|
||||||
# - Bash 4.4+ is required to use `@Q`.
|
# - Bash 4.4+ is required to use `@Q`.
|
||||||
# - Completions require line editing. Since Bash supports only two modes of
|
# - Completions require line editing. Since Bash supports only two modes of
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,12 @@ function __zoxide_zi
|
||||||
and __zoxide_cd $result
|
and __zoxide_cd $result
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Jump to sub directories of current directory.
|
||||||
|
function __zoxide_zw
|
||||||
|
set -l result (command zoxide query --workingdir -- $argv)
|
||||||
|
and __zoxide_cd $result
|
||||||
|
end
|
||||||
|
|
||||||
{{ section }}
|
{{ section }}
|
||||||
# Commands for zoxide. Disable these using --no-cmd.
|
# Commands for zoxide. Disable these using --no-cmd.
|
||||||
#
|
#
|
||||||
|
|
@ -126,6 +132,12 @@ function {{cmd}}i
|
||||||
__zoxide_zi $argv
|
__zoxide_zi $argv
|
||||||
end
|
end
|
||||||
|
|
||||||
|
abbr --erase {{cmd}}w &>/dev/null
|
||||||
|
complete --command {{cmd}}w --erase
|
||||||
|
function {{cmd}}w
|
||||||
|
__zoxide_zw $argv
|
||||||
|
end
|
||||||
|
|
||||||
{%- when None %}
|
{%- when None %}
|
||||||
|
|
||||||
{{ not_configured }}
|
{{ not_configured }}
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,12 @@ function __zoxide_zi() {
|
||||||
result="$(\command zoxide query -i -- "$@")" && __zoxide_cd "${result}"
|
result="$(\command zoxide query -i -- "$@")" && __zoxide_cd "${result}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Jump to sub directories of current directory.
|
||||||
|
function __zoxide_zw() {
|
||||||
|
\builtin local result
|
||||||
|
result="$(\command zoxide query --workingdir -- "$@")" && __zoxide_cd "${result}"
|
||||||
|
}
|
||||||
|
|
||||||
{{ section }}
|
{{ section }}
|
||||||
# Commands for zoxide. Disable these using --no-cmd.
|
# Commands for zoxide. Disable these using --no-cmd.
|
||||||
#
|
#
|
||||||
|
|
@ -96,6 +102,11 @@ function {{cmd}}i() {
|
||||||
__zoxide_zi "$@"
|
__zoxide_zi "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
\builtin unalias {{cmd}}w &>/dev/null || \builtin true
|
||||||
|
function {{cmd}}w() {
|
||||||
|
__zoxide_zw "$@"
|
||||||
|
}
|
||||||
|
|
||||||
if [[ -o zle ]]; then
|
if [[ -o zle ]]; then
|
||||||
function __zoxide_z_complete() {
|
function __zoxide_z_complete() {
|
||||||
# Only show completions when the cursor is at the end of the line.
|
# Only show completions when the cursor is at the end of the line.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue