How to setup AG (Silver Searcher) to find text in files in Spacemacs on Windows

Install AG

Follow these steps to install AG.

Configure Spacemacs

Add this line to your Spacemacs user config, so Helm can find AG:

(setq helm-ag-base-command "c:\\Users\\Jason\\AppData\\Roaming\\ag --vimgrep")

Make sure to change the path to where you installed AG. See the documentation for an explanation about the vimgrep argument.

Search within a project

Make sure you've setup a project and have a file in that project open.

Open a file in Spacemacs. Type SPACE s a p:

shows helm-project-do-ag option

A search window will appear. Start typing, and you'll see fuzzy-matched results:

shows the word Animal matching when typing imal

You can use the up/down arrow keys (or CTRL-j or CTRL-k) and then press the enter key to select a result and navigate to it.

Next: How to setup etags for fuzzy symbol searching in Spacemacs on Windows

Comments

Leave a comment

What color are green eyes? (spam prevention)
Submit
Code under MIT License unless otherwise indicated.
© 2020, Downranked, LLC.