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 implements Transient menus for dispatching project-related commands on top of the project.el library. It aims to provide a more featureful version of the project-switch-project command, which it is inspired by. Those who are familiar with Projectile 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 in MELPA and MELPA Stable. See Getting Started instructions for using MELPA.

Guix

Disproject is also available as a GNU Guix package.

The stable version can be found in the (gnu packages emacs-xyz) module under the name emacs-disproject. It may be installed in the user profile like so:

guix install emacs-disproject

Alternatively, one may use the package definition in ./guix.scm to install a development version of Disproject from the repository. 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.