From 69fbc438c17dcb1acac64070df6b1faed1b27c8e Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 15 Mar 2023 17:27:25 +0000 Subject: [PATCH] home: zsh: add {home,end} 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 d970b7d..6378f7a 100644 --- a/home/zsh/extra-mappings.zsh +++ b/home/zsh/extra-mappings.zsh @@ -67,3 +67,17 @@ if [ -n "${terminfo[knp]}" ]; then bindkey -M viins "${terminfo[knp]}" down-line-or-history bindkey -M vicmd "${terminfo[knp]}" down-line-or-history fi + +# Home goes to the beginning of the line +if [ -n "${terminfo[khome]}" ]; then + bindkey -M emacs "${terminfo[khome]}" beginning-of-line + bindkey -M viins "${terminfo[khome]}" beginning-of-line + bindkey -M vicmd "${terminfo[khome]}" beginning-of-line +fi + +# End goes to the end of the line +if [ -n "${terminfo[kend]}" ]; then + bindkey -M emacs "${terminfo[kend]}" end-of-line + bindkey -M viins "${terminfo[kend]}" end-of-line + bindkey -M vicmd "${terminfo[kend]}" end-of-line +fi