Earlier quoted context omitted.
If that's your use case, here's another game changer (one line bashrc change to make bash_history changes immediately, rather than upon shell exit, e.g. when you end your tmux session): https://web.archive.org/web/20090815205011/http://www.cuberi...
Thank you!! Why on earth isn't that the default. It always seemed weird that with multiple bash windows open, the commands from most of them weren't added to the history.
So you've installed `fzf` – now what?
191–200 of 292 posts
Re: So you've installed `fzf` – now what?
#192Am 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.
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.
Re: So you've installed `fzf` – now what?
#193I'd never heard of fzf before! It looks like there's a lot of cool stuff you can do with it, but honestly, I think it's worth it even just to replace the frustrating ctrl+R search in bash, which I use a lot, but constantly dislike. I feel like with a lot of these kinds of tools, if I have to actually actively use them, I forget that they exist ('z'[0] ended up being like this for me) and eventually remove them, but s…
https://xkcd.com/1053/
Re: So you've installed `fzf` – now what?
#194 alias jf="cd \$(sort -nr ~/Library/autojump/autojump.txt | awk 'BEGIN {FS = \"\\t\"} {print \$2}' | fzf)"
or without the escaping: cd $(sort -nr ~/Library/autojump/autojump.txt | awk 'BEGIN {FS = "\t"} {print $2}' | fzf)
It gets my autojump history, sorts it by most used on top, extracts just the directory names, pipes the list to `fzf` and `cd`s into the selection. It's great because my most-used directories will be right on top of the `fzf` list.Re: So you've installed `fzf` – now what?
#195Am 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.
Re: So you've installed `fzf` – now what?
#196Thanks for this. I didn't know about the built-in-cd. For anyone on macOS trying to get Alt-C to work see https://github.com/junegunn/fzf/issues/164 .
Another possibility is to fix it via eg the terminal emulator - but that doesn't work for global hotkeys like window management with yabai via skhd.
See my comment on lobsters: https://lobste.rs/s/nvoikx/helix_notes#c_m8guuh
Re: So you've installed `fzf` – now what?
#197The basic problem, however, is that whatever I type into the fuzzy search, it finds many thousands of hits. It seems it's picking up a lot of aliased Downloads folders in ~/Library/Containers. Anyone else have that problem? Not sure how to turn that off.
I just typed "abcdefghijklmno" trying to narrow it down, and still had 10 hits. Typing a further "p" reduced that to 2, but I could see most of those eliminated 8 had a "p" in the filename. Confusing!
edit: I got Ctrl-R, Esc-C and **TAB complete working by adding this to .bash_profile, not .bashrc as it said to when installing:
source /opt/local/share/fzf/shell/key-bindings.bash
source /opt/local/share/fzf/shell/completion.bash
But I still have many thousands of options for Esc-C cding, for example, whatever I type—mostly from ~/Library/Containers. I don't remember having that problem when I tried fzf a few years ago, on macos 10.13 I think.Re: So you've installed `fzf` – now what?
#198Re: So you've installed `fzf` – now what?
#199fzf lua is a cool plugin for neovim: https://github.com/ibhagwan/fzf-lua So you don't need to do stuff like vi $(find . '/' | fzf) And instead can use fzf from inside the editor. It also supports integrating it with fdfind and ripgrep.
Re: So you've installed `fzf` – now what?
#200Fantastic article. I was exactly in the situation the article describes, I installed it, then, didn't find a use case. But that's because Ubuntu doesn't come with completion enabled by default. You have to add in your bashrc: if [ -e /usr/share/doc/fzf/examples/key-bindings.bash ]; then source /usr/share/doc/fzf/examples/key-bindings.bash fi The fzf and ubuntu docs don't mention you have to. Couldn't find easily how…
git log --oneline | fzf
for example is one of my favorite tricks. Instead of scanning by eye or repeatedly grepping to find something, it's a live fuzzy filter. And depending on how deep you want to go you can then add key bindings to check out the selected commit, or preview the full message, or anything really.