Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rsteube/lazycomplete
lazy loading for shell completion scripts
https://github.com/rsteube/lazycomplete
bash completion fish lazy oil powershell shell xonsh zsh
Last synced: 4 months ago
JSON representation
lazy loading for shell completion scripts
- Host: GitHub
- URL: https://github.com/rsteube/lazycomplete
- Owner: rsteube
- License: mit
- Created: 2020-11-14T13:09:21.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-11-22T14:08:57.000Z (about 2 years ago)
- Last Synced: 2024-06-19T19:48:34.436Z (8 months ago)
- Topics: bash, completion, fish, lazy, oil, powershell, shell, xonsh, zsh
- Language: Go
- Homepage:
- Size: 40 KB
- Stars: 18
- Watchers: 4
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lazycomplete
Lazy loading for shell completion scripts.
A lot of programs provide their own shell completion script by invoking them with a specific argument like `mybinary completion`. The easiest way to use it is to add the call to the shell init script (like `.bashrc`) which keeps the completion up to date. Add a couple of these and shell startup time is affected considerably though as a single invocation and subsequent parsing can take ~50-100ms. This tool generates a lazy loading script for given binaries where the actual completion script is resolved only when needed.
## StatusWIP
## Usage
Invoke with pairs of binary name and command to be invoked to create the completion:
```sh
# bash
source <(lazycomplete \
example 'example _carapace' \
lab 'lab _carapace' \
)# elvish
eval (lazycomplete ^
example 'example _carapace' ^
lab 'lab _carapace' ^
|slurp)# fish
lazycomplete \
example 'example _carapace' \
lab 'lab _carapace' \
| source# oil
source <(lazycomplete \
example 'example _carapace' \
lab 'lab _carapace' \
)# powershell
lazycomplete `
example 'example _carapace' `
lab 'lab _carapace' `
| Out-String | Invoke-Expression# xonsh
exec($(lazycomplete \
example 'example _carapace' \
lab 'lab _carapace' \
))# zsh
source <(lazycomplete \
example 'example _carapace' \
lab 'lab _carapace' \
)
```