all repos — nixfiles @ 188f2e6df131994c202dcd6d66db749eb7ce1fe3

System and user configuration, managed by nix and home-manager

Emacs: optimise startup
Alan Pearce alan@alanpearce.eu
Thu, 27 Feb 2020 15:59:27 +0100
commit

188f2e6df131994c202dcd6d66db749eb7ce1fe3

parent

9e32592dac3e9a75c268ea63d6cb1c16f3b51314

1 files changed, 13 insertions(+), 4 deletions(-)

jump to
M user/emacs/.emacs.d/init.eluser/emacs/.emacs.d/init.el
@@ -9,9 +9,9 @@ frame-inhibit-implied-resize t) 
 (setq gc-cons-threshold most-positive-fixnum
       gc-cons-percentage 0.6)
-(add-hook 'emacs-startup-hook (lambda ()
-                                (setq gc-cons-threshold (* 16 1024 1024)
-                                      gc-cons-percentage 0.1)))
+(add-hook 'after-init-hook (lambda ()
+                             (setq gc-cons-threshold (* 16 1024 1024)
+                                   gc-cons-percentage 0.1)))
 
 (package-initialize)
 
@@ -86,7 +86,7 @@ (minions-mode +1))) 
 (column-number-mode +1)
 (use-package doom-modeline
-  :hook (after-init . doom-modeline-mode)
+  :hook (emacs-startup . doom-modeline-mode)
   :config (progn
             (setq doom-modeline-buffer-file-name-style 'relative-from-project
                   doom-modeline-buffer-icon nil
@@ -146,6 +146,7 @@ (when (eq system-type 'darwin)               (general-unbind "s-x"))))
 
 (use-package avy
+  :defer 2
   :config (setq avy-all-windows nil))
 (use-package ace-link
   :after avy
@@ -177,6 +178,7 @@ (use-package hydra
   :defer 2)
 (use-package ivy
+  :defer 1
   :config (progn
             (ivy-mode +1)))
 (use-package ivy-hydra
@@ -303,6 +305,7 @@ (:states '(normal motion)            "g s" #'evil-avy-goto-symbol-1))
 
 (use-package evil-anzu
+  :defer 2
   :after evil)
 
 (defvar evil-collection-company-use-tng t)
@@ -367,6 +370,7 @@ :config (setq evil-magit-use-y-for-yank nil)) 
 (use-package evil-matchit
   :after evil
+  :defer 2
   :config (progn
             (global-evil-matchit-mode +1)))
 
@@ -554,6 +558,7 @@ ;;;; Auto-reloading
 
 (use-package autorevert
+  :defer 10
   :config (progn
             (setq auto-revert-verbose t
                   auto-revert-use-notify t)
@@ -674,6 +679,7 @@ ;;; Major modes 
 ;;;; golang
 (use-package go-mode
+  :defer t
   :config (progn
             (setq-default gofmt-command "goimports")
             (add-hook 'go-mode-hook (lambda ()
@@ -740,6 +746,7 @@ ;;;; ledger 
 (use-package ledger-mode
   :gfhook '(ledger-flymake-enable ws-butler-mode)
+  :defer t
   :config (progn
             (setq ledger-reconcile-default-commodity "€"
                   ledger-narrow-on-reconcile t
@@ -768,6 +775,7 @@ (setq org-ellipsis "…"       org-directory "~/Documents/org")
 
 (use-package org-journal
+  :after org
   :commands (org-journal-new-date-entry
 	     org-journal-new-entry
 	     org-journal-new-scheduled-entry)
@@ -797,6 +805,7 @@ (fringe-helper-define 'left-vertical-bar '(center repeated)
   "XXX.....")
 (use-package flymake
+  :defer 5
   :config (setq flymake-error-bitmap '(left-vertical-bar compilation-error)
                 flymake-warning-bitmap '(left-vertical-bar compilation-warning)))
 (use-package flycheck