When comparing The Silver Searcher (Ag) vs Nirw Search, the Slant community recommends The Silver Searcher (Ag) for most people. In the question“What are the best open source tools for searching source code?” The Silver Searcher (Ag) is ranked 1st while Nirw Search is ranked 11th. The most important reason people chose The Silver Searcher (Ag) is:
It is written in C. It is up to 10 times faster than ack.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Really fast
It is written in C. It is up to 10 times faster than ack.
Pro Simple syntax
Ack-compatible.
Pro Ignores files in .gitignore by default
It ignores file patterns from your .gitignore
, .hgignore
and .ignore
. This can be a bit buggy though.
Pro Supports PCRE RegExp
Supports RegEx like look-ahead/behind (only fixed length lookbehind however).
Pro No need to manage another config file or learn a new config syntax
Everything is managed with command line args, meaning you can store commonly used options through .bashrc
aliases, bash scripts, and/or autocompletion. There is no config file format to learn or extra dotfiles to manage.
Pro Progress Output
By default, display the file being searched.
Pro Optional multi-line support
Pro Color highlight matches
Pro Tab completion
The command-line for refining a search supports auto-completing based on the current output.
Pro Can refine the initial search
Initial search can be refined by typing in other terms (optionally exclude from results too).
Pro Optional regex or literal text searches
While regex is default, sometimes escaping is inconvenient, in these cases you can perform literal searches.
Cons
Con You have to remember commonly used options and add them as flags everytime
You are not able to define options in a config file as there is none. (You have to use a shell alias or wrapper script to get your default options.)
Con Cannot add custom file types
All file types ag is able to search for are baked into the executable. There is no way to add new ones neither via command line nor via (the not existing) config file. The only way is a pull request on github and waiting for a new release.