Minor updates.

This commit is contained in:
Derek Taylor
2020-08-11 17:27:59 -05:00
parent c00618a23a
commit 367af05623
154 changed files with 2484 additions and 1801 deletions

View File

@@ -1,5 +1,13 @@
;;; tools/magit/config.el -*- lexical-binding: t; -*-
(defvar +magit-open-windows-in-direction 'right
"What direction to open new windows from the status buffer.
For example, diffs and log buffers. Accepts `left', `right', `up', and `down'.")
;;
;;; Packages
(use-package! magit
:commands magit-file-delete
:defer-incrementally (dash f s with-editor git-commit package eieio lv transient)
@@ -11,16 +19,11 @@
transient-history-file (concat doom-etc-dir "transient/history"))
:config
(setq transient-default-level 5
magit-revision-show-gravatars '("^Author: " . "^Commit: ")
magit-diff-refine-hunk t ; show granular diffs in selected hunk
;; Don't autosave repo buffers. This is too magical, and saving can
;; trigger a bunch of unwanted side-effects, like save hooks and
;; formatters. Trust us to know what we're doing.
magit-save-repository-buffers nil
;; Magit runs git *a lot*. Having to scan your PATH so many times can
;; add up with each invokation, especially on Catalina (macOS) or
;; Windows, so we resolve it once.
magit-git-executable (executable-find magit-git-executable))
magit-save-repository-buffers nil)
(add-hook 'magit-process-mode-hook #'goto-address-mode)
(defadvice! +magit-revert-repo-buffers-deferred-a (&rest _)
@@ -154,10 +157,7 @@ ensure it is built when we actually use Forge."
:after magit
:config
(setq magit-todos-keyword-suffix "\\(?:([^)]+)\\)?:?") ; make colon optional
(define-key magit-todos-section-map "j" nil)
;; Warns that jT isn't bound. Well, yeah, you don't need to tell me, that was
;; on purpose ya goose.
(advice-add #'magit-todos-mode :around #'doom-shut-up-a))
(define-key magit-todos-section-map "j" nil))
(use-package! magit-gitflow
@@ -179,8 +179,12 @@ ensure it is built when we actually use Forge."
(evil-define-key* 'normal magit-status-mode-map [escape] nil) ; q is enough
(evil-define-key* '(normal visual) magit-mode-map
"%" #'magit-gitflow-popup
"zt" #'evil-scroll-line-to-top
"zz" #'evil-scroll-line-to-center
"g=" #'magit-diff-default-context)
"zb" #'evil-scroll-line-to-bottom
"g=" #'magit-diff-default-context
"gi" #'forge-jump-to-issues
"gm" #'forge-jump-to-pullreqs)
(define-key! 'normal
(magit-status-mode-map
magit-stash-mode-map
@@ -193,4 +197,8 @@ ensure it is built when we actually use Forge."
(setcar desc (cdr key))))
(evil-define-key* evil-magit-state git-rebase-mode-map
"gj" #'git-rebase-move-line-down
"gk" #'git-rebase-move-line-up)))
"gk" #'git-rebase-move-line-up))
(transient-replace-suffix 'magit-dispatch 'magit-worktree
'("%" "Gitflow" magit-gitflow-popup))
(transient-append-suffix 'magit-dispatch '(0 -1 -1)
'("*" "Worktree" magit-worktree)))