ui/doom: refactor
This commit is contained in:
parent
1e06d8b186
commit
fb8a361e1f
2 changed files with 33 additions and 22 deletions
|
@ -7,5 +7,21 @@
|
||||||
(let ((theme (or (car-safe custom-enabled-themes) +doom-theme)))
|
(let ((theme (or (car-safe custom-enabled-themes) +doom-theme)))
|
||||||
(when theme
|
(when theme
|
||||||
(mapc #'disable-theme custom-enabled-themes))
|
(mapc #'disable-theme custom-enabled-themes))
|
||||||
(load-theme theme t)))
|
(load-theme theme t)
|
||||||
|
(+doom|refresh-bright-buffers)))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +doom|restore-bright-buffers (&rest _)
|
||||||
|
"Restore `doom-buffer-mode' in buffers when `persp-mode' loads a session."
|
||||||
|
(dolist (buf (persp-buffer-list))
|
||||||
|
(with-current-buffer buf
|
||||||
|
(+doom|buffer-mode-on))))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +doom|refresh-bright-buffers ()
|
||||||
|
"Refresh `doom-buffer-mode', in case of graphical glitches."
|
||||||
|
(dolist (win (window-list))
|
||||||
|
(when (buffer-local-value 'doom-buffer-mode (window-buffer win))
|
||||||
|
(with-selected-window win
|
||||||
|
(doom-buffer-mode -1)
|
||||||
|
(doom-buffer-mode +1)))))
|
||||||
|
|
|
@ -43,20 +43,18 @@
|
||||||
:config
|
:config
|
||||||
(load-theme +doom-theme t)
|
(load-theme +doom-theme t)
|
||||||
|
|
||||||
|
;; Add file icons to doom-neotree
|
||||||
|
(doom-themes-neotree-config)
|
||||||
|
(setq doom-neotree-enable-variable-pitch t
|
||||||
|
doom-neotree-file-icons 'simple
|
||||||
|
doom-neotree-line-spacing 2)
|
||||||
|
|
||||||
;; Since Fira Mono doesn't have an italicized variant, highlight it instead
|
;; Since Fira Mono doesn't have an italicized variant, highlight it instead
|
||||||
(set-face-attribute 'italic nil
|
(set-face-attribute 'italic nil
|
||||||
:weight 'ultra-light
|
:weight 'ultra-light
|
||||||
:foreground "#ffffff"
|
:foreground "#ffffff"
|
||||||
:background (face-background 'doom-hl-line))
|
:background (face-background 'doom-hl-line))
|
||||||
|
|
||||||
(defface +doom-folded-face
|
|
||||||
`((((background dark))
|
|
||||||
(:inherit font-lock-comment-face :background ,(doom-color 'black)))
|
|
||||||
(((background light))
|
|
||||||
(:inherit font-lock-comment-face :background ,(doom-color 'light-grey))))
|
|
||||||
"Face to hightlight `hideshow' overlays."
|
|
||||||
:group 'doom)
|
|
||||||
|
|
||||||
;; Dark frames by default
|
;; Dark frames by default
|
||||||
(when (display-graphic-p)
|
(when (display-graphic-p)
|
||||||
(push (cons 'background-color (face-background 'default)) default-frame-alist)
|
(push (cons 'background-color (face-background 'default)) default-frame-alist)
|
||||||
|
@ -76,19 +74,8 @@
|
||||||
(doom-buffer-mode -1)))
|
(doom-buffer-mode -1)))
|
||||||
(add-hook 'doom-popup-mode-hook #'+doom|buffer-mode-off)
|
(add-hook 'doom-popup-mode-hook #'+doom|buffer-mode-off)
|
||||||
|
|
||||||
(when (featurep! :feature workspaces)
|
;;
|
||||||
(defun +doom|restore-bright-buffers (&rest _)
|
(add-hook '+workspaces-load-session-hook #'+doom|restore-bright-buffers))
|
||||||
"Restore `doom-buffer-mode' in buffers when `persp-mode' loads a session."
|
|
||||||
(dolist (buf (persp-buffer-list))
|
|
||||||
(with-current-buffer buf
|
|
||||||
(+doom|buffer-mode-on))))
|
|
||||||
(add-hook '+workspaces-load-session-hook #'+doom|restore-bright-buffers))
|
|
||||||
|
|
||||||
;; Add file icons to doom-neotree
|
|
||||||
(doom-themes-neotree-config)
|
|
||||||
(setq doom-neotree-enable-variable-pitch t
|
|
||||||
doom-neotree-file-icons 'simple
|
|
||||||
doom-neotree-line-spacing 2))
|
|
||||||
|
|
||||||
|
|
||||||
;; Flashes the line around the cursor after any motion command that might
|
;; Flashes the line around the cursor after any motion command that might
|
||||||
|
@ -124,6 +111,14 @@
|
||||||
|
|
||||||
|
|
||||||
(after! hideshow
|
(after! hideshow
|
||||||
|
(defface +doom-folded-face
|
||||||
|
`((((background dark))
|
||||||
|
(:inherit font-lock-comment-face :background ,(doom-color 'black)))
|
||||||
|
(((background light))
|
||||||
|
(:inherit font-lock-comment-face :background ,(doom-color 'light-grey))))
|
||||||
|
"Face to hightlight `hideshow' overlays."
|
||||||
|
:group 'doom)
|
||||||
|
|
||||||
;; Nicer code-folding overlays
|
;; Nicer code-folding overlays
|
||||||
(setq hs-set-up-overlay
|
(setq hs-set-up-overlay
|
||||||
(lambda (ov)
|
(lambda (ov)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue