So you've installed `fzf` – now what?
181–190 of 292 posts
Re: So you've installed `fzf` – now what?
#182Earlier quoted context omitted.
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.
I've seen a number of projects with hundreds of "index.js" files.
Learning for me: Brew suggests to install the shortcuts but doesn’t automatically do this. Just activated this and Ctrl-R is a big improvement this way.
Re: So you've installed `fzf` – now what?
#183Earlier quoted context omitted.
Something I've always wanted from my shell history is to be able to record relative filepaths as their absolute equivalent in the history, is that supported in atuin?. If you do a lot of data munging on the CLI, you end up with a lot of commands like `jq 'complicated_selector' data.json`, which if I want to remember the selector is good, but if I want to remember which data I ran it on is not so good. I could do it w…
I sometime use a #a-text-comment at the end of long/complex command line incantation. Easy to find using fzf at a later date. Also can provide you with a quick context.
Or at least I hope it is. :)
Re: So you've installed `fzf` – now what?
#184> I reviewed my options. I could > Use my half-remembered knowledge of the FHS to guess around, with trees and greps, or > Just know and commit it to memory and feel superior to everyone else, or > Just pipe find . ‘/’ to fzf and start searching. Or you could have just typed find / -name nginx.conf Maybe an extra 2>/dev/null if you dont want to do it from sudo
Notice in that section I called it within a subshell. If I ran `vi $(find / -name nginx.conf)`, and there happened to be multiple files named nginx.conf lying around my system, my guess is `vi` would try to open all of them as different buffers, which is not generally what I want.
Or, for this specific example, remember standard config file convention?
Re: So you've installed `fzf` – now what?
#185I 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 }
Re: So you've installed `fzf` – now what?
#186I don't think this article goes far enough into what a game-changer fzf can be. Combined with some clever "preview" functions, and a pop-up terminal function (which, that part is admittedly harder than it ought to be) it can be an across the board a better general purpose script menu creator than most command line AND GUI tools, namely due to - instant previews AND - the ability to either arrow up and down OR fuzzy t…
I have ~200 lines of scripts that use fzf and mblaze ( https://github.com/leahneukirchen/mblaze ) as the ui for my very own mua. It's all Unixy and lovely. I should write a page about that
Re: So you've installed `fzf` – now what?
#187Earlier quoted context omitted.
Packages can place init scripts into /etc/profile.d and those get autoloaded by shells.
This is what happens when tooling providers try to do their own packaging. Homebrew, apt, rpm, and other package managers, as well as bash, zsh and other shells, all offer standardized ways to install configuration loader scripts for the user's environment, and to display installer messages that prompt the user to do it - but fzf has a bunch of functionality to go around all that and auto-update itself in place and h…
There’s no standardised way to extend interactive shell configuration without just appending to /etc/bashrc.
The other problem with this is that it is hard to disable. What if you want fzf but without the key bindings? FZF could add a mechanism for this, but it doesn’t fully solve the problem, because the FZF script being added to global configuration will always be run before any user config.
In this specific case, it is a limitation of bash (and probably ZSH as well) that there is no simple package-manger compatible extension mechanism for interactive shell plugins which doesn’t sacrifice user control.
Re: So you've installed `fzf` – now what?
#188Earlier 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?
To wit:
> It says to put those commands in the .bashrc config:
shopt -s histappend
PROMPT_COMMAND="history -a;$PROMPT_COMMAND"
> The first command changes the history file mode to append and the second configures the history -a command to be run at each shell prompt. The -a option makes history immediately write the current/new lines to the history file.I used to have something like this set up on my Linux laptop - the downside is that seperate shell/terminals/windows/tabs don't keep seperate history - so if you eg start a server in shell one (rails s), start editor in two - then go back to one and ctrl-c out - up arrow will now give you "vim" not "rails s".
The problem compounds if you ping, or curl in another shell etc.
Re: So you've installed `fzf` – now what?
#189Re: So you've installed `fzf` – now what?
#190I 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...