add gitswitch and git repo list to consult-buffer, do: g SPC

This commit is contained in:
2026-07-30 23:59:55 +02:00
parent 586caeffba
commit f94826d8cc
4 changed files with 58 additions and 11 deletions

View File

@@ -212,7 +212,6 @@ targets."
(consult-widen-key ">")
:config
(when (fboundp 'persp-new)
(consult-customize consult--source-buffer :hidden t :default nil)
@@ -224,7 +223,21 @@ targets."
:default t
:items #'persp-get-buffer-names))
(push consult--source-perspective consult-buffer-sources)))
(push consult--source-perspective consult-buffer-sources))
(defvar git-source
(list :name "Git Repo"
:category 'consult-location
:narrow ?g
:face 'consult-buffer
:history 'buffer-name-history
:state #'consult--buffer-state
:sort t
:action #'tvd-switch-to-repo
:items #'tvd-list-git-repos))
(add-to-list 'consult-buffer-sources 'git-source 'append))
;; needs to be defined outside
(defalias 'rg 'consult-ripgrep)
@@ -273,7 +286,7 @@ targets."
([backtab] . corfu-previous)))
;; much better experience to seach current buffer consult-line would
;; much better experience to seach current buffer, consult-line would
;; do the job as well and looks similar, but I'm used to swiper, so
;; stick with it.
(use-package swiper