diff options
Diffstat (limited to 'Functions/Misc')
-rw-r--r-- | Functions/Misc/run-help-ip | 4 | ||||
-rw-r--r-- | Functions/Misc/zed | 23 |
2 files changed, 25 insertions, 2 deletions
diff --git a/Functions/Misc/run-help-ip b/Functions/Misc/run-help-ip index 740af52b5..8807f9ef1 100644 --- a/Functions/Misc/run-help-ip +++ b/Functions/Misc/run-help-ip @@ -19,8 +19,8 @@ while [[ $# != 0 && $1 == -* ]]; do done case $1 in - (addr*) man ip-address ;; - (addrlabel) man ip-addrlabel ;; + (addrl*) man ip-addrlabel ;; + (a*) man ip-address ;; (l2*) man ip-l2tp ;; (li*) man ip-link ;; (ma*) man ip-maddress ;; diff --git a/Functions/Misc/zed b/Functions/Misc/zed index 77d392bc3..33bd1025b 100644 --- a/Functions/Misc/zed +++ b/Functions/Misc/zed @@ -39,6 +39,24 @@ local curcontext=zed::: zstyle -m ":completion:zed:*" insert-tab '*' || zstyle ":completion:zed:*" insert-tab yes +zmodload zsh/terminfo 2>/dev/null + +__zed_pg_up() +{ + integer count=$(( LINES / 2 - 1 )) + while (( count -- )); do + zle up-line + done +} + +__zed_pg_down() +{ + integer count=$(( LINES / 2 - 1 )) + while (( count -- )); do + zle down-line + done +} + if (( bind )) || ! bindkey -M zed >&/dev/null; then # Make the zed keymap a copy of the current main. bindkey -N zed main @@ -54,6 +72,11 @@ if (( bind )) || ! bindkey -M zed >&/dev/null; then bindkey -M zed '^x^w' accept-line bindkey -M zed '^M' self-insert-unmeta + zle -N __zed_pg_up + zle -N __zed_pg_down + [[ ${+terminfo} = 1 && -n "$terminfo[kpp]" ]] && bindkey -M zed "$terminfo[kpp]" __zed_pg_up + [[ ${+terminfo} = 1 && -n "$terminfo[knp]" ]] && bindkey -M zed "$terminfo[knp]" __zed_pg_down + # Make zed-set-file-name available. # Assume it's in fpath; there's no error at this point if it isn't autoload -Uz zed-set-file-name |