* archive: fix unrar check when using unrar-free
unrar-free returns the error code 1 when run without arguments, thus
failing the presence check. Replacing the current presence check with
(( $+commands[unrar] )) fixes the problem.
* archive: add unar support for lsarchive and unarchive
No `archive` support with unar.
* Add zsh-help function for easily searching the zsh documentation
Looks up things in the zsh documentation.
Usage: zsh-help [--all] search term(s)
Option --all will seach for the term anywhere, not just at the start of a
line. When not using --all it will search nicely for terms at the beginning
of the line, which in the zsh man pages is where terms that are explained
are located, allowing you to search the zsh man pages easily.
* Improve zsh-help to search section headings before other text
Provides a much easier way to search and access ZSH's manual. First checks for
terms at the start of the manual, then checks if it's at start of a line allowing
whitespace.
Clean up some of the code a bit and format it to have a proper header for the
zprezto project with author/email and description of the function.
Now that pyenv plugins availability is detected by directly probing
'pyenv', we need to rely on the same mechanism consistently.
Further, we perform available pyenv plugin scan with native zsh
techniques instead of relying on external commands.
If the pyenv virtualenv plugin is installed using the [pyenv-installer][1]
app script or directly via a [Git clone][2], then the pyenv-virtualenv-init
executable, that the `pyenv virtualenv-init` command uses, will not
exist in the user's PATH and therefore cannot be found using
`$commands[pyenv-virtualenv-init]`.
Installing the pyenv-virtualenv plugin in this manner is common among Linux users.
Using the pyenv `commands` command, which lists all commands pyenv can
run, we can find if the virtualenv-init command is available to pyenv
and subsequently the virtualenv plugin, without relying on
pyenv-virtualenv-init to exist in the user's PATH.
[1]: https://github.com/pyenv/pyenv-installer
[2]: https://github.com/pyenv/pyenv-virtualenv#installing-as-a-pyenv-plugin
This was a change in zsh 5.4.1 where prompt_sp is now reset on calls to
prompt, unlike previous behavior where it was set by default. This
restores the previous default behavior.
Refs #1423, but is not a complete fix because we need to wait for
external prompts to update as well.
Just having 'pyenv' available doesn't imply availability of virtualenv pyenv
plugins. Check for availability of virtualenv plugins as well before attempting
to use pyenv wrapper for virtualenv.
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.).
Changes:
* Simplify zstyle name `skip-virtualenvwrapper-init` to `initialize`
avoiding double negation in name
* Always perform `eval (pyenv virtualenv-init -)` at initialization
* Prefer `virtualenvwrapper_lazy` over `virtualenvwrapper` when available
* Honor `VIRTUALENVWRAPPER_VIRTUALENV` if it is defined.
* Document about `VIRTUALENVWRAPPER_PYTHON` and `VIRTUALENVWRAPPER_VIRTUALENV`
(this would be particularly important in macOS after recent homebrew update)
* Add additional documentation for `initialize` in _README.md_ and _zpreztorc_
* Add aliases `py2`, `py3` as shortcut for `python2`, `python3` respectively