A code-searching tool similar to ack, but faster.
The Silver Searcher is a tool for searching code. It started off as a clone of Ack, but their feature sets have since diverged slightly. In typical usage, Ag is 5-10x faster than Ack. See the GitHub page for more info.
What’s so great about Ag?
- It is an order of magnitude faster than
- It ignores file patterns from your
- If there are files in your source repo you don’t want to search, just add their patterns to a
- The command name is 33% shorter than
ack, and all keys are on the home row!
ack test_blah ~/code/ 104.66s user 4.82s system 99% cpu 1:50.03 total ag test_blah ~/code/ 4.67s user 4.58s system 286% cpu 3.227 total
brew install the_silver_searcher
You can use Ag with ack.vim by adding the following line to your
let g:ackprg = 'ag --nogroup --nocolor --column'
let g:ackprg = 'ag --vimgrep'
Which has the same effect but will report every match on the line.