diff options
-rw-r--r-- | .zshrc | 65 |
1 files changed, 35 insertions, 30 deletions
@@ -389,39 +389,44 @@ zstyle ':completion:*:(ssh|scp|rsync):*:hosts-host' ignored-patterns '*(.|:)*' l zstyle ':completion:*:(ssh|scp|rsync):*:hosts-domain' ignored-patterns '<->.<->.<->.<->' '^[-[:alnum:]]##(.[-[:alnum:]]##)##' '*@*' zstyle ':completion:*:(ssh|scp|rsync):*:hosts-ipaddr' ignored-patterns '^(<->.<->.<->.<->|(|::)([[:xdigit:].]##:(#c,2))##(|%*))' '127.0.0.<->' '255.255.255.255' '::1' 'fe80::*' +# autosuggestions +autosuggestions=( "/usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh" + "/usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh" + "/usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh" ) +for p in ${autosuggestions}; do + if [ -f "$p" ]; then + source "$p" + fi +done # syntax-highlighting -if [ -f /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]; then - source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh -elif [ -f /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]; then - source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh -fi +syntax_highlighting=( "/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" + "/usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" + "/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" ) +for p in ${syntax_highlighting}; do + if [ -f "$p" ]; then + source "$p" + fi +done -if [ -f /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh ]; then - # history-substring-search - source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh - # Vi - bindkey -M vicmd "k" history-substring-search-up - bindkey -M vicmd "j" history-substring-search-down - - # Emacs and Vi - for keymap in 'viins'; do - bindkey -M "$keymap" "$key_info[Up]" history-substring-search-up - bindkey -M "$keymap" "$key_info[Down]" history-substring-search-down - done -elif [ -f /usr/share/zsh-history-substring-search/zsh-history-substring-search.zsh ]; then - # history-substring-search - source /usr/share/zsh-history-substring-search/zsh-history-substring-search.zsh - # Vi - bindkey -M vicmd "k" history-substring-search-up - bindkey -M vicmd "j" history-substring-search-down - - # Emacs and Vi - for keymap in 'viins'; do - bindkey -M "$keymap" "$key_info[Up]" history-substring-search-up - bindkey -M "$keymap" "$key_info[Down]" history-substring-search-down - done -fi +# history-substring-search +history_substring=( "/usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh" + "/usr/share/zsh-history-substring-search/zsh-history-substring-search.zsh" + "/usr/local/share/zsh-history-substring-search/zsh-history-substring-search.zsh" ) +for p in ${history_substring}; do + if [ -f "$p" ]; then + source "$p" + # Vi + bindkey -M vicmd "k" history-substring-search-up + bindkey -M vicmd "j" history-substring-search-down + + # Emacs and Vi + for keymap in 'viins'; do + bindkey -M "$keymap" "$key_info[Up]" history-substring-search-up + bindkey -M "$keymap" "$key_info[Down]" history-substring-search-down + done + fi +done # zsh.after # |