summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachIR <zachir@librem.one>2025-01-21 19:11:45 -0600
committerZachIR <zachir@librem.one>2025-01-21 19:11:45 -0600
commit95d509eeaba97aa0a35bb8c42225495e69d3a2c1 (patch)
treefc24746e0b0c89ca85770b113bc17263c7b8402c
parent8dd9c87d4d8c2f35f7ef26fe19d3330235abdfb7 (diff)
Use zkbd for zsh keybindings
-rw-r--r--zsh/zshrc17
1 files changed, 13 insertions, 4 deletions
diff --git a/zsh/zshrc b/zsh/zshrc
index fb5b167..c95feb3 100644
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -33,7 +33,16 @@ elif [ -f "$HOME"/.zshrc ]; then
alias e='source ~/.zshrc'
fi
+source ~/.zkbd/$TERM-${${DISPLAY:t}:-$VENDOR-$OSTYPE}
+
+#autoload zkbd; zkbd
bindkey -v
+bindkey "${key[Backspace]}" backward-delete-char
+bindkey "${key[Delete]}" delete-char
+bindkey "${key[Home]}" beginning-of-line
+bindkey "${key[End]}" end-of-line
+bindkey "${key[PageUp]}" history-substring-search-up
+bindkey "${key[PageDown]}" history-substring-search-down
MYPROMPT=$'%B%S%F{002}[%n@%m]%s\UE0B0%F{015}%~%S%F{002}\UE0B0%#%s\UE0B0%f%k%b '
function zle-line-init zle-keymap-select {
@@ -52,10 +61,10 @@ if [ -n "$ZPLUG_INSTALLED" ]; then
# zsh history substring search
zplug "zsh-users/zsh-history-substring-search", as:plugin
- bindkey '^[[A' history-substring-search-up
- bindkey '^[[B' history-substring-search-down
- bindkey -M vicmd '^[[A' history-substring-search-up
- bindkey -M vicmd '^[[B' history-substring-search-down
+ bindkey '${key[Up]}' history-substring-search-up
+ bindkey '${key[Down]}' history-substring-search-down
+ bindkey -M vicmd '${key[Up]}' history-substring-search-up
+ bindkey -M vicmd '${key[Down]}' history-substring-search-down
bindkey -M vicmd 'k' history-substring-search-up
bindkey -M vicmd 'j' history-substring-search-down