natecraddock / zf

a commandline fuzzy finder and zig module designed for filtering filepaths
MIT License
469 stars 17 forks source link

some problems that block me adopting zf #37

Closed haolian9 closed 1 year ago

haolian9 commented 1 year ago

hi folks, thanks for making this awesome tool! i want to use zf in my nvim plugin and here are some problems that stop me from adopting zf. and i do know zf aims to be simple and can be use as a library, but i still think it's worth to put them here.

a) able to read from a file nvim does not support ls | zf without using a shell https://github.com/neovim/neovim/issues/23141

b) able to save output as a file since zf itself uses stdout or stderr to show its tui, i'd like to get user's choice from a known file. you may say 'why not use ls | zf > file`, that invokes a shell, i do want to avoid invoking that.

c) settable keybinds to choose the item, and output the triggered keybind this is essential to my use, with it, i can know which way that user wants my plugin to deal with the choice. for example, <c-o> for editing the chose file in nvim, <c-t> for editing the file in new tab, <c-v for editing the file in a vertical split.

d) able to set last query and use last query as a placeholder maybe it's possible to do without changing the implementation: feeding last query in zf's stdin when its tui is ready. even it's doable by that way, we has no way to support this placeholder feature at now. this placeholder feature is just like how the HTML tag <input> works: once user input something new, the placeholder will be erased.

natecraddock commented 1 year ago

Hi @haolian9!

You have some interesting suggestions here. I am not immediately against any of them, though I am hesitant to add unneeded complexity to zf. Before discussing the individual points in your request, I would appreciate some clarification

i want to use zf in my nvim plugin and here are some problems that stop me from adopting zf.

Do you mind if I ask what this plugin is? It sounds like you want to use zf to filter something, are you building your own fuzzy finder? The more information you give the more I think I'll be able to help!

Just in case you didn't see it, there is already telescope-zf-native.nvim that integrates zf into the telescope fuzzy finder.

haolian9 commented 1 year ago

thanks for your time! this problem keeps lingering in my head these days, and now i think i should give it a try by myself.