rcj / consult-ls-git

Consult extension for git

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

consult-ls-git.el - consult extension for git

Overview

consult-ls-git allows to quickly select a file from a git repository or act on a stash. It provides a consult multi view of files considered by git status, stashes as well as all tracked files. Alternatively you can narrow to a specific section via the shortcut key:

  • s: Status
  • z: Stash
  • f: Tracked Files

If default-directory is inside a git repository, it will use this repository. Otherwise `consult-ls-git-project-prompt-function’ is used to select the project directory.

Each view also has a standalone command in case that is preferable:

  • consult-ls-git-status
  • consult-ls-git-stash
  • consult-ls-git-tracked-files

Examples

Installation

Install directly from source (a.k.a this repository) using straight.el. The configuration shown here relies on the use-package macro.

;; git
(use-package consult-ls-git
  :straight (consult-ls-git :type git :host github :repo "rcj/consult-ls-git")
  :bind
  (("C-c g f" . #'consult-ls-git)
   ("C-c g F" . #'consult-ls-git-other-window)))

;; melpa
(use-package consult-ls-git
  :straight t
  :bind
  (("C-c g f" . #'consult-ls-git)
   ("C-c g F" . #'consult-ls-git-other-window)))

Use-package or package-install

;; Make sure you have MELPA as a package source.
(package-refresh-contents)

(package-install 'consult-ls-git)
(require 'consult-ls-git)
(global-set-key (kbd "C-c g f") #'consult-ls-git)
(global-set-key (kbd "C-c g F") #'consult-ls-git-other-window)

Or install using use-package

(use-package consult-ls-git
  :ensure t
  :bind
  (("C-c g f" . #'consult-ls-git)
   ("C-c g F" . #'consult-ls-git-other-window)))

Manual

Just download consult-ls-git.el and place it in a directory that is in your load-path and simply (require 'consult-ls-git).

About

Consult extension for git

License:GNU General Public License v3.0


Languages

Language:Emacs Lisp 100.0%