2017-06-08 11:47:56 +02:00
|
|
|
;;; ui/doom/config.el -*- lexical-binding: t; -*-
|
2017-01-17 00:20:59 -05:00
|
|
|
|
2018-03-22 19:28:03 -04:00
|
|
|
(defvar +doom-solaire-themes
|
2018-03-28 06:49:49 -04:00
|
|
|
'((doom-city-lights . t)
|
|
|
|
(doom-dracula . t)
|
2019-03-04 04:46:40 -05:00
|
|
|
(doom-molokai)
|
2018-03-28 06:49:49 -04:00
|
|
|
(doom-nord . t)
|
2018-05-02 23:41:17 +02:00
|
|
|
(doom-nord-light . t)
|
2018-08-03 16:17:32 +02:00
|
|
|
(doom-nova)
|
2018-03-28 06:49:49 -04:00
|
|
|
(doom-one . t)
|
|
|
|
(doom-one-light . t)
|
2018-06-17 12:12:13 +02:00
|
|
|
(doom-opera . t)
|
2018-08-03 16:17:32 +02:00
|
|
|
(doom-solarized-light)
|
|
|
|
(doom-spacegrey)
|
|
|
|
(doom-vibrant)
|
|
|
|
(doom-tomorrow-night))
|
2018-03-28 06:49:49 -04:00
|
|
|
"An alist of themes that support `solaire-mode'. If CDR is t, then use
|
|
|
|
`solaire-mode-swap-bg'.")
|
2018-03-22 19:28:03 -04:00
|
|
|
|
|
|
|
|
|
|
|
;;
|
2018-09-07 19:36:16 -04:00
|
|
|
;; Packages
|
2018-03-22 19:28:03 -04:00
|
|
|
|
2017-01-31 05:09:20 -05:00
|
|
|
;; <https://github.com/hlissner/emacs-doom-theme>
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! doom-themes
|
2018-05-25 00:46:11 +02:00
|
|
|
:defer t
|
|
|
|
:init
|
2017-12-09 16:52:23 -05:00
|
|
|
(unless doom-theme
|
2018-03-22 19:28:03 -04:00
|
|
|
(setq doom-theme 'doom-one))
|
2019-03-17 23:19:55 -04:00
|
|
|
:config
|
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-07-23 02:06:14 +02:00
|
|
|
:defer t
|
2018-03-22 19:28:03 -04:00
|
|
|
:init
|
2019-07-18 15:27:20 +02:00
|
|
|
(add-hook 'doom-load-theme-hook
|
2019-07-21 12:58:50 +02:00
|
|
|
(defun +doom-solaire-mode-swap-bg-maybe-h ()
|
2019-07-23 02:06:14 +02:00
|
|
|
(pcase-let ((`(,theme . ,swap) (assq doom-theme +doom-solaire-themes)))
|
|
|
|
(require 'solaire-mode)
|
|
|
|
(if swap (solaire-mode-swap-bg))))
|
2019-07-18 15:27:20 +02:00
|
|
|
'append)
|
2017-06-05 03:13:24 +02:00
|
|
|
:config
|
2018-02-18 03:14:33 -05:00
|
|
|
;; fringe can become unstyled when deleting or focusing frames
|
|
|
|
(add-hook 'focus-in-hook #'solaire-mode-reset)
|
2018-03-22 19:27:17 -04:00
|
|
|
;; Prevent color glitches when reloading either DOOM or loading a new theme
|
|
|
|
(add-hook! :append '(doom-load-theme-hook doom-reload-hook)
|
2018-02-07 01:36:16 -05:00
|
|
|
#'solaire-mode-reset)
|
|
|
|
;; org-capture takes an org buffer and narrows it. The result is erroneously
|
|
|
|
;; considered an unreal buffer, so solaire-mode must be restored.
|
2018-09-18 15:16:22 -04:00
|
|
|
(add-hook 'org-capture-mode-hook #'turn-on-solaire-mode)
|
2017-06-05 03:13:24 +02:00
|
|
|
|
2019-03-05 03:01:59 -05:00
|
|
|
;; On Emacs 26+, when point is on the last line and solaire-mode is remapping
|
|
|
|
;; the hl-line face, hl-line's highlight bleeds into the rest of the window
|
|
|
|
;; after eob.
|
|
|
|
(when EMACS26+
|
2019-07-18 15:27:20 +02:00
|
|
|
(defun +doom--line-range-fn ()
|
2019-03-05 03:01:59 -05:00
|
|
|
(cons (line-beginning-position)
|
|
|
|
(cond ((let ((eol (line-end-position)))
|
|
|
|
(and (= eol (point-max))
|
|
|
|
(/= eol (line-beginning-position))))
|
|
|
|
(1- (line-end-position)))
|
|
|
|
((or (eobp)
|
|
|
|
(= (line-end-position 2) (point-max)))
|
|
|
|
(line-end-position))
|
|
|
|
((line-beginning-position 2)))))
|
2019-07-18 15:27:20 +02:00
|
|
|
(setq hl-line-range-function #'+doom--line-range-fn))
|
2019-03-05 03:01:59 -05:00
|
|
|
|
2018-09-18 15:16:22 -04:00
|
|
|
;; Because fringes can't be given a buffer-local face, they can look odd, so
|
|
|
|
;; we remove them in the minibuffer and which-key popups (they serve no
|
|
|
|
;; purpose there anyway).
|
2019-07-18 15:27:20 +02:00
|
|
|
(add-hook 'solaire-mode-hook
|
|
|
|
(defun +doom-disable-fringes-in-minibuffer-h (&rest _)
|
|
|
|
(set-window-fringes (minibuffer-window) 0 0 nil)))
|
2018-09-18 15:16:22 -04:00
|
|
|
|
:boom: revise advice naming convention (1/2)
This is first of three big naming convention updates that have been a
long time coming. With 2.1 on the horizon, all the breaking updates will
batched together in preparation for the long haul.
In this commit, we do away with the asterix to communicate that a
function is an advice function, and we replace it with the '-a' suffix.
e.g.
doom*shut-up -> doom-shut-up-a
doom*recenter -> doom-recenter-a
+evil*static-reindent -> +evil--static-reindent-a
The rationale behind this change is:
1. Elisp's own formatting/indenting tools would occasionally struggle
with | and * (particularly pp and cl-prettyprint). They have no
problem with / and :, fortunately.
2. External syntax highlighters (like pygmentize, discord markdown or
github markdown) struggle with it, sometimes refusing to highlight
code beyond these symbols.
3. * and | are less expressive than - and -- in communicating the
intended visibility, versatility and stability of a function.
4. It complicated the regexps we must use to search for them.
5. They were arbitrary and over-complicated to begin with, decided
on haphazardly way back when Doom was simply "my private config".
Anyhow, like how predicate functions have the -p suffix, we'll adopt the
-a suffix for advice functions, -h for hook functions and -fn for
variable functions.
Other noteable changes:
- Replaces advice-{add,remove}! macro with new def-advice!
macro. The old pair weren't as useful. The new def-advice! saves on a
lot of space.
- Removed "stage" assertions to make sure you were using the right
macros in the right place. Turned out to not be necessary, we'll
employ better checks later.
2019-07-18 15:42:52 +02:00
|
|
|
(def-advice! +doom--no-fringes-in-which-key-buffer-a (&rest _)
|
|
|
|
:after 'which-key--show-buffer-side-window
|
2019-07-18 15:27:20 +02:00
|
|
|
(+doom-disable-fringes-in-minibuffer-h)
|
2018-09-18 15:16:22 -04:00
|
|
|
(set-window-fringes (get-buffer-window which-key--buffer) 0 0 nil))
|
|
|
|
|
|
|
|
(add-hook! '(minibuffer-setup-hook window-configuration-change-hook)
|
2019-07-18 15:27:20 +02:00
|
|
|
#'+doom-disable-fringes-in-minibuffer-h)
|
2018-12-26 17:36:44 -05:00
|
|
|
|
2019-03-02 12:48:08 -05:00
|
|
|
(solaire-global-mode +1))
|