Shell tab completion scripts for pre-commit.
- Files completion (e.g. when using
pre-commit run --files
).
Select a required file (zsh, bash, tcsh) and copy its content somewhere your shell looks for completions.
For example, for zsh (ohmyzsh) I use /usr/local/share/zsh/site-functions/_pre-commit
.
Restart a shell.
You can find more examples in the shtab documentation.
Not an alternative for tab completion, but pre-commit plugin adds aliases for common commands of pre-commit.
An open issue since 2019: pre-commit/pre-commit#1119