From c48f6261beb9f1b1afe356379e2c251b7b255380 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 15 Mar 2023 17:26:09 +0000 Subject: [PATCH] home: zsh: add page{up,down} mapping --- home/zsh/extra-mappings.zsh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/home/zsh/extra-mappings.zsh b/home/zsh/extra-mappings.zsh index c8682cc..d970b7d 100644 --- a/home/zsh/extra-mappings.zsh +++ b/home/zsh/extra-mappings.zsh @@ -53,3 +53,17 @@ else bindkey -M viins '^[[Z' reverse-menu-complete bindkey -M vicmd '^[[Z' reverse-menu-complete fi + +# PageUp goes backwards in history +if [ -n "${terminfo[kpp]}" ]; then + bindkey -M emacs "${terminfo[kpp]}" up-line-or-history + bindkey -M viins "${terminfo[kpp]}" up-line-or-history + bindkey -M vicmd "${terminfo[kpp]}" up-line-or-history +fi + +# PageDown goes forward in history +if [ -n "${terminfo[knp]}" ]; then + bindkey -M emacs "${terminfo[knp]}" down-line-or-history + bindkey -M viins "${terminfo[knp]}" down-line-or-history + bindkey -M vicmd "${terminfo[knp]}" down-line-or-history +fi