Earlier quoted context omitted.
Fuzzy history is nice, but the real game changer for me was the ability to pretty much stop remembering paths in big projects. The default keybindings provide the Ctrl-T shortcut to insert a path/filename on the command line using fuzzy search and Alt-C to fuzzy-cd. No more tedious completion - just search + enter.
Same thing with Emacs with Projectile. I can't believe people still using a tree view of a deeply nested project and clicking though directories and finally finding a file. I am not willing to type more than a few characters for any file in the project. Fuzzy finding with quick narrowing FTW.
So you've installed `fzf` – now what?
171–180 of 292 posts
Re: So you've installed `fzf` – now what?
#172I really like the suggested command ` $(fzf)` to quickly open files in relative to the directory I am in. However, when I abort the fuzzy find with esc, it still opens without a file input, which is not what I want, so I wrote a little script for my shell config to prevent this: fuzz() { file=$(fzf) if [ ${#file} -gt 0 ]; then nvim "$file" # or any editor you prefer else : fi }
fuzz() { file=$(fzf) && nvim "$file"; }Re: So you've installed `fzf` – now what?
#173Interesting, I'm of the first kind, who uninstalled it quickly. I use ctrl-r a lot, though I have no issue remembering exact portions of the commands, but that may just be me. I'll give it another try. In the same vein as ripgrep (rg), I recommand the author (and everybody else) to give fd-find (fd) a try as a replacement to find. It's much, much faster (multithreaded search), and has better defaults to use from the…
nvm. tutorial explains https://youtu.be/qgG5Jhi_Els?t=400
Re: So you've installed `fzf` – now what?
#174Maybe I'm just getting old, but I found most of the animations in this article to go too fast. I couldn't tell what was happening, couldn't tell what I was supposed to be looking at.
It's not that you're getting old and it's not that it's "too fast". The problem with many animations like this and why they make no sense whatsoever is because they cycle without adding a little pause... So you have no way to know when it's beginning and when it's ending. It's endemic on Github.
Some .gif files are properly done but IMO most don't explain anything, only add confusion and would be better served by three or four screenshots.
There are poor UX and then there are these kind of cycling .gif files.
Re: So you've installed `fzf` – now what?
#175Earlier 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...
FWIW I get a 503 on that URL. Any chance someone can give me that magic one-liner?
PROMPT_COMMAND='history -a'
Has always worked for me. Goes in your .bashrc from the FM
PROMPT_COMMAND ¶ If this variable is set, and is an array, the value of each set element is interpreted as a command to execute before printing the primary prompt ($PS1). If this is set but not an array variable, its value is used as a command to execute instead.
Re: So you've installed `fzf` – now what?
#176The interface is really cool. But is it possible to globally set the default "fuzziness" to zero? I'd like to get only exact matches in all circumstances.
export FZF_DEFAULT_OPTS="--exact"
Or invoke it with one of these: fzf --exact
fzf -e
Or if you start your search with a single quote ' it disables fuzz. (But maybe you already knew that, it sounds like you want the first option.)Re: So you've installed `fzf` – now what?
#177I love fuzzy shell history. Game changer in terms of shell productivity. I use atuin[0] instead of fzf as I find the experience a bit nicer and it has history backups built in (disclaimer, I am a maintainer) Some of our users still prefer fzf because they are used to how it fuzzy finds, but we're running an experiment with skim[1] which allows us to embed the fuzzy engine without much overhead - hopefully giving them…
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...
setopt inc_append_historyRe: So you've installed `fzf` – now what?
#178Earlier quoted context omitted.
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.
My guesses are that it's on-close so you can follow the per-shell history slightly easier (rather than it being interleaved from multiple shells?), or reducing disk writes?
Re: So you've installed `fzf` – now what?
#179> And I found myself asking: Where the heck is nginx.conf? The author lists some ways but misses the standard Unix way: simply use locate https://en.m.wikipedia.org/wiki/Locate_(Unix) Using locate maybe piped to grep is good enough for all my finding needs
Re: So you've installed `fzf` – now what?
#180Earlier quoted context omitted.
Yes. It's a shell hook, it's expected for you to add it to your bash/zsh .rc yourself. How else can it work?
Packages can place init scripts into /etc/profile.d and those get autoloaded by shells.
Not trying to single out fzf here - there are many other tools that do this - but I find this behavior really sad because it makes me very disinclined to trust the tool with anything. A command-line tool should not be trying to auto-update itself or manipulate dotfiles in the user's home directory. It's dangerous and unexpected.