Skip to content

Commit

Permalink
Introduce a common prefix for project lifecycle command keybindings
Browse files Browse the repository at this point in the history
  • Loading branch information
bbatsov committed Feb 3, 2025
1 parent 398ec6f commit dd1a8e2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@
* Speed-up load time by moving known projects initialization outside of `projectile-mode`'s init.
* As a side effect the known projects will be initialized properly even if you're not using `projectile-mode`.
* The projects are read from disk the first time you invoke `projectile-switch-project` or a similar command.
* Introduce a common prefix for project lifecycle command keybindings:
* `c o` -> `projectile-configure-project`
* `c c` -> `projectile-compile-project`
* `c p` -> `projectile-package-project`
* `c i` -> `projectile-install-project`
* `c t` -> `projectile-test-project`
* `c r` -> `projectile-run-project`
* The old keybindings will be removed in a future version of Projectile.

## 2.8.0 (2023-10-13)

Expand Down
18 changes: 13 additions & 5 deletions doc/modules/ROOT/pages/usage.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,10 @@ You need to know only a handful of Projectile commands to start benefiting from
* Toggle between related files (e.g. `foo.h` <-> `foo.c` and `Gemfile` <-> `Gemfile.lock`) (kbd:[s-p a])
* Run a shell command in the root of the project (kbd:[s-p !] for a sync command and kbd:[s-p &] for an async command)
* Run various pre-defined project commands like:
** build/compile project (kbd:[s-p c])
** test project (kbd:[s-p T])
** build/compile project (kbd:[s-p c c])
** test project (kbd:[s-p c t])
** install project (kbd:[s-p c i])
** run project (kbd:[s-p c r])

The next section lists many more commands, but the basics can get you pretty far.

Expand Down Expand Up @@ -272,15 +274,21 @@ Here's a list of the interactive Emacs Lisp functions, provided by Projectile:
| kbd:[s-p &]
| Runs `async-shell-command` in the root directory of the project.

| kbd:[s-p C]
| kbd:[s-p c o]
| Runs a standard configure command for your type of project.

| kbd:[s-p c]
| kbd:[s-p c c]
| Runs a standard compilation command for your type of project.

| kbd:[s-p P]
| kbd:[s-p c t]
| Runs a standard test command for your type of project.

| kbd:[s-p c i]
| Runs a standard install command for your type of project.

| kbd:[s-p c r]
| Runs a standard run command for your type of project.

| kbd:[s-p t]
| Toggle between an implementation file and its test file.

Expand Down
9 changes: 7 additions & 2 deletions projectile.el
Original file line number Diff line number Diff line change
Expand Up @@ -6165,9 +6165,14 @@ thing shown in the mode line otherwise."
(define-key map (kbd "v") #'projectile-vc)
(define-key map (kbd "V") #'projectile-browse-dirty-projects)
;; project lifecycle external commands
;; TODO: Bundle those under some prefix key
(define-key map (kbd "c o") #'projectile-configure-project)
(define-key map (kbd "c c") #'projectile-compile-project)
(define-key map (kbd "c p") #'projectile-package-project)
(define-key map (kbd "c i") #'projectile-install-project)
(define-key map (kbd "c t") #'projectile-test-project)
(define-key map (kbd "c r") #'projectile-run-project)
;; TODO: Legacy keybindings that will be removed in Projectile 3
(define-key map (kbd "C") #'projectile-configure-project)
(define-key map (kbd "c") #'projectile-compile-project)
(define-key map (kbd "K") #'projectile-package-project)
(define-key map (kbd "L") #'projectile-install-project)
(define-key map (kbd "P") #'projectile-test-project)
Expand Down

0 comments on commit dd1a8e2

Please sign in to comment.