Questions tagged [the-silver-searcher]
A faster alternative for grep; usually installed as the 'ag' command.
16
questions
1
vote
1answer
76 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 ...
0
votes
1answer
101 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 ...
1
vote
1answer
148 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 ...
0
votes
1answer
68 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 ...
0
votes
1answer
153 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 ....
0
votes
1answer
905 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 --...
4
votes
1answer
1k 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 ...
0
votes
2answers
122 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 ...
0
votes
1answer
61 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 ...
0
votes
1answer
311 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 ...
4
votes
1answer
304 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 ...
2
votes
0answers
79 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 ...
3
votes
0answers
72 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,...
4
votes
4answers
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:
...
1
vote
1answer
503 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 ...
3
votes
1answer
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 -...