Update modules/ui/doom

This commit is contained in:
Henrik Lissner 2017-02-19 18:52:26 -05:00
parent dc777e8d76
commit 8cdaa116ef
2 changed files with 30 additions and 12 deletions

View file

@ -1,13 +1,12 @@
;;; ui/doom/autoload.el ;;; ui/doom/autoload/evil.el
;;;###autoload (autoload '+doom:scratch-buffer "ui/doom/autoload" nil t) ;;;###autoload (autoload '+doom:scratch-buffer "ui/doom/autoload/evil" nil t)
(evil-define-operator +doom:scratch-buffer (&optional beg end bang) (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, "Send a region to and pop up the scratch buffer. If BANG, don't use a popup,
use the current window." use the current window."
:move-point nil :move-point nil :type inclusive
:type inclusive ;; TODO Test me
(interactive "<r><!>") (interactive "<r><!>")
;; TODO Ensure this works
(let ((text (when (and (evil-visual-state-p) beg end) (let ((text (when (and (evil-visual-state-p) beg end)
(buffer-substring beg end))) (buffer-substring beg end)))
(mode major-mode) (mode major-mode)

View file

@ -37,20 +37,36 @@
(window-divider-mode +1) (window-divider-mode +1)
;; Apply the doom-one theme from `doom-themes' for full compatibility; gives ;; doom-one: gives Emacs a look inspired by Dark One in Atom.
;; Emacs a look inspired by Dark One in Atom.
;; <https://github.com/hlissner/emacs-doom-theme> ;; <https://github.com/hlissner/emacs-doom-theme>
(@def-package doom-themes :demand t (@def-package doom-themes :demand t
:load-path "~/work/plugins/emacs-doom-theme" :load-path "~/work/plugins/emacs-doom-theme"
:config :config
(load-theme +doom-theme t) (load-theme +doom-theme t)
(nconc default-frame-alist
`((background-color . ,(face-background 'default))
(foreground-color . ,(face-foreground 'default))))
;; brighter source buffers ;; brighter source buffers
(defun +doom|buffer-mode-on ()
(unless (doom-popup-p)
(doom-buffer-mode +1)))
;; (add-hook 'find-file-hook '+doom|buffer-mode-on)
(add-hook 'find-file-hook 'doom-buffer-mode) (add-hook 'find-file-hook 'doom-buffer-mode)
;; Popup buffers should always be dimmed ;; Popup buffers should always be dimmed
(defun +doom|disable-buffer-mode () (defun +doom|buffer-mode-off ()
(when doom-buffer-mode (doom-buffer-mode -1))) (when doom-buffer-mode (doom-buffer-mode -1)))
(add-hook 'doom-popup-mode-hook '+doom|disable-buffer-mode) (add-hook 'doom-popup-mode-hook '+doom|buffer-mode-off)
(when (@featurep :feature workspaces)
(defun +doom|restore-bright-buffers (windows)
"Restore `doom-buffer-mode' in buffers when `persp-mode' loads a session."
(dolist (window windows)
(when (and (doom-real-buffer-p (window-buffer window))
(not (bound-and-true-p doom-buffer-mode)))
(doom-buffer-mode +1))))
(add-hook '+workspaces-load-session-hook '+doom|restore-bright-buffers))
;; Add file icons to doom-neotree ;; Add file icons to doom-neotree
(require 'doom-neotree) (require 'doom-neotree)
@ -65,7 +81,8 @@
;; Causes a flash around the cursor when it moves across a "large" distance. ;; 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 ;; 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. ;; where your cursor is, which I find helpful on my 30" 2560x1600 display.
(@def-package beacon :demand t (@def-package beacon
:after doom-themes
:config :config
(beacon-mode +1) (beacon-mode +1)
(setq beacon-color (let ((bg (face-attribute 'highlight :background nil t))) (setq beacon-color (let ((bg (face-attribute 'highlight :background nil t)))
@ -76,11 +93,13 @@
beacon-blink-when-point-moves-vertically 10)) beacon-blink-when-point-moves-vertically 10))
;; Nicer folded overlays that stand out a bit more
(@after hideshow (@after hideshow
(defface doom-folded-face '((t (:foreground "#555" :background "#888"))) ;; Nicer code-folding overlays
(defface doom-folded-face
'((t (:foreground "#555" :background "#888")))
"Face to hightlight `hideshow' overlays." "Face to hightlight `hideshow' overlays."
:group 'hideshow) :group 'hideshow)
(setq hs-set-up-overlay (setq hs-set-up-overlay
(lambda (ov) (lambda (ov)
(when (eq 'code (overlay-get ov 'hs)) (when (eq 'code (overlay-get ov 'hs))