]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - zsh/rc
zsh/rc: Bindkey can unbind multiple keys.
[config/dotfiles.git] / zsh / rc
diff --git a/zsh/rc b/zsh/rc
index 902d184bc4c0970c17d7ec06b6493a163c0b2873..d440e2fe630464d84bc641aeb4e5aa3f08320e2f 100644 (file)
--- a/zsh/rc
+++ b/zsh/rc
@@ -5,9 +5,6 @@ source_debug "sourcing ~/.zsh/rc"
 
 # MISCELLANEOUS SETTINGS
 
-# Use Vi(m) style key bindings.
-bindkey -v
-
 # Be paranoid, new files are readable/writable by me only.
 umask 077
 
@@ -33,6 +30,22 @@ setopt extendedglob
 setopt ignoreeof
 
 
+# KEY BINDINGS
+
+# Not all bindings are done here, only those not specific to a given section.
+
+# Use Vi(m) style key bindings.
+bindkey -v
+
+# Also use jj to exit insert mode.
+bindkey -M viins 'jj' vi-cmd-mode
+
+# I don't need the arrow keys, I use ^N and ^P for this (see below).
+bindkey -M viins -r '^[OA' '^[OB' '^[OC' '^[OD' '^[[A' '^[[B' '^[[C' '^[[D'
+# Also not in Vi mode.
+bindkey -M vicmd -r '^[OA' '^[OB' '^[OC' '^[OD' '^[[A' '^[[B' '^[[C' '^[[D'
+
+
 # FUNCTION SETTINGS
 
 # Make sure every entry in $fpath is unique.