4 ms·
Am I the only one that tried fzf as a replacement to the default Ctrl+R behavior, then switched back? I'm perfectly satisfied with the default Ctrl+R functiona
by endorphine 4y ago
Am I the only one that tried fzf as a replacement to the default Ctrl+R behavior, then switched back?
I'm perfectly satisfied with the default Ctrl+R functionality, to the point that fzf seemed to add visual clutter without any value.
I guess I was never let down by inverse search.
Context: I'm using Linux and doing SWE and SRE work, and constantly live in the terminal.
- andelink 4y agoThe default ctrl+r behavior doesn't allow me to scroll up through my history of matches, which is always disappointing. Often it's some random incantation I'm trying to search for that shares a prefix with other more common commands and the default ctrl+r requires me to type out far enough to be unique, which defeats the purpose of history search. Maybe I'm missing some essential behavior that I'm not familiar with.
- babuskov 4y agoI don't know if the version I have is somewhat special, but I can simply keep pressing ctrl+r to search "up" for the next match. So, type: ctrl+r, prefix, and then keep pressing ctrl+r to find everything that matches the prefix.
- Izkata 4y ago> that shares a prefix ctrl+r matches any part of the line, not just the commands / start of the line. I'm often using it on a unique argument I remember last using the command with.
- jnsaff2 4y agoFor me (in a similar role to you) Ctrl+R is the main reason of having fzf. Quality of Life improvement is immense.
- bloopernova 4y agoImagine you have a bunch of different for loops and you want to get the one that ran a specific command. You can use something like "history | grep for | grep command" or you can use fzf. Ctrl-r, type "f o r <space>" then type "c o m m" and you'll quickly narrow down the search results. It's the fuzziness that really beats ordinary ctrl-r, being able to search on multiple fragments of text is just fantastic.
- kubanczyk 4y agoNot a hard choice. So far I stick to the vanilla C-r, same as you. But I also remember that I can C-r /fzf/ and it will search back to the command: source /usr/share/doc/fzf/examples/key-bindings.bash which will instantly upgrade my search capabilities, if I'm stuck. Which doesn't really happen that much. I think the main part of my vanilla C-r experience is that I trained myself to remember commands differently. I somehow remember exact char-to-char tokens, like the "/fzf/" substring above. Or for a more extreme example "ose -p d" when I try to find: docker compose -p devenv exec myservice /bin/sh Weirdly, I kinda know that if used "se -p d" instead (shorter) it would land me on a wrong command (so, not shorter).
- olejorgenb 4y agoIt's inconceivable to me that someone could prefer the default behavior, but to each their own :)
- varenc 4y agoI initially felt the same way and found it cluttered. Though I still left fzf-history around and bound it Ctrl+Alt+R so Ctrl+R could still be the default. In zsh I just did this with `bindkey '^[^R' fzf-history-widget`. Over time I eventually found myself using Ctrl+Alt+R more and more so I made it the default and now Ctrl+Alt+R is still 'old school' history search for me.
- dtgriscom 4y agoThere's a potential well of habit that you have to climb out of before you start getting a benefit. If you don't put in the energy to try it for a while, you'll slide back down into the well.
- fallat 4y agoWhen I learned what Ctrl-R was originally, by mistake, I was like damn... maybe the majority of shell users just have no idea how to drive bash. No wonder people lose their shit over it, it's like trying to drive a car but you're never told the car can go in reverse and the rear view mirror is just tucked up into the roof!
- asicsp 4y agoI don't like the `Ctrl+r` interface. Instead, I use these settings in `.inputrc`. Type the command I want and use arrow keys (I prefer matching from start of the command, but you can match anywhere too). # use up and down arrow to match search history based on typed starting text "\e[A": history-search-backward "\e[B": history-search-forward # if you prefer to search anywhere in the command "\e[A":history-substring-search-backward "\e[B":history-substring-search-forward