dahlia / iterfzf

Pythonic interface to fzf, a CLI fuzzy finder
https://pypi.python.org/pypi/iterfzf
GNU General Public License v3.0
161 stars 19 forks source link

Implementing fzf --bind #21

Open jayghoshter opened 3 years ago

jayghoshter commented 3 years ago

Hi,

I love your project, and use it a lot since I'm migrating my scripts to python. However, the --bind feature of fzf hasn't yet been implemented in iterfzf.

Is there a timeline for it?

Thanks!

dahlia commented 7 months ago

It would be great if we have bind option, but it looks a quite complex feature. Typing-wise in particular. If we have such option, usage would be like below:

iterfzf(iterable, bind={
    "ctrl-j": "accept",
    "ctrl-k": "kill-line",
})
Gregory-K commented 2 months ago

It can be passed as __extra__, e.g. __extra__=['--bind=ctrl-j:accept,ctrl-k:kill-line']

Gregory-K commented 2 months ago

Anyway, I guess everything can be passed as an extra. But, as the library describes itself as "Pythonic interface to fzf", writing in-line key-bindings isn't so 'pythonic'.

I've implemented a working 'bind' keyword argument adhering to the provide dictionary template:

iterfzf(iterable, bind={
    "ctrl-j": "accept",
    "ctrl-k": "kill-line",
})