2022 Developer Survey is open! Take survey.

Questions tagged [the-silver-searcher]

A faster alternative for grep; usually installed as the 'ag' command.

Filter by
Sorted by
Tagged with
0 votes
1 answer
179 views

ever since i moved from vim to neovim, my AG has started acting strange

I recently switched to neovim, but ever since my AG usage have acted weird lately. Here is my current .vimrc file. Here is my neovim init file ~/.config/nvim/init.vim: set runtimepath^=~/.vim ...
user avatar
  • 539
0 votes
1 answer
121 views

How to keep Ag (the silver searcher) open when no matches are found?

I do use Ag as my grep replacement. My problem is that when I search for something that does not exist (search result empty) my quick fix windows closes automatically. Is that normal? Would it be ...
user avatar
  • 103
0 votes
1 answer
215 views

Any way to prevent :Ag search from automatically opening the first returned result?

Whenever I run an :Ag search on my present working directory, the first entry in the returned results list is always automatically opened in the currently active pane. Is there any way to disable ...
user avatar
0 votes
1 answer
77 views

How to add a fallback when :b buffer change fails

I have 2 ways to open a file for editing: :b <filename> to switch to an opened buffer -- imagine that I have a lot of folders containing index.html so by using :b I know I am working on the one ...
user avatar
  • 432
0 votes
1 answer
185 views

How to see the number of search return with Ag?

Is there anyway that I can see the number of result with :Ag (attached) If somewhere I could see the number of return would be awesome. I can't find any reference for it on Internet. Thanks My ....
user avatar
  • 197
1 vote
1 answer
1k views

my ag shortcut chokes on spaces

I got this in my .vimrc: set grepprg=grep\ -nriI\ --exclude=tags\ --exclude-dir=vendor " The Silver Searcher if executable('ag') " Use ag over grep let &grepprg = "ag --nogroup --nocolor --...
user avatar
  • 539
4 votes
1 answer
2k views

How to call the fzf Ag command with multiple arguments?

The plugin fzf.vim defines the following vim command here: command! -bang -nargs=* Ag call fzf#vim#ag(<q-args>, <bang>0)' the fzt#vim#ag function seems to allow passing all the ag ...
user avatar
  • 203
0 votes
2 answers
211 views

how to go back and forth in the view stack in vi

I'm not sure if I'm asking this right (I think this is a buffer thing?) so here is the scenario (in gherkin) As a vim user, i would like to use the silver searcher to search for files which have ...
user avatar
  • 539
0 votes
1 answer
82 views

How to dismiss the bottom search bar

background So I have the silver search thing going: " The Silver Searcher if executable('ag') " Use ag over grep let &grepprg = "ag --nogroup --nocolor --ignore wiki --ignore tags" " Use ...
user avatar
  • 539
0 votes
1 answer
457 views

why doesn't ag in my vimrc ignore multiple patterns [closed]

I have this in my .vimrc: " The Silver Searcher if executable('ag') " Use ag over grep set grepprg=ag\ --nogroup\ --nocolor\ --ignore\ wiki --ignore\tests endif " bind \ (backward slash) to ...
user avatar
  • 539
3 votes
1 answer
428 views

Don't expand `%` in external grep call

I try to search for {% amount in all files under the current directory. Using ag, this works fine: ag -Q '{% amount' (-Q specify to not use any regex, try to match text literally) I have this in ...
user avatar
  • 15k
2 votes
0 answers
87 views

Is there a way to highlight searches done with grepprg?

I'm using vim-grepper plugin, but I guess it doesn't really matter. What I want is when I'm searching for something inside my project via vim-grepper or some grepprg if there are matches inside opened ...
user avatar
  • 1,071
3 votes
0 answers
79 views

Can I use Ag in combination with YouCompleteMe for tag autocompletion? [closed]

I have setup vim to use Ag for grepping and for use in the CtrlP plugin. For tag autocompletion, I am using YouCompleteMe. To get autocompletion suggestions for functions throughout the whole project,...
user avatar
  • 161
4 votes
4 answers
2k views

Project Wide replace using Ag

Referencing Post: https://stackoverflow.com/questions/22206332/vim-ag-search-and-replace-globally-and-within-a-directory Specifically: :Ag foo :Qfdo s/foo/bar/c I type Ag miwt-os, I get this: ...
user avatar
  • 1,053
1 vote
1 answer
559 views

Search for %, $ using :Ag

How can I search for queries including %, $ and the likes? I tried to prefix then with '\', enclosing in quotes, but it only makes it worse: :Ag "$r" || ERR: Error: No query. What do you want to ...
user avatar
  • 2,212
3 votes
1 answer
1k views

How to setup AG (the silver searcher) in vim?

I am using AG to simplifying and improve the search in my vim. I remapped K to search for the current selected word as follows: if executable('ag') set grepprg=ag\ --nogroup\ --nocolor command -...
user avatar