refactor: Reorganize config with use-package and optimize startup hooks

- Split monolithic init-package.el into focused modules
- Convert eager `:init` blocks to lazy `:hook`
- Consolidate UI settings and defer theme loading.
- Remove duplicated config between GUI and terminal paths.
This commit is contained in:
2026-06-04 02:27:20 +08:00
parent 8db37d1c6d
commit b4733718d4
20 changed files with 910 additions and 849 deletions

View File

@@ -4,6 +4,58 @@
;;; Code:
(use-package gcmh
:delight
:init
(setq gcmh-idle-delay 'auto
gcmh-auto-idle-delay-factor 10
gcmh-high-cons-threshold #x4000000)
(gcmh-mode))
(use-package benchmark-init
:init
(benchmark-init/activate)
:hook
(after-init . benchmark-init/deactivate))
(use-package recentf
:if
(or (display-graphic-p) *is-android*)
:hook
(after-init . recentf-mode)
:init
(setq recentf-max-saved-items 30)
:config
(if *is-android*
(add-to-list 'recentf-exclude "~/storage/shared/my-org-note/journal/.*\\.org\\'")
(add-to-list 'recentf-exclude "~/org/my-org-note/journal/.*\\.org\\'")
(add-to-list 'recentf-exclude "~/org/my-org-note/20260509T232442==agenda--all-my-todos__org\\.org")))
(use-package savehist
:hook
(after-init . savehist-mode)
:init
(setq enable-recursive-minibuffers t
history-length 50
savehist-additional-variables '(mark-ring
global-mark-ring
search-ring
regexp-search-ring
extended-command-history)
savehist-ignored-variables '(consult-notes-history)
savehist-autosave-interval 300))
(use-package saveplace
:hook
(after-init . save-place-mode))
(use-package restart-emacs)
(use-package autorevert
:delight
:hook
(after-init . global-auto-revert-mode))
;; 安装crux
(use-package crux)