mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2026-04-14 13:19: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]].
|
We set a keybinding to this in [[#h:2b827c27-0de7-45ed-9d9e-6c511e2c6bb5][Custom Keybindings]].
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
(declare-function consult--read "consult")
|
||||||
|
|
||||||
(defun swarsel/consult-magit-repos ()
|
(defun swarsel/consult-magit-repos ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(require 'magit)
|
(require 'magit)
|
||||||
(let* ((repos (magit-list-repos))
|
(let ((repos (magit-list-repos)))
|
||||||
(repo (consult--read repos
|
(unless repos
|
||||||
:prompt "Magit repo: "
|
(user-error "No repositories found in `magit-repository-directories'"))
|
||||||
:require-match t
|
(let ((repo
|
||||||
:history 'my/consult-magit-repos-history
|
(if (or (fboundp 'consult--read)
|
||||||
:sort t)))
|
(require 'consult nil t))
|
||||||
(magit-status repo)))
|
(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
|
#+end_src
|
||||||
**** org-mode: General setup
|
**** org-mode: General setup
|
||||||
|
|
|
||||||
|
|
@ -162,16 +162,30 @@ create a new one."
|
||||||
(define-key minibuffer-local-filename-completion-map
|
(define-key minibuffer-local-filename-completion-map
|
||||||
[C-backspace] #'up-directory)
|
[C-backspace] #'up-directory)
|
||||||
|
|
||||||
|
(declare-function consult--read "consult")
|
||||||
|
|
||||||
(defun swarsel/consult-magit-repos ()
|
(defun swarsel/consult-magit-repos ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(require 'magit)
|
(require 'magit)
|
||||||
(let* ((repos (magit-list-repos))
|
(let ((repos (magit-list-repos)))
|
||||||
(repo (consult--read repos
|
(unless repos
|
||||||
:prompt "Magit repo: "
|
(user-error "No repositories found in `magit-repository-directories'"))
|
||||||
:require-match t
|
(let ((repo
|
||||||
:history 'my/consult-magit-repos-history
|
(if (or (fboundp 'consult--read)
|
||||||
:sort t)))
|
(require 'consult nil t))
|
||||||
(magit-status repo)))
|
(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 ()
|
(defun swarsel/org-mode-setup ()
|
||||||
(variable-pitch-mode 1)
|
(variable-pitch-mode 1)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue