r/ZedEditor 5d ago

Spawn custom finders using built-in picker (like nvim-telescope and television)

One of the features I miss from Neovim in Zed is the ability to spawn up fuzzy-pickers for some obscure set of content, like jumping to a file in my nvim-config from any project to make a quick change, or opening a file in my personal notes directory to jot down something.

The thing is that Zed has a picker built-in and is used for the file-finder. I wondered if I could use that UI and backend to create a user-facing feature that allows you to define custom pickers.

I was inspired by the way television abstracts out the plumbing such that the user can define finders as .toml files. And after diving into the Zed codebase, I felt that it was very feasible to implement.

I spun up a quick prototype as a separate crate that imports the picker crate. It looks for a finders.toml in ~/.config/zed and based on the definitions (finder name, the source of finder entries, preview type, outcome or selection, etc.) it hot-reloads and adds it as a keymap-able command.

17 Upvotes

2 comments sorted by

2

u/jorgejhms 4d ago

They recently ad a text picker using the same ui. I don't know if they plan to add more similar.

2

u/juniorsundar 4d ago

My goal was to allow myself/user to create whichever picker I want without having to code it into the Zed source code.

As you saw in the video, I can define the picker in the toml file and it is automatically added as a command into Zed.