history-substring-search.plugin.zsh 869 B

1234567891011121314151617181920212223242526
  1. # This file integrates the zsh-history-substring-search script into oh-my-zsh.
  2. source "${0:r:r}.zsh"
  3. if test "$CASE_SENSITIVE" = true; then
  4. unset HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS
  5. fi
  6. if test "$DISABLE_COLOR" = true; then
  7. unset HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND
  8. unset HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND
  9. fi
  10. # Bind terminal-specific up and down keys
  11. # Bind in both emacs and vi modes so it works in both, and is not
  12. # sensitive to whether this is loaded before or after the vi-mode plugin
  13. if [[ -n "$terminfo[kcuu1]" ]]; then
  14. bindkey -M emacs "$terminfo[kcuu1]" history-substring-search-up
  15. bindkey -M viins "$terminfo[kcuu1]" history-substring-search-up
  16. fi
  17. if [[ -n "$terminfo[kcud1]" ]]; then
  18. bindkey -M emacs "$terminfo[kcud1]" history-substring-search-down
  19. bindkey -M viins "$terminfo[kcud1]" history-substring-search-down
  20. fi