Config: streamline config structure and reorganize modules

- Remove init-workspace.el and redundant UI/font/autothemer setup
- Add init-prog.el for programming language configs (treesit, lua, scheme, etc.)
- Defer org-refile loading via org-mode hook
- Adjust load order in init.el, add init-proxy
- Fix indentation and formatting issues
This commit is contained in:
User
2026-04-26 07:49:55 +08:00
parent c6cf0ef9d8
commit 4d810f270f
13 changed files with 205 additions and 347 deletions

View File

@@ -16,9 +16,6 @@
(set-language-environment "UTF-8")
(prefer-coding-system 'utf-8)))
;; 安装autothemer
(use-package autothemer)
;; 预览所有可用emacs颜色
(defun my-color-picker ()
"Pick a color with preview."
@@ -61,13 +58,6 @@
;; (use-package color-theme-modern)
(use-package naysayer-theme)
;; modeline
;; (use-package smart-mode-line
;; :config
;; (setq sml/no-confirm-load-theme t)
;; ;; sml/theme 'respectful)
;; (sml/setup))
;; (use-package simple-modeline
;; :init (simple-modeline-mode)
;; :config
@@ -110,68 +100,6 @@
;; 显示行号列号
(column-number-mode t)
;; 配置字体
(defvar cn-fonts-list '("Sarasa Fixed TC" "STHeiti" "微软雅黑" "文泉译微米黑")
"定义使用的中文字体候选列表")
(defvar en-fonts-list '("Sarasa Fixed TC" "Courier New" "Monaco" "Ubuntu Mono")
"定义使用的英文字体候选列表")
(defvar emoji-fonts-list '("Apple Color Emoji" "Segoe UI Emoji" "Noto Color Emoji" "Symbola" "Symbol")
"定义使用Emoji字体候选列表")
(defun tenon--available-font (font-list)
"从 FONT-LIST 中寻找第一个系统中可用的字"
(catch 'found
(dolist (font font-list)
(when (member font (font-family-list))
(throw 'found font)))))
;; 设置字体大小和字重变量
(when *is-windows*
(defvar tenon-font-size 125
"默认字体大小")
(defvar tenon-font-weight 'light
"默认字重选项有ultra-lightlightnormalmediumsemiboldbold"))
(when *is-mac*
(defvar tenon-font-size 160
"默认字体大小")
(defvar tenon-font-weight 'light
"默认字重选项有ultra-lightlightnormalmediumsemiboldbold"))
(when *is-linux*
(defvar tenon-font-size 125
"默认字体大小")
(defvar tenon-font-weight 'normal
"默认字重选项有ultra-lightlightnormalmediumsemiboldbold"))
;; 定义函数
;;;###autoload
(defun tenon--font-setup ()
"Font setup."
(interactive)
(let* ((cf (tenon--available-font cn-fonts-list))
(ef (tenon--available-font en-fonts-list))
(em (tenon--available-font emoji-fonts-list)))
(when ef
(dolist (face '(default fixed-pitch fixed-pitch-serif variable-pitch))
(set-face-attribute face nil
:family ef
:height tenon-font-size
:weight tenon-font-weight)))
(when em
(dolist (charset `(unicode unicode-bmp ,(if (> emacs-major-version 27) 'emoji 'symbol)))
(set-fontset-font t charset em nil 'prepend)))
(when cf
(dolist (charset '(kana han cjk-misc bopomofo))
(set-fontset-font t charset cf))
(setq face-font-rescale-alist
(mapcar (lambda (item) (cons item 1)) `(,cf ,em))))))
;; 延迟执行字体设置
(add-hook 'after-init-hook #'tenon--font-setup)
;; 添加个人字体到 cnfonts
(setq cnfonts-personal-fontnames
'(("Sarasa Fixed TC") ; 英文字体
@@ -182,8 +110,8 @@
;; 安装cnfonts脚本用于修复中英文对齐
(use-package cnfonts
:init
(cnfonts-mode 1)
:hook
(after-init-hook . cnfonts-mode)
:config
(cnfonts--select-profile "profile1"))