When I am running helm-ag commands in a large project with multiple git submodules, the shared libaries are repeatedly searched. I do not want those be searched.

So how can I change the helm-ag commands' behavior to achieve that?

The helm-ag library I mentioned above is here: https://github.com/syohex/emacs-helm-ag

1 Answer 1


You can do that by adding a .agignore (or .ignore if you use ag 2.0.0) to the root of your project with a list of folders that you want to ignore. You have to set helm-ag-use-grep-ignore-list to non-nil value to use this file.

There is other way to do that by only changing your emacs configuration. You set helm-ag-use-grep-ignore-list to non-nil value and add the directories that you want to ignore to grep-find-ignored-directories. You can find an example of use of grep-find-ignored-directories in Endless Parentheses.

  • This does not work with helm-do-ag.
    – Adelita
    Commented Nov 3, 2022 at 13:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.