15
15
16
16
17
17
# -- Completion --#
18
+ # shellcheck disable=SC2206
18
19
[ -e /usr/local/share/zsh-completions ] && fpath=(/usr/local/share/zsh-completions $fpath )
19
20
autoload -U compinit
20
21
compinit -u
@@ -26,9 +27,11 @@ export UNZIPOPT=-OCP932
26
27
27
28
28
29
# -- 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
32
35
33
36
34
37
# -- Key --#
@@ -53,16 +56,20 @@ key[PageDown]=${terminfo[knp]}
53
56
[[ -n " ${key[End]} " ]] && bindkey " ${key[End]} " end-of-line
54
57
[[ -n " ${key[Insert]} " ]] && bindkey " ${key[Insert]} " overwrite-mode
55
58
[[ -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
58
59
[[ -n " ${key[Left]} " ]] && bindkey " ${key[Left]} " backward-char
59
60
[[ -n " ${key[Right]} " ]] && bindkey " ${key[Right]} " forward-char
60
61
[[ -n " ${key[PageUp]} " ]] && bindkey " ${key[PageUp]} " beginning-of-buffer-or-history
61
62
[[ -n " ${key[PageDown]} " ]] && bindkey " ${key[PageDown]} " end-of-buffer-or-history
62
63
63
64
# 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
66
73
67
74
# Finally, make sure the terminal is in application mode, when zle is
68
75
# active. Only then are the values from $terminfo valid.
@@ -96,7 +103,7 @@ colors
96
103
97
104
98
105
# -- Pass to the path --#
99
- [[ -d ~ /.bin ]] && export PATH=" ~ /.bin:${PATH} "
106
+ [[ -d ~ /.bin ]] && export PATH=" ${HOME} /.bin:${PATH} "
100
107
101
108
102
109
# -- PROMPT --#
0 commit comments