How to get icomplete-like find-file completion in doom/ivy/selectrum/etc.?
So, I'm in the middle of trying to port my 20 years of emacs config from a homegrown solution based on a fork of grail.el to Doom. And by "port" I really mean "rebuild something familiar enough that I can relearn to use it", as I'd really like to leverage the community-built configs for stuff like python (been writing python in Emacs for 10+ years, and I still can't the experience to be anything better than "rather sucky").
Anyway, a big, big problem for the adoption right now is the fact that, try as I might, I can't get find-file completion to work the way it does in icomplete. By which I mean that if I type ~/D/r-g/sc/, it will complete to ~/Dev/renpy-games/scratchpad. No packages I've tried to migrate to (which so far includes Doom's (ivy +fuzzy +prescient) and selectrum-prescient in my old personal config) have anything like that. They don't seem to match partial directory names, don't recurse into subdirectories, and don't consider / to be a separator. The closest I could find is Ivy's C-j, which inserts the current candidate into the minibuffer, but that's much clunkier and less powerful, since I can't just say "whichever of the candidate directories has the file in it". Is there any way to make it do that? I know that Doom generally expects you to use projectile and there the fuzzy searching works, but my workflow isn't currently built around projects, and I do a lot of ad-hoc editing of files that I know the path of, and don't want to give it up.
Posted Jun 11, 2020, 9:25 PM UTC
I think what you want is counsel-fzf. You need to install fzf on your system and counsel in emacs. There is a really useful extension to counsel-fzf on Protesilaos Stavrou's .emacs file that I use: https://protesilaos.com/dotemacs/
I think it's called prot/counsel-fzf-with-rg or something. He demonstrates it on his YouTube channel if you search for fzf rg ivy. Sorry for the bad formatting, I'm on mobile.
Thanks, I'll check that out.