zsh: add vim-keybindings

This commit is contained in:
Thomas Preisner 2017-07-09 13:10:10 +02:00
parent 8172900e22
commit a5af099628
2 changed files with 14 additions and 0 deletions

12
zsh/keybindings.zsh Normal file
View file

@ -0,0 +1,12 @@
# ===== keybindings
# use Vi(m) style key bindings.
bindkey -v
# ===== history bindings
# make ^P and ^N behave like arrow keys (scroll through history)
bindkey -a '^P' history-beginning-search-backward
bindkey -a '^N' history-beginning-search-forward
# re-enable incremental backward search for vim keybindings which is especially
# useful when the string is an argument and not the command.
bindkey '^R' history-incremental-pattern-search-backward

2
zshrc
View file

@ -1,3 +1,5 @@
# Loading keybindings first because activating Vi-bindings resets all keybinds.
source ~/.zsh/keybindings.zsh
source ~/.zsh/setopt.zsh source ~/.zsh/setopt.zsh
source ~/.zsh/checks.zsh source ~/.zsh/checks.zsh
source ~/.zsh/colors.zsh source ~/.zsh/colors.zsh