Econf Theme

Table of Contents

Introduction

This is how I define my theme in Emacs. It's probably not the best way to go about it, but it's how I have it set up.

Dependencies

Dependency Description
doom-themes A thing that dynamically assigns links key sequences that you can jump to.
(ec-load-deps deps)

Variables

;; Compiler pacifier
(defvar modeline-bg)

;; These are the font sizes used for titles and other things
(defvar ec-font-scale-level-1 1.5)
(defvar ec-font-scale-level-2 1.3)
(defvar ec-font-scale-level-3 1.2
  "The smallest level of text.")

(defvar ec-font-scale-title   1.8
  "Titles in my files are this size")


(defvar ec-heading-font "Jura"
  "The font for titles.")

(defvar ec-title-font "Jura Bold Italic"
  "The font for titles.")

(defface ec-title
  nil
  "Basic face for titles."
  :group 'ec-faces)

(defface ec-headline
  nil
  "Basic face for headlines."
  :group 'ec-faces)

(defgroup econf-theme nil
  "Options for the `doom-econf' theme."
  :group 'doom-themes)

Doom Theme

(def-doom-theme econf
  "A modern, consistent, light theme for my emacs config."
  ;; name        default   256       16
  (

Common Colors

(bg         '("#fff" "#282a36" nil)) ;; this is the background for the hl-line, modeline, and minibuffer
(bg-alt     '("#f5f5f5" "#f5f5f5" nil)) ;; this is the background for the line you arent currently on
(base0      '("#fff" "#fff" "black"))
(base1      '("#f5f5f5" "#f5f5f5" "brightwhite"))
(base2      '("#eee" "#eee" "brightwhite"))
(base3      '("#bbb" "#bbb" "white"))
(base4      '("#a4a4a4" "#a4a4a4" "white"))
(base5      '("#a4a4a4" "#a4a4a4" "brightblack"))
(base6      '("#494949" "#494949" "brightblack"))
(base7      '("#212121" "#212121" "black"))
(base8      '("#ff5c57" "#ff5c57" "black"))
(fg         '("#000" "#000" "black"))
(fg-alt     '("#d1d1d1" "#d1d1d1" "brightblack"))

(ui0 '("#848688" "#848688" "grey"))
(ui1 '("#606580" "#606580" "grey"))
(ui2 '("#3a3d4d" "#3a3d4d" "grey"))
(ui3 '("#1c1e27" "#1c1e27" "black"))

(grey       ui0)
(red        '("#E53935" "#E53935" "red"          ))
(dark-red   '("#ab000d" "#ab000d" "darkred"      ))
(green      '("#388e3c" "#388e3c" "brightred"    ))
(yellow     '("#f57f17" "#f57f17" "green"        ))
(blue       '("#1976D2" "#1976D2" "brightgreen"  ))
(dark-blue  '("#004a9f" "#004a9f" "yellow"       ))
(magenta    '("#7c1fa3" "#7c1fa3" "brightblue"   ))
(cyan       '("#0097A7" "#0097A7" "blue"         ))
(violet     '("#512DA8" "#512DA8" "magenta"      ))
(orange     '("#E64A19" "#E64A19" "brightmagenta"))
(teal       '("#00796B" "#00796B" "brightcyan"   ))
(dark-cyan  '("#006876" "#006876" "cyan"         ))

Face Categories

(default fg-alt)
;; face categories -- required for all themes
(highlight      red) ;; when searching with (/) ?
(vertical-bar   (doom-darken base1 0.1)) ; the bar that separates modeline and minibuffer?
(selection      red) ; for like company autocomplete and stuff
(builtin        red)    ; saw this in company autocomplete if i moved my mouse
;; over it
(comments       base4) ;; comments
(doc-comments   base5) ;; easy to test with elisp
;; documentation or git commit
;; first line thing

(functions      fg)
(methods        fg) ;; wtf is the difference between this and function?
(operators      fg)

;; make constants and keywords look better
(constants      fg)
(keywords       red)
(type           red)

(strings        base6)
(variables      fg)
(numbers        red)
(region         red)
(error          red)
(warning        orange)
(success        green)
(vc-modified    orange)
(vc-added       green)
(cursor         fg)
(vc-deleted     red)

Basic Faces

)(

Here I set the basic faces for the configuration. Stuff like the initial

(default :family "Iosevka Term"
  :slant 'normal
  :weight 'normal
  :height 120
  :width 'normal)
(fixed-pitch :family "Iosevka Term"
             :slant 'normal
             :weight 'normal
             :height 120
             :width 'normal)


(variable-pitch :family "Iosevka Aile"
                :slant 'normal
                :weight 'normal
                :height 120
                :width 'normal)

Code Style

Here I set the various faces for programming languages and italicize comments. As you can see I use a mixture of bold and italic faces in order to do this as it makes the faces distinctive without making it so that I have to go outside my limited color palette for this theme.

;; Code style improvements.
(font-lock-keyword-face :foreground red :slant 'italic)
(font-lock-function-name-face :weight 'bold :slant 'italic )

(font-lock-constant-face :foreground red)
(font-lock-builtin-face :foreground red)
(font-lock-variable-name-face :slant 'italic)

;; italic comments
(font-lock-comment-face :slant 'italic :foreground comments)

Interface-y Stuff

Here I set faces for the stuff that is used in interface like stuff rather than code or a file like thing. So docs, dired, and so on.

   ;;;; Highlighted line
(hl-line :foreground bg :background red :extend t)

 ;;;; Line Numbers
(line-number :foreground comments)
(line-number-current-line :foreground bg :background comments)

   ;;;; Ivy
(ivy-prompt-match :foreground bg :background red :extend t)
(ivy-current-match :foreground bg :background red :extend t)

   ;;;; rainbow delimiters
(rainbow-delimiters-depth-1-face :foreground base6)
(rainbow-delimiters-depth-2-face :foreground base3)


   ;;;; Modeline
(mode-line :background base2)
(mode-line-inactive :background bg-alt :foreground comments)
(tooltip :background bg-alt :foreground fg)

;; Regions of highlighted text.
(region :foreground bg :background red)


   ;;;; Woman / Man
(woman-italic :foreground fg :background bg :slant 'italic)
(Man-underline :foreground fg :background bg :slant 'italic)

   ;;;; isearch
(lazy-highlight :foreground bg :background dark-red)
(isearch :foreground bg :background red :weight 'bold)
(pdf-isearch-lazy :foreground bg :background dark-red)
(pdf-isearch-match :foreground bg :background red :weight 'bold)

   ;;;; dired
((diredfl-dir-name &override) :foreground red)
((diredfl-dir-heading &override) :foreground red :weight 'bold)
((diredfl-date-time &override) :foreground fg)
((diredfl-number &override) :foreground fg)


   ;;;; vterm
(vterm-color-black :foreground fg :background bg)


   ;;;; doom-modeline
(doom-modeline-bar :background highlight)

   ;;;; ivy posframe
(ivy-posframe :background bg-alt)
(ivy-posframe-border :background base2 :foreground base2)

;;;; Hydra posframe
(hydra-posframe-face :background bg-alt)
(hydra-posframe-border-face :background base2 :foreground base2)

   ;;;; Avy faces
(avy-lead-face   :background bg :foreground red)
(avy-lead-face-0 :background bg :foreground red)
(avy-lead-face-2 :background bg :foreground red)


   ;;;; Ace Window
(aw-leading-char-face
 :foreground red
 :weight 'bold
 :undelrine t
 :font ec-title-font
 :height 300)
(aw-minibuffer-leading-char-face
 :foreground red
 :weight 'bold
 :undelrine t
 :font ec-title-font)

   ;;;; custom button
(custom-button :foreground red)


   ;;;; Solaire
(solaire-default-face :foreground fg :background bg)
(solaire-mode-line-face :foreground fg :background base2)
(solaire-mode-line-inactive-face :foreground comments :background fg-alt )
(solaire-hl-line-face :foreground bg :background red :extend t)


   ;;; window divider
(vertical-border :foreground base2
                 :background base2)


   ;;;; Links
(link-visited :foreground dark-red)

EMMS

These

(emms-playlist-track-face :foreground red)
(emms-playlist-selected-face :foreground bg :background red :extend t)

;; (emms-browser-year/genere-face)
;; (emms-brwoser-artist-face :foreground fg)

Documentation Lookups

I set the documentation lookup function faces so the interfaces for them are more consistent

    ;;;; Helpful
(helpful-heading :foreground red
                 :font ec-heading-font
                 :weight 'bold
                 :height ec-font-scale-level-1)


   ;;;; Info Mode
   (info-title-1 :background red
                 :foreground bg
                 :slant 'italic
                 :weight 'bold
                 :extend t
                 :font ec-title-font
                 :height ec-font-scale-title)
   (info-title-2 :foreground red
                 :font ec-heading-font
                 :weight 'bold
                 :height ec-font-scale-level-1)
   (info-title-3 :foreground red
                 :font ec-heading-font
                 :weight 'bold
                 :height ec-font-scale-level-2)
   (info-title-4 :foreground red
                 :font ec-heading-font
                 :weight 'bold
                 :height ec-font-scale-level-3)
   (info-quoted :background bg-alt)

Elfeed Related

;;;; Message headers for emails and the like
(message-header-subject  :background red
                         :foreground bg
                         :slant 'italic
                         :weight 'bold
                         :extend t
                         :font ec-title-font
                         :height ec-font-scale-title)
(message-header-name :foreground comments :inherit 'fixed-pitch)
(message-header-other :foreground fg)

   ;;;; Elfeed
(elfeed-search-feed-face :foreground red)
(elfeed-search-date-face :foreground comments)
(elfeed-search-filter-face :foreground red :slant 'italic)

w3m

   ;;;; w3m
   (w3m-error :foreground red :weight 'bold)
   (w3m-image :foreground red :underline t :weight 'bold)


   ;; form buttons
   (w3m-form-button :foreground red
                    :background bg
                    :box '(:line-width 1 :style none))
   (w3m-form-button-mouse :foreground bg-alt
                          :background red
                          :box '(:line-width 1 :style none))
   (w3m-form-button-pressed :foreground bg-alt
                            :background red
                            :box '(:line-width 1 :style none))

   ;; Text entries
   (w3m-form :foreground red)

   ;; header line
   (w3m-header-line-title :foreground red
                          :background bg-alt
                          :weight 'bold)

   (w3m-header-line-background :background bg-alt)
   (w3m-header-line-content :background bg-alt :foreground fg)
   
   ;; anchors
   (w3m-anchor :inherit 'link)
   (w3m-current-anchor :foreground red)
   ((w3m-arrived-anchor &override) :foreground dark-red :inherit 'link)
   ((w3m-image-anchor &override) :inherit 'link)

Outline Settings

Here I just set the outline fonts to be the same. I don't set their scale because outline-mode is used to display the table of contents for PDFs among other things, which becomes inconvenient if they have different scales.

;;;; Outlines
(outline-1 :foreground red
           :font ec-heading-font
           :weight 'bold)
(outline-2 :foreground red
           :font ec-heading-font
           :weight 'bold)
(outline-3 :foreground red
           :font ec-heading-font
           :weight 'bold)
(outline-3 :foreground red
           :font ec-heading-font
           :weight 'bold)
(outline-4 :foreground red
           :font ec-heading-font
           :weight 'bold)
(outline-5 :foreground red
           :font ec-heading-font
           :weight 'bold)
(outline-6 :foreground red
           :font ec-heading-font
           :weight 'bold)
(outline-7 :foreground red
           :font ec-heading-font
           :weight 'bold)
(outline-8 :foreground red
           :font ec-heading-font
           :weight 'bold)

Markdown Mode

A few settings to make markdown-mode like the org-mode theme which is below.

   ;;;; Markdown Mode
(markdown-header-face-1 :background red
                        :foreground bg
                        :slant 'italic
                        :weight 'bold
                        :extend t
                        :font ec-title-font
                        :height ec-font-scale-title)
(markdown-header-face-2 :foreground red
                        :font ec-heading-font
                        :weight 'bold
                        :height ec-font-scale-level-1)
(markdown-header-face-3 :foreground red
                        :font ec-heading-font
                        :weight 'bold
                        :height ec-font-scale-level-2)
(markdown-header-face-4 :foreground red
                        :font ec-heading-font
                        :weight 'bold
                        :height ec-font-scale-level-3)
(markdown-header-face-5 :foreground red
                        :font ec-heading-font
                        :weight 'bold
                        :height 1)
(markdown-code-face :background bg-alt :foreground fg :extend t)
(markdown-inline-code-face :background bg-alt :foreground fg)
(markdown-link-face :inherit 'link)

Org-mode

Now for the monster of a theme, basically all my settings for org-mode collated into a single section. Note that it includes other packages like org-noter as well as regular org-mode settings.

;;;; Org Transclusion
(org-transclusion-fringe :foreground red)

(org-transclusion-source-fringe :foreground green)
;;;; Org Noter
(org-noter-notes-exist-face :foreground green)
(org-noter-no-notes-exist-face :foreground dark-red)
;;;; org <built-in>
;; org code blocks
(org-block-begin-line :inherit 'fixed-pitch
                      :background bg-alt
                      :foreground comments
                      :extend t)

(org-block-end-line :inherit 'fixed-pitch
                    :background bg-alt
                    :foreground comments
                    :extend t)

(org-block :inherit 'fixed-pitch
           :background bg-alt
           :extend t)

(org-table :inherit 'fixed-pitch
           :background bg-alt
           :foreground fg)

(org-code :inherit 'fixed-pitch
          :background bg-alt
          :foreground fg)

;; org titles
(org-document-title :background red
                    :foreground bg
                    :slant 'italic
                    :weight 'bold
                    :extend t
                    :font ec-title-font
                    :height ec-font-scale-title)
(org-document-info :foreground red
                   :font ec-heading-font
                   :weight 'bold)

;; org headings
(org-level-1 :foreground red
             :font ec-heading-font
             :weight 'bold
             :height ec-font-scale-level-1)
(org-level-2 :foreground red
             :font ec-heading-font
             :weight 'bold
             :height ec-font-scale-level-2)
(org-level-3 :foreground red
             :font ec-heading-font
             :weight 'bold
             :height ec-font-scale-level-3)
(org-level-4 :foreground red
             :font ec-heading-font
             :weight 'bold)
(org-level-5 :foreground red
             :font ec-heading-font
             :weight 'bold)
(org-level-6 :foreground red
             :font ec-heading-font
             :weight 'bold)
(org-level-7 :foreground red
             :font ec-heading-font
             :weight 'bold)
(org-level-8 :foreground red
             :font ec-heading-font
             :weight 'bold)
;; footnotes
(org-footnote :foreground comments :slant 'italic)

;; org comment-like stuff
(org-document-info-keyword :foreground comments
                           :inherit 'fixed-pitch)
(org-meta-line :foreground comments
               :inherit 'fixed-pitch)

;; tags and keywords
(org-special-keyword :foreground comments
                     :inherit 'fixed-pitch)
(org-tag :foreground comments
         :inherit 'fixed-pitch)

;; Quotes and Examples
(org-quote :background bg-alt
           :slant 'italic
           :extend t)

;; Clock stuff
(org-mode-clock-overrun :foreground bg
                        :background red)

;; Drawers
(org-drawer :foreground comments :inherit 'fixed-pitch)
(org-property-value :foreground comments :inherit 'fixed-pitch)
))

Last Modified: 2022-W05-1 22:07

Generated Using: Emacs 27.2 (Org mode 9.4.6)

Except where otherwise noted content on cons.dev is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.