mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2026-04-14 05:09:09 +02:00
chore[client]: improve emacs repolist
This commit is contained in:
parent
05548fdfcb
commit
b1b2fc68a3
2 changed files with 41 additions and 14 deletions
|
|
@ -32138,17 +32138,30 @@ At work and when working on private projects, I often have to jump between sever
|
|||
We set a keybinding to this in [[#h:2b827c27-0de7-45ed-9d9e-6c511e2c6bb5][Custom Keybindings]].
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(declare-function consult--read "consult")
|
||||
|
||||
(defun swarsel/consult-magit-repos ()
|
||||
(interactive)
|
||||
(require 'magit)
|
||||
(let* ((repos (magit-list-repos))
|
||||
(repo (consult--read repos
|
||||
:prompt "Magit repo: "
|
||||
:require-match t
|
||||
:history 'my/consult-magit-repos-history
|
||||
:sort t)))
|
||||
(magit-status repo)))
|
||||
(let ((repos (magit-list-repos)))
|
||||
(unless repos
|
||||
(user-error "No repositories found in `magit-repository-directories'"))
|
||||
(let ((repo
|
||||
(if (or (fboundp 'consult--read)
|
||||
(require 'consult nil t))
|
||||
(consult--read repos
|
||||
:prompt "Magit repo: "
|
||||
:require-match t
|
||||
:history 'my/consult-magit-repos-history
|
||||
:sort t)
|
||||
(completing-read "Magit repo: "
|
||||
repos
|
||||
nil
|
||||
t
|
||||
nil
|
||||
'my/consult-magit-repos-history))))
|
||||
(when (and repo (> (length repo) 0))
|
||||
(magit-status repo)))))
|
||||
|
||||
#+end_src
|
||||
**** org-mode: General setup
|
||||
|
|
|
|||
|
|
@ -162,16 +162,30 @@ create a new one."
|
|||
(define-key minibuffer-local-filename-completion-map
|
||||
[C-backspace] #'up-directory)
|
||||
|
||||
(declare-function consult--read "consult")
|
||||
|
||||
(defun swarsel/consult-magit-repos ()
|
||||
(interactive)
|
||||
(require 'magit)
|
||||
(let* ((repos (magit-list-repos))
|
||||
(repo (consult--read repos
|
||||
:prompt "Magit repo: "
|
||||
:require-match t
|
||||
:history 'my/consult-magit-repos-history
|
||||
:sort t)))
|
||||
(magit-status repo)))
|
||||
(let ((repos (magit-list-repos)))
|
||||
(unless repos
|
||||
(user-error "No repositories found in `magit-repository-directories'"))
|
||||
(let ((repo
|
||||
(if (or (fboundp 'consult--read)
|
||||
(require 'consult nil t))
|
||||
(consult--read repos
|
||||
:prompt "Magit repo: "
|
||||
:require-match t
|
||||
:history 'my/consult-magit-repos-history
|
||||
:sort t)
|
||||
(completing-read "Magit repo: "
|
||||
repos
|
||||
nil
|
||||
t
|
||||
nil
|
||||
'my/consult-magit-repos-history))))
|
||||
(when (and repo (> (length repo) 0))
|
||||
(magit-status repo)))))
|
||||
|
||||
(defun swarsel/org-mode-setup ()
|
||||
(variable-pitch-mode 1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue