Fork me on GitHub
#spacemacs
<
2022-03-07
>
Drew Verlee00:03:48

when i try to do a project wide search i get "option ignore is ambiguous...." instead of the expected search results.

jeff.terrell01:03:11

Spacemacs doesn't have a lot of smarts about how it calls the underlying searchers like ack, pt, ag, etc (see the SPC s menu for the list). This means that sometimes you mean to search for things but you're accidentally passing options to the searcher. (Try prefixing your search with --, which is an old unix CLI trick. Dunno if that will help; just a guess.) This is frustrating at times but also can be powerful to be able to easily change the options on the fly.

practicalli-johnny01:03:52

Can you share the search pattern used? And which search tool you have installed I use ripgrep and haven't had too many problems, although the odd special character can confuse the search too. These are the options I know about, which should work for ripgrep and ag https://practical.li/spacemacs/spacemacs-basics/working-with-projects/searching-projects.html#searching-specific-files

Drew Verlee01:03:36

it happens for all patterns. I'll install ripgrep, im using my labtop so thats likely the issue. thanks john

Drew Verlee01:03:57

thanks jeff ill try that

Drew Verlee01:03:37

install ripgrep fixed it. thanks again 🙂

👍 1
practicalli-johnny18:03:40

I've updated https://practical.li/spacemacs/spacemacs-basics/working-with-projects/searching-projects.html with example of using the -A option which will show the specified number of additional lines after each matching line. There is also a screenshot of the error that occurs if using an option without a valid value (i.e. missing a glob pattern from -g). This is because Spacemacs sends the pattern to the search binary as soon as you type characters. I didn't get anywhere with --, although did discover that the pattern can be used before or after the options, which seems very handy