2017-02-03 19:44:14 -05:00
|
|
|
;;; ui/doom/config.el
|
2017-01-17 00:20:59 -05:00
|
|
|
|
|
|
|
(defvar +doom-theme 'doom-one
|
|
|
|
"The color theme currently in use.")
|
|
|
|
|
2017-01-31 05:09:20 -05:00
|
|
|
(defvar +doom-font
|
|
|
|
(font-spec :family "Fira Mono" :size 12)
|
|
|
|
"The font currently in use.")
|
2017-01-17 00:20:59 -05:00
|
|
|
|
2017-01-31 05:09:20 -05:00
|
|
|
(defvar +doom-variable-pitch-font
|
2017-03-16 23:39:35 -04:00
|
|
|
(font-spec :family "Fira Sans" :size 14)
|
2017-01-31 05:09:20 -05:00
|
|
|
"The font currently in use.")
|
2017-01-17 00:20:59 -05:00
|
|
|
|
2017-01-31 05:09:20 -05:00
|
|
|
(defvar +doom-unicode-font
|
|
|
|
(font-spec :family "DejaVu Sans Mono" :size 12)
|
|
|
|
"Fallback font for unicode glyphs.")
|
2017-01-17 00:20:59 -05:00
|
|
|
|
2017-02-03 19:44:14 -05:00
|
|
|
|
2017-01-31 05:09:20 -05:00
|
|
|
;;; Set fonts
|
|
|
|
(when (display-graphic-p)
|
|
|
|
(with-demoted-errors "FONT ERROR: %s"
|
|
|
|
(set-frame-font +doom-font t t)
|
|
|
|
;; Fallback to `doom-unicode-font' for Unicode characters
|
|
|
|
(when +doom-unicode-font
|
|
|
|
(set-fontset-font t 'unicode +doom-unicode-font))
|
|
|
|
;; ...and for variable-pitch mode
|
|
|
|
(when +doom-variable-pitch-font
|
|
|
|
(set-face-attribute 'variable-pitch nil :font +doom-variable-pitch-font))))
|
|
|
|
|
|
|
|
|
|
|
|
;;; More reliable inter-window border
|
2017-02-03 19:44:14 -05:00
|
|
|
;; The native border "consumes" a pixel of the fringe on righter-most splits,
|
|
|
|
;; `window-divider' does not. Available since Emacs 25.1.
|
2017-01-31 05:09:20 -05:00
|
|
|
(setq window-divider-default-places t
|
2017-05-01 14:52:29 -04:00
|
|
|
window-divider-default-bottom-width 0
|
2017-01-31 05:09:20 -05:00
|
|
|
window-divider-default-right-width 1)
|
|
|
|
(window-divider-mode +1)
|
|
|
|
|
|
|
|
|
2017-02-19 18:52:26 -05:00
|
|
|
;; doom-one: gives Emacs a look inspired by Dark One in Atom.
|
2017-01-31 05:09:20 -05:00
|
|
|
;; <https://github.com/hlissner/emacs-doom-theme>
|
2017-02-23 00:06:12 -05:00
|
|
|
(def-package! doom-themes :demand t
|
2017-02-03 19:44:14 -05:00
|
|
|
:config
|
2017-01-17 00:20:59 -05:00
|
|
|
(load-theme +doom-theme t)
|
|
|
|
|
2017-04-28 13:16:04 -04:00
|
|
|
;; Since Fira Mono doesn't have an italicized variant, highlight it instead
|
|
|
|
(set-face-attribute 'italic nil
|
|
|
|
:weight 'ultra-light
|
|
|
|
:foreground "#ffffff"
|
|
|
|
:background (face-background 'doom-hl-line))
|
|
|
|
|
2017-02-20 00:10:10 -05:00
|
|
|
(defface +doom-folded-face
|
2017-05-07 19:14:02 +02:00
|
|
|
`((((background dark))
|
|
|
|
(:inherit font-lock-comment-face :background ,(doom-color 'black)))
|
|
|
|
(((background light))
|
|
|
|
(:inherit font-lock-comment-face :background ,(doom-color 'light-grey))))
|
2017-02-20 00:10:10 -05:00
|
|
|
"Face to hightlight `hideshow' overlays."
|
|
|
|
:group 'doom)
|
|
|
|
|
2017-02-21 16:04:35 -05:00
|
|
|
;; Dark frames by default
|
2017-04-22 01:49:15 -04:00
|
|
|
(when (display-graphic-p)
|
|
|
|
(push (cons 'background-color (face-background 'default)) default-frame-alist)
|
|
|
|
(push (cons 'foreground-color (face-foreground 'default)) default-frame-alist))
|
2017-02-19 18:52:26 -05:00
|
|
|
|
2017-02-22 17:15:14 -05:00
|
|
|
(defun +doom|buffer-mode-on ()
|
2017-03-15 22:42:05 -04:00
|
|
|
"Enable `doom-buffer-mode' in buffers that are real (see
|
|
|
|
`doom-real-buffer-p')."
|
2017-02-22 04:29:04 -05:00
|
|
|
(when (and (not doom-buffer-mode)
|
2017-03-09 00:34:37 -05:00
|
|
|
(doom-real-buffer-p))
|
2017-02-19 18:52:26 -05:00
|
|
|
(doom-buffer-mode +1)))
|
2017-04-17 02:17:10 -04:00
|
|
|
(add-hook 'after-change-major-mode-hook #'+doom|buffer-mode-on)
|
2017-02-22 04:29:04 -05:00
|
|
|
|
2017-02-19 18:52:26 -05:00
|
|
|
(defun +doom|buffer-mode-off ()
|
2017-03-15 22:42:05 -04:00
|
|
|
"Disable `doom-buffer-mode' in popup buffers."
|
2017-02-24 20:01:50 -05:00
|
|
|
(when (and doom-buffer-mode
|
|
|
|
(not (get-buffer-window-list)))
|
|
|
|
(doom-buffer-mode -1)))
|
2017-04-17 02:17:10 -04:00
|
|
|
(add-hook 'doom-popup-mode-hook #'+doom|buffer-mode-off)
|
2017-02-19 18:52:26 -05:00
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(when (featurep! :feature workspaces)
|
2017-02-22 04:29:04 -05:00
|
|
|
(defun +doom|restore-bright-buffers (&rest _)
|
2017-02-19 18:52:26 -05:00
|
|
|
"Restore `doom-buffer-mode' in buffers when `persp-mode' loads a session."
|
2017-02-22 04:29:04 -05:00
|
|
|
(dolist (buf (persp-buffer-list))
|
2017-02-22 17:15:14 -05:00
|
|
|
(with-current-buffer buf
|
|
|
|
(+doom|buffer-mode-on))))
|
2017-04-17 02:17:10 -04:00
|
|
|
(add-hook '+workspaces-load-session-hook #'+doom|restore-bright-buffers))
|
2017-01-17 00:20:59 -05:00
|
|
|
|
2017-01-31 05:09:20 -05:00
|
|
|
;; Add file icons to doom-neotree
|
2017-05-06 13:40:15 +02:00
|
|
|
(doom-themes-neotree-config)
|
2017-01-31 05:09:20 -05:00
|
|
|
(setq doom-neotree-enable-variable-pitch t
|
|
|
|
doom-neotree-file-icons 'simple
|
|
|
|
doom-neotree-line-spacing 3)
|
|
|
|
|
|
|
|
;; Add line-highlighting to nlinum
|
2017-05-06 13:40:15 +02:00
|
|
|
(doom-themes-nlinum-config))
|
2017-01-31 05:09:20 -05:00
|
|
|
|
|
|
|
|
2017-03-15 22:00:03 -04:00
|
|
|
;; Flashes the line around the cursor after any motion command that might
|
|
|
|
;; reasonably send the cursor somewhere the eyes can't follow. Tremendously
|
|
|
|
;; helpful on a 30" 2560x1600 display.
|
|
|
|
(def-package! nav-flash
|
|
|
|
:commands nav-flash-show
|
|
|
|
:init
|
|
|
|
(defun doom/blink-cursor (&rest _)
|
|
|
|
"Blink line, to keep track of the cursor."
|
|
|
|
(interactive)
|
|
|
|
(nav-flash-show))
|
|
|
|
|
|
|
|
(add-hook! :append
|
2017-03-23 00:29:44 -04:00
|
|
|
'(imenu-after-jump-hook evil-jumps-post-jump-hook find-file-hook)
|
2017-03-15 22:00:03 -04:00
|
|
|
'doom/blink-cursor)
|
|
|
|
|
|
|
|
(after! evil
|
2017-04-17 02:17:10 -04:00
|
|
|
(advice-add #'evil-window-bottom :after #'doom/blink-cursor)
|
|
|
|
(advice-add #'evil-window-middle :after #'doom/blink-cursor)
|
|
|
|
(advice-add #'evil-window-top :after #'doom/blink-cursor)))
|
2017-02-09 04:22:08 -05:00
|
|
|
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(after! hideshow
|
2017-02-19 18:52:26 -05:00
|
|
|
;; Nicer code-folding overlays
|
2017-01-31 05:09:20 -05:00
|
|
|
(setq hs-set-up-overlay
|
|
|
|
(lambda (ov)
|
|
|
|
(when (eq 'code (overlay-get ov 'hs))
|
|
|
|
(overlay-put
|
2017-02-20 00:10:10 -05:00
|
|
|
ov 'display (propertize " [...] " 'face '+doom-folded-face))))))
|
2017-01-31 05:09:20 -05:00
|
|
|
|
2017-02-19 18:39:54 -05:00
|
|
|
|
|
|
|
;; subtle diff indicators in the fringe
|
2017-02-23 00:06:12 -05:00
|
|
|
(after! git-gutter-fringe
|
2017-02-19 18:39:54 -05:00
|
|
|
;; places the git gutter outside the margins.
|
|
|
|
(setq-default fringes-outside-margins t)
|
|
|
|
;; thin fringe bitmaps
|
|
|
|
(define-fringe-bitmap 'git-gutter-fr:added
|
|
|
|
[224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224]
|
|
|
|
nil nil 'center)
|
|
|
|
(define-fringe-bitmap 'git-gutter-fr:modified
|
|
|
|
[224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224]
|
|
|
|
nil nil 'center)
|
|
|
|
(define-fringe-bitmap 'git-gutter-fr:deleted
|
|
|
|
[0 0 0 0 0 0 0 0 0 0 0 0 0 128 192 224 240 248]
|
|
|
|
nil nil 'center))
|