Open hyiltiz opened 8 years ago
Selection can act as a pipe as in, make a search, select results (bunch of cmd+d), then make a new search in selection. Multiple selection work great for that. However search does not support negative query.
With complex query usually i'm either OK with doing manual pruning, or if it's a data collection task then OK with using dedicated tool. Grep looks like the right tool for your task.
While it is not a one shot search, I would not call it "complex" query. I think you are suggesting that this is not an editor task. I think I agree, thought Unite for Vim dues that happily. (I believe there are Emacs packages that dues this too).
With search on selection, can we search into the selected files when each selection is a filename? Haven't tried, but I doubt so.
On Mon, Nov 16, 2015, 23:06 Jean Christophe Roy notifications@github.com wrote:
Selection can act as a pipe as in, make a search, select results (bunch of cmd+d), then make a new search in selection. Multiple selection work great for that. However search does not support negative query.
With complex query usually i'm either OK with doing manual pruning, or if it's a data collection task then OK with using dedicated tool. Grep looks like the right tool for your task.
— Reply to this email directly or view it on GitHub https://github.com/atom/find-and-replace/issues/595#issuecomment-157262639 .
Sent from Gmail Mobile.
While it is not a one shot search, I would not call it "complex" query.
com·plex adjective 1. consisting of many different and connected parts. synonyms: compound, composite, multiplex
Unite for Vim dues that happily. (I believe there are Emacs packages that dues this too)
Possibly the proper solution for atom is a community package too ? A lot of discussion about package development happens on the https://discuss.atom.io/ board.
Maybe what I was trying to say is that in grep the unit of work is a line. This make it easy to make query such as :
Find & replace works on consecutive characters. This make it easy to do:
And while ultimately a line is made up of consecutive character, the different representation make different kind of query very easy / hard to express.
Consider two scenarios:
collect
with the input arguments ofapple
but notorange
. Normally, one would come up with a rather complicatedregex
that looks similar to this (this is not even correct; could not get my head around something like this as a single regex)collect.*[(apple)][^(orange)]
. Solution: first search all lines that containcollect
, then in those lines search for lines that containapple
, then in these lines, continue searching for lines that does not haveorange
. Basically, it isgrep 'collect' file | grep 'apple' | grep -v 'orange'
usinggrep
.orchard
. You would usegrep -rl 'orchard' /path/to/project/ | grep 'collect' | grep 'apple' | grep -v 'orange'
usinggrep
and it's-l
switch along withxargs
.Basically, it is the
|
tunnels, but being able to performgrep
's-v
and-l
switches as well, easily, right from within almightyatom
. I could not find how to do that from withinatom
vanilla, or using any of the existing packages. Am I missing something, or is this actually a feature to consider?