-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathearly-init.el
51 lines (37 loc) · 1.6 KB
/
early-init.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
;;; early-init.el --- -*- lexical-binding: t; -*-
;;; Commentary:
;;; Set GUI related settings here so that the startup process would be faster
;;; Code:
(setq package-enable-at-startup nil)
(defun my/macos-p ()
"Return t if it's in macos."
(string-equal system-type "darwin"))
;;; GUI dependent settings, read before setting fonts
;;; Override them in early-init-custom.el in different machine
(defvar my/gui-font-size-choices (if (my/macos-p) '(160) '(102))
"List of integers as choices of font size (height).")
(defvar my/gui-fringe-size (if (my/macos-p) 8 16))
(let ((my/-early-init-local-file (expand-file-name "early-init-local.el" user-emacs-directory)))
(when (file-exists-p my/-early-init-local-file)
(load-file my/-early-init-local-file)))
(set-fringe-mode my/gui-fringe-size)
(scroll-bar-mode -1)
(setq frame-resize-pixelwise t) ;; required to remove margin on macOS fullscreen
(setenv "LSP_USE_PLISTS" "true")
(unless (and (my/macos-p) (display-graphic-p))
(menu-bar-mode 0))
(unless (my/macos-p)
(setq frame-inhibit-implied-resize t) ;; for tile-WM; speedup
)
(set-face-attribute 'default nil
:family "PragmataPro Liga"
:slant 'normal
:weight 'normal
:height (car my/gui-font-size-choices)
:width 'expanded)
(defvar my/gui-font-size-current (car my/gui-font-size-choices))
(defun my/gui-font-size-set (value)
"Set gui font with size VALUE."
(setq my/gui-font-size-current value)
(set-face-attribute 'default nil :height value))
;;; early-init.el ends here