Skip to content

fzf builtin plugin improvements #3099

@Axlefublr

Description

@Axlefublr

I find the default behavior of fzf reasonable, but a bit unwieldy

Most of the time, I'm fzfing for a file to immediately open it — pressing Enter twice is a bit laborious
You unfortunately can't just chain the fzf plugin call and open together, as that wouldn't handle the case when you cancel fzf — it'd then open the entry you are currently on, which is not what we want

Then, cding to some subdirectory is really wonderful by using fzf.
But currently, I have to search for a file (which may not exist) in that directory, to reveal that directory
instead of simply filtering through directories only

It's kind of the worst of both worlds, imo. As a default, it makes sense, but for more active usage I find it inconvenient.

I would love to be able to provide flags to the fzf plugin, to change its behavior: some --open flag to make the plugin automatically open the accepted file, and some --dir flag to make the plugin search for a directory, to then cd into


You can make fzf display directories instead of files by passing the --walker option with correct arguments.
On that, you can make fzf either ignore or accept hidden directories — directories that start with a dot.

I believe the fzf plugin should care about the show_hidden option set — if it's true, fzf will search through hidden directories, but if it's false, it won't

--walker=file,follow,hidden
--walker=file,follow
--walker=dir,follow,hidden
--walker=dir,follow

Currently I achieve these three wants I've outlined by forking the plugin two times; while the changes are quite minimal and could instead be part of the core plugin. Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions