Fork me on GitHub
#spacemacs
<
2018-06-08
>
troglotit15:06:51

Does anyone use ripgrep? do you have problems grepping for \(when in SPC / (error in process sentinel, Invalid regex)? I’ve googled a bit and found that indeed something like that happened in rg.el package. Going to research a bit for spc /

jeff.terrell15:06:58

I use pt, for no particular reason, but I haven't noticed that problem with it.

ag17:06:08

@troglotit what exactly is the problem? I'm using "rg" as default search app - it slightly differs in syntax from "ag", but it works fine for me. I often do complex queries like searching for a string in only *.cljs files with added lines above and after the line (-C key)

jeff.terrell17:06:30

Wait wait wait—@ag are you saying you can do those kinds of queries from within Spacemacs? I've wanted to do this sort of thing for a while and not known how. Example: exclude results from *.json fixture files. Is that possible?

jeff.terrell18:06:40

If I type --version after SPC s t p (for the pt-based search I'm used to), I get an error: > Error running timer: (error "Candidates function ‘helm-ag--do-ag-candidate-process’ should run a process")

jeff.terrell18:06:51

(1) Strange that the error mentions ag instead of pt.

jeff.terrell18:06:20

(2) I wonder if what you're describing is unique to rg, which I notice isn't one of the built-in tools under the SPC s menu.

ag18:06:59

I think (I need to check if that's accurate) it's because for SPC / spacemacs uses helm-ag and helm-ag can use not just ag. Anything you set in dotspacemacs-search-tools as the first thing will be used by default

ag18:06:45

yeah basically check man page for your search tool e.g. SPC h m rg - you can use some of the arguments in SPC /

jeff.terrell18:06:18

I get that what you're ultimately doing is including args in the rg shell command rather than just a search string, but I think there might be some more config making that possible. I tried :(setq dotspacemacs-search-tools '("rg")) then SPC / and it immediately tells me let: Wrong type argument: commandp, helm-project-do-rg rather than letting me search helm-style. If I reset the var back to '("pt") it works fine, just without the possibility of intervening arguments.

jeff.terrell18:06:15

I did this after a brew install ripgrep, and rg is a valid shell command now, but maybe I need to restart emacs? That error doesn't seem to indicate that, but who knows.

ag18:06:21

Jeff, try putting the search term first and the arguments after

jeff.terrell18:06:01

Ah, that worked (with pt). Strange, but OK!

eggsyntax18:06:24

As another datapoint, for me "rg" was already first in the list. I installed ripgrep, and (`SPC /`) -g*clj foo works for me.

eggsyntax18:06:37

Oh good, it's working, NM 🙂

ag18:06:57

yeah, the way how rg works it slightly annoying, it would immediately throw some errors but if you continue typing it will search. Now I think I want to find a way to execute actual search only after pressing RET

troglotit21:06:40

@ag when I grep for something which starts with opening paren, e.g. \(when

ag21:06:31

@troglotit ah yeah... rg uses rust's regexp syntax that I'm too lazy to learn. for those kind of things I still use ag. SPC s a f \(when

👍 4
ag22:06:06

tbh I was absolutely happy with ag. But then spacemacs guys decided to make rg the default. I thought: "oh cool - no one confuses it with my name anymore" and did the switch.

😂 16