فهرست منبع

Update zsh up/down history search to use whole input

`*-line-or-search` only searches by the current command. Not sure why I
thought that one did all text up to the cursor.
Weiyi Lou 9 سال پیش
والد
کامیت
cb9a7e99f7
1فایلهای تغییر یافته به همراه6 افزوده شده و 2 حذف شده
  1. 6 2
      shell/zsh/key-bindings.zsh

+ 6 - 2
shell/zsh/key-bindings.zsh

@@ -41,10 +41,14 @@ bindkey '^Z' fancy-ctrl-z
 #
 #
 # [Up & Down Arrow] - search through history for the current input string.
 # [Up & Down Arrow] - search through history for the current input string.
 if [[ "${terminfo[kcuu1]}" != "" ]]; then
 if [[ "${terminfo[kcuu1]}" != "" ]]; then
-  bindkey "${terminfo[kcuu1]}" up-line-or-search
+  autoload -U up-line-or-beginning-search
+  zle -N up-line-or-beginning-search
+  bindkey "${terminfo[kcuu1]}" up-line-or-beginning-search
 fi
 fi
 if [[ "${terminfo[kcud1]}" != "" ]]; then
 if [[ "${terminfo[kcud1]}" != "" ]]; then
-  bindkey "${terminfo[kcud1]}" down-line-or-search
+  autoload -U down-line-or-beginning-search
+  zle -N down-line-or-beginning-search
+  bindkey "${terminfo[kcud1]}" down-line-or-beginning-search
 fi
 fi
 # [Ctrl-r] - Search backward incrementally for a specified string.
 # [Ctrl-r] - Search backward incrementally for a specified string.
 bindkey '^r' history-incremental-search-backward
 bindkey '^r' history-incremental-search-backward