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 # Some things need to be done very early
32 # the following helper functions have been taken from the grml zshrc
33 # (wherever they got them from)
34 # check for version/system
35 # check for versions (compatibility reasons)
37 [[ $ZSH_VERSION == <4->* ]] && return 0
42 [[ $ZSH_VERSION == 4.
<1->* ||
$ZSH_VERSION == <5->* ]] && return 0
47 [[ $ZSH_VERSION == 4.
<2->* ||
$ZSH_VERSION == <5->* ]] && return 0
52 [[ $ZSH_VERSION == 4.2.
<5->* ||
$ZSH_VERSION == 4.
<3->* ||
$ZSH_VERSION == <5->* ]] && return 0
57 [[ $ZSH_VERSION == 4.
<3->* ||
$ZSH_VERSION == <5->* ]] && return 0
62 [[ $ZSH_VERSION == 4.3.
<3->* ||
$ZSH_VERSION == 4.
<4->* \
63 ||
$ZSH_VERSION == <5->* ]] && return 0
68 [[ $ZSH_VERSION == 4.3.
<4->* ||
$ZSH_VERSION == 4.
<4->* \
69 ||
$ZSH_VERSION == <5->* ]] && return 0
74 [[ $ZSH_VERSION == 4.3.
<5->* ||
$ZSH_VERSION == 4.
<4->* \
75 ||
$ZSH_VERSION == <5->* ]] && return 0
80 [[ $ZSH_VERSION == 4.3.
<7->* ||
$ZSH_VERSION == 4.
<4->* \
81 ||
$ZSH_VERSION == <5->* ]] && return 0
86 [[ $ZSH_VERSION == 4.3.
<9->* ||
$ZSH_VERSION == 4.
<4->* \
87 ||
$ZSH_VERSION == <5->* ]] && return 0
92 [[ $ZSH_VERSION == 4.3.
<11->* ||
$ZSH_VERSION == 4.
<4->* \
93 ||
$ZSH_VERSION == <5->* ]] && return 0
98 [[ $OSNAME == Darwin
* ]] && return 0
103 [[ $OSNAME == FreeBSD
* ]] && return 0
108 [[ $
(locale charmap
) == "UTF-8" ]] && return 0
113 [[ $TERM == "linux" ]] && return 0
117 if ! [[ ${ZSH_VERSION} == 3.1.
<7->* \
118 ||
${ZSH_VERSION} == 3.
<2->.
<->* \
119 ||
${ZSH_VERSION} == <4->.
<->* ]] ; then
122 printf '-!- In this configuration we try to only enable features supported by the shell\n'
123 printf '-!- version found on the system. However you are running a particular old zsh\n'
124 printf '-!- "version %s.\n' "$ZSH_VERSION"
125 printf '-!- While this *may* work, it might as well fail.\n'
127 printf '-!- Please consider updating to at least version 3.1.7 of zsh.\n'
129 printf '-!- DO NOT EXPECT THIS TO WORK FLAWLESSLY!\n'
130 printf '-!- If it does today, you'\''ve been lucky.\n'
132 printf '-!- Ye been warned!\n'
135 function zstyle
() { : }
138 # Now that FPATH is set correctly, do autoloaded functions.
139 # autoload all functions in $FPATH - that is, all files in
140 # each component of the array $fpath. If there are none, feed the list
141 # it prints into /dev/null.
142 for paths
in "$fpath[@]"; do
143 autoload
-U "$paths"/*(N
:t
) >/dev
/null