This commit is contained in:
parent
46b86fc5a9
commit
d260817105
6 changed files with 208 additions and 206 deletions
322
elpaca.lock
322
elpaca.lock
File diff suppressed because it is too large
Load diff
|
|
@ -48,14 +48,14 @@
|
||||||
(use-package buffer-move :ensure t :defer t)
|
(use-package buffer-move :ensure t :defer t)
|
||||||
|
|
||||||
;; Garbage collection magic hack
|
;; Garbage collection magic hack
|
||||||
(use-package gcmh :ensure t
|
(use-package gcmh :ensure t :defer t
|
||||||
|
:commands (gcmh-mode)
|
||||||
|
:hook ((elpaca-after-init . (lambda () (gcmh-mode t))))
|
||||||
:config
|
:config
|
||||||
(declare-function gcmh-mode "gcmh")
|
|
||||||
(setopt gcmh-verbose nil) ;; Do not log GC messages
|
(setopt gcmh-verbose nil) ;; Do not log GC messages
|
||||||
(setopt gcmh-idle-delay 'auto) ;; Compute GC delay based on gcmh-auto-idle-delay-factor
|
(setopt gcmh-idle-delay 'auto) ;; Compute GC delay based on gcmh-auto-idle-delay-factor
|
||||||
(setopt gcmh-auto-idle-delay-factor 10) ;; Original value was 10
|
(setopt gcmh-auto-idle-delay-factor 10) ;; Original value was 10
|
||||||
(setopt gcmh-high-cons-threshold (* 128 1024 1024))
|
(setopt gcmh-high-cons-threshold (* 128 1024 1024)))
|
||||||
(gcmh-mode t))
|
|
||||||
|
|
||||||
;; #====================== Backup config #==============================
|
;; #====================== Backup config #==============================
|
||||||
(setopt backup-directory-alist
|
(setopt backup-directory-alist
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@
|
||||||
(use-package company :ensure t)
|
(use-package company :ensure t)
|
||||||
|
|
||||||
;; Finally, wait for installation of these four packages.
|
;; Finally, wait for installation of these four packages.
|
||||||
(declare-function elpaca-wait "elpaca")
|
(if (fboundp 'elpaca-wait)
|
||||||
(elpaca-wait)
|
(elpaca-wait))
|
||||||
|
|
||||||
(provide 'icejam-blocking)
|
(provide 'icejam-blocking)
|
||||||
;;; icejam-blocking.el ends here
|
;;; icejam-blocking.el ends here
|
||||||
|
|
|
||||||
|
|
@ -59,12 +59,13 @@ in `icejam-set-font-to-screen`.")
|
||||||
(defun icejam-set-lsp-ui-font-hook ()
|
(defun icejam-set-lsp-ui-font-hook ()
|
||||||
"Reset LSP IO font to specified `icejam-font` and `icejam-font-height`."
|
"Reset LSP IO font to specified `icejam-font` and `icejam-font-height`."
|
||||||
(setopt lsp-ui-doc-frame-hook nil)
|
(setopt lsp-ui-doc-frame-hook nil)
|
||||||
(add-hook
|
(add-hook 'lsp-ui-doc-frame-hook
|
||||||
'lsp-ui-doc-frame-hook
|
|
||||||
(lambda (frame _w)
|
(lambda (frame _w)
|
||||||
(set-face-attribute 'default frame
|
(set-face-attribute 'default frame
|
||||||
:family icejam-mut-font-family
|
:family icejam-mut-font-family
|
||||||
:height (-> icejam-mut-font-height (- 2) (* 10))))))
|
:height (-> icejam-mut-font-height
|
||||||
|
(- 2)
|
||||||
|
(* 10))))))
|
||||||
|
|
||||||
(defun icejam-set-font (family height)
|
(defun icejam-set-font (family height)
|
||||||
"Set font to FAMILY and its HEIGHT to X.
|
"Set font to FAMILY and its HEIGHT to X.
|
||||||
|
|
@ -80,18 +81,26 @@ two points smaller."
|
||||||
(setopt icejam-mut-font-height height)
|
(setopt icejam-mut-font-height height)
|
||||||
|
|
||||||
;; Set default font.
|
;; Set default font.
|
||||||
(set-face-attribute 'default nil :family family :height (-> height (* 10)))
|
(set-face-attribute 'default nil
|
||||||
|
:family family
|
||||||
|
:height (-> height
|
||||||
|
(* 10)))
|
||||||
|
|
||||||
;; Some font faces look better when they are 1 point smaller.
|
;; Some font faces look better when they are 1 point smaller.
|
||||||
(dolist (face '(tooltip
|
(dolist (face '(tooltip
|
||||||
company-tooltip
|
company-tooltip
|
||||||
company-tooltip-annotation
|
company-tooltip-annotation
|
||||||
company-tooltip-mouse))
|
company-tooltip-mouse))
|
||||||
(set-face-attribute face nil :height (-> height (- 1) (* 10))))
|
(set-face-attribute face nil :height (-> height
|
||||||
|
(- 1)
|
||||||
|
(* 10))))
|
||||||
|
|
||||||
;; And some, mainly in modeline with 2 points.
|
;; And some, mainly in modeline with 2 points.
|
||||||
(dolist (face '(mode-line mode-line-inactive))
|
(dolist (face '(mode-line
|
||||||
(set-face-attribute face nil :height (-> height (- 2) (* 10))))
|
mode-line-inactive))
|
||||||
|
(set-face-attribute face nil :height (-> height
|
||||||
|
(- 2)
|
||||||
|
(* 10))))
|
||||||
|
|
||||||
;; Call LSP-UI hook
|
;; Call LSP-UI hook
|
||||||
(icejam-set-lsp-ui-font-hook))
|
(icejam-set-lsp-ui-font-hook))
|
||||||
|
|
@ -99,20 +108,22 @@ two points smaller."
|
||||||
(defun icejam-set-font-to-screen ()
|
(defun icejam-set-font-to-screen ()
|
||||||
"Automatically set font height to suit the monitor."
|
"Automatically set font height to suit the monitor."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
|
||||||
;; Only do anything if there's a display at all.
|
;; Only do anything if there's a display at all.
|
||||||
(if (x-display-list)
|
(if (x-display-list)
|
||||||
|
(let ((pixel-height (x-display-pixel-height)))
|
||||||
(cond
|
(cond
|
||||||
;; LG 27" screen connected to a MacBook.
|
;; MacBook 14" built-in screen.
|
||||||
((>= 1080 (x-display-pixel-height))
|
((>= 1080 pixel-height)
|
||||||
(icejam-set-font icejam-font-family icejam-font-height))
|
(icejam-set-font icejam-font-family icejam-font-height))
|
||||||
|
|
||||||
;; MacBook 14" built-in screen.
|
;; LG 27" screen connected to a MacBook.
|
||||||
((>= 1440 (x-display-pixel-height))
|
((>= 1440 pixel-height)
|
||||||
(icejam-set-font icejam-font-family (+ icejam-font-height 3)))
|
(icejam-set-font icejam-font-family (+ icejam-font-height 3)))
|
||||||
|
|
||||||
;; 4K screen on Windows or Linux
|
;; 4K screen on Windows or Linux
|
||||||
((>= 2160 (x-display-pixel-height))
|
((>= 2160 pixel-height)
|
||||||
(icejam-set-font icejam-font-family (- icejam-font-height 3))))))
|
(icejam-set-font icejam-font-family (- icejam-font-height 3)))))))
|
||||||
|
|
||||||
;; Run the above function once, after elpaca finishes all downloads.
|
;; Run the above function once, after elpaca finishes all downloads.
|
||||||
(add-hook 'elpaca-after-init-hook 'icejam-set-font-to-screen)
|
(add-hook 'elpaca-after-init-hook 'icejam-set-font-to-screen)
|
||||||
|
|
@ -127,14 +138,5 @@ two points smaller."
|
||||||
(interactive "nEnter new height for font in this frame: ")
|
(interactive "nEnter new height for font in this frame: ")
|
||||||
(set-frame-font (format "%s %d" icejam-mut-font-family new-height)))
|
(set-frame-font (format "%s %d" icejam-mut-font-family new-height)))
|
||||||
|
|
||||||
;; Remove ugly black line
|
|
||||||
(set-face-attribute 'vertical-border nil :foreground
|
|
||||||
(face-attribute 'fringe :background))
|
|
||||||
|
|
||||||
;; Set fringe colors to default, so it does not bother you.
|
|
||||||
(set-face-attribute 'fringe nil
|
|
||||||
:foreground (face-foreground 'default)
|
|
||||||
:background (face-background 'default))
|
|
||||||
|
|
||||||
(provide 'icejam-fonts)
|
(provide 'icejam-fonts)
|
||||||
;;; icejam-fonts.el ends here
|
;;; icejam-fonts.el ends here
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
(use-package magit
|
(use-package magit
|
||||||
:ensure t
|
:ensure t
|
||||||
|
:commands (magit-blame-quit)
|
||||||
:defer t
|
:defer t
|
||||||
:bind (:map icejam-keys-mode-map
|
:bind (:map icejam-keys-mode-map
|
||||||
("<f5> c" . magit-checkout)
|
("<f5> c" . magit-checkout)
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
(require 'icejam-avy)
|
(require 'icejam-avy)
|
||||||
(require 'icejam-keys-mode)
|
(require 'icejam-keys-mode)
|
||||||
(require 'icejam-blocking)
|
(require 'icejam-blocking)
|
||||||
;; (use-package transient :ensure (:wait t) :demand t)
|
|
||||||
|
|
||||||
(defun icejam-mark-and-indent-whole-buffer ()
|
(defun icejam-mark-and-indent-whole-buffer ()
|
||||||
"Mark and indent whole buffer."
|
"Mark and indent whole buffer."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue