2a0c12d6fba10ffce4a5ad5b9ccade2858c548d4
6 # Tiny helper function to set variables/values according to styles
7 # removed after config load
14 zstyle
-s ':ganneff:config' ${variable} tempvar
15 tempvar
=${tempvar:-${default}}
16 if (( ${command} )); then
17 ${variable} ${tempvar}
19 export ${variable}=${tempvar}
25 # watch for everybody but me
27 # check every 5 min for login/logout activity
29 setvar WATCHFMT
'%n %a %l from %m at %t.'
31 # autoload wrapper - use this one instead of autoload directly
32 # We need to define this function as early as this, because autoloading
33 # 'is-at-least()' needs it.
42 for fdir
in ${fpath} ; do
43 [[ -e ${fdir}/${ffile} ]] && (( ffound
= 1 ))
46 (( ffound
== 0 )) && return 1
47 if [[ $ZSH_VERSION == 3.1.
<6-> ||
$ZSH_VERSION == <4->* ]] ; then
48 autoload
-U ${ffile} ||
return 1
50 autoload
${ffile} ||
return 1
55 # Some things need to be done very early
56 # the following helper functions have been taken from the grml zshrc
57 # (wherever they got them from)
58 # check for version/system
59 # check for versions (compatibility reasons)
61 [[ $ZSH_VERSION == <4->* ]] && return 0
66 [[ $ZSH_VERSION == 4.
<1->* ||
$ZSH_VERSION == <5->* ]] && return 0
71 [[ $ZSH_VERSION == 4.
<2->* ||
$ZSH_VERSION == <5->* ]] && return 0
76 [[ $ZSH_VERSION == 4.2.
<5->* ||
$ZSH_VERSION == 4.
<3->* ||
$ZSH_VERSION == <5->* ]] && return 0
81 [[ $ZSH_VERSION == 4.
<3->* ||
$ZSH_VERSION == <5->* ]] && return 0
86 [[ $ZSH_VERSION == 4.3.
<3->* ||
$ZSH_VERSION == 4.
<4->* \
87 ||
$ZSH_VERSION == <5->* ]] && return 0
92 [[ $ZSH_VERSION == 4.3.
<4->* ||
$ZSH_VERSION == 4.
<4->* \
93 ||
$ZSH_VERSION == <5->* ]] && return 0
98 [[ $ZSH_VERSION == 4.3.
<5->* ||
$ZSH_VERSION == 4.
<4->* \
99 ||
$ZSH_VERSION == <5->* ]] && return 0
104 [[ $ZSH_VERSION == 4.3.
<7->* ||
$ZSH_VERSION == 4.
<4->* \
105 ||
$ZSH_VERSION == <5->* ]] && return 0
110 [[ $ZSH_VERSION == 4.3.
<9->* ||
$ZSH_VERSION == 4.
<4->* \
111 ||
$ZSH_VERSION == <5->* ]] && return 0
116 [[ $OSNAME == Darwin
* ]] && return 0
121 [[ $OSNAME == FreeBSD
* ]] && return 0
125 if ! [[ ${ZSH_VERSION} == 3.1.
<7->* \
126 ||
${ZSH_VERSION} == 3.
<2->.
<->* \
127 ||
${ZSH_VERSION} == <4->.
<->* ]] ; then
130 printf '-!- In this configuration we try to only enable features supported by the shell\n'
131 printf '-!- version found on the system. However you are running a particular old zsh\n'
132 printf '-!- "version %s.\n' "$ZSH_VERSION"
133 printf '-!- While this *may* work, it might as well fail.\n'
135 printf '-!- Please consider updating to at least version 3.1.7 of zsh.\n'
137 printf '-!- DO NOT EXPECT THIS TO WORK FLAWLESSLY!\n'
138 printf '-!- If it does today, you'\''ve been lucky.\n'
140 printf '-!- Ye been warned!\n'
143 function zstyle
() { : }
146 for paths
in "$fpath[@]"; do
147 for func
in "$paths"/*(N
:t
); do