Browse Source

Emacs: Add keybind to select magit repo, using prefix argument

master
Riyyi 2 years ago
parent
commit
3378ba974c
  1. 1
      .config/emacs/config.org
  2. 15
      .config/emacs/config/development.org

1
.config/emacs/config.org

@ -1115,6 +1115,7 @@ General.el ~leader key binds.
"v l" '(:ignore t :which-key "list") "v l" '(:ignore t :which-key "list")
"v l r" '(magit-list-repositories :which-key "List repositories") "v l r" '(magit-list-repositories :which-key "List repositories")
"v l s" '(magit-list-submodules :which-key "List submodules") "v l s" '(magit-list-submodules :which-key "List submodules")
"v r" '(dot/magit-select-repo :which-key "Select repo")
;; Window ;; Window
"w" '(:ignore t :which-key "window") "w" '(:ignore t :which-key "window")

15
.config/emacs/config/development.org

@ -88,7 +88,9 @@ GLSL integration with company requires the package: ~glslang~.
(use-package transient (use-package transient
:defer t :defer t
:config (setq transient-history-file (concat dot-cache-dir "/transient/history.el"))) :config
(setq transient-history-file (concat dot-cache-dir "/transient/history.el"))
(setq transient-values-file (concat dot-cache-dir "/transient/values.el")))
(use-package magit (use-package magit
:after (diff-hl transient) :after (diff-hl transient)
@ -98,14 +100,21 @@ GLSL integration with company requires the package: ~glslang~.
:hook (magit-post-refresh . diff-hl-magit-post-refresh) :hook (magit-post-refresh . diff-hl-magit-post-refresh)
:config :config
(setq git-commit-fill-column 72) (setq git-commit-fill-column 72)
(setq git-commit-summary-max-length 70) (setq git-commit-summary-max-length 72)
(setq magit-completing-read-function #'selectrum-completing-read) (setq magit-completing-read-function #'selectrum-completing-read)
(setq magit-diff-paint-whitespace-lines 'both) (setq magit-diff-paint-whitespace-lines 'both)
(setq magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)
(setq magit-repository-directories '(("~/dotfiles" . 0) (setq magit-repository-directories '(("~/dotfiles" . 0)
("~/code" . 3))) ("~/code" . 3)))
(put 'magit-log-select-pick :advertised-binding [?\M-c]) (put 'magit-log-select-pick :advertised-binding [?\M-c])
(put 'magit-log-select-quit :advertised-binding [?\M-k])) (put 'magit-log-select-quit :advertised-binding [?\M-k])
(defun dot/magit-select-repo ()
"Select project repo."
(interactive)
(let ((current-prefix-arg '(t)))
(call-interactively #'magit-status))))
#+END_SRC #+END_SRC
** Project ** Project

Loading…
Cancel
Save