Projectile is an Emacs library for finding files, searching, building, testing, and switching between code projects from the editor.
Overview
Projectile is a project interaction library for Emacs. It detects project roots from version control markers or common project files, then exposes commands that operate on the whole tree instead of a single directory.
You can jump to files ranked by how often you visit them, switch between project buffers, move between related files such as models and tests, and search or replace across the project with reviewable result UIs. It can run build, test, and custom task commands, including npm scripts, Make targets, and justfile recipes defined in the project.
Projectile works through Emacs’s standard completing-read interface, so it pairs with Vertico, Consult, Ido, Fido, and other completion front ends. It integrates with the built-in project.el library as a backend and supports per-project sessions that restore window layouts and buffers.
Project discovery is automatic for common layouts, including monorepo subprojects and remote trees over TRAMP. Optional indexing uses external tools such as ripgrep, grep, ag, find, or fd when available, while a portable Emacs Lisp path remains for environments without those utilities.
Key features
- Jump to project files by frecency
- Project-wide grep and replace
- Toggle between code and tests
- Switch between recent projects
- Run compile, test, and custom tasks
- Per-project session restoration
- Integration with project.el
- Monorepo subproject support
Use cases
- Navigating large Emacs codebases
- Scoped search and replace
- Running project tests from Emacs
- Switching between multiple repositories