From 9e10eab9561ed31fcf48b3fb804213e4139c7713 Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Wed, 28 Sep 2016 19:26:01 +0000 Subject: [PATCH] zshrc: Switch to vi mode with some emacs bindings This provides the best of both worlds. --- zshrc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/zshrc b/zshrc index 9585b13..927bba8 100644 --- a/zshrc +++ b/zshrc @@ -17,7 +17,19 @@ FEMALE="no" # Whether the user is female ;) LISTMAX=32768 WORDCHARS="*?[];!#~" -bindkey -e +bindkey -v +# history-incremental-search-backward is much more useful than +# _history-complete-* +bindkey "^R" history-incremental-search-backward +# Add a few other emacs bindings for convenience, as it's sometimes quicker to +# use those than to switch between modes. +bindkey "^A" beginning-of-line +bindkey "^E" end-of-line +bindkey "^D" delete-char-or-list +# backward-kill-word behaves more like vim, whereas vi-backward-kill-word is +# the vi behaviour. +bindkey "^W" backward-kill-word + setopt no_bg_nice setopt no_nomatch setopt extended_glob