summaryrefslogtreecommitdiff
path: root/zscripts/keybindrc.zsh
diff options
context:
space:
mode:
authorTim Keller <tjk@tjkeller.xyz>2024-10-18 21:52:28 -0500
committerTim Keller <tjk@tjkeller.xyz>2024-10-18 21:52:28 -0500
commit2dc486fb891e65658dff83ab34ca8878756a6a90 (patch)
tree03b39eb93f38534ab0972beadb770fecbd2243b8 /zscripts/keybindrc.zsh
downloadzsh-2dc486fb891e65658dff83ab34ca8878756a6a90.tar.xz
zsh-2dc486fb891e65658dff83ab34ca8878756a6a90.zip
initial commit
Diffstat (limited to 'zscripts/keybindrc.zsh')
-rwxr-xr-xzscripts/keybindrc.zsh24
1 files changed, 24 insertions, 0 deletions
diff --git a/zscripts/keybindrc.zsh b/zscripts/keybindrc.zsh
new file mode 100755
index 0000000..2f2e664
--- /dev/null
+++ b/zscripts/keybindrc.zsh
@@ -0,0 +1,24 @@
+#!/usr/bin/env zsh
+
+# Vi mode + requirements for ALL keybindings to work correctly
+bindkey -v # Select viins keymap
+KEYTIMEOUT=1
+
+# Keybindings
+autoload edit-command-line; zle -N edit-command-line # Edit line in Vim buffer
+bindkey '^E' edit-command-line # Ctrl-e - edit line in Vim buffer
+
+bindkey '^[[P' delete-char # Delete Key
+bindkey '^[[F' end-of-line # End Key
+bindkey '^[[H' beginning-of-line # Home Key
+bindkey '^[[2~' overwrite-mode # Insert Key
+bindkey '^D' kill-whole-line # Ctrl-d - delete line
+bindkey '^X' clear-screen # Ctrl-x - clear screen
+bindkey '^H' backward-delete-word # Ctrl-Backspace - delete entire word behind cursor
+bindkey '^[[3;5~' delete-word # Ctrl-Delete - delete currect word in front of the cursor
+# History completion
+bindkey '\e[A' history-search-backward # Up arrow - seach history backwards
+bindkey '\e[B' history-search-forward # Down arrow - seach history forwards
+
+# Ignore ctrl-d to exit shell
+setopt IGNORE_EOF