Compare commits

..

1 Commits

Author SHA1 Message Date
Alexander F. Rødseth 5b3e0192b4
Merge 4f793a0031 into e61c9c14d6 2025-03-24 12:16:10 +01:00
1 changed files with 10 additions and 34 deletions

View File

@ -3,9 +3,8 @@ zsh-completions ![GitHub release](https://img.shields.io/github/release/zsh-user
**Additional completion definitions for [Zsh](https://www.zsh.org/).** **Additional completion definitions for [Zsh](https://www.zsh.org/).**
*This project aims at gathering/developing new completion scripts that are not available in Zsh yet. The scripts may be contributed to the Zsh project when stable enough.* *This projects aims at gathering/developing new completion scripts that are not available in Zsh yet. The scripts may be contributed to the Zsh project when stable enough.*
---
## Usage ## Usage
@ -25,7 +24,6 @@ zsh-completions ![GitHub release](https://img.shields.io/github/release/zsh-user
| NetBSD | [pkgsrc](https://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/shells/zsh-completions/README.html) | | NetBSD | [pkgsrc](https://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/shells/zsh-completions/README.html) |
| FreeBSD | [shells/zsh-completions](https://www.freshports.org/shells/zsh-completions) | | FreeBSD | [shells/zsh-completions](https://www.freshports.org/shells/zsh-completions) |
---
### Using zsh frameworks ### Using zsh frameworks
@ -35,61 +33,39 @@ Add `antigen bundle zsh-users/zsh-completions` to your `~/.zshrc`.
#### [oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh) #### [oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh)
To avoid issues with redundant `.zcompdump` cache generation (see [#603](https://github.com/zsh-users/zsh-completions/issues/603)), do **not** load `zsh-completions` as a standard plugin. * Clone the repository inside your oh-my-zsh repo:
Instead, follow this optimized approach:
1. Clone the repository into your custom plugins directory: git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions
```bash * Add it to `FPATH` in your `.zshrc` by adding the following line before `source "$ZSH/oh-my-zsh.sh"`:
git clone https://github.com/zsh-users/zsh-completions.git \
${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions
```
2. Update your `~/.zshrc` configuration **before** sourcing oh-my-zsh:
```bash
fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src
autoload -U compinit && compinit
source "$ZSH/oh-my-zsh.sh"
```
This prevents `compinit` from being called twice and significantly improves shell startup time. Note: adding it as a regular Oh My ZSH! plugin will not work properly (see [#603](https://github.com/zsh-users/zsh-completions/issues/603)).
#### [zinit](https://github.com/zdharma-continuum/zinit) #### [zinit](https://github.com/zdharma-continuum/zinit)
Add `zinit light zsh-users/zsh-completions` to your `~/.zshrc`. Add `zinit light zsh-users/zsh-completions` to your `~/.zshrc`.
---
### Manual installation ### Manual installation
* Clone the repository: * Clone the repository:
```bash
git clone https://github.com/zsh-users/zsh-completions.git git clone https://github.com/zsh-users/zsh-completions.git
```
* Include the directory in your `$fpath`, for example by adding in `~/.zshrc`: * Include the directory in your `$fpath`, for example by adding in `~/.zshrc`:
```bash
fpath=(path/to/zsh-completions/src $fpath) fpath=(path/to/zsh-completions/src $fpath)
```
* You may have to force rebuild `zcompdump`: * You may have to force rebuild `zcompdump`:
```bash
rm -f ~/.zcompdump; compinit rm -f ~/.zcompdump; compinit
```
---
### Contributing ### Contributing
Contributions are welcome, see [CONTRIBUTING](https://github.com/zsh-users/zsh-completions/blob/master/CONTRIBUTING.md). Contributions are welcome, see [CONTRIBUTING](https://github.com/zsh-users/zsh-completions/blob/master/CONTRIBUTING.md).
---
## License ## License
Completions use the Zsh license, unless explicitly mentioned in the file header. Completions use the Zsh license, unless explicitly mentioned in the file header.
See [LICENSE](https://github.com/zsh-users/zsh-completions/blob/master/LICENSE) for more information. See [LICENSE](https://github.com/zsh-users/zsh-completions/blob/master/LICENSE) for more information.