skim icon indicating copy to clipboard operation
skim copied to clipboard

multiple tokens with rg

Open adrianstaniec opened this issue 4 years ago • 4 comments

hello lotabout,

I like the multiple tokens feature, particularly than when I just write two words (separated by space) they will be found even if order is different, so that works nicely on filtering file names

however this feature is lost/broken when filtering lines, when using rg recommended setup, can I preserve this feature somehow?

one option I can think of, would be to only pass the first token to rg, and give the other tokens to skim to filter further the results from rg,

it can be also misleading because the second token is used by rg as a file to search on

please advise

adrianstaniec avatar Apr 15 '20 22:04 adrianstaniec

@adrianstaniec To clarify, what is "multiple tokens feature"? Is it rg -e <pattern1> -e <pattern2>?

lotabout avatar Apr 16 '20 02:04 lotabout

By multiple token I meant:

skim also supports the combination of tokens.

Whitespace has the meaning of AND. With the term src main, skim will search for items that match both src and main.

I like it a lot, and would like to use it also when grepping lines (content of files). Do you know if its possible?

the command you suggested, works like an OR instead of AND

adrianstaniec avatar Apr 29 '20 05:04 adrianstaniec

I'm also interested in this. It could be understood as allowing multiple search terms to be input simultaneously, which is basically what skim's "extended search mode" is. The problem is this isn't supported in regex mode, so you can't have multiple regex search terms.

dkasak avatar Nov 12 '21 10:11 dkasak

Probably the ticket to follow is over here: https://github.com/BurntSushi/ripgrep/issues/875

garfieldnate avatar Nov 18 '21 21:11 garfieldnate