diff --git a/modules/ui/doom/+dashboard.el b/modules/ui/doom/+dashboard.el deleted file mode 100644 index e69de29bb..000000000 diff --git a/modules/ui/doom/+modeline.el b/modules/ui/doom/+modeline.el deleted file mode 100644 index e69de29bb..000000000 diff --git a/modules/ui/doom/autoload.el b/modules/ui/doom/autoload.el new file mode 100644 index 000000000..bc7f3d752 --- /dev/null +++ b/modules/ui/doom/autoload.el @@ -0,0 +1,24 @@ +;;; autoload.el + +;;;###autoload (autoload '+doom:scratch-buffer "ui/doom/autoload" nil t) +(evil-define-operator +doom:scratch-buffer (&optional beg end bang) + "Send a region to and pop up the scratch buffer. If BANG, don't use a popup, +use the current window." + :move-point nil + :type inclusive + (interactive "") + ;; TODO Ensure this works + (let ((text (when (and (evil-visual-state-p) beg end) + (buffer-substring beg end))) + (mode major-mode) + (old-project (doom-project-root)) + (new-buf (get-buffer-create " *doom:scratch*"))) + (with-current-buffer new-buf + (setq default-directory old-project + mode-line-format (assq 'minimal doom-modeline-formats)) + (when (and (not (eq major-mode mode)) + (functionp mode)) + (funcall mode)) + (if text (insert text))) + (if bang (switch-to-buffer new-buf) (doom-popup-buffer new-buf)))) + diff --git a/modules/ui/doom/config.el b/modules/ui/doom/config.el index 2c5f6d93f..ae33489bd 100644 --- a/modules/ui/doom/config.el +++ b/modules/ui/doom/config.el @@ -1,26 +1,107 @@ +;;; (defvar +doom-theme 'doom-one "The color theme currently in use.") -(defvar +doom-dashboard t - "") +(defvar +doom-font + (font-spec :family "Fira Mono" :size 12) + "The font currently in use.") -(defvar +doom-modeline t "Whether or not to enable the modeline") +(defvar +doom-variable-pitch-font + (font-spec :family "Fira Sans" :size 12) + "The font currently in use.") -; (when +doom-dashboard (load! +dashboard)) -; (when +doom-modeline (load! +modeline)) +(defvar +doom-unicode-font + (font-spec :family "DejaVu Sans Mono" :size 12) + "Fallback font for unicode glyphs.") -;; +;;; 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)))) + + +;;; TODO/FIXME/NOTE highlighting in comments +(add-hook! (prog-mode emacs-lisp-mode css-mode) + (font-lock-add-keywords + nil '(("\\<\\(TODO\\(?:(.*)\\)?:?\\)\\>" 1 'warning prepend) + ("\\<\\(FIXME\\(?:(.*)\\)?:?\\)\\>" 1 'error prepend) + ("\\<\\(NOTE\\(?:(.*)\\)?:?\\)\\>" 1 'success prepend)))) + + +;;; More reliable inter-window border +;; The native border "consumes" a pixel of the fringe on righter-most splits (in +;; Yamamoto's emacs-mac at least), `window-divider' does not. Available since +;; Emacs 25.1. +(setq window-divider-default-places t + window-divider-default-bottom-width 0 + window-divider-default-right-width 1) +(window-divider-mode +1) + + +;; Apply the doom-one theme from `doom-themes' for full compatibility; gives +;; Emacs a look inspired by Dark One in Atom. +;; (after! doom-themes - (setq doom-neotree-enable-variable-pitch t - doom-neotree-file-icons 'simple - doom-neotree-line-spacing 3) - (load-theme +doom-theme t) ;; brighter source buffers (add-hook 'find-file-hook 'doom-buffer-mode) - ;; neotree + nlinum integration + ;; Add file icons to doom-neotree (require 'doom-neotree) + (setq doom-neotree-enable-variable-pitch t + doom-neotree-file-icons 'simple + doom-neotree-line-spacing 3) + + ;; Add line-highlighting to nlinum (require 'doom-nlinum)) + + +;; Causes a flash around the cursor when it moves across a "large" distance. +;; Usually between windows, or across files. This makes it easier to keep track +;; where your cursor is, which I find helpful on my 30" 2560x1600 display. +(after! beacon + (beacon-mode +1) + (setq beacon-color (let ((bg (face-attribute 'highlight :background nil t))) + (if (eq bg 'unspecified) + (face-attribute 'highlight :foreground nil t) + bg)) + beacon-blink-when-buffer-changes t + beacon-blink-when-point-moves-vertically 10)) + + +;; Make code folding overlays look a little nicer +(after! hideshow ; built-in + (defface doom-folded-face '((t (:background "#888"))) + "Face to hightlight `hideshow' overlays." + :group 'hideshow) + + (setq hs-set-up-overlay + (lambda (ov) + (when (eq 'code (overlay-get ov 'hs)) + (overlay-put + ov 'display (propertize " [...] " 'face 'doom-folded-face)))))) + + +;; Show diffs with subtle lines in the fringe +(after! git-gutter-fringe + ;; 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)) diff --git a/modules/ui/doom/packages.el b/modules/ui/doom/packages.el index b225180b5..ab96ab838 100644 --- a/modules/ui/doom/packages.el +++ b/modules/ui/doom/packages.el @@ -1,7 +1,8 @@ ;;; ui/doom/packages.el +(package! beacon :demand t) + (package! doom-themes :ensure nil :demand t :load-path "~/work/plugins/emacs-doom-theme") -