Skip to content

Latest commit

 

History

History
84 lines (55 loc) · 2.73 KB

README.md

File metadata and controls

84 lines (55 loc) · 2.73 KB

consult-vc-modified-files

consult-vc-modified-files provides a easy way to list Git-tracked files that have been modified, newly added, or are part of the HEAD commit in a project.

It integrates with Emacs' built-in vc and project libraries, as well as the consult package for navigation.

Features

  • View locally modified and newly added files in the current Git project.
  • List files from the HEAD commit.
  • Customize sources for specific use cases.
  • Navigate the open files with consult.

Screenshot

image

Installation

Using package.el (with Emacs 29's package-vc.el)

(unless (package-installed-p 'consult-vc-modified-files)
  (package-vc-install "https://github.com/chmouel/consult-vc-modified-files"))
(use-package consult-vc-modified-files
  :bind
  ("C-x v /" . consult-vc-modified-files))

Example Configuration with general.el and evil

If you're using general.el with a leader key in evil:

(use-package consult-vc-modified-files
  :general
  (general-leader '(normal) "sm" #'consult-vc-modified-files :wk "Modified files"))

Usage

Call the interactive function consult-vc-modified-files, or use a key binding like C-x v / (if configured with the configuration above).

When invoked, the command show a prompt for selecting files based on customizable sources:

  • Modified locally: Lists locally modified or untracked files.
  • Modified in HEAD: Lists files modified in the HEAD commit.

You can customize the available sources using the consult-vc-modified-files-sources variable.

Customization

Configure Sources

Customize consult-vc-modified-files-sources to control which file categories appear in the selection. For example:

(setq consult-vc-modified-files-sources
      '(consult-vc-modified-source-files
        consult-vc-modified-source-head-files))

Customize Faces

Adjust the appearance of listed files by customizing:

  • consult-vc-modified-files-face: For locally modified files.
  • consult-vc-modified-head-files-face: For files modified in HEAD.

Authors

Chmouel Boudjnah

License

This project is licensed under the GPL-3.0.