forked from seagle0128/.emacs.d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom.el
150 lines (133 loc) · 7.26 KB
/
custom.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
;;; custom.el --- user customization file -*- lexical-binding: t no-byte-compile: t -*-
;;; Commentary:
;;; Add or change the configurations in custom.el, then restart Emacs.
;;; Put your own configurations in custom-post.el to override default configurations.
;;; Code:
;; (setq centaur-logo nil) ; Logo file or nil (official logo)
;; (setq centaur-full-name "user name") ; User full name
;; (setq centaur-mail-address "[email protected]") ; Email address
(setq centaur-proxy "127.0.0.1:7890") ; HTTP/HTTPS proxy
(setq centaur-socks-proxy "127.0.0.1:7890") ; SOCKS proxy
;; (setq centaur-server nil) ; Enable `server-mode' or not: t or nil
;; (setq centaur-icon nil) ; Display icons or not: t or nil
(setq centaur-package-archives 'melpa) ; Package repo: melpa, emacs-cn, bfsu, netease, sjtu, tencent, tuna or ustc
(setq centaur-theme 'auto) ; Color theme: auto, random, system, default, pro, dark, light, warm, cold, day or night
(setq centaur-completion-style 'minibuffer) ; Completion display style: minibuffer or childframe
;; (setq centaur-dashboard nil) ; Display dashboard at startup or not: t or nil
(setq centaur-lsp 'lsp-bridge) ; Set LSP client: lsp-mode, eglot, lsp-bridge or nil
;; (setq centaur-lsp-format-on-save t) ; Auto format buffers on save: t or nil
(setq centaur-lsp-format-on-save-ignore-modes '(c-mode c++-mode web-mode markdown-mode)) ; Ignore format on save for some languages
(setq centaur-tree-sitter nil) ; Enable tree-sitter or not: t or nil. Only available in 29+.
(setq centaur-chinese-calendar t) ; Support Chinese calendar or not: t or nil
;; (setq centaur-player t) ; Enable players or not: t or nil
;; (setq centaur-prettify-symbols-alist nil) ; Alist of symbol prettifications. Nil to use font supports ligatures.
;; (setq centaur-prettify-org-symbols-alist nil) ; Alist of symbol prettifications for `org-mode'
;; For Emacs devel
;; (setq package-user-dir (locate-user-emacs-file (format "elpa-%s" emacs-major-version)))
;; (setq desktop-base-file-name (format ".emacs-%s.desktop" emacs-major-version))
;; (setq desktop-base-lock-name (format ".emacs-%s.desktop.lock" emacs-major-version))
;; Fonts
(defun centaur-setup-fonts ()
"Setup fonts."
(when (display-graphic-p)
;; Set default font
(cl-loop for font in '(
"JetBrainsMono Nerd Font"
"Iosevka Comfy"
"Cascadia Code"
"Hack Nerd Font Mono"
"FiraCode Nerd Font"
"Modus Mono"
"Operator Mono"
"Monego Nerd Font Fix"
"Iosevka"
"SF Mono"
"mononoki"
"Menlo"
"DejaVu Sans Mono"
"Source Code Pro"
"Monaco"
"Consolas")
when (font-installed-p font)
return (set-face-attribute 'default nil
:font font
:weight 'normal
:height (cond (sys/macp 120)
(sys/win32p 110)
(t 100))))
;; Set mode-line font
;; (cl-loop for font in '("Menlo" "SF Pro Display" "Helvetica")
;; when (font-installed-p font)
;; return (progn
;; (set-face-attribute 'mode-line nil :family font :height 120)
;; (when (facep 'mode-line-active)
;; (set-face-attribute 'mode-line-active nil :family font :height 120))
;; (set-face-attribute 'mode-line-inactive nil :family font :height 120)))
;; Specify font for all unicode characters
(cl-loop for font in '("Apple Color Emoji" "Noto Color Emoji" "Segoe UI Symbol" "Symbola" "Symbol")
when (font-installed-p font)
return (if (< emacs-major-version 27)
(set-fontset-font "fontset-default" 'unicode font nil 'prepend)
(set-fontset-font t 'symbol (font-spec :family font) nil 'prepend)))
;; Emoji
(cl-loop for font in '("Noto Color Emoji" "Apple Color Emoji" "Segoe UI Emoji")
when (font-installed-p font)
return (cond
((< emacs-major-version 27)
(set-fontset-font "fontset-default" 'unicode font nil 'prepend))
((< emacs-major-version 28)
(set-fontset-font t 'symbol (font-spec :family font) nil 'prepend))
(t
(set-fontset-font t 'emoji (font-spec :family font) nil 'prepend))))
;; Specify font for Chinese characters
(cl-loop for font in '("LXGW Neo Xihei" "WenQuanYi Micro Hei Mono" "LXGW WenKai Screen"
"LXGW WenKai Mono" "PingFang SC" "Microsoft Yahei UI" "Simhei")
when (font-installed-p font)
return (progn
(setq face-font-rescale-alist `((,font . 1.0)))
(set-fontset-font t 'han (font-spec :family font))))))
(centaur-setup-fonts)
(add-hook 'window-setup-hook #'centaur-setup-fonts)
(add-hook 'server-after-make-frame-hook #'centaur-setup-fonts)
;; Mail
;; (setq message-send-mail-function 'smtpmail-send-it
;; smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))
;; smtpmail-auth-credentials '(("smtp.gmail.com" 587
;; user-mail-address nil))
;; smtpmail-default-smtp-server "smtp.gmail.com"
;; smtpmail-smtp-server "smtp.gmail.com"
;; smtpmail-smtp-service 587)
;; Calendar
;; Set location , then press `S' can show the time of sunrise and sunset
;; (setq calendar-location-name "Chengdu"
;; calendar-latitude 30.67
;; calendar-longitude 104.07)
;; Misc.
(setq confirm-kill-emacs 'y-or-n-p)
(setq yes-or-no-prompt "y or n") ;; require emacs 30.1+
(setq custom-safe-themes t)
(global-unset-key [remap scroll-up-command])
(global-unset-key [remap scroll-down-command])
;; Enable proxy
(enable-http-proxy)
;; (proxy-socks-enable)
;; Display on the specified monitor
;; (when (and (> (length (display-monitor-attributes-list)) 1)
;; (> (display-pixel-width) 1920))
;; (set-frame-parameter nil 'left 1920))
;; (put 'cl-destructuring-bind 'lisp-indent-function 'defun)
;; (put 'pdf-view-create-image 'lisp-indent-function 'defun)
;; (put 'treemacs-create-theme 'lisp-indent-function 'defun)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
;;; custom.el ends here