mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-04 13:25:05 +08:00
Update dircycle.plugin.zsh
Added dirhistory-like go up a directory (insert-cycledup) and go down to first child directory (insert-cycleddown).
This commit is contained in:
@@ -43,6 +43,27 @@ insert-cycledright () {
|
||||
}
|
||||
zle -N insert-cycledright
|
||||
|
||||
insert-cycledup () {
|
||||
switch-to-dir .. || return
|
||||
|
||||
local fn
|
||||
for fn (chpwd $chpwd_functions precmd $precmd_functions); do
|
||||
(( $+functions[$fn] )) && $fn
|
||||
done
|
||||
zle reset-prompt
|
||||
}
|
||||
zle -N insert-cycledup
|
||||
|
||||
insert-cycleddown () {
|
||||
switch-to-dir "$(find . -mindepth 1 -maxdepth 1 -type d | sort -n | head -n 1)" || return
|
||||
|
||||
local fn
|
||||
for fn (chpwd $chpwd_functions precmd $precmd_functions); do
|
||||
(( $+functions[$fn] )) && $fn
|
||||
done
|
||||
zle reset-prompt
|
||||
}
|
||||
zle -N insert-cycleddown
|
||||
|
||||
# These sequences work for xterm, Apple Terminal.app, and probably others.
|
||||
# Not for rxvt-unicode, but it doesn't seem differentiate Ctrl-Shift-Arrow
|
||||
|
||||
Reference in New Issue
Block a user