;;; init-ui.el --- ui and other style customization cofig -*- lexical-binding: t -*- ;;; Commentary: ;;; Code: ;; 自定义主题路径 (add-to-list 'custom-theme-load-path "~/.emacs.d/lisp/") ;; 信任所有主题 (setq custom-safe-themes t) ;; 安装solarized dark (use-package solarized-theme :straight '(solarized-emacs :fork (:host github :repo "Andsy10/solarized-emacs")) :init ;; 把主题加载延迟到frame创建之后,防止daemon模式下宏不能正常展开 (if (daemonp) (add-hook 'after-make-frame-functions (lambda (frame) (with-selected-frame frame (load-theme 'my-base16-dark t)))) (load-theme 'my-base16-dark t))) ;; 行号 (use-package display-line-numbers :hook (after-init . global-display-line-numbers-mode) :config (setq display-line-numbers-type '2 display-line-numbers-grow-only t display-line-numbers-width-start 4)) ;; org-mode美化 (use-package olivetti :delight :hook (org-mode . olivetti-mode) (olivetti-mode . (lambda () (display-line-numbers-mode -1))) :init (setq olivetti-body-width 85)) ;; rainbow mode (use-package rainbow-mode) ;; rainbow-delimiters (use-package rainbow-delimiters) ;; 很多主题 ;; (use-package doom-themes) ;; (use-package color-theme-modern) (use-package naysayer-theme) (use-package ef-themes) (if *is-android* (use-package simple-modeline :hook (after-init . simple-modeline-mode))) ;; eshell高亮 (use-package eshell-syntax-highlighting :hook (eshell-mode . eshell-syntax-highlighting-global-mode) :config (add-hook 'eshell-mode-hook (lambda () (setenv "TERM" "xterm-256color") (setenv "COLORTERM" "truecolor") (add-to-list 'eshell-output-filter-functions 'eshell-handle-ansi-color t) (setq-local eshell-prefer-lisp-functions nil) (setenv "LS_COLORS" "di=34:ln=35:so=32:pi=33:ex=31:bd=34;46:cd=34;43:su=30;41:sg=30;46")))) ;; 缩进线 (use-package indent-bars :custom (indent-bars-color '(font-lock-comment-face :face-bg nil :blend 0.4)) (indent-bars-highlight-current-depth '(:face default :blend 0.4)) (indent-bars-pattern ".") (indent-bars-width-frac 0.1) (indent-bars-pad-frac 0.1) (indent-bars-color-by-depth nil) (indent-bars-no-descend-string t) (indent-bars-prefer-character t)) ;; 高亮当前行 (use-package hl-line :hook (after-init . global-hl-line-mode)) ;; 显示时间 (unless *is-android* (use-package time :hook (persp-mode . display-time-mode) :config (setq display-time-default-load-average nil display-time-string-forms '((propertize (concat (propertize (format-time-string " %I:%M") 'face 'display-time-date-and-time) (propertize (format-time-string "-%p") 'face 'font-lock-comment-face)) 'help-echo (format-time-string "%A, %B %d, %Y")))))) ;; 安装cnfonts脚本,用于修复中英文对齐 (use-package cnfonts :hook (after-init . cnfonts-mode) :init (setq cnfonts-personal-fontnames '(("Sarasa Fixed TC") ;英文 ("Sarasa Fixed TC") ;中文 nil ;ext-B nil ;symbol nil)) ;装饰 :config (cnfonts--select-profile "profile1")) (provide 'init-ui) ;;; init-ui.el ends here