atweiden / fzf-extras

Key bindings from fzf wiki
MIT License
192 stars 23 forks source link

Small conflict with readline binding in inputrc #17

Closed m040601 closed 3 years ago

m040601 commented 3 years ago

Hi, first of all thank you for your work maintaining this. Very usefull, and very clever thought and clean designed bindings and functions.

I just have this small issue that I cant figure out the root cause for it. I use bash. I install fzf-extras in arch linux with AUR. I source /usr/share/fzf/fzf-extras.bash in my .bashrc.

Everything works fine. Except this little issue.

I also have some readline bindings in my .inputrc (https://wiki.archlinux.org/index.php?title=Readline) They allow me to confortably type Ctrl+Alt+FOOBAR and

# append "| less" to the line
"\e\C-l": "\C-e | less\C-m"
# prepend sudo others
"\e\C-u": "\C-asudo \C-e"
# append fzf or grep
"\e\C-f": "\C-e | fzf\C-m"
"\e\C-g": "\C-e | grep --color=auto -i  -\C-b\C-b"
"\e\C-t": "**\C-i"

This has worked fine with fzf for years. But when I install "fzf-extras", something clashes or hijacks this binding:

# append "| less" to the line
"\e\C-l": "\C-e | less\C-m"

so that, now, when i type Control-Alt-L , get the output piped to some fzf function, instead of the expected output piped to less.

All the other binding work fine as ever.

I already tried peeking at the code in, /usr/share/fzf/fzf-extras.bash , but i cant identify what is responsible for this clash.

Any idea ? Thanks in advance

atweiden commented 3 years ago

The AUR fzf-extras hasn't been updated in years. What happens when you uninstall the AUR package and source the bindings manually?

git clone https://github.com/atweiden/fzf-extras ~/.fzf-extras
m040601 commented 3 years ago

The AUR fzf-extras hasn't been updated in years.

Oops, I hadnt even noticed this !

https://aur.archlinux.org/packages/?O=0&SeB=nd&K=fzf-extras&outdated=&SB=n&SO=a&PP=50&do_Search=Go

And I seemed to have missed "fzf-extras-git" maintained by yourself right ? It was there "hidden" back in the command line results when I searched with yay. It happens when there is tones of packages called "fzf something".

Why is it marked "orphan" ?

I flagged the "fzf-extras" out of date anyway. Best thing would be to remove "fzf-extras" from the AUR if there is a "fzf-extras-git". Specially if that "fzf-extras-git" is also done by an Arch user like you.

These kind of well curated fzf script collections packaged as AUR, are really usefull in my opinion. It avoids having to hunt and peck the Inernet and github for updates. You discover a lot of stuff like "i never thought about this cool use"

If you could collect and pack for Arch Linux even more quality fzf stuff, this would be really appreciated.

Anyway, I cleaned up everything and installed "fzf-extras-git". Seems to be working now.

You do have to edit your README, https://github.com/atweiden/fzf-extras then, if you're sending people to install an unmaintained package

## Installation

### Install fzf-extras

**Arch Linux**

Install [aur/fzf-extras](https://aur.archlinux.org/packages/fzf-extras).
atweiden commented 3 years ago

I guess I could edit out the AUR link, but that seems unfair on Arch users. I don't maintain those packages, but they could always be updated.