From fa695734493d4068b3c67a8f1895a1a2a322ed61 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sun, 29 May 2016 22:19:16 +0800 Subject: zsh: avoid switching to vi-mode reset bindkey settings --- _zsh/50-bindkeys.zsh | 24 ------------------------ _zsh/50-vi-mode.zsh | 4 ++++ _zsh/60-bindkeys.zsh | 28 ++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 24 deletions(-) delete mode 100644 _zsh/50-bindkeys.zsh create mode 100644 _zsh/60-bindkeys.zsh diff --git a/_zsh/50-bindkeys.zsh b/_zsh/50-bindkeys.zsh deleted file mode 100644 index c53d3bf..0000000 --- a/_zsh/50-bindkeys.zsh +++ /dev/null @@ -1,24 +0,0 @@ -# -# zsh/bindkeys.zsh -# -# To see the key combo you want to use just do: -# cat > /dev/null -# And press it -# - -bindkey "^K" kill-whole-line # ctrl-k -bindkey "^R" history-incremental-search-backward # ctrl-r -bindkey "^A" beginning-of-line # ctrl-a -bindkey "^E" end-of-line # ctrl-e -bindkey "[B" history-search-forward # down arrow -bindkey "[A" history-search-backward # up arrow -bindkey "^D" delete-char # ctrl-d -bindkey "^F" forward-char # ctrl-f -bindkey "^B" backward-char # ctrl-b - -# see zshcontrib(1) -autoload -U select-word-style -# bash-style word killing: word characters are alphanumeric characters only -select-word-style bash - -# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=zsh: # diff --git a/_zsh/50-vi-mode.zsh b/_zsh/50-vi-mode.zsh index d786102..4fe2d9e 100644 --- a/_zsh/50-vi-mode.zsh +++ b/_zsh/50-vi-mode.zsh @@ -1,5 +1,9 @@ # # zsh/vi-mode.zsh +# see zshzle(1) +# +# NOTE: +# This will *reset* previous bindkey settings! # # Credits: # https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/vi-mode/vi-mode.plugin.zsh diff --git a/_zsh/60-bindkeys.zsh b/_zsh/60-bindkeys.zsh new file mode 100644 index 0000000..80ed079 --- /dev/null +++ b/_zsh/60-bindkeys.zsh @@ -0,0 +1,28 @@ +# +# zsh/bindkeys.zsh +# see zshzle(1) +# +# To see the key combo you want to use just do: +# $ cat > /dev/null +# then press it. +# +# NOTE: +# Switching mode (e.g., `bindkey -v`) will *reset* the following settings! +# + +bindkey "^K" kill-whole-line # ctrl-k +bindkey "^R" history-incremental-search-backward # ctrl-r +bindkey "^A" beginning-of-line # ctrl-a +bindkey "^E" end-of-line # ctrl-e +bindkey "[B" history-search-forward # down arrow +bindkey "[A" history-search-backward # up arrow +bindkey "^D" delete-char # ctrl-d +bindkey "^F" forward-char # ctrl-f +bindkey "^B" backward-char # ctrl-b + +# see zshcontrib(1) +autoload -U select-word-style +# bash-style word killing: word characters are alphanumeric characters only +select-word-style bash + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=zsh: # -- cgit v1.2.2