From b26c3e86b3ca6de3b2fd937327687659aaec042f Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Fri, 22 Apr 2022 21:05:39 +0800 Subject: Autoload magit (emacs) --- .emacs.d/lisp/init-git.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.emacs.d/lisp/init-git.el b/.emacs.d/lisp/init-git.el index c47dcf9..3c3acf2 100644 --- a/.emacs.d/lisp/init-git.el +++ b/.emacs.d/lisp/init-git.el @@ -1,13 +1,14 @@ -(gx/maybe-require-package 'magit) +(when (gx/maybe-require-package 'magit) + (autoload #'magit-status "magit-status" nil t)) (with-eval-after-load 'evil (evil-define-key 'normal 'global - (kbd "gs") 'magit)) + (kbd "gs") #'magit-status)) (setq magit-refresh-status-buffer nil) (when (gx/maybe-require-package 'git-gutter) - (add-hook 'after-init-hook 'global-git-gutter-mode 'append)) + (add-hook 'after-init-hook #'global-git-gutter-mode 'append)) (with-eval-after-load 'git-gutter (gx/diminish 'git-gutter-mode)) -- cgit v1.2.3