iterfzf icon indicating copy to clipboard operation
iterfzf copied to clipboard

Implementing fzf --bind

Open jayghoshter opened this issue 4 years ago • 3 comments

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!

jayghoshter avatar Dec 12 '20 04:12 jayghoshter

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",
})

dahlia avatar Nov 14 '23 01:11 dahlia

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

Gregory-K avatar May 03 '24 15:05 Gregory-K

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",
})

Gregory-K avatar May 05 '24 19:05 Gregory-K