浏览代码

dircycle: remove redundant key bindings

In bindkey strings, "^[" and "\e" mean the same thing. They're both notations for Escape.
Andrew Janke 8 年之前
父节点
当前提交
c8e280f2ab
共有 1 个文件被更改,包括 8 次插入8 次删除
  1. 8 8
      plugins/dircycle/dircycle.plugin.zsh

+ 8 - 8
plugins/dircycle/dircycle.plugin.zsh

@@ -27,11 +27,11 @@ insert-cycledright () {
 zle -N 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
+# These sequences work for xterm, Apple Terminal.app, and probably others.
+# Not for rxvt-unicode, but it doesn't seem differentiate Ctrl-Shift-Arrow
+# from plain Shift-Arrow, at least by default.
+# iTerm2 does not have these key combinations defined by default; you will need
+# to add them under "Keys" in your profile if you want to use this. You can do
+# this conveniently by loading the "xterm with Numeric Keypad" preset.
+bindkey "\e[1;6D" insert-cycledleft
+bindkey "\e[1;6C" insert-cycledright