Skip to content

Commit

Permalink
docs: rework completions section (#5879)
Browse files Browse the repository at this point in the history
Co-authored-by: Bjorn Neergaard <[email protected]>
  • Loading branch information
Secrus and neersighted authored Jun 21, 2022
1 parent faf02de commit 2571a42
Showing 1 changed file with 35 additions and 17 deletions.
52 changes: 35 additions & 17 deletions docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,42 +282,60 @@ To uninstall Poetry, simply delete the entire `$VENV_PATH` directory.
`poetry` supports generating completion scripts for Bash, Fish, and Zsh.
See `poetry help completions` for full details, but the gist is as simple as using one of the following:
### Bash
#### Auto-loaded (recommended)
```bash
# Bash
poetry completions bash > /etc/bash_completion.d/poetry
poetry completions bash >> ~/.bash_completion
```
# Fish
poetry completions fish > ~/.config/fish/completions/poetry.fish
#### Lazy-loaded
# Zsh
poetry completions zsh > ~/.zfunc/_poetry
# Oh-My-Zsh
mkdir $ZSH_CUSTOM/plugins/poetry
poetry completions zsh > $ZSH_CUSTOM/plugins/poetry/_poetry
```bash
poetry completions bash > ${XDG_DATA_HOME:~/.local/share}/bash_completion/completions/poetry
```
# prezto
poetry completions zsh > ~/.zprezto/modules/completion/external/src/_poetry
### Fish
```fish
poetry completions fish > ~/.config/fish/completions/poetry.fish
```
{{% note %}}
You may need to restart your shell in order for the changes to take effect.
{{% /note %}}
### Zsh
For `zsh`, you must then add the following lines in your `~/.zshrc`
```zsh
poetry completions zsh > ~/.zfunc/_poetry
```
You must then add the following lines in your `~/.zshrc`, if they do not already exist:
```bash
fpath+=~/.zfunc
autoload -Uz compinit && compinit
```
For `oh-my-zsh`, you must then enable poetry in your `~/.zshrc` plugins
#### Oh My Zsh
```zsh
mkdir $ZSH_CUSTOM/plugins/poetry
poetry completions zsh > $ZSH_CUSTOM/plugins/poetry/_poetry
```
You must then add `poetry` to your plugins array in `~/.zshrc`:
```text
plugins(
poetry
...
)
```
#### prezto
```zsh
poetry completions zsh > ~/.zprezto/modules/completion/external/src/_poetry
```
{{% note %}}
You may need to restart your shell in order for these changes to take effect.
{{% /note %}}

0 comments on commit 2571a42

Please sign in to comment.