From ec3738c8d5ae07adde668559af4363590e2e57ee Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Fri, 30 Mar 2012 18:54:47 -0400 Subject: [PATCH] [Fix #75] Bind history-substring-search in itself --- keyboard.zsh | 19 ------------------- plugins/history-substring-search/init.zsh | 5 +++++ 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/keyboard.zsh b/keyboard.zsh index 7f6f173..617ddd5 100644 --- a/keyboard.zsh +++ b/keyboard.zsh @@ -139,13 +139,6 @@ bindkey -M emacs "$keyinfo[Control]X$keyinfo[Control]]" vi-match-bracket # Edit command in an external editor. bindkey -M emacs "$keyinfo[Control]X$keyinfo[Control]E" edit-command-line -# Bind to the history substring search plugin if enabled; -# otherwise, bind to built-in Zsh history search. -if (( $+plugins[(er)history-substring-search] )); then - bindkey -M emacs "$keyinfo[Control]P" history-substring-search-up - bindkey -M emacs "$keyinfo[Control]N" history-substring-search-down -fi - if (( $+widgets[history-incremental-pattern-search-backward] )); then bindkey -M emacs "$keyinfo[Control]R" \ history-incremental-pattern-search-backward @@ -173,13 +166,6 @@ bindkey -M viins "kj" vi-cmd-mode bindkey -M vicmd "gg" beginning-of-history bindkey -M vicmd "G" end-of-history -# Bind to the history substring search plugin if enabled; -# otherwise, bind to built-in Zsh history search. -if (( $+plugins[(er)history-substring-search] )); then - bindkey -M vicmd "k" history-substring-search-up - bindkey -M vicmd "j" history-substring-search-down -fi - if (( $+widgets[history-incremental-pattern-search-backward] )); then bindkey -M vicmd "?" history-incremental-pattern-search-backward bindkey -M vicmd "/" history-incremental-pattern-search-forward @@ -203,11 +189,6 @@ for keymap in 'emacs' 'viins'; do # Expand history on space. bindkey -M "$keymap" ' ' magic-space - if (( $+plugins[(er)history-substring-search] )); then - bindkey -M "$keymap" "$keyinfo[Up]" history-substring-search-up - bindkey -M "$keymap" "$keyinfo[Down]" history-substring-search-down - fi - # Clear screen. bindkey -M "$keymap" "$keyinfo[Control]L" clear-screen diff --git a/plugins/history-substring-search/init.zsh b/plugins/history-substring-search/init.zsh index 66ffaec..196f2db 100644 --- a/plugins/history-substring-search/init.zsh +++ b/plugins/history-substring-search/init.zsh @@ -17,3 +17,8 @@ if ! zstyle -t ':omz:plugin:history-substring-search' color; then unset HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND fi +bindkey -M emacs "$keyinfo[Control]P" history-substring-search-up +bindkey -M emacs "$keyinfo[Control]N" history-substring-search-down +bindkey -M vicmd "k" history-substring-search-up +bindkey -M vicmd "j" history-substring-search-down +