Now that we are loading package autoloads files (as part of the generated doom-package-autoload-file when running make autoloads), many :commands properties are redundant. In fact, many def-package! blocks are redundant. In some cases, we can do without a config.el file entirely, and can move into the autoloads file or rely entirely on package autoloads. Also, many settings have been moved in their module's autoloads files, which makes them available ASAP; their use no longer depends on module load order. This gained me a modest ~10% boost in startup speed.
40 lines
1.1 KiB
EmacsLisp
40 lines
1.1 KiB
EmacsLisp
;;; tools/magit/config.el -*- lexical-binding: t; -*-
|
|
|
|
(def-package! magit
|
|
:defer t
|
|
:config
|
|
(setq magit-completing-read-function
|
|
(if (featurep! :completion ivy)
|
|
#'ivy-completing-read
|
|
#'magit-builtin-completing-read)
|
|
magit-revision-show-gravatars '("^Author: " . "^Commit: "))
|
|
|
|
(set! :popup "^\\(?:\\*magit\\|magit:\\)" :ignore)
|
|
;; no mode-line in magit popups
|
|
(add-hook 'magit-popup-mode-hook #'hide-mode-line-mode)
|
|
;; Clean up after magit by properly killing buffers
|
|
(map! :map magit-status-mode-map [remap magit-mode-bury-buffer] #'+magit/quit))
|
|
|
|
|
|
(def-package! magit-blame :after git-timemachine)
|
|
|
|
|
|
(def-package! magithub
|
|
:commands magithub-feature-autoinject
|
|
:after magit
|
|
:preface
|
|
(setq magithub-dir (concat doom-etc-dir "magithub/"))
|
|
:init
|
|
(setq magithub-clone-default-directory "~/"
|
|
magithub-preferred-remote-method 'clone_url)
|
|
:config
|
|
(magithub-feature-autoinject t))
|
|
|
|
|
|
(def-package! evil-magit
|
|
:when (featurep! :feature evil)
|
|
:after magit
|
|
:config
|
|
(setq evil-magit-state 'normal)
|
|
(map! :map (magit-mode-map magit-blame-read-only-mode-map)
|
|
doom-leader-key nil))
|