aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.zshrc43
1 files changed, 30 insertions, 13 deletions
diff --git a/.zshrc b/.zshrc
index 4d500ec..b03cacb 100644
--- a/.zshrc
+++ b/.zshrc
@@ -391,20 +391,37 @@ zstyle ':completion:*:(ssh|scp|rsync):*:hosts-ipaddr' ignored-patterns '^(<->.<-
# syntax-highlighting
-source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
-
-# 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
+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
+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
# zsh.after
#