Update ui modules for v2
This commit is contained in:
parent
d4b0216154
commit
a2a0ab4ed7
5 changed files with 75 additions and 57 deletions
|
@ -1,4 +1,4 @@
|
||||||
;;; config.el --- make mode-lines sexy again
|
;;; ui/doom-modeline/config.el
|
||||||
|
|
||||||
;; all-the-icons doesn't work in the terminal, so we "disable" it.
|
;; all-the-icons doesn't work in the terminal, so we "disable" it.
|
||||||
(unless (display-graphic-p)
|
(unless (display-graphic-p)
|
||||||
|
@ -8,11 +8,29 @@
|
||||||
(defun all-the-icons-wicon (&rest _) "" "")
|
(defun all-the-icons-wicon (&rest _) "" "")
|
||||||
(defun all-the-icons-alltheicon (&rest _) "" ""))
|
(defun all-the-icons-alltheicon (&rest _) "" ""))
|
||||||
|
|
||||||
(after! eldoc-eval
|
(use-package powerline :demand t)
|
||||||
|
|
||||||
|
(use-package all-the-icons :demand t
|
||||||
|
:when (display-graphic-p))
|
||||||
|
|
||||||
|
(use-package eldoc-eval :demand t
|
||||||
|
:config
|
||||||
;; Show eldoc in the mode-line with `eval-expression'
|
;; Show eldoc in the mode-line with `eval-expression'
|
||||||
(setq eldoc-in-minibuffer-show-fn '+doom-modeline--show-eldoc)
|
(setq eldoc-in-minibuffer-show-fn '+doom-modeline--show-eldoc)
|
||||||
(eldoc-in-minibuffer-mode +1))
|
(eldoc-in-minibuffer-mode +1))
|
||||||
|
|
||||||
|
;; anzu and evil-anzu make it possible to display current/total in the
|
||||||
|
;; mode-line.
|
||||||
|
(use-package! evil-anzu
|
||||||
|
:init
|
||||||
|
(defun +evil*lazy-load-evil-anzu (&rest _) (require 'evil-anzu))
|
||||||
|
(advice-add 'evil-ex-start-setup :before '+evil*lazy-load-evil-anzu)
|
||||||
|
:config
|
||||||
|
(advice-remove 'evil-ex-start-setup '+evil*lazy-load-evil-anzu)
|
||||||
|
(setq anzu-cons-mode-line-p nil
|
||||||
|
anzu-minimum-input-length 1
|
||||||
|
anzu-search-threshold 250))
|
||||||
|
|
||||||
|
|
||||||
;;; Flash the mode-line on error
|
;;; Flash the mode-line on error
|
||||||
;; TODO More flexible colors (only suits dark themes)
|
;; TODO More flexible colors (only suits dark themes)
|
||||||
|
@ -116,14 +134,6 @@ active.")
|
||||||
;; Bootstrap
|
;; Bootstrap
|
||||||
;;
|
;;
|
||||||
|
|
||||||
;; all-the-icons doesn't work in the terminal, so we "disable" it.
|
|
||||||
(unless (display-graphic-p)
|
|
||||||
(defun all-the-icons-octicon (&rest _) "" "")
|
|
||||||
(defun all-the-icons-faicon (&rest _) "" "")
|
|
||||||
(defun all-the-icons-fileicon (&rest _) "" "")
|
|
||||||
(defun all-the-icons-wicon (&rest _) "" "")
|
|
||||||
(defun all-the-icons-alltheicon (&rest _) "" ""))
|
|
||||||
|
|
||||||
;; Show version string for multi-version managers like rvm, rbenv, pyenv, etc.
|
;; Show version string for multi-version managers like rvm, rbenv, pyenv, etc.
|
||||||
(defvar-local +doom-modeline-env-version nil)
|
(defvar-local +doom-modeline-env-version nil)
|
||||||
(defvar-local +doom-modeline-env-command nil)
|
(defvar-local +doom-modeline-env-command nil)
|
||||||
|
@ -178,7 +188,7 @@ active.")
|
||||||
(let ((data nil)
|
(let ((data nil)
|
||||||
(i 0))
|
(i 0))
|
||||||
(setq data (make-list height (make-list width 1)))
|
(setq data (make-list height (make-list width 1)))
|
||||||
(pl/make-xpm "percent" color color (reverse data))))))
|
(pl/make-xpm "percent" color color data)))))
|
||||||
;; Definitely not premature optimization, I-I swear!
|
;; Definitely not premature optimization, I-I swear!
|
||||||
(pl/memoize '+doom-modeline--make-xpm)
|
(pl/memoize '+doom-modeline--make-xpm)
|
||||||
|
|
||||||
|
@ -433,7 +443,9 @@ lines are selected, or the NxM dimensions of a block selection."
|
||||||
(make-variable-buffer-local 'anzu--state)
|
(make-variable-buffer-local 'anzu--state)
|
||||||
(defun *anzu ()
|
(defun *anzu ()
|
||||||
"Show the match index and total number thereof. Requires `evil-anzu'."
|
"Show the match index and total number thereof. Requires `evil-anzu'."
|
||||||
(when (and (featurep 'evil-anzu) (evil-ex-hl-active-p 'evil-ex-search))
|
(when (or (featurep 'anzu)
|
||||||
|
(and (featurep 'evil-ex-hl-active-p)
|
||||||
|
(evil-ex-hl-active-p 'evil-ex-search)))
|
||||||
(propertize
|
(propertize
|
||||||
(format " %s/%d%s "
|
(format " %s/%d%s "
|
||||||
anzu--current-position anzu--total-matched
|
anzu--current-position anzu--total-matched
|
||||||
|
@ -475,6 +487,7 @@ lines are selected, or the NxM dimensions of a block selection."
|
||||||
'face (if (active) 'doom-modeline-panel))))
|
'face (if (active) 'doom-modeline-panel))))
|
||||||
|
|
||||||
(defun *media-info ()
|
(defun *media-info ()
|
||||||
|
"TODO"
|
||||||
(cond ((eq major-mode 'image-mode)
|
(cond ((eq major-mode 'image-mode)
|
||||||
(let ((size (image-size (image-get-display-property) :pixels)))
|
(let ((size (image-size (image-get-display-property) :pixels)))
|
||||||
(format " %dx%d " (car size) (cdr size))))))
|
(format " %dx%d " (car size) (cdr size))))))
|
||||||
|
@ -486,9 +499,9 @@ lines are selected, or the NxM dimensions of a block selection."
|
||||||
|
|
||||||
(+doom-modeline-define 'main
|
(+doom-modeline-define 'main
|
||||||
`(:eval
|
`(:eval
|
||||||
(let* ((meta (concat (*macro-recording)
|
(let* ((meta (concat ,(if (featurep 'evil) '(*macro-recording))
|
||||||
(*anzu)
|
(*anzu)
|
||||||
(*evil-substitute)
|
,(if (featurep 'evil) '(*evil-substitute))
|
||||||
(*iedit)))
|
(*iedit)))
|
||||||
(lhs (list (+doom-modeline--make-xpm (face-background (if (active)
|
(lhs (list (+doom-modeline--make-xpm (face-background (if (active)
|
||||||
'doom-modeline-bar
|
'doom-modeline-bar
|
||||||
|
@ -499,7 +512,7 @@ lines are selected, or the NxM dimensions of a block selection."
|
||||||
" "
|
" "
|
||||||
(*buffer-info)
|
(*buffer-info)
|
||||||
" %l:%c %p "
|
" %l:%c %p "
|
||||||
(*selection-info)))
|
,(if (featurep 'evil) '(*selection-info))))
|
||||||
(rhs (list (*buffer-encoding)
|
(rhs (list (*buffer-encoding)
|
||||||
(*vc)
|
(*vc)
|
||||||
(*major-mode)
|
(*major-mode)
|
||||||
|
@ -519,6 +532,22 @@ lines are selected, or the NxM dimensions of a block selection."
|
||||||
(propertize " " 'display `((space :align-to (1- (+ right right-fringe right-margin))))))))
|
(propertize " " 'display `((space :align-to (1- (+ right right-fringe right-margin))))))))
|
||||||
|
|
||||||
(+doom-modeline-define 'minimal
|
(+doom-modeline-define 'minimal
|
||||||
|
`(:eval
|
||||||
|
(let* ((lhs (list (+doom-modeline--make-xpm (face-background (if (active)
|
||||||
|
'doom-modeline-bar
|
||||||
|
'doom-modeline-inactive-bar))
|
||||||
|
doom-modeline-height
|
||||||
|
doom-modeline-bar-width)
|
||||||
|
" "
|
||||||
|
(*buffer-info)))
|
||||||
|
(rhs (list (*media-info)
|
||||||
|
(*major-mode)))
|
||||||
|
(mid (propertize
|
||||||
|
" " 'display `((space :align-to (- (+ right right-fringe right-margin)
|
||||||
|
,(+ 1 (string-width (format-mode-line rhs)))))))))
|
||||||
|
(list lhs mid rhs))))
|
||||||
|
|
||||||
|
(+doom-modeline-define 'project
|
||||||
`(:eval
|
`(:eval
|
||||||
(let* ((lhs (list (+doom-modeline--make-xpm (face-background (if (active)
|
(let* ((lhs (list (+doom-modeline--make-xpm (face-background (if (active)
|
||||||
'doom-modeline-bar
|
'doom-modeline-bar
|
||||||
|
|
|
@ -16,9 +16,8 @@
|
||||||
;;(require 'iedit)
|
;;(require 'iedit)
|
||||||
;;(require 'evil-multiedit)
|
;;(require 'evil-multiedit)
|
||||||
|
|
||||||
(package! powerline :demand t)
|
(package! all-the-icons)
|
||||||
|
(package! eldoc-eval)
|
||||||
(package! all-the-icons :when (display-graphic-p) :demand t)
|
(package! evil-anzu :when (featurep 'evil))
|
||||||
|
(package! powerline)
|
||||||
(package! eldoc-eval :demand t)
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
;;; autoload.el
|
;;; ui/doom/autoload.el
|
||||||
|
|
||||||
;;;###autoload (autoload '+doom:scratch-buffer "ui/doom/autoload" nil t)
|
;;;###autoload (autoload '+doom:scratch-buffer "ui/doom/autoload" nil t)
|
||||||
(evil-define-operator +doom:scratch-buffer (&optional beg end bang)
|
(evil-define-operator +doom:scratch-buffer (&optional beg end bang)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
;;;
|
;;; ui/doom/config.el
|
||||||
|
|
||||||
(defvar +doom-theme 'doom-one
|
(defvar +doom-theme 'doom-one
|
||||||
"The color theme currently in use.")
|
"The color theme currently in use.")
|
||||||
|
@ -15,6 +15,7 @@
|
||||||
(font-spec :family "DejaVu Sans Mono" :size 12)
|
(font-spec :family "DejaVu Sans Mono" :size 12)
|
||||||
"Fallback font for unicode glyphs.")
|
"Fallback font for unicode glyphs.")
|
||||||
|
|
||||||
|
|
||||||
;;; Set fonts
|
;;; Set fonts
|
||||||
(when (display-graphic-p)
|
(when (display-graphic-p)
|
||||||
(with-demoted-errors "FONT ERROR: %s"
|
(with-demoted-errors "FONT ERROR: %s"
|
||||||
|
@ -27,28 +28,35 @@
|
||||||
(set-face-attribute 'variable-pitch nil :font +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
|
;;; More reliable inter-window border
|
||||||
;; The native border "consumes" a pixel of the fringe on righter-most splits (in
|
;; The native border "consumes" a pixel of the fringe on righter-most splits,
|
||||||
;; Yamamoto's emacs-mac at least), `window-divider' does not. Available since
|
;; `window-divider' does not. Available since Emacs 25.1.
|
||||||
;; Emacs 25.1.
|
|
||||||
(setq window-divider-default-places t
|
(setq window-divider-default-places t
|
||||||
window-divider-default-bottom-width 0
|
window-divider-default-bottom-width 0
|
||||||
window-divider-default-right-width 1)
|
window-divider-default-right-width 1)
|
||||||
(window-divider-mode +1)
|
(window-divider-mode +1)
|
||||||
|
|
||||||
|
|
||||||
|
;; 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.
|
||||||
|
(use-package! beacon :demand t
|
||||||
|
:config
|
||||||
|
(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))
|
||||||
|
|
||||||
|
|
||||||
;; Apply the doom-one theme from `doom-themes' for full compatibility; gives
|
;; Apply the doom-one theme from `doom-themes' for full compatibility; 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>
|
||||||
(after! doom-themes
|
(use-package! doom-themes :demand t
|
||||||
|
:load-path "~/work/plugins/emacs-doom-theme"
|
||||||
|
:config
|
||||||
(load-theme +doom-theme t)
|
(load-theme +doom-theme t)
|
||||||
|
|
||||||
;; brighter source buffers
|
;; brighter source buffers
|
||||||
|
@ -64,25 +72,11 @@
|
||||||
(require 'doom-nlinum))
|
(require 'doom-nlinum))
|
||||||
|
|
||||||
|
|
||||||
;; Causes a flash around the cursor when it moves across a "large" distance.
|
;; Nicer folded overlays that stand out a bit more
|
||||||
;; Usually between windows, or across files. This makes it easier to keep track
|
(after! hideshow
|
||||||
;; where your cursor is, which I find helpful on my 30" 2560x1600 display.
|
(defface doom-folded-face '((t (:foreground "#555" :background "#888")))
|
||||||
(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."
|
"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))
|
||||||
|
@ -94,7 +88,6 @@
|
||||||
(after! git-gutter-fringe
|
(after! git-gutter-fringe
|
||||||
;; places the git gutter outside the margins.
|
;; places the git gutter outside the margins.
|
||||||
(setq-default fringes-outside-margins t)
|
(setq-default fringes-outside-margins t)
|
||||||
|
|
||||||
;; thin fringe bitmaps
|
;; thin fringe bitmaps
|
||||||
(define-fringe-bitmap 'git-gutter-fr:added
|
(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]
|
[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]
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; ui/doom/packages.el
|
;;; ui/doom/packages.el
|
||||||
|
|
||||||
(package! beacon :demand t)
|
(package! beacon)
|
||||||
|
(package! doom-themes)
|
||||||
|
|
||||||
(package! doom-themes
|
|
||||||
:ensure nil
|
|
||||||
:demand t
|
|
||||||
:load-path "~/work/plugins/emacs-doom-theme")
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue