1515
1616
1717# -- Completion --#
18+ # shellcheck disable=SC2206
1819[ -e /usr/local/share/zsh-completions ] && fpath=(/usr/local/share/zsh-completions $fpath )
1920autoload -U compinit
2021compinit -u
@@ -26,9 +27,11 @@ export UNZIPOPT=-OCP932
2627
2728
2829# -- Like fish prompt --#
29- source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
30- source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
31- source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh
30+ for plugin in " /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh" " /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" ; do
31+ if [[ -f " ${plugin} " ]]; then
32+ source " ${plugin} "
33+ fi
34+ done
3235
3336
3437# -- Key --#
@@ -53,16 +56,20 @@ key[PageDown]=${terminfo[knp]}
5356[[ -n " ${key[End]} " ]] && bindkey " ${key[End]} " end-of-line
5457[[ -n " ${key[Insert]} " ]] && bindkey " ${key[Insert]} " overwrite-mode
5558[[ -n " ${key[Delete]} " ]] && bindkey " ${key[Delete]} " delete-char
56- [[ -n " ${key[Up]} " ]] && bindkey " ${key[Up]} " history-substring-search-up
57- [[ -n " ${key[Down]} " ]] && bindkey " ${key[Down]} " history-substring-search-down
5859[[ -n " ${key[Left]} " ]] && bindkey " ${key[Left]} " backward-char
5960[[ -n " ${key[Right]} " ]] && bindkey " ${key[Right]} " forward-char
6061[[ -n " ${key[PageUp]} " ]] && bindkey " ${key[PageUp]} " beginning-of-buffer-or-history
6162[[ -n " ${key[PageDown]} " ]] && bindkey " ${key[PageDown]} " end-of-buffer-or-history
6263
6364# Normal history display
64- # [[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-history
65- # [[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-history
65+ if [[ -f " /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh" ]]; then
66+ source " /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh"
67+ [[ -n " ${key[Up]} " ]] && bindkey " ${key[Up]} " history-substring-search-up
68+ [[ -n " ${key[Down]} " ]] && bindkey " ${key[Down]} " history-substring-search-down
69+ else
70+ [[ -n " ${key[Up]} " ]] && bindkey " ${key[Up]} " up-line-or-history
71+ [[ -n " ${key[Down]} " ]] && bindkey " ${key[Down]} " down-line-or-history
72+ fi
6673
6774# Finally, make sure the terminal is in application mode, when zle is
6875# active. Only then are the values from $terminfo valid.
@@ -96,7 +103,7 @@ colors
96103
97104
98105# -- Pass to the path --#
99- [[ -d ~ /.bin ]] && export PATH=" ~ /.bin:${PATH} "
106+ [[ -d ~ /.bin ]] && export PATH=" ${HOME} /.bin:${PATH} "
100107
101108
102109# -- PROMPT --#
0 commit comments