summaryrefslogtreecommitdiff
path: root/plugins/history-substring-search
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/history-substring-search')
-rw-r--r--plugins/history-substring-search/README7
-rw-r--r--plugins/history-substring-search/README.markdown7
-rw-r--r--plugins/history-substring-search/history-substring-search.zsh9
3 files changed, 14 insertions, 9 deletions
diff --git a/plugins/history-substring-search/README b/plugins/history-substring-search/README
deleted file mode 100644
index be11adf76..000000000
--- a/plugins/history-substring-search/README
+++ /dev/null
@@ -1,7 +0,0 @@
-To activate this script, load it into an interactive ZSH session:
-
- % source history-substring-search.zsh
-
-See the "history-substring-search.zsh" file for more information:
-
- % sed -n '2,/^$/s/^#//p' history-substring-search.zsh | more
diff --git a/plugins/history-substring-search/README.markdown b/plugins/history-substring-search/README.markdown
new file mode 100644
index 000000000..143b813a1
--- /dev/null
+++ b/plugins/history-substring-search/README.markdown
@@ -0,0 +1,7 @@
+To activate this script, please include it the `plugins` variable within `~/.zshrc`
+
+ `plugins=(git history-substring-search.zsh)`
+
+See the "history-substring-search.zsh" file for more information:
+
+ `sed -n '2,/^$/s/^#//p' history-substring-search.zsh | more`
diff --git a/plugins/history-substring-search/history-substring-search.zsh b/plugins/history-substring-search/history-substring-search.zsh
index 53f707c79..22f03dd6d 100644
--- a/plugins/history-substring-search/history-substring-search.zsh
+++ b/plugins/history-substring-search/history-substring-search.zsh
@@ -163,8 +163,13 @@ function history-substring-search-down() {
zle -N history-substring-search-up
zle -N history-substring-search-down
-bindkey '\e[A' history-substring-search-up
-bindkey '\e[B' history-substring-search-down
+zmodload zsh/terminfo
+if [[ -n "$terminfo[kcuu1]" ]]; then
+ bindkey "$terminfo[kcuu1]" history-substring-search-up
+fi
+if [[ -n "$terminfo[kcud1]" ]]; then
+ bindkey "$terminfo[kcud1]" history-substring-search-down
+fi
#-----------------------------------------------------------------------------
# implementation details