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
2
votes
1 answer

ag search results has corrupted messages in emacs

Recently my ag search results have started returning corrupted results like this: [[?25h^[[0G^[[?25h^[[0Gapp/config/development.coffee:49:33:# I am unsure as to why this has suddenly started happening.
dagda1
  • 26,856
  • 59
  • 237
  • 450
2
votes
2 answers

Grep/Ack expression with parenthese and semicolon

I'm using vim Ag.vim from Silver Searcher. I would like to search let(:application in my project. If I do :Ag "let(:application" app/ I get || ERR: Bad regex! pcre_compile() failed at position 16: missing ) || If you meant to search for a literal…
Mio
  • 1,412
  • 2
  • 19
  • 41
2
votes
1 answer

How to search from the root of project - Ag / VIM

I did add let g:ag_working_path_mode="r" to my .vimrc but it doesn't work when I tried to search for example :Ag! jquery in /vagrant/my_prj/app/Controller/MyController.php [Git(master)] and I get No matches for "jquery" But if searched :Ag! jquery…
whitesiroi
  • 2,725
  • 4
  • 30
  • 64
2
votes
0 answers

Emacs `shell` and `eshell` on Windows

I have some of the console commands I would like to use from Emacs, namely ag. It works great in CMD or Far Manager. However when I use it from Emacs shell or eshell I run into a problem which may be (slight chance, though) ag-specific. When I run…
EvgeniySharapov
  • 3,078
  • 3
  • 27
  • 38
2
votes
4 answers

Vim, Ag and Quickfix window, limit output width and height

Is there a way to limit :Ag output so it always takes one line and doesn't blow up the quickfix window? At the moment it looks like this and it's awful. I can't see filenames, everything is super slow and just sucks: Update For the record, I…
firedev
  • 20,898
  • 20
  • 64
  • 94
1
vote
1 answer

How do I let silver searcher ignore certain sub-directories?

How do I let silver searcher ignore certian sub-directories, in my case I want ag to search md format only and ignore all the node_modules directories, I tried what here silver searcher ignore multiple directories said, but it did not work. ag --md…
Qiulang
  • 10,295
  • 11
  • 80
  • 129
1
vote
0 answers

ag (the silver searcher) does not automatically search recursively

When performing ag pattern it only searches in the files in the current directory, even when providing --depth NUM>1. Performing ag pattern ./** looks in all subdirectories as well. I am currently using the :Ag command with fzf-vim which also only…
hilbor
  • 15
  • 3
1
vote
1 answer

ag (the_silver_searcher) definition of hidden dir and including hidden dirs in search path

The man does not define 'hidden' and 'ignored'. This probably means the 'hidden' is a file starting with a dot and 'ignored' is an entry in related ignore lists (.gitignore and .ignore). However it is not clear if 'hidden' also includes hidden dirs.…
user3156459
  • 1,123
  • 2
  • 9
  • 17
1
vote
1 answer

Silver Searcher: How can I only return results in folders matching a pattern?

My file structure is like this: A G (want to ignore) H (want to ignore) X (contains files I want to search) B G (want to ignore) H (want to ignore) X (contains files I want to search) C (want to ignore) X (contains files I want to…
veeTrain
  • 2,915
  • 2
  • 26
  • 43
1
vote
1 answer

How to know which Column is selected for Sort in Ag-Grid in Angular and is Acending or Decending

How to know which Column is selected for Sort in Ag-Grid in Angular and is Acending or Decending Html ts import {Component} from…
1
vote
2 answers

FZF - Search the target folder

I've been using fzf for a while now and finding it really great, however there is one thing I want it to do but I don't think I'm Googling the correct words. I use it with neovim on a zsh terminal and what I want to do is for it to search only the…
clueless
  • 839
  • 1
  • 10
  • 24
1
vote
1 answer

ag grid angular 9 model problem .. it doesn't recognize in app model

I'm using angular 9. i created a new project .. i tried to import Ag-grid package .. but for some reason it doesn't recognize ag-grid .. i installed it properly - because i can see it in the import of the model ... my code : /*Modules*/ import {…
1
vote
2 answers

sed - Search and replace always puts capture group at the end

I'm refactoring some code across lots of files, and am trying to do a search and replace using sed on a Mac. The goal is to go from this: fooActions: typeof fooActionCreators to this: fooActions: Partial I've gotten it to…
Danny Delott
  • 6,756
  • 3
  • 33
  • 57
1
vote
1 answer

Find and replace text in files with the silver searcher and sed

Heck I just can't remember ... I recently had a cool way to use ag with sed to do find and replace. The gist was simple, something like: ag foo -l | ... magic here ... sed 's/foo/bar/g' That doesn't work, but you might just know what does.…
Robert
  • 1,530
  • 1
  • 16
  • 24
1
vote
1 answer

Why does silver searcher not find Java files w/out -t flag?

Java files are listed in the known file types (using ag --list-file-types) but aren't aren't returned in the ag search results below unless I use the -t flag (-a and -U also return Java files in the results). Is this expected behavior? I have…
Andrew Goodnough
  • 1,068
  • 7
  • 8