2017-06-08 11:47:56 +02:00
|
|
|
;;; ui/doom/config.el -*- lexical-binding: t; -*-
|
2017-01-17 00:20:59 -05:00
|
|
|
|
2020-04-08 15:29:29 -04:00
|
|
|
;;;###package pos-tip
|
|
|
|
(setq pos-tip-internal-border-width 6
|
|
|
|
pos-tip-border-width 1)
|
|
|
|
|
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! doom-themes
|
2018-05-25 00:46:11 +02:00
|
|
|
:defer t
|
|
|
|
:init
|
2021-05-07 16:33:07 -04:00
|
|
|
(setq doom-theme 'doom-one)
|
2017-12-08 22:57:08 -05:00
|
|
|
;; improve integration w/ org-mode
|
2018-03-22 19:28:03 -04:00
|
|
|
(add-hook 'doom-load-theme-hook #'doom-themes-org-config)
|
2018-07-10 23:05:01 +02:00
|
|
|
;; more Atom-esque file icons for neotree/treemacs
|
2018-07-03 12:29:27 +02:00
|
|
|
(when (featurep! :ui neotree)
|
|
|
|
(add-hook 'doom-load-theme-hook #'doom-themes-neotree-config)
|
2019-07-21 12:29:51 +02:00
|
|
|
(setq doom-themes-neotree-enable-variable-pitch t
|
|
|
|
doom-themes-neotree-file-icons 'simple
|
|
|
|
doom-themes-neotree-line-spacing 2))
|
2018-07-10 23:05:01 +02:00
|
|
|
(when (featurep! :ui treemacs)
|
2019-07-21 12:29:51 +02:00
|
|
|
(add-hook 'doom-load-theme-hook #'doom-themes-treemacs-config)))
|
2017-01-31 05:09:20 -05:00
|
|
|
|
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! solaire-mode
|
2019-12-12 03:39:34 -05:00
|
|
|
:when (or (daemonp) (display-graphic-p))
|
2020-04-24 18:47:10 -04:00
|
|
|
:hook (doom-load-theme . solaire-global-mode)
|
2017-06-05 03:13:24 +02:00
|
|
|
:config
|
2020-04-23 03:44:42 -04:00
|
|
|
(when (daemonp)
|
2020-05-18 14:38:27 -04:00
|
|
|
(add-hook! '(doom-switch-frame-hook after-make-frame-functions)
|
|
|
|
(defun +doom-disable-solaire-mode-maybe-h (&optional frame)
|
|
|
|
(if (display-graphic-p frame)
|
2020-04-25 02:40:20 -04:00
|
|
|
(unless solaire-global-mode
|
|
|
|
(solaire-global-mode +1))
|
|
|
|
(when solaire-global-mode
|
|
|
|
(solaire-global-mode -1))))))
|
2020-04-23 03:44:42 -04:00
|
|
|
|
2020-06-01 18:33:25 -04:00
|
|
|
;; DEPRECATED No longer needed in Emacs 27+
|
2019-11-07 12:49:30 -05:00
|
|
|
(unless EMACS27+
|
2020-06-01 18:33:25 -04:00
|
|
|
;; HACK On Emacs <=26, when point is on the last (or second to last) line
|
|
|
|
;; and solaire-mode is remapping the hl-line face, hl-line's highlight
|
|
|
|
;; bleeds into the rest of the window after eob. On Emacs 27 this no
|
|
|
|
;; longer happens. This tries to fix it for 26 users, but it imposes
|
|
|
|
;; another problem: the 2nd-to-last line will only be highlighted up to
|
|
|
|
;; the (n-1)th character, but I think that is the lesser evil.
|
2019-07-18 15:27:20 +02:00
|
|
|
(defun +doom--line-range-fn ()
|
2020-06-01 18:33:25 -04:00
|
|
|
(if solaire-mode
|
|
|
|
(let ((bol (line-beginning-position))
|
|
|
|
(eol (line-end-position))
|
|
|
|
(eob (point-max)))
|
2020-06-01 19:36:27 -04:00
|
|
|
(cond ((= bol eob)
|
2020-06-01 18:33:25 -04:00
|
|
|
nil)
|
2020-06-01 19:36:27 -04:00
|
|
|
((= (1+ eol) eob)
|
|
|
|
(cons bol (1- eob)))
|
|
|
|
((or (= eol eob) (eobp))
|
2020-06-01 18:33:25 -04:00
|
|
|
(cons bol eol))
|
|
|
|
((cons bol (line-beginning-position 2)))))
|
|
|
|
(cons (line-beginning-position)
|
|
|
|
(line-beginning-position 2))))
|
2020-04-23 03:44:23 -04:00
|
|
|
(setq hl-line-range-function #'+doom--line-range-fn)
|
2019-03-05 03:01:59 -05:00
|
|
|
|
2020-04-23 03:44:23 -04:00
|
|
|
;; HACK The fringe cannot have a buffer-local remapping on Emacs <= 26, so
|
|
|
|
;; we jump through hoops to reset it (globally) whenever it is likely
|
|
|
|
;; that the fringe will have lost its background color.
|
2020-10-16 22:28:08 -04:00
|
|
|
(add-hook! '(doom-load-theme-hook doom-after-reload-hook) :append
|
2020-04-23 03:44:23 -04:00
|
|
|
#'solaire-mode-reset)
|
2018-09-18 15:16:22 -04:00
|
|
|
|
2020-04-23 03:44:23 -04:00
|
|
|
;; fringe can become unstyled when deleting or focusing frames
|
|
|
|
(add-hook 'focus-in-hook #'solaire-mode-reset)
|
2018-09-18 15:16:22 -04:00
|
|
|
|
2020-04-23 03:44:23 -04:00
|
|
|
;; A global fringe color means the minibuffer (with its fringes) will always
|
|
|
|
;; stand out, so we remove them (in which-key popups too).
|
|
|
|
(add-hook! 'solaire-mode-hook
|
|
|
|
(defun +doom-disable-fringes-in-minibuffer-h (&rest _)
|
|
|
|
(set-window-fringes (minibuffer-window) 0 0 nil)))
|
|
|
|
(defadvice! +doom--no-fringes-in-which-key-buffer-a (&rest _)
|
|
|
|
:after 'which-key--show-buffer-side-window
|
|
|
|
(+doom-disable-fringes-in-minibuffer-h)
|
|
|
|
(set-window-fringes (get-buffer-window which-key--buffer) 0 0 nil))
|
|
|
|
(add-hook! '(minibuffer-setup-hook window-configuration-change-hook)
|
|
|
|
#'+doom-disable-fringes-in-minibuffer-h)))
|