Questions tagged [ag]

The Silver Searcher, better known as Ag is a tool similar to ack.

The Silver Searcher, better known as Ag is an open-source tool similar to created and maintained by Geoff Greer.

115 questions
0
votes
1 answer

Is there a better way to grep than using these four commands thrown together?

Essentially what I'm trying to do is parse through some files on my system and pull out a few different things from each file. Here is how I'm currently doing this: grep -oP "((?<=set_kb_item\(name:)(.*?)(?=, value:))" *.nasl >>…
Chad D
  • 299
  • 8
  • 21
0
votes
1 answer

Can't find a result with The Silver Searcher at a certain depth

I'm getting some odd behaviour with The Silver Searcher that I just discovered when looking for a line in my code base. In the root folder, I call % ag branding_black_with_bundles % ag --depth -1 branding_black_with_bundles and get nothing.…
socksy
  • 13
  • 1
  • 4
0
votes
1 answer

NERDTree with AG.vim after "e" cursor goes to NERDTree - vim

I have NERDTree opened on the default left side, and some vim file on the right side. After I do search with Ag like :Ag! "echo" I get results in the quickfix window. I chose one of the results and by pressing "e" it opens it to the right side and…
whitesiroi
  • 2,725
  • 4
  • 30
  • 64
0
votes
1 answer

ag without PATH parameter vs. ag with PATH parameter

If I call ag "SomeTest" ~/foo I get no result, while cd ~/foo; ag "SomeTest" lists the expected result. How comes?
rknuus
  • 118
  • 1
  • 9
0
votes
2 answers

Using Ag ("The Silver Searcher") to find hex codes

I used to use find command for linux to find hex code in php code as the following: find "/www_root/myfile" -type f -name "*.php" | xargs grep -il x29 The above command works like a charm, but I may need a faster searcher as my files are keep…
0
votes
3 answers

How to append the output of a function in a normal mapping command

I have this mapping in vim map f :Ag --ignore node_modules I would like to append the result of the 'getcwd()' at the end of the command. Something like (not working, but gives the idea): map f :Ag --ignore node_modules :call getcwd() So the…
Jean-Francois
  • 1,332
  • 3
  • 17
  • 24
0
votes
1 answer

Error when pattern search in netrw

When I do :Explore //** searchingforthis I get this error: E132: Function call depth is higher than 'maxfuncdepth' Anyone knows why? Btw, //** do a grep in the netrw dir and let you step through the files where the pattern were found. I'm using ag…
Olle Härstedt
  • 3,799
  • 1
  • 24
  • 57
-2
votes
1 answer

Regex for optional parts of string

How can I match all four variants shown below with one regular expression? ABC ABC_DEF ABC_DEF_GHI ABC_DEF_GHI_JKL ABC, DEF, GHI, JKL do not represent number of characters. I've tried something like this (only for second option) but no luck:…
Murakami
  • 3,474
  • 7
  • 35
  • 89
-2
votes
1 answer

silver searcher fail for certain files

I'm having trouble recently using silver searcher. There are 2 files in a directory containing same content: A.cpp: This is a cpp file B.cpp: This is a cpp file However, $ ag cpp returns the result of B.cpp, not that of A.cpp: B.cpp 1:This is a…
-4
votes
3 answers

File searching and proximity search

I've been looking at grep a file, but show several surrounding lines? I'm using a bash terminal, looking for a file which Has both path and redirect on any one line Has flash on a nearby line, within five lines from the first In this possible with…
american-ninja-warrior
  • 7,397
  • 11
  • 46
  • 80
1 2 3 4 5 6 7
8