https://github.com/jdtsmith/consult-jump-project
Quickly jump between projects, their files and buffers with consult
https://github.com/jdtsmith/consult-jump-project
Last synced: 4 months ago
JSON representation
Quickly jump between projects, their files and buffers with consult
- Host: GitHub
- URL: https://github.com/jdtsmith/consult-jump-project
- Owner: jdtsmith
- License: gpl-3.0
- Created: 2022-04-17T00:12:04.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-11T16:51:01.000Z (11 months ago)
- Last Synced: 2025-02-11T17:45:39.784Z (11 months ago)
- Language: Emacs Lisp
- Size: 52.7 KB
- Stars: 20
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# consult-jump-project
Quickly jump between projects, their files and buffers with [consult](https://github.com/minad/consult).
In action:

And from a non-project buffer:

```elisp
;; Consult-jump-project provides a single interactive command of the
;; same name which provides a narrowable list of project-related
;; targets, ala consult-buffer (which it uses):
;;
;; - project files (f)
;; - project buffers (b)
;; - other projects (p)
;;
;; If the file from which consult-jump-project is invoked is not in
;; any project, you are prompted only with the full list of projects
;; known to Emacs (via project.el). While selecting projects, a
;; preview is provided in the form of a dired buffer visiting its
;; root. Information on the number of recent files and buffers, and
;; the abbreviated age of the newest of these is shown.
;;
;; Upon selecting a project, the interface is re-entered, allowing you
;; to select one of its recent files or open buffers, or to switch to
;; yet another project.
;;
;; Usage: simply bind `consult-jump-project` to a convenient key, e.g. C-x p j
;;
;; Inspiration from: consult, consult-project-extra.
```
## Install
For now, simply use straight or a local `load-path` from a cloned directory:
```elisp
(use-package consult-jump-project
:load-path "~/code/emacs/consult-jump-project/"
;; :straight (consult-jump-project :type git :host github :repo "jdtsmith/consult-jump-project")
:custom
(consult-jump-direct-jump-modes '(dired-mode))
(recentf-filename-handlers (lambda (f) ; avoid remote ~/abbreviations to recentf files can be matched
(if (file-remote-p f) f
(abbreviate-file-name f))))
:bind ("C-x p p" . consult-jump-project))
```
## Customization
Customize the variable `consult-jump-direct-jump-modes` to a list of modes (symbols) from which to jump directly to the project's dired buffer, if a project is selected, rather than prompting for files/buffers from that project to visit.
E.g. `(dired-mode)` would indicate that invoking jump from a dired buffer and selecting a project would go directly to the project's dired buffer.
`vc-annotate-background` and `vc-annotate-color-map` can be used to alter project age coloration. Set the former to `nil` to remove the background color from the age.
## Related Packages
- [consult](https://github.com/minad/consult): required dependency
- [consult-project-extra](https://github.com/Qkessler/consult-project-extra): Similar package from which this was inspired. Main differences are the color-coded "project age" and the project selection, which is always available from the same interface.