Command reference
Projectile provides a large number of interactive commands. This page is the full keybinding reference; the notation assumes the s-p prefix.
Projectile doesn’t have a default key prefix for its commands, but all the examples
in the manual assume you’ve opted for s-p (super-p).
|
Here’s a list of the interactive Emacs Lisp functions, provided by Projectile:
| Keybinding | Description |
|---|---|
s-p f |
Display a list of all files in the project. With a prefix argument it will clear the cache first. |
s-p F |
Display a list of all files in all known projects. |
s-p g |
Display a list of all files at point in the project. With a prefix argument it will clear the cache first. |
s-p 4 4 |
Display the buffer of the next command in another window (see the note on prefix commands below). |
s-p 5 5 |
Display the buffer of the next command in another frame (see the note on prefix commands below). |
s-p 4 f |
Jump to a project’s file using completion and show it in another window. |
s-p 4 g |
Jump to a project’s file based on context at point and show it in another window. |
s-p 5 f |
Jump to a project’s file using completion and show it in another frame. |
s-p 5 g |
Jump to a project’s file based on context at point and show it in another frame. |
s-p d |
Display a list of all directories in the project. With a prefix argument it will clear the cache first. |
s-p 4 d |
Switch to a project directory and show it in another window. |
s-p 5 d |
Switch to a project directory and show it in another frame. |
s-p T |
Display a list of all test files (specs, features, etc.) in the project. |
s-p l |
Display a list of all files in a directory (that’s not necessarily a project) |
s-p s s |
Search the project with the configured backend ( |
s-p s g |
Run grep on the files in the project. |
M-- s-p s g |
Run grep on |
s-p s r |
Runs |
s-p s a |
Runs |
s-p s x |
Find references to the symbol at point within the project. Uses internally the |
s-p s R |
Reviewable search: gather all matches for a literal string into a read-only results buffer you can navigate, filter and reshape (see below). |
s-p s X |
Reviewable search for an Emacs regexp (the regexp sibling of s-p s R). |
s-p v |
Run |
s-p b |
Display a list of all project buffers currently open. |
s-p 4 b |
Switch to a project buffer and show it in another window. |
s-p 5 b |
Switch to a project buffer and show it in another frame. |
s-p 4 C-o |
Display a project buffer in another window without selecting it. |
s-p a |
Switch between files with the same name but different extensions. |
s-p 4 a |
Switch between files with the same name but different extensions in other window. |
s-p 5 a |
Switch between files with the same name but different extensions in other frame. |
s-p o |
Runs |
s-p r |
Runs interactive query-replace on all files in the project. |
s-p R |
Reviewable replace: gather all matches in a results buffer where you can preview and toggle them before applying (see below). |
s-p i |
Invalidates the project cache (if existing). |
s-p k |
Kills all project buffers. |
s-p D |
Opens the root of the project in |
s-p 4 D |
Opens the root of the project in |
s-p 5 D |
Opens the root of the project in |
s-p e |
Shows a list of recently visited project files. |
s-p left |
Switch to the previous project buffer. |
s-p right |
Switch to the next project buffer. |
s-p E |
Opens the root |
s-p ! |
Runs |
s-p & |
Runs |
s-p c o |
Runs a standard configure command for your type of project. |
s-p c c |
Runs a standard compilation command for your type of project. |
s-p c t |
Runs a standard test command for your type of project. |
s-p c . |
Runs the test at point (requires Emacs 29+ with tree-sitter). |
s-p c i |
Runs a standard install command for your type of project. |
s-p c p |
Runs a standard package command for your type of project. |
s-p c r |
Runs a standard run command for your type of project. |
s-p c x |
Runs one of the project’s named tasks (see |
s-p c X |
Re-runs the last task executed in the project. |
s-p t |
Toggle between an implementation file and its test file. |
s-p 4 t |
Jump to implementation or test file in other window. |
s-p 5 t |
Jump to implementation or test file in other frame. |
s-p j |
Find a project file of a chosen kind (e.g. a Rails model or controller), using the project type’s |
s-p 4 j |
Find a project file of a chosen kind and show it in another window. |
s-p 5 j |
Find a project file of a chosen kind and show it in another frame. |
s-p J |
Jump from the current file to a related file of another kind, cycling through them on repeated presses. |
s-p z |
Adds the currently visited file to the cache. |
s-p p |
Display a list of known projects you can switch to. |
s-p 4 p |
Switch to a known project and show it in another window (runs |
s-p 5 p |
Switch to a known project and show it in another frame (runs |
s-p q |
Display a list of open projects you can switch to. |
s-p S |
Save all project buffers. |
s-p m |
Open the Projectile dispatch menu (a |
s-p x r |
Start or visit a shell/REPL/terminal for the project, using the configured backend ( |
s-p x e |
Start or visit an |
s-p x i |
Start or visit an |
s-p x t |
Start or visit an |
s-p x s |
Start or visit a |
s-p x g |
Start or visit a |
s-p x v |
Start or visit a |
s-p x x |
Start or visit an |
s-p x G |
Start or visit a |
s-p w s |
Save the current project’s session (see |
s-p w S |
Save every open project’s session. |
s-p w r |
Restore the current project’s saved session. |
s-p w R |
Reopen every saved project’s session, each into its own tab. |
s-p w f |
Forget (delete) the current project’s saved session. |
s-p w b |
Switch to a buffer belonging to the current tab’s project. |
s-p ESC |
Switch to the most recently selected Projectile buffer. |
projectile-other-window-command (s-p 4 4) and
projectile-other-frame-command (s-p 5 5) are modeled after the
built-in other-window-prefix (C-x 4 4) and other-frame-prefix
(C-x 5 5) commands: they make the next command display its buffer in
another window or frame, and keep the Projectile keymap active for the next
key, so you don’t have to type the Projectile prefix again. For instance,
s-p 4 4 f opens a project file in another window, and the same works
for commands without a dedicated other-window variant, e.g. s-p 4 4 x s
starts a project shell in another window, or s-p 5 5 v shows the
project’s version control status in another frame.
|
If you ever forget any of Projectile’s keybindings just do a:
s-p C-h