junegunn / fzf

:cherry_blossom: A command-line fuzzy finder
https://junegunn.github.io/fzf/
MIT License
63.9k stars 2.37k forks source link

[feature] shell completion #2808

Closed Freed-Wu closed 2 years ago

Freed-Wu commented 2 years ago

Info

Problem / Steps to reproduce

I press fzf --<Tab> in the terminal and found no completions. Does fzf have shell completion for itself?

junegunn commented 2 years ago

We only have that for bash. But even that is not well-maintained.

https://github.com/junegunn/fzf/blob/0d06c28b1943e820440cff9182a0ae3bdd5e3c59/shell/completion.bash#L65

Freed-Wu commented 11 months ago

Why not use https://jmtirado.net/shell-completion-with-cobra-and-go/ to generate shell completion automatically? https://github.com/cli/cli/blob/cf4b73ff958b272cf3c9c0cf9351459f76b793a0/pkg/cmd/completion/completion.go is an example.

Can we reopen this issue as a feature request?

Related issue: https://github.com/lotabout/skim/issues/439