diff options
author | Case Duckworth | 2021-02-26 19:24:19 -0600 |
---|---|---|
committer | Case Duckworth | 2021-02-26 19:24:19 -0600 |
commit | 084a367183c658fcef734911400c91df0c59df04 (patch) | |
tree | 86ffb1b714a253031fc84f90ee1efd81c8f5b568 | |
parent | Add split-other-window commands (diff) | |
download | emacs-084a367183c658fcef734911400c91df0c59df04.tar.gz emacs-084a367183c658fcef734911400c91df0c59df04.zip |
Try to speed up init a bit
Shamelessly stole some bits from =use-package=. One day, I may even end up using it again!
-rw-r--r-- | config.org | 51 |
1 files changed, 39 insertions, 12 deletions
diff --git a/config.org b/config.org index 43096c1..9327758 100644 --- a/config.org +++ b/config.org | |||
@@ -339,7 +339,8 @@ someday. | |||
339 | Adapted from =midnight-mode=, using suggestions from [[https://old.reddit.com/r/emacs/comments/l6jpxf/how_do_emacs_users_usually_have_multiple_files/gl2249u/][u/ndamee]]. | 339 | Adapted from =midnight-mode=, using suggestions from [[https://old.reddit.com/r/emacs/comments/l6jpxf/how_do_emacs_users_usually_have_multiple_files/gl2249u/][u/ndamee]]. |
340 | 340 | ||
341 | #+begin_src emacs-lisp :noweb-ref packages | 341 | #+begin_src emacs-lisp :noweb-ref packages |
342 | (require 'midnight) | 342 | (unless (fboundp 'clean-buffer-list) |
343 | (autoload #'clean-buffer-list "mightnight")) | ||
343 | #+end_src | 344 | #+end_src |
344 | 345 | ||
345 | What time I run the clean up is a little tricky for me, since I use | 346 | What time I run the clean up is a little tricky for me, since I use |
@@ -514,7 +515,8 @@ So... function! | |||
514 | (straight-use-package '(unicode-fonts | 515 | (straight-use-package '(unicode-fonts |
515 | :host github | 516 | :host github |
516 | :repo "rolandwalker/unicode-fonts")) | 517 | :repo "rolandwalker/unicode-fonts")) |
517 | (require 'unicode-fonts) | 518 | (unless (fboundp 'unicode-fonts-setup) |
519 | (autoload #'unicode-fonts-setup "unicode-fonts")) | ||
518 | #+end_src | 520 | #+end_src |
519 | 521 | ||
520 | According to [[https://github.com/rolandwalker/unicode-fonts/issues/3][Issue #3]], there can be problems with =unicode-fonts-setup= | 522 | According to [[https://github.com/rolandwalker/unicode-fonts/issues/3][Issue #3]], there can be problems with =unicode-fonts-setup= |
@@ -808,19 +810,42 @@ to /hide/ those contents. | |||
808 | 810 | ||
809 | #+begin_src emacs-lisp :noweb-ref packages | 811 | #+begin_src emacs-lisp :noweb-ref packages |
810 | (straight-use-package 'orderless) | 812 | (straight-use-package 'orderless) |
811 | (require 'orderless) | 813 | (unless (fboundp 'orderless) |
814 | (autoload #'orderless "orderless")) | ||
812 | #+end_src | 815 | #+end_src |
813 | 816 | ||
814 | #+begin_src emacs-lisp :noweb-ref settings | 817 | #+begin_src emacs-lisp :noweb-ref settings |
815 | (setq-default | 818 | (setq-default completion-styles '(orderless)) |
816 | completion-styles '(orderless)) | ||
817 | #+end_src | 819 | #+end_src |
818 | 820 | ||
819 | *** Consult :package: | 821 | *** Consult :package: |
820 | 822 | ||
821 | #+begin_src emacs-lisp :noweb-ref modes | 823 | #+begin_src emacs-lisp :noweb-ref modes |
822 | (straight-use-package 'consult) | 824 | (straight-use-package 'consult) |
823 | (require 'consult) | 825 | (dolist (f '(consult-history |
826 | consult-mode-command | ||
827 | consult-complex-command | ||
828 | consult-buffer | ||
829 | consult-buffer-other-window | ||
830 | consult-buffer-other-frame | ||
831 | consult-register | ||
832 | consult-bookmark | ||
833 | consult-line | ||
834 | consult-outline | ||
835 | consult-mark | ||
836 | consult-global-mark | ||
837 | consult-imenu | ||
838 | consult-error | ||
839 | consult-grep | ||
840 | consult-find | ||
841 | consult-line | ||
842 | consult-multi-occur | ||
843 | consult-keep-lines | ||
844 | consult-focus-lines | ||
845 | consult-yank-pop | ||
846 | consult-apropos)) | ||
847 | (unless (fboundp f) | ||
848 | (autoload (function f) "consult"))) | ||
824 | #+end_src | 849 | #+end_src |
825 | 850 | ||
826 | Consult has a lot of great bindings that work well with Emacs's | 851 | Consult has a lot of great bindings that work well with Emacs's |
@@ -847,10 +872,10 @@ default completion system. These all come from the [[https://github.com/minad/c | |||
847 | ("M-g i" #'consult-imenu) | 872 | ("M-g i" #'consult-imenu) |
848 | ("M-g e" #'consult-error) | 873 | ("M-g e" #'consult-error) |
849 | ;; M-s bindings (`search-map') | 874 | ;; M-s bindings (`search-map') |
850 | ("M-s g" #'consult-grep) ; alts: | 875 | ("M-s g" #'consult-grep) ; alts: |
851 | ; consult-git-grep, | 876 | ; consult-git-grep, |
852 | ; consult-ripgrep | 877 | ; consult-ripgrep |
853 | ("M-s f" #'consult-find) ; alts: | 878 | ("M-s f" #'consult-find) ; alts: |
854 | ; consult-locate | 879 | ; consult-locate |
855 | ("M-s l" #'consult-line) | 880 | ("M-s l" #'consult-line) |
856 | ("M-s m" #'consult-multi-occur) | 881 | ("M-s m" #'consult-multi-occur) |
@@ -1070,7 +1095,7 @@ well as the option for some other variables. Since storage is cheap, | |||
1070 | I keep all of it. | 1095 | I keep all of it. |
1071 | 1096 | ||
1072 | #+begin_src emacs-lisp :noweb-ref requires | 1097 | #+begin_src emacs-lisp :noweb-ref requires |
1073 | (require 'savehist) | 1098 | (run-with-idle-timer 3 nil #'require 'savehist nil t) |
1074 | #+end_src | 1099 | #+end_src |
1075 | 1100 | ||
1076 | #+begin_src emacs-lisp :noweb-ref modes | 1101 | #+begin_src emacs-lisp :noweb-ref modes |
@@ -1114,7 +1139,7 @@ I also like to keep track of recently-opened files. =recentf= helps | |||
1114 | with that. | 1139 | with that. |
1115 | 1140 | ||
1116 | #+begin_src emacs-lisp :noweb-ref requires | 1141 | #+begin_src emacs-lisp :noweb-ref requires |
1117 | (require 'recentf) | 1142 | (run-with-idle-timer 5 nil #'require 'recentf nil t) |
1118 | #+end_src | 1143 | #+end_src |
1119 | 1144 | ||
1120 | #+begin_src emacs-lisp :noweb-ref settings | 1145 | #+begin_src emacs-lisp :noweb-ref settings |
@@ -2016,7 +2041,8 @@ of (I suppose) generic files. | |||
2016 | 2041 | ||
2017 | #+begin_src emacs-lisp :noweb-ref packages | 2042 | #+begin_src emacs-lisp :noweb-ref packages |
2018 | (straight-use-package 'web-mode) | 2043 | (straight-use-package 'web-mode) |
2019 | (require 'web-mode) | 2044 | (unless (fboundp 'web-mode) |
2045 | (autoload #'web-mode "web-mode" nil t)) | ||
2020 | #+end_src | 2046 | #+end_src |
2021 | 2047 | ||
2022 | #+begin_src emacs-lisp :noweb-ref hooks | 2048 | #+begin_src emacs-lisp :noweb-ref hooks |
@@ -2890,7 +2916,8 @@ TODO, and Diary. | |||
2890 | 2916 | ||
2891 | #+begin_src emacs-lisp :noweb-ref packages | 2917 | #+begin_src emacs-lisp :noweb-ref packages |
2892 | (straight-use-package 'org-auto-tangle) | 2918 | (straight-use-package 'org-auto-tangle) |
2893 | (require 'org-auto-tangle) | 2919 | (with-eval-after-load 'org |
2920 | (require 'org-auto-tangle)) | ||
2894 | #+end_src | 2921 | #+end_src |
2895 | 2922 | ||
2896 | #+begin_src emacs-lisp :noweb-ref hooks | 2923 | #+begin_src emacs-lisp :noweb-ref hooks |