init.zsh 722 B

123456789101112131415161718192021222324252627282930313233343536
  1. #
  2. # Integrates zsh-autosuggestions into Prezto.
  3. #
  4. # Authors:
  5. # Sorin Ionescu <sorin.ionescu@gmail.com>
  6. #
  7. # Load dependencies.
  8. pmodload 'editor'
  9. # Source module files.
  10. source "${0:h}/external/zsh-autosuggestions.zsh" || return 1
  11. #
  12. # Highlighting
  13. #
  14. # Set highlight color, default 'fg=8'.
  15. zstyle -s ':prezto:module:autosuggestions:color' found \
  16. 'ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE' || ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8'
  17. # Disable highlighting.
  18. if ! zstyle -t ':prezto:module:autosuggestions' color; then
  19. ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE=''
  20. fi
  21. #
  22. # Key Bindings
  23. #
  24. if [[ -n "$key_info" ]]; then
  25. # vi
  26. bindkey -M viins "$key_info[Control]F" vi-forward-word
  27. bindkey -M viins "$key_info[Control]E" vi-add-eol
  28. fi