Files
.emacs.d/lisp/init-ui.el

163 lines
4.8 KiB
EmacsLisp
Raw Normal View History

2025-12-14 04:51:24 +11:00
;; -*- lexical-binding: t -*-
2025-12-22 10:51:46 +11:00
;; (setq idle-update-delay 1.0)
2025-12-14 04:51:24 +11:00
2026-02-22 05:49:18 +11:00
;; (setq-default line-height 0.16)
;; (setq-local default-text-properties '(line-spacing 0.1 line-height 1.1))
2025-12-14 04:51:24 +11:00
(setq-default cursor-in-non-selected-windows nil)
(setq highlight-nonselected-windows nil)
(setq fast-but-imprecise-scrolling t)
(setq redisplay-skip-fontification-on-input t)
(setq frame-inhibit-implied-resize t
frame-resize-pixelwise t)
2026-02-27 02:32:57 +11:00
;; 隐藏 title bar
(setq default-frame-alist '((undecorated-round . t)))
2025-12-14 04:51:24 +11:00
(use-package solaire-mode
2025-12-15 18:20:19 +11:00
:hook (elpaca-after-init . solaire-global-mode))
2026-02-20 03:16:08 +11:00
2026-03-14 11:42:48 +11:00
(use-package standard-themes :demand t
:config
(modus-themes-load-theme 'standard-wombat))
;; (use-package doric-themes
2026-02-21 08:47:38 +11:00
;; :demand t
2026-03-14 11:42:48 +11:00
;; :bind ("<f5>" . doric-load-random)
2026-02-21 08:47:38 +11:00
;; :init
2026-03-14 11:42:48 +11:00
;; (defun doric-load-random ()
;; (interactive)
;; (mapc #'disable-theme custom-enabled-themes)
;; (let* ((themes '(doric-fire
;; doric-oak
;; doric-jade
;; doric-wind
;; doric-beach
;; doric-earth
;; doric-valley))
;; (loaded (seq-random-elt themes)))
;; (load-theme loaded :no-confirm)))
;; (doric-load-random)
;; )
2026-02-21 08:47:38 +11:00
(use-package modus-themes
2025-12-22 14:48:37 +11:00
:init
2026-02-21 08:47:38 +11:00
(setq modus-themes-italic-constructs t
2026-02-22 04:38:13 +11:00
modus-themes-bold-constructs t
2026-03-14 11:42:48 +11:00
modus-themes-mixed-fonts t))
2025-12-14 04:51:24 +11:00
(use-package rainbow-delimiters
:hook ((prog-mode . rainbow-delimiters-mode)
(typst-ts-mode . rainbow-delimiters-mode)
(foo-mode . rainbow-delimiters-mode)))
2026-02-21 08:47:38 +11:00
(use-package rainbow-mode
:hook elpaca-after-init)
2026-03-14 11:42:48 +11:00
;; (use-package nano-theme
;; :ensure (nano-theme :type git :host github
;; :repo "rougier/nano-theme")
;; :init
;; (modus-themes-load-theme 'nano-dark))
2026-03-11 21:08:31 +11:00
(use-package doom-modeline
:hook (elpaca-after-init . doom-modeline-mode)
:config
(setq doom-modeline-support-imenu t
doom-modeline-height 30
doom-modeline-buffer-file-name-style 'buffer-name
doom-modeline-enable-word-count t))
2025-12-14 04:51:24 +11:00
(use-package hide-mode-line
:autoload turn-off-hide-mode-line-mode
:hook (((eat-mode
eshell-mode shell-mode
term-mode vterm-mode
embark-collect-mode lsp-ui-imenu-mode
pdf-annot-list-mode) . turn-on-hide-mode-line-mode)))
;; Suppress GUI features
(setq use-file-dialog nil
use-dialog-box nil
inhibit-startup-screen t
inhibit-startup-echo-area-message user-login-name
inhibit-default-init t
initial-scratch-message nil)
2025-12-21 10:30:07 +11:00
2025-12-14 04:51:24 +11:00
(unless (daemonp)
(advice-add #'display-startup-echo-area-message :override #'ignore))
;; Display dividers between windows
(setq window-divider-default-places t
window-divider-default-bottom-width 1
window-divider-default-right-width 1)
(add-hook 'window-setup-hook #'window-divider-mode)
(pcase system-type
('darwin ; macOS
2026-03-14 11:42:48 +11:00
(set-face-attribute 'default nil :font "Sarasa Mono TC Nerd Font-22") ; 20 * 1.5
2026-03-11 21:08:31 +11:00
(set-face-attribute 'variable-pitch nil :font "Bookerly-22" :weight 'light)
(set-face-attribute 'fixed-pitch nil :font "Sarasa Term SC-22")
2025-12-14 04:51:24 +11:00
(add-to-list 'default-frame-alist '(height . 53))
(add-to-list 'default-frame-alist '(width . 120)))
2026-03-11 21:08:31 +11:00
2025-12-14 04:51:24 +11:00
('gnu/linux ; Linux (including Debian)
2026-03-14 11:42:48 +11:00
(set-face-attribute 'variable-pitch nil :font "Sarasa Mono TC Nerd Font-14") ; 20 * 1.5
2025-12-19 09:44:24 +11:00
(add-to-list 'default-frame-alist '(height . 40))
(add-to-list 'default-frame-alist '(width . 90))))
2025-12-14 04:51:24 +11:00
2026-03-11 21:08:31 +11:00
(use-package mixed-pitch
:hook org-mode
:hook LaTeX-mode)
2025-12-14 04:51:24 +11:00
2025-12-14 06:12:41 +11:00
(use-package diff-hl
2026-03-14 11:42:48 +11:00
:hook (elpaca-after-init global-diff-hl-mode)
:hook (elpaca-after-init diff-hl-dired-mode)
:hook (elpaca-after-init diff-hl-flydiff-mode))
2025-12-14 04:51:24 +11:00
;; Easily adjust the font size in all frames
(use-package default-text-scale
2025-12-15 18:20:19 +11:00
:hook (elpaca-after-init . default-text-scale-mode)
2025-12-14 04:51:24 +11:00
:bind (:map default-text-scale-mode-map
("C-s-=" . default-text-scale-increase)
("C-s--" . default-text-scale-decrease)
("C-s-0" . default-text-scale-reset)))
(setq hscroll-step 1
hscroll-margin 2
scroll-step 1
scroll-margin 0
scroll-conservatively 100000
scroll-preserve-screen-position t
auto-window-vscroll nil
;; mouse
mouse-wheel-scroll-amount-horizontal 1
mouse-wheel-progressive-speed nil)
2025-12-15 00:26:46 +11:00
(use-package nerd-icons
:ensure (nerd-icons
:type git
:host github
:repo "rainstormstudio/nerd-icons.el"
:files (:defaults "data"))
:custom
;; The Nerd Font you want to use in GUI
;; "Symbols Nerd Font Mono" is the default and is recommended
;; but you can use any other Nerd Font if you want
(nerd-icons-font-family "Symbols Nerd Font Mono"))
2025-12-15 05:50:04 +11:00
(use-package nerd-icons-ibuffer
:ensure t
:hook (ibuffer-mode-hook . nerd-icons-ibuffer-mode))
2026-02-02 00:04:11 +11:00
(use-package beacon
2026-02-25 22:12:47 +11:00
:diminish
2026-02-02 00:04:11 +11:00
:hook elpaca-after-init)
2026-02-22 05:24:39 +11:00
(use-package spacious-padding)
2025-12-14 04:51:24 +11:00
(provide 'init-ui)