dajva / rg.el

Emacs search tool based on ripgrep
https://rgel.readthedocs.io
GNU General Public License v3.0
471 stars 38 forks source link

Is there a way to sort the files? #80

Closed tspiteri closed 4 years ago

tspiteri commented 4 years ago

Ripgrep does have an option, but it is not exposed and I think with good reason, as it inhibits rigprep parallelism. However sometimes having the result buffer sorted by file would help my flow; is there a way to sort the files inside the result buffer once rg is finished?

dajva commented 4 years ago

There is no easy way to sort an existing result since the result buffer is only text and no datastructure is available to work on unfortunately. You can make use of the rg flag though. There are several ways to go about this:

tspiteri commented 4 years ago

Thanks! (rg-define-toggle "--sort path" "o") is perfectly fine for my use. It allows me to pass whatever flags I want to rg; it can't be much more flexible than that :)