From 282240bf37d6fd9979da2c3a41006824dbb4e268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 24 Dec 2014 01:33:28 +0100 Subject: [PATCH] Account for iTerm2 sent keys in dircycle plugin --- plugins/dircycle/dircycle.plugin.zsh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/dircycle/dircycle.plugin.zsh b/plugins/dircycle/dircycle.plugin.zsh index 12b20ab0..1e31105b 100644 --- a/plugins/dircycle/dircycle.plugin.zsh +++ b/plugins/dircycle/dircycle.plugin.zsh @@ -26,5 +26,12 @@ insert-cycledright () { } zle -N insert-cycledright -bindkey "\e[1;6D" insert-cycledleft -bindkey "\e[1;6C" insert-cycledright + +# add key bindings for iTerm2 +if [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then + bindkey "^[[1;6D" insert-cycledleft + bindkey "^[[1;6C" insert-cycledright +else + bindkey "\e[1;6D" insert-cycledleft + bindkey "\e[1;6C" insert-cycledright +fi \ No newline at end of file