1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2025-07-01 03:29:26 +00:00

general: Reformat documentation with better formatting and wording

General purpose reformating and rewording in (a few places). This should
also make markdown linting happier.

Prefer back-ticks wherever useful and use `console` for code blocks to
be executed on terminal.

Also, update references links wherever possible (including update from
'http://' to 'https://').
This commit is contained in:
Indrajit Raychaudhuri
2021-05-03 20:59:31 -05:00
committed by Indrajit Raychaudhuri
parent 8edc5e9323
commit d80e393f78
44 changed files with 1188 additions and 1396 deletions

View File

@ -1,20 +1,18 @@
Python
======
# Python
Enables local Python and local Python package installation.
Settings
--------
## Settings
This module supports virtual environments from conda and virtualenvwrapper. By
default, only virtualenvwrapper is enabled. To disable virtualenvwrapper, add
the following to *zpreztorc*.
This module supports virtual environments from conda and
[*virtualenvwrapper*][2]. By default, only *virtualenvwrapper* is enabled. To
disable *virtualenvwrapper*, add the following to *~/.zpreztorc*.
```sh
zstyle ':prezto:module:python' skip-virtualenvwrapper-init 'on'
```
Conda support is enabled by adding the following to *zpreztorc*.
Conda support is enabled by adding the following to *~/.zpreztorc*.
```sh
zstyle ':prezto:module:python' conda-init 'on'
@ -22,24 +20,22 @@ zstyle ':prezto:module:python' conda-init 'on'
Caution: using conda and virtualenvwrapper at the same time may cause conflicts.
Local Python Installation
-------------------------
## Local Python Installation
[pyenv][4] builds and installs multiple Python versions locally in the home
[*pyenv*][4] builds and installs multiple Python versions locally in the home
directory.
This module prepends the pyenv directory to the path variable to enable the
This module prepends the *pyenv* directory to the path variable to enable the
execution of `pyenv`.
### Usage
Install Python versions with `pyenv install` into `~/.pyenv/versions`.
Install Python versions with `pyenv install` into *~/.pyenv/versions*.
This will be loaded automatically if pyenv is installed to `$PYENV_ROOT`,
`~/.pyenv`, or if the `pyenv` command is on the path.
*~/.pyenv*, or if the `pyenv` command is on the path.
Local Package Installation
--------------------------
## Local Package Installation
Since version 2.6, Python supports per user package installation, as defined in
[PEP 370][1].
@ -52,10 +48,9 @@ documentation.
Install packages into the per user site directory with `pip install --user`.
virtualenvwrapper
-----------------
## virtualenvwrapper
[`virtualenvwrapper`][2] is a frontend to the popular [`virtualenv`][3] utility.
[*virtualenvwrapper*][2] is a frontend to the popular [*virtualenv*][3] utility.
`virtualenv` creates isolated Python environments and `virtualenvwrapper`
provides convenient shell functions to create, switch, and manage them.
@ -64,7 +59,7 @@ provides convenient shell functions to create, switch, and manage them.
Install `virtualenvwrapper`.
Virtual environments are stored in `~/.virtualenvs`.
Virtual environments are stored in *~/.virtualenvs*.
There are configuration variables that have to be set to enable certain features.
If you wish to use these features, export the variables in [`zshenv`][6].
@ -119,27 +114,26 @@ zstyle ':prezto:module:python:virtualenv' auto-switch 'yes'
zstyle ':prezto:module:python:virtualenv' initialize 'no'
```
Aliases
-------
## Aliases
- `py` is short for `python`.
- `py2` is short for `python2`.
- `py3` is short for `python3`.
- `py` is short for `python`.
- `py2` is short for `python2`.
- `py3` is short for `python3`.
Functions
---------
## Functions
- `python-info` exposes information about the Python environment via the
`$python_info` associative array.
- `python-info` exposes information about the Python environment via the
`$python_info` associative array.
Theming
-------
## Theming
To display the name of the current virtual enviroment in a prompt, define the
To display the name of the current virtual environment in a prompt, define the
following style in the `prompt_name_setup` function.
# %v - virtualenv name.
zstyle ':prezto:module:python:info:virtualenv' format 'virtualenv:%v'
```sh
# %v - virtualenv name.
zstyle ':prezto:module:python:info:virtualenv' format 'virtualenv:%v'
```
Then add `$python_info[virtualenv]` to `$PROMPT` or `$RPROMPT` and call
`python-info` in the `prompt_name_preexec` hook function.
@ -148,17 +142,16 @@ Similarly, you can use `:prezto:module:python:info:version:format` with `%v` for
the version and add `$python_info[version]` to your prompt for the current
python version/
Authors
-------
## Authors
*The authors of this module should be contacted via the [issue tracker][5].*
- [Sorin Ionescu](https://github.com/sorin-ionescu)
- [Sebastian Wiesner](https://github.com/lunaryorn)
- [Sorin Ionescu](https://github.com/sorin-ionescu)
- [Sebastian Wiesner](https://github.com/lunaryorn)
[1]: http://www.python.org/dev/peps/pep-0370/
[2]: http://www.doughellmann.com/projects/virtualenvwrapper/
[3]: http://pypi.python.org/pypi/virtualenv
[1]: https://www.python.org/dev/peps/pep-0370/
[2]: https://www.doughellmann.com/projects/virtualenvwrapper/
[3]: https://pypi.org/project/virtualenv/
[4]: https://github.com/yyuu/pyenv
[5]: https://github.com/sorin-ionescu/prezto/issues
[6]: https://github.com/sorin-ionescu/prezto/blob/master/runcoms/zshenv