From 4f0a619921315e83b94090671a88ecf5be9bff9f Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 15 Mar 2023 17:39:13 +0000 Subject: [PATCH] home: zsh: add ctrl-delete mapping --- home/zsh/extra-mappings.zsh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/home/zsh/extra-mappings.zsh b/home/zsh/extra-mappings.zsh index 6378f7a..baf72db 100644 --- a/home/zsh/extra-mappings.zsh +++ b/home/zsh/extra-mappings.zsh @@ -43,6 +43,17 @@ else bindkey -M vicmd "^[3;5~" delete-char fi +# Ctrl-Delete to delete a whole word forward +if [ -n "${terminfo[kdl1]}" ]; then + bindkey -M emacs "${terminfo[kdl1]}" kill-word + bindkey -M viins "${terminfo[kdl1]}" kill-word + bindkey -M vicmd "${terminfo[kdl1]}" kill-word +else + bindkey -M emacs '^[[3;5~' kill-word + bindkey -M viins '^[[3;5~' kill-word + bindkey -M vicmd '^[[3;5~' kill-word +fi + # Enable Shift-Tab to go backwards in completion list if [ -n "${terminfo[kcbt]}" ]; then bindkey -M emacs "${terminfo[kcbt]}" reverse-menu-complete