junegunn / junegunn/fzf

bash: replace standard file path completion of bash with a zsh like fzf subset

Open
#1,504 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
83k
Forks
2.9k
Avg merge
17h 8m
Merged PRs (30d)
10

Description

- Category
- [ ] fzf binary
- [ ] fzf-tmux script
- [ ] Key bindings
- [x] Completion
- [ ] Vim
- [ ] Neovim
- [ ] Etc.
- OS
- [x] Linux
- [ ] Mac OS X
- [ ] Windows
- [ ] Windows Subsystem for Linux
- [ ] Etc.
- Shell
- [x] bash
- [ ] zsh
- [ ] fish

In zsh you can do `cd a/b/e` and it will expand to `cd alice/bob/eve/`

Using `cd a/b/e/**` with standard fzf behaviour has a few drawbacks, mostly it doesn't just match directories/files there that are two layers deep (as indicated by the /) and therefore searches a lot, taking sometimes some time, making it not as well suited as just a shorthand notation for when you basically know what the directory is called but just don't want to type it. It also requires the additional trigger ** which is probably fine for the more expensive fuzzy search on "everything" but is probably not really necessary for a "short expansion".

So unless I have overlooked an easy way to enable this, please add to the bash completion functionality a path expansion replacement which works like the zsh expansion, that is it takes the to-be-completes string, takes each directory layer component and expands that individually, but with fzf it should have the addition of being "more fuzzy". Results should be passed back the normal way to bash, thus showing the standard "completion menu".

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Bash completion functionality and the existing standard fzf completion behavior, then compare the requested path-by-path expansion with the described zsh behavior. Done means Bash can expand each directory component with a more-fuzzy match, without requiring the ** trigger, and returns results through the normal completion menu.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.