From 7e4cb772c4448c72f199364cb7852662e5bce0c0 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 22 Dec 2015 04:23:58 -0500 Subject: [PATCH] zsh: pre 5.0.8 compatibility --- zsh/keybinds | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/zsh/keybinds b/zsh/keybinds index f83385ef..91fa0265 100644 --- a/zsh/keybinds +++ b/zsh/keybinds @@ -15,18 +15,21 @@ bindkey -a ys add-surround bindkey -M visual S add-surround # text-objects -autoload -U select-quoted; zle -N select-quoted -for m in visual viopp; do - for c in {a,i}{\',\",\`}; do - bindkey -M $m $c select-quoted +autoload -U is-at-least +if is-at-least 5.0.8; then + autoload -U select-quoted; zle -N select-quoted + for m in visual viopp; do + for c in {a,i}{\',\",\`}; do + bindkey -M $m $c select-quoted + done done -done -autoload -U select-bracketed; zle -N select-bracketed -for m in visual viopp; do - for c in {a,i}${(s..)^:-'()[]{}<>bB'}; do - bindkey -M $m $c select-bracketed + autoload -U select-bracketed; zle -N select-bracketed + for m in visual viopp; do + for c in {a,i}${(s..)^:-'()[]{}<>bB'}; do + bindkey -M $m $c select-bracketed + done done -done +fi # Allow command line editing in an external editor. autoload -Uz edit-command-line; zle -N edit-command-line