Skip to content

Transient interface for managing and interacting with projects

License

Notifications You must be signed in to change notification settings

aurtzy/disproject

Repository files navigation

Disproject

Disproject is a package for GNU Emacs that provides integration with project.el and allows for dispatching various project-related commands via Transient menus.

It is similar to (and inspired by) the function project-switch-project, but also attempts to improve on its feature set in addition to the use of Transient. Projectile users may also find similarities to projectile-commander.

Some notable features include (but may not be limited to):

  • Auto-detecting the current project when starting the menu.
  • Switching between projects with open buffers.
  • Defining custom per-project suffixes like compilation commands to show in the menu (see disproject-custom-suffixes).
  • An option to prefer displaying buffers to another window when executing commands.
  • Support for the following directory/project-based environment packages: envrc; mise.el.

    This includes support for using the correct environment when executing commands like project-compile after a project switch (see an envrc issue on this).

  • When available, pre-configured menu commands for: magit; magit-todos.
  • A set of customizable variables to substitute some commands in the menu (see Customization).

images/disproject-dispatch.png

See images for more screenshots of Disproject menus.

Installation

MELPA

https://melpa.org/packages/disproject-badge.svg https://stable.melpa.org/packages/disproject-badge.svg

Disproject is available on MELPA and MELPA Stable. See Getting Started instructions for using MELPA.

Guix

If Guix is available, one may use the package definition in guix.scm to install Disproject. For example, to install in the user profile, run the following in this repository’s root directory:

guix package --install-from-file=guix.scm

Usage

Disproject tries to provide usable defaults that don’t require additional packages or significant configuration; however, it does not provide any keybind for disproject-dispatch by default. The following is a suggested minimal setup using use-package:

(use-package disproject
  ;; Replace `project-prefix-map' with `disproject-dispatch'.
  :bind ( :map ctl-x-map
          ("p" . disproject-dispatch)))

Customization

Disproject provides a set of customizable variables that can be viewed by searching for the disproject group via M-x customize-group.

Some of these variables customize what commands are called in the main dispatch menu. To look at just these, search for the disproject-commands group via M-x customize-group which provides additional documentation on how to make sure commands respect menu settings.

The documentation for disproject-commands also applies for adding new commands to the transient menu (e.g. with transient-append-suffix). Notably, it is recommended to use disproject-with-environment to set relevant variables.