https://github.com/chitoku-k/fzf-zsh-completions
Fuzzy completions for fzf and Zsh (git, kubectl, docker, ...)
https://github.com/chitoku-k/fzf-zsh-completions
fzf git kubectl zsh-plugin
Last synced: 8 months ago
JSON representation
Fuzzy completions for fzf and Zsh (git, kubectl, docker, ...)
- Host: GitHub
- URL: https://github.com/chitoku-k/fzf-zsh-completions
- Owner: chitoku-k
- License: mit
- Created: 2020-01-01T17:45:50.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-11-21T09:14:54.000Z (about 1 year ago)
- Last Synced: 2025-03-29T00:11:47.274Z (9 months ago)
- Topics: fzf, git, kubectl, zsh-plugin
- Language: Shell
- Homepage:
- Size: 642 KB
- Stars: 157
- Watchers: 5
- Forks: 7
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-zsh-plugins - fzf-zsh-completions - Fuzzy completions for [fzf](https://github.com/junegunn/fzf) and [ZSH](https://www.zsh.org/) that can be triggered by a trigger sequence that defaults to `**`. (Completions / ZSH on Windows)
- fucking-awesome-zsh-plugins - fzf-zsh-completions - Fuzzy completions for <b><code> 75058⭐</code></b> <b><code> 2613🍴</code></b> [fzf](https://github.com/junegunn/fzf)) and 🌎 [ZSH](www.zsh.org/) that can be triggered by a trigger sequence that defaults to `**`. (Completions / ZSH on Windows)
README
fzf-zsh-completions
===============
[![][workflow-badge]][workflow-link]
Fuzzy completions for [fzf][] and [Zsh][] that can be triggered by the trigger
sequence that defaults to `**`.



## Prerequisites
- [fzf][] >= 0.21.1
- [Zsh][] >= 5.1
- [jq][] >= 1.5
- awk
The following dependencies are optional unless those completions are desired:
- [docker][] CLI >= 17.03.0 (for `docker` completions)
- [git][] >= 2.7.1 (for `git` completions)
## Installation
Load `fzf-zsh-completions.plugin.zsh`.
For those who prefer to install via package managers, see the instructions
below. Be sure to load the plugin after `alias` calls for aliased completions to
work.
### Antigen
```zsh
antigen bundle "chitoku-k/fzf-zsh-completions"
```
### zplug
```zsh
zplug "chitoku-k/fzf-zsh-completions"
```
## Usage
For further information, please refer to [Fuzzy completions for bash and zsh][fzf-completions].
```zsh
git rebase -i **
```
## Supported commands
- cf
- Apps/App instances/Tasks/...
- Domains/Routes/...
- Files
- Marketplace/Service brokers/Service instances/...
- Orgs/Spaces/...
- composer
- Scripts
- docker
- Containers/Images/Networks/Volumes
- Files
- Repositories
- gh
- Pull Requests
- git
- Commit-ish
- Commit messaees
- Files
- Remotes
- glab
- Merge Requests
- kubectl
- Annotations/Labels/Field selectors
- Containers/Ports
- Files
- Resources
- Taints
- make
- Targets
- npm
- Scripts
- systemctl
- Services
- vault
- Paths
- yarn
- Scripts
## Extension
In order to add/override completions for subcommands to the existing completion,
define a function as in the following:
```zsh
# This function implements `kubectl view-serviceaccount-kubeconfig **`
# Function name must be _fzf_complete_(command)_(subcommand)
_fzf_complete_kubectl_view-serviceaccount-kubeconfig() {
# Call preprocessors
_fzf_complete_kubectl_parse_resource_and_name 2
_fzf_complete_kubectl_parse_completing_option
_fzf_complete_kubectl_parse_kubectl_arguments
# Return status code other than 0 to fall back to default
if [[ -n $completing_option ]]; then
return 1
fi
# Call any one of completion functions; see source code as to their usage
resource=serviceaccounts
_fzf_complete_kubectl-resource-names '' "$@"
}
```
## Testing
For contributing to this project, be sure to update `tests/` and run following:
```zsh
tests/test.zsh
```
## Related Project
- [fzf-preview.zsh][]
[workflow-link]: https://github.com/chitoku-k/fzf-zsh-completions/actions?query=branch:master
[workflow-badge]: https://img.shields.io/github/actions/workflow/status/chitoku-k/fzf-zsh-completions/ci.yml?branch=master&style=flat-square
[fzf]: https://github.com/junegunn/fzf
[fzf-completions]: https://github.com/junegunn/fzf/blob/master/README.md#fuzzy-completion-for-bash-and-zsh
[Zsh]: https://www.zsh.org/
[fzf-preview.zsh]: https://github.com/yuki-ycino/fzf-preview.zsh
[jq]: https://github.com/stedolan/jq
[docker]: https://github.com/docker/cli
[git]: https://github.com/git/git