chiark / gitweb /
dot/zshrc: Recognize the keypad keys.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 11 May 2018 19:17:48 +0000 (20:17 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 11 May 2018 19:39:07 +0000 (20:39 +0100)
There's an unfortunate interaction between the Debian `/etc/zsh/zshrc'
file (setting application mode) and pterm(1) which causes zsh to get the
same escape sequences from the keypad regardless of the num-lock state.
I think I can live with this.

Also, sneakily, make the home/end keys actually work.

dot/zshrc

index 660f846e44dcb13124d0dd316aad1c28e58f68df..a42e48220f2932fcabffb679676ef83790ac42c7 100644 (file)
--- a/dot/zshrc
+++ b/dot/zshrc
@@ -67,6 +67,20 @@ bindkey "\e^l" down-case-word-shell
 bindkey "\ec" capitalize-word-bash
 bindkey "\e^c" capitalize-word-shell
 
+bindkey "\e[1~" beginning-of-line "\e[4~" end-of-line
+
+bindkey -s           "\eOQ" "/" "\eOR" "*" "\eOS" "-"
+bindkey -s "\eOw" "7" "\eOx" "8" "\eOy" "9"
+bindkey -s "\eOt" "4" "\eOu" "5" "\eOv" "6" "\eOk" "+"
+bindkey -s "\eOq" "1" "\eOr" "2" "\eOs" "3"
+bindkey -s "\eOp" "0"           "\eOn" "."; bindkey "\eOM" accept-line
+
+bindkey -s           "\eOQ" "/" "\eOR" "*" "\eOS" "-"
+bindkey -s "\eOw" "7" "\eOx" "8" "\eOy" "9"
+bindkey -s "\eOt" "4" "\eOu" "5" "\eOv" "6" "\eOk" "+"
+bindkey -s "\eOq" "1" "\eOr" "2" "\eOs" "3"
+bindkey -s "\eOp" "0"           "\eOn" "."; bindkey "\eOM" accept-line
+
 bindkey "\ep" history-beginning-search-backward
 bindkey "\en" history-beginning-search-forward