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

116 lines
3.0 KiB
EmacsLisp
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
;;; 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
(:type git :host github :repo "Andsy10/solarized-emacs" :protocol ssh))
:init
;; 把主题加载延迟到frame创建之后防止daemon模式下宏不能正常展开
(if (and (daemonp) (not *is-android*))
(add-hook 'after-make-frame-functions
(lambda (frame)
(with-selected-frame frame
(load-theme 'my-dark t))))
(if *is-android*
(load-theme 'my-light t)
(load-theme 'my-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 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))
;; 缩进线
(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