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
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)))
Just download consult-ls-git.el and place it in a directory that is
in your load-path
and simply (require 'consult-ls-git)
.