For short single commands, prefer a one-liner `for` with the zsh syntax:
```
for x (foo bar) print ${x}
```
Otherwise just place `; do` on the same line as the POSIX `for ... in`:
```
for x in foo bar; do
print ${x}
done
```
Closes#268
* create digest of scripts in a `functions` directory that don't start
with `_` (completion functions) and that don't have a `.` (function
names cannot have that character)
* zrecompile any `.zsh` or `.zsh-theme` file that is not in a `*test*`
directory (see 2a9a003), and that is a plain file with more than 1K of
size.
instead of the fixed logic that was zrecompiling syntax-highlighting and
history-substring-search modules' scripts.
Closes#260
First choice is `init.zsh`, the script we use, introduced by Prezto.
Next choices are based on which are the most common init scripts in the
zsh-users repositories:
* `zsh-autosuggestions`, `zsh-history-substring-search` and
`zsh-syntax-highlighting` have `${zmodule}.zsh`
* `zsh-completions` has `${zmodule}.plugin.zsh`
Latter format apparently was introduced by Oh-My-Zsh.
Leaving `${zmodule}.zsh-theme` and `${zmodule}.sh` as the last options.
instead of a big single `functions.zwc` file containing functions from
all the `functions` subdirectories.
This solution here better suits the functions autoloading mechanism in
zsh, as documented in
http://zsh.sourceforge.net/Doc/Release/Functions.html#index-autoloading-functions
Given `~/.zim/modules/foo/functions` is in the `fpath`, autoload looks
for functions in the following files, picking the **newest one** in this
order:
* `~/.zim/modules/foo/functions.zwc`, which should contain all
functions in the directory named `functions`
* `~/.zim/modules/foo/functions/function.zwc`
* `~/.zim/modules/foo/functions/function`
With this approach, we're also having individual entries back in `fpath`
for the `functions` subdirectory of each enabled module (as was the case
before commit 55df5a4).
This is also probably closest to the original plan at #86. The current
code was not compiling "*all* files in a folder into a single digest",
but instead compiling *all* files in *all* the functions folders into a
single digest, which was a bad idea. This commit fixes this.
Fixes#231. Fixes#232. Closes#234.
Closes#239
so it's not a template anymore and can be under version control, instead
of being manually updated by the user, as currently is the case with
`~/.zlogin` and `${ZIM_HOME}/templates/zlogin`.
Closes#218