init-ui.el (2874B)
1 ;;; init-ui.el --- ui and other style customization cofig -*- lexical-binding: t -*- 2 3 ;;; Commentary: 4 5 ;;; Code: 6 7 ;; custom-theme-load-path 8 (add-to-list 'custom-theme-load-path (concat user-emacs-directory "lisp/")) 9 10 ;; trust all themes 11 (setq custom-safe-themes t) 12 13 ;; solarized 14 (use-package solarized-theme 15 :straight 16 (solarized-emacs 17 :fork 18 (:type git :host nil :repo "https://git.trogloxene.org/solarized-emacs.git")) 19 :init 20 (if (and (daemonp) (not *is-android*)) 21 (add-hook 'after-make-frame-functions 22 (lambda (frame) 23 (with-selected-frame frame 24 (load-theme 'my-dark t)))) 25 (if *is-android* 26 (load-theme 'my-light t) 27 (load-theme 'my-dark t)))) 28 29 ;; line numbers 30 (use-package display-line-numbers 31 :straight nil 32 :hook 33 (after-init . global-display-line-numbers-mode) 34 :config 35 (setq display-line-numbers-type t 36 display-line-numbers-grow-only t 37 display-line-numbers-width-start 4)) 38 39 ;; resize margins 40 (use-package olivetti 41 :delight 42 :hook 43 (org-mode . olivetti-mode) 44 (olivetti-mode . (lambda () (display-line-numbers-mode -1))) 45 :init 46 (setq olivetti-body-width 85)) 47 48 ;; rainbow mode 49 (use-package rainbow-mode) 50 51 ;; rainbow-delimiters 52 (use-package rainbow-delimiters) 53 54 (if *is-android* 55 (use-package simple-modeline 56 :hook 57 (after-init . simple-modeline-mode))) 58 59 ;; indent-bars 60 (use-package indent-bars 61 :custom 62 (indent-bars-color '(font-lock-comment-face :face-bg nil :blend 0.4)) 63 (indent-bars-highlight-current-depth '(:face default :blend 0.4)) 64 (indent-bars-pattern ".") 65 (indent-bars-width-frac 0.1) 66 (indent-bars-pad-frac 0.1) 67 (indent-bars-color-by-depth nil) 68 (indent-bars-no-descend-string t) 69 (indent-bars-prefer-character t)) 70 71 ;; highlight current line 72 (use-package hl-line 73 :straight nil 74 :hook 75 (after-init . global-hl-line-mode)) 76 77 ;; display time in mode line 78 (unless *is-android* 79 (use-package time 80 :straight nil 81 :hook 82 (persp-mode . display-time-mode) 83 :config 84 (setq display-time-default-load-average nil 85 display-time-string-forms 86 '((propertize 87 (concat 88 (propertize (format-time-string " %I:%M") 'face 'display-time-date-and-time) 89 (propertize (format-time-string "-%p") 'face 'font-lock-comment-face)) 90 'help-echo (format-time-string "%A, %B %d, %Y")))))) 91 92 ;; easier to setup fonts 93 (use-package cnfonts 94 :hook 95 (after-init . cnfonts-mode) 96 :init 97 (setq cnfonts-personal-fontnames 98 '(("Sarasa Fixed TC") ;English 99 ("Sarasa Fixed TC") ;Chinese 100 nil ;ext-B 101 nil ;symbol 102 nil)) ;what's this 103 :config 104 (cnfonts--select-profile "profile1")) 105 106 (provide 'init-ui) 107 ;;; init-ui.el ends here