Set `LS_COLORS` if not already available so that it is available as
standard style `list-colors`.
This needs to be explicitly set in completion module to ensure that the
variable is available even if 'utility' module is not loaded earlier.
As curl bundled with macOS does not include `_curl` definitions, one
way to make `_curl` available is to install curl from Homebrew.
However, since curl from Hombrew is _keg-only_, its function path needs
to be explicitly included.
`compinit -i` doesn't always change zcompdump, which means that the
`compinit -C` condition fails to run until the completions change.
When we `compinit -i`, we should touch the file too to solve this.
- Add missing documentation for options and environment variables
- Rearrange definition and documentation of 'Options', 'Variables'
and 'Aliases' in a consistent order
By keeping the variable `_etc_host_ignores` around, it can be resolved
lazily which is turn should allow selective ignores on a per invocation
basis.
Also, `'\#'` doesn't need to be added to `_etc_host_ignores` anymore.
It is enforced inline.
Entries from static '/etc/hosts' can now be ignored via 'zstyle' based
configuration. Both IP address and corresponding hostname will be ignored
during host completion. However, some of the entries ignored from '/etc/hosts'
still might appear during completion because of their presence in 'ssh'
configuration ('~/.ssh/config') or history ('~/.ssh/ssh_hosts',
'~/.ssh/known_hosts' etc.).
Usage of `(( ... ))` over `[[ ... ]]` is preferred for arithmetic expression
since the former is less error prone.
Also, unset local variable whenever possible.
The original idea was by @samjonester in #1210. This version aims to avoid
relying on the stat or date programs because they have different flags depending
on the OS and if it uses BSD or GNU coreutils.
7 is pretty arbitrarily chosen, but seems like a reasonable tradeoff, at
least the completion no longer shows symptoms of exponential
time-growth when trying to complete something completely wrong.
This fixes#946.