Feature Request: Changing fzf command-line arguments via an fzf action
- Dominant language
- Go
- Stars
- 83k
- Forks
- 2.9k
- Avg merge
- 17h 8m
- Merged PRs (30d)
- 10
Description
- [x] I have read through the manual page (`man fzf`)
- [x] I have the latest version of fzf
- [x] I have searched through the existing issues
## Info
NOT APPLICABLE
- OS
- [ ] Linux
- [ ] Mac OS X
- [ ] Windows
- [ ] Etc.
- Shell
- [ ] bash
- [ ] zsh
- [ ] fish
## Problem / Steps to reproduce
The CtrlP plug-in for vim has a very useful feature that allows to toggle between fuzzy-searching for the entire path and fuzzy-searching for only the filename.
I've looked into replicating this with fzf. I don't think it's possible, but here's how I envision it could be: I think we'd just need an fzf action for setting the -n command-line option from within fzf. With that, we could invoke fzf with --delimiter=/, and then, if we want to search filenames only, we could have a keybinding that sets -n to '{-1}'.
Additionally, it would be great to be able to toggle between having -n set to '{}' (i.e. fuzzy-search entire path) and -n set to '{-1}' with a single key-binding, so I guess we'd also need to be able to write some logic like `if -n == {} then -n = '{-1}' else -n = '{}'`. This seems like it would require building out a programming interface of sorts (however minimal) for fzf, though (which, by the way, I would **love**...), so I would be OK with just having to have two separate key-bindings, one to set -n to '{}' and another to set it to '{-1}'.
Thoughts?
Contributor guide
No contributing guide indexed for this repository
Research direction
The request centers on fzf's -n option, --delimiter=/, actions, and keybindings; start with the man fzf documentation and the command-line option and action entry points. Define how an action would change -n and how separate bindings or a toggle should behave; done means filename-only and full-path searching can be switched as requested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100