summaryrefslogtreecommitdiff
path: root/source/bindkeys.zsh
diff options
context:
space:
mode:
authorChloe Kudryavtsev <toast@toast.cafe>2020-02-14 19:11:04 -0500
committerChloe Kudryavtsev <toast@toast.cafe>2020-02-14 19:11:04 -0500
commit858a4a31a251d0eab21dffb96776aca007dafb07 (patch)
tree54d0b73cab4eb4bc6c023ad4a75a5de0e724ed1f /source/bindkeys.zsh
Squashed 'dot_local/share/toasty/' content from commit aee4da7
git-subtree-dir: dot_local/share/toasty git-subtree-split: aee4da752bdb07b0524bb8803ead46d4093fa57f
Diffstat (limited to 'source/bindkeys.zsh')
-rw-r--r--source/bindkeys.zsh36
1 files changed, 36 insertions, 0 deletions
diff --git a/source/bindkeys.zsh b/source/bindkeys.zsh
new file mode 100644
index 0000000..0c78646
--- /dev/null
+++ b/source/bindkeys.zsh
@@ -0,0 +1,36 @@
+# this is totally not shamelessly stolen from omz-keybindings and zshwiki
+# definitely not
+# no way
+
+# basic bindings
+bindkey ${terminfo[khome]} beginning-of-line
+bindkey ${terminfo[kend]} end-of-line
+
+bindkey ${terminfo[kdch1]} delete-char
+
+bindkey ${terminfo[kcuu1]} up-line-or-history
+bindkey ${terminfo[kcud1]} down-line-or-history
+
+bindkey ${terminfo[kcub1]} backward-char
+bindkey ${terminfo[kcuf1]} forward-char
+
+bindkey '^?' backward-delete-char
+bindkey ${terminfo[kdch1]} delete-char
+
+# opinionated bindings
+bindkey '^r' history-incremental-search-backward
+bindkey '^[[1;5C' forward-word
+bindkey '^[[1;5D' backward-word
+bindkey ${terminfo[kcbt]} reverse-menu-complete
+
+# make sure terminfo keys make actual sense
+if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
+ function zle-line-init () {
+ echoti smkx
+ }
+ function zle-line-finish () {
+ echoti rmkx
+ }
+ zle -N zle-line-init
+ zle -N zle-line-finish
+fi