Emacs Ag Search Config

Sometimes the files and directories in for instance a .gitignore file differ from what you want to have included / visible when you work with a project.

For the standard projectile file search etc just doing:

(setq projectile-indexing-method 'native)

Will take care of things, it will override everything with what you have configured in the .projectile file as it should be.

However Ag project searching the code still respected .gitignore and I wanted to be able to have some of the directories searched by Ag, example being configs and untracked testing logic.

This config in my init.el took care of it:

(straight-use-package 'ag)
(setq ag-reuse-window 't)
(setq ag-reuse-buffers 't)
(setq ag-arguments (list "--smart-case" "--stats" "--skip-vcs-ignores" "--ignore-case"))

The key part being –skip-vcs-ignores.

Related Posts

Tags: , ,