reddit / emacs

Helm Fuzzy Find always returns error "Command not found: ff"

EquivalentCancel6 · 2022-01-23 18:07
Hey guys, So I managed to get majority of what I think my emacs config should look like up and running. Still tweaking things for modern web development (react, ts, etc etc).. One thing I miss the most about vim/neovim was telescope and fuzzy finding. Is there a way to have this functionality in emacs? I messed around with counsel-fzf but what I got was fuzzy-finding in the current directory rather than the entire project.. I am trying out helm now and I keep running into this annoying issue when trying to use helm-fuzzy-find. Am I doing things right? Any suggestions on getting fuzzy finding working in emacs where whenever I trigger it, it searches the root project directory?? ​ THANKS!
FrozenOnPluto · 2022-01-23 18:33
No answer for you (sorry!), but related perhaps - I've been on and off over the years looking for a 'find' operation that supports plugins; akin to how orderless can change how find-file is filtered. I'd love to be able to search for 'foo bar' to find fooBar or BARfoo in the buffer text. (To make it workable, make it work on a per-line basis for buffers with linebreaks, like those of us doing coding.) Must be a hard thing to implement, since I don't think such a thing exists yet?
wargxs · 2022-01-23 18:54
you can fuzzy find in projects with projectile or project.el. No need for fzf.
EquivalentCancel6 · 2022-01-23 20:27
There isn't a perfect solution but apparently using something like projectile might help u/wargxs suggestion not mine.
wargxs · 2022-01-23 20:53
consult-line? or helm-occur?
FrozenOnPluto · 2022-01-23 20:58
huh; consult-line (not -lines, thats different I gather) may do the trick; I think I'm looking for somethign more like icomplete where you just keep hitting C-s to head to the next match, but that ought to help and feed into the completion system of choice hopefully (Selectrum et al.) I'll give it a shot!
wargxs · 2022-01-23 21:12
ivy has swiper which can probably do the same … project wide you can use git grep / ripgrep which all completion frameworks support ; I don’t completely understand what you are looking for …
wargxs · 2022-01-24 07:27
I tested swiper-isearch again (from [https://oremacs.com/swiper/](https://oremacs.com/swiper/)) and it does exactly what you would like, you can jump between results via C-s and C-r and foo bar finds foobar and barfoo etc.
FrozenOnPluto · 2022-01-24 14:39
Just tried it, and it seems wonky, but close; I'll fiddle with config.. I've never used Ivy, using other things instead, so I don't really have much of an Ivy config.. or perhaps some of my other thousands of lines are fighitng with it. But,. it looks promising! I'll go a diggin'! Thanks for the tips folks! **You're right, Ivy with a bit of twiddling works a treat with orderless :)**
00-11 · 2022-01-24 16:11
1. You can do this with Isearch, if you use [Isearch+](). It gives you [Dynamic Search Filtering](https://www.emacswiki.org/emacs/DynamicIsearchFiltering#WhatYouCanDo). To search for all lines that contain both `fooBar` and `BARfoo` you just use `C-z . fooBAR` and `C-z . BARfoo` while searching for regexp `.+` (that is, line search). See [What You Can Do](https://www.emacswiki.org/emacs/DynamicIsearchFiltering#WhatYouCanDo). 2. You can also do it using [Icicles Search](https://www.emacswiki.org/emacs/Icicles_-_Search_Commands%2c_Overview). That's even easier than using Isearch+: `C-c '` (`icicle-occur`), then type each pattern you want to match in the same line, separating them with `S-SPC`: `C-c ' fooBar BARfoo`. *All* use of the minibuffer for completion with Icicles gives you this [progressive completion](https://www.emacswiki.org/emacs/Icicles_-_Progressive_Completion#progressive_completion), which allows orderless matching. And you can combine progressive completion with [chipping away the nonelephant](https://www.emacswiki.org/emacs/Icicles_-_Nutshell_View#ChippingAway), or with [regressive completion](https://www.emacswiki.org/emacs/Icicles_-_Regressive_Completion), to get orderless *OR*ing as well as orderless *AND*ing. (*Chipping away* prunes by removing candidates that match, instead of pruning by removing candidates that don't also match an additional pattern.)
wargxs · 2022-01-24 21:58
Ok, never tried it with orderless usually I use (setq ivy-re-builders-alist '((t . ivy--regex-ignore-order))) which provides out of order matching.
FrozenOnPluto · 2022-01-24 22:02
Thats interesting; I use Selectrum + marginalia + orderless, so as close to aht sort of thing as I can get is a win. I ended up with: ;; enable Ivy swiper to use orderless (setq ivy-re-builders-alist '((t . orderless-ivy-re-builder))) ;; replace C-s isearch with swiper's (global-set-key (kbd "C-s") 'swiper-isearch) ; orderless swiper override (global-set-key (kbd "C-r") 'swiper-isearch-backward) ; orderless swiper override ;; set height of the ivy window; we set 1 so that it more or less looks like isearch .. not a huge ;; Ivy window that is distracting as it reformats the display (setq ivy-height 1) ;; show m/n layout for the in-flight counter (setq ivy-count-format "(%d/%d) ")