Is it just me or is Mickey Petersen on some crazy roll right now? It seems like every other day he's posting another blindingly clear and useful write up of some nook and cranny of Emacs that you'd either never considered the possibility of or at best only got round to daydreaming you'd one day try to figure out or implement?
> So that got me thinking. There’s no reason why you can’t use Emacs to do this instead of fzf! Emacs has better fuzzy finding and it’s the text editor you’re already using, so why not use Emacs?
He's also a reasonably active participant in r/emacs which is great. I'm already pretty proficient in Emacs, and Emacs already comes with pretty solid documentation, but I bought his book "Mastering Emacs" anyway because I'm a fan of his writing and blog posts.
Should be as cross-platform as Emacs and Bash are: very cross-platform. And the Bash wrapper (ezf.sh for ezf.el) could probably be rewritten in say Powershell.
Fzf is written in C, and there's a Rust implementation called skim (sk).
Each of these seem very cross-platform. But the advantage this solution has is that you stay within the Emacs ecosystem with Emacs syntax/keybinds/colors etc.
I suppose I should have been clearer: The submission is on how to get fzf behavior in Emacs without using the various fzf related packages for Emacs.
Emacs is cross platform.
fzf is cross platform.
Presumably the fzf packages for Emacs are cross platform, but I haven't checked. If any of them are, then I can have the same setup for Windows and Linux (I use Emacs on both).
With this solution, I'd need to have a different script in Windows and Linux (I don't use WSL - Emacs works quite well without it). So by cross platform, I meant "Copy config from one platform to another and just have it work".
While we're on the topic of finding stuff in Emacs, check out the `consult-ripgrep` [1] command from the Consult package by Daniel Mendler. Consult coupled with Orderless [2] package is a super power. You can even export the results (using Embark [3]) into a wgrep buffer, make edits on just the search results, and have them applied across the code base!
The `Emacs-wgrep` [1] package is what allows you to edit a standard Emacs grep buffer and have the specified changes applied to all the project's files. I just recently started using it, and it's extremely handy!
With due respect to Mr. Petersen, and as an Emacs user myself, I really can't agree. When I fire up fzf I just type and generally without any thinking I get what I want. Emacs takes some configuration to get to that point; the built in flex completion is, for whatever reason, not as robust in my experience.
In fact, in my current config I've been using fzf (or really skim) for completion within Emacs, via fussy: https://github.com/jojojames/fussy
16 comments
[ 2.8 ms ] story [ 22.9 ms ] thread> So that got me thinking. There’s no reason why you can’t use Emacs to do this instead of fzf! Emacs has better fuzzy finding and it’s the text editor you’re already using, so why not use Emacs?
Love it.
Also, as he says in the footer, this is available on Github: https://github.com/mickeynp/ezf
I'd imagine if he records a video of doing his daily work in Emacs, it probably feels like the Matrix.
Fzf is written in C, and there's a Rust implementation called skim (sk).
Each of these seem very cross-platform. But the advantage this solution has is that you stay within the Emacs ecosystem with Emacs syntax/keybinds/colors etc.
That would be fzy : https://github.com/jhawthorn/fzy
Emacs is cross platform.
fzf is cross platform.
Presumably the fzf packages for Emacs are cross platform, but I haven't checked. If any of them are, then I can have the same setup for Windows and Linux (I use Emacs on both).
With this solution, I'd need to have a different script in Windows and Linux (I don't use WSL - Emacs works quite well without it). So by cross platform, I meant "Copy config from one platform to another and just have it work".
This solution is just as portable as Emacs. Very, very portable.
[1]: https://github.com/minad/consult#grep-and-find
[2]: https://github.com/oantolin/orderless
[3]: https://github.com/oantolin/embark
[1]: https://github.com/mhayashi1120/Emacs-wgrep
With due respect to Mr. Petersen, and as an Emacs user myself, I really can't agree. When I fire up fzf I just type and generally without any thinking I get what I want. Emacs takes some configuration to get to that point; the built in flex completion is, for whatever reason, not as robust in my experience.
In fact, in my current config I've been using fzf (or really skim) for completion within Emacs, via fussy: https://github.com/jojojames/fussy