Search code examples
ag

How do I add a persistent configuration option to 'ag'?


I have recently begun to use the 'ag' command instead of 'ack'.

Ag is much faster, but does not seem to have a file (such as .ackrc) where one could add configuration options.

For example, I always want a pager to be used, and I don't want to have to always type in:

ag --pager "less -R"

Solution

  • How about putting the following in your command line configuration file (such as .bashrc or .zshrc)?

    alias ag="ag $* --pager 'less -R'"