(macros)
Code

Projects & search

Macros follows the projectile.el pattern: a project is the directory tree above the file you're editing, found by walking up to a marker (like .git). On top of that, ripgrep's gitignore-aware walker powers fast file finding and project-wide grep — and it works in non-git directories too.

Commands

Key Command Action
C-c p f projectile-find-file Find a file in the current project (Helm)
C-c p p projectile-switch-project Switch to another known project
C-c p g projectile-grep Live grep across the project (Helm)
C-c p G projectile-grep-buffer Grep into a grep-mode results buffer

The project root is shown in the mode line.

Find file

projectile-find-file lists every file under the project root using ripgrep's walker (so .gitignore is honored). It's a static Helm source — the file list is walked once when the picker opens, then filtered in memory as you type.

Switch project

projectile-switch-project lets you pick a known project's root, makes it current, and immediately drops you into its find-file picker.

Grep

projectile-grep is a live Helm picker — the helm-ag / counsel-rg experience. Type a regexp and matches narrow in the panel as you type; Enter jumps to the file at that line, and C-SPC multi-marks like any Helm source. The search re-runs on every keystroke (above two characters), backed by ripgrep's gitignore-aware content searcher.

When you'd rather keep a persistent, walkable result set, projectile-grep-buffer (C-c p G) prompts for a pattern and dumps the matches into a grep-mode buffer instead:

Key Action
Enter jump to the match
g re-run the grep
q close

Those buffer results also feed next-error / previous-error (M-g n / M-g p) — see Diagnostics.

The ripgrep walker is configured through search-* primitives in your init.scm. Because the walker is gitignore-aware by default, you usually don't need to configure anything — but you can prune, whitelist, or loosen it:

(search-exclude "target")                       ; skip a directory or glob
(search-exclude "*.min.js")
(search-include "*.rs")                          ; whitelist: only walk matching files
(set-search-option "hidden" #t)                 ; include dotfiles
(set-search-option "respect-gitignore" #f)      ; walk ignored files too
(set-search-option "max-depth" 8)               ; cap recursion depth

The root resolver (project-root) is itself a Scheme function — walk-up-to-marker — so you can teach Macros about project markers beyond .git if your repos use something else.