Atom was developed by GitHub as a text editor. Facebook then developed the Nuclide and Atom IDE projects to turn Atom into an integrated development environment, but development stopped in December 2018
It's got nothing on emacs.
Having said that, emacs is the product of decades of open source contributions (see video below) - and that means more than one way to do things. In the case of themes, there are two primary methodologies.
1. Use the customize-themes framework, accessible through the menu bar -> 'options' -> 'customize emacs' -> 'custom-themes'.
2. A custom configuration file.
The first option records theme settings you make through the menu bar customization framework, or M-x 'customize...', in a file called 'custom.el,' then loads that file on start-up.
To use the second option, you get simplicity and clarity about what is where, but you need to do just a little more work.
Start by disabling the customization storage by renaming 'custom.el.' Then never load the new file. This way any changes you do make through the customization framework won't be used.
(setq custom-file "~/.emacs.d/garbage.el")
;keep it simple: don't use or load the custom file
;(load custom-file)
Now your theme configurations will be loaded as needed every time you start up.
You can set up functions to change themes on the fly; however, you will want to ensure any custom faces you changed are overwritten.
That takes a little extra care.
Given my schedule, I haven't done exactly a perfect job with the themes, but it works for me.
Feel free to make any improvements, and if you do, pay me an e-visit with your results.
I'd really appreciate that.
Theme Setup
My theming method packs theme changes, like face customization, into functions that are called when I select a new theme from a hydra. The code below adds some custom faces architecture.
;loaded elsewhere, or no longer required
;(require 'font-lock)
;(add-to-list 'load-path font-lock+-p)
;(require 'font-lock+);copy/paste to path
; change face of filetypes (.org)
(use-package dired-filetype-face
:init
(require 'dired-filetype-face)
:config
;define a new face
;(deffiletype-face "mytype" "#02478e")
(deffiletype-face "mytype" "#02478e")
;(deffiletype-face "mytype" "#008080")
;attach new face name to filetype
(deffiletype-face-regexp mytype
:extensions '("org") :type-for-docstring "my type")
;attach with regexp to match permissions, filetype size, and date
;(deffiletype-face-regexp mytype
;:regexp "^ -.*\\.\\(foo\\|bar\\)$" :type-for-docstring "my type")
; attach new face to filetype
(deffiletype-setup "mytype" "mytype")
);end dired-filetype-face
Theme Setup Company
It's a challenge with 'company completion' to style the drop-down box backgrounds and fonts. I hope you're up to it.
One trick is to use 'company-box' package and swap out 'company-box-frame-parameters' colors every time you change themes.
I made a function for that, called 'initialize-company-frame-parameters'
Every time I change a theme, my theme changing function sets new colour variables and swaps out the old colour variables.
frame parameters are stored in a linked list, so swapping them requires a little delicacy.
I use a function called 'replace-element-in-list' to cycle the colours list (moves last element to first element)
This time works but is admittedly hacky, if you swap out a colour with the same colour it goes into an infinite loop and you have to kill emacs. So don't do that, each theme function swaps new colours into company-box-frame-parameters.
Updated. Use a condition before replacing company-box-frame-parameters, which is what you find in the code.
(and (not (equal pbg-color pbg-swap)) (not (equal pfg-color pfg-swap))
(progn
(replace-element-in-list pbg-color pbg-swap company-box-frame-parameters)
(replace-element-in-list pfg-color pfg-swap company-box-frame-parameters)
));end check frame swap loop
;use this to set then change company frame parameters
(defun replace-element-in-list (old new xs)
(let ((tail (member old xs)))
(while tail
(setcar tail new)
(setq tail (member old tail))))
xs)
;set initial color variables for frame parameter swap, careful because replace-element-in-list lousy, pgb-colors cannoter equal pgb-swap
;or it will infinitely replace itself
(setq pbg-color '(background-color . "#ffff99"))
(setq pfg-color '(foreground-color . "#ffff99"))
(defun initialize-company-frame-parameters ()
"initialize company-box-frame-parameters"
(interactive)
(progn
(setq-default company-box-frame-parameters company-box-frame-parameters)
(add-to-list 'company-box-frame-parameters pbg-color)
(add-to-list 'company-box-frame-parameters pfg-color)
);end progn
);end initialize/
;on theme change change swap list values / you can also set our attributs (I do this in the functions)
;(setq pbg-swap '(background-color . "#whatvevr"))
;(replace-element-in-list bg-color bg-swap company-box-frame-parameters )
Reset Themes
Every time I change themes, I call a reset function.
;reset themes
(defun reset-themes ()
(interactive)
(progn
(mapc #'disable-theme custom-enabled-themes);disable all themes, revert to default theme
(set-face-attribute 'default nil :family "Consolas" :height 150) ; change font
));end reset-themes
How this theme system works
Remember a 'use-package' declaration doesn't load any code inside it until you trigger it.
I use the included ':commands' function to trigger theme loads.
When you call one of the ':commands' the use package loads the code, and in my theme cases, initializes a function called style-themename-theme
Use-package comes with an ':init,' which loads any code within at the moment the emacs first encounters it.
I use the :init to declare a theme-loading function which I add to :commands. Then I put the theme loading function in my appearance hydra.
When I call a theme loading function, it first triggers the use-package code, then calls the functions I declared in the use-package code, which in the theme case, again, is style-themename-theme.
In my configuration file, I first put the code I've shown above, then I add the use-package declarations for each theme package I'm using (5 or 6).
I will show only one of these theme declarations in this post, and the other 5 or 6 in following posts.
After my config lists all the theme use-package declarations (sets up the triggers but does not load the configuration code), it loads some mode-line code, which you will see in this post, then loads an after-init-hook, which it calls directly after loading the .emacs (or .init or whatever), that function requires company-box, which needs to be initialized before customizing company-box faces (you could put it in ':init' in the company-box use-package declaration also), then it initializes frame parameters and calls whatever 'load-theme' function I set it to, so my emacs loads a theme on startup (remember, the load-theme is a command which triggers that use-package config code).
This works better for me than cycle themes which gets tripped up over custom faces, and a good theme gets me through an otherwise possibly tough coding session.
This is advanced emacs configuration, but it's not writing an emacs package, which is another level up (following that is creating emacs.)
Play around with it a bit and you will figure it out easily.
Then feel free to let me know how you improved on it.
Solarized Themes
Here's what my customized solarized-dark and solarized light look like:
Solarized-Dark
Solarized-Light
And here's the code:
[Note: I dropped the syntax here. The Chroma syntax highlighter is written in 'Go,' and it's great, but it does put every differently coloured word in a span, which drops performance under 84 on lighthouse. I like 90's when I can get them. Next I'll have to drop getclicky.com web analytics, who have a decent free product that unfortunately still use scripts google doesn't like] 😏
;solarized
(use-package color-theme-sanityinc-solarized
:commands (Appearance_/load-solarized-light Appearance_/load-solarized-dark load-solarized-light load-solarized-dark)
:init
(defun load-solarized-dark()
(interactive)
(progn
(reset-themes)
(load-theme 'sanityinc-solarized-dark t)
(stylize-solarized-dark)
));end load solarized-dark
(defun load-solarized-light ()
(interactive)
(progn
(reset-themes)
(load-theme 'sanityinc-solarized-light t)
(stylize-solarized-light)
))
:config
(defun stylize-solarized-light ()
(interactive)
(progn
;tab bar
;(set-face-attribute 'tab-bar nil :background "#fdf6e3" :foreground "#808080" :box '(:line-width 1 :color "#808080" :style pressed-button))
(set-face-attribute 'tab-bar nil :background "#fdf6e3" :foreground "#808080" :box '(:line-width 1 :color "#808080" :style pressed-button))
(set-face-attribute 'tab-bar-tab-inactive nil :background "#fdf6e3" :foreground "#808080" :underline nil :box '(:line-width 1 :color "#808080" :style pressed-button))
(set-face-attribute 'tab-bar-tab nil :background "#fdf6e3" :foreground "#EA0E0E" :width 'expanded :box '(:line-width 4 :color "#EA0E0E" :style unpressed-button))
;dired
(set-face-attribute 'all-the-icons-dired-dir-face nil :background "#F2FBDE" :foreground "#1797c5")
(set-face-attribute 'dired-filetype-execute nil :background "#fdf6e3" :foreground "#1797c5")
(set-face-attribute 'dired-filetype-xml nil :background "#fdf6e3" :foreground "#843031")
(set-face-attribute 'dired-filetype-js nil :background "#fdf6e3" :foreground "#2C942C" :weight 'normal)
(set-face-attribute 'dired-filetype-common nil :background "#fdf6e3" :foreground "#EA0E0E")
(set-face-attribute 'dired-filetype-image nil :background "#fdf6e3" :foreground "#a32020")
(set-face-attribute 'dired-filetype-source nil :background "#fdf6e3" :foreground "#a61fde")
(set-face-attribute 'dired-filetype-link nil :background "#fdf6e3" :foreground "#d02b61")
(set-face-attribute 'dired-filetype-plain nil :background "#fdf6e3" :foreground "#9054f0")
(set-face-attribute 'diredp-dir-name nil :background "#F2FBDE" :foreground "#0b0b0b")
(set-face-attribute 'dired-filetype-mytype nil :background "#fdf6e3" :foreground "#ff6fff")
;font lock
(set-face-attribute 'font-lock-comment-face nil :background "#F2FBDE" :foreground "#1797c5")
(set-face-attribute 'font-lock-function-name-face nil :background "#F2FBDE" :foreground "#ff7518")
(set-face-attribute 'font-lock-builtin-face nil :background "#F2FBDE" :foreground "#a32020")
(set-face-attribute 'font-lock-string-face nil :background "#F2FBDE" :foreground "#b5006a")
(set-face-attribute 'font-lock-keyword-face nil :background "#F2FBDE" :foreground "#EA0E0E")
;org-block
(set-face-attribute 'default nil :background "#fdf6e3")
;org
(set-face-attribute 'org-document-title nil :background "#fdf6e3" :foreground "#EA0E0E")
(set-face-attribute 'org-block nil :background "#F2FBDE" :foreground "#0b0b0b" :extend t)
(set-face-attribute 'org-block-begin-line nil :background "#fdf6e3" :foreground "#5e6687")
(set-face-attribute 'org-block-end-line nil :background "#fdf6e3" :foreground "#5e6687")
(set-face-attribute 'org-level-1 nil :background "#fdf6e3" :foreground "#1e9ab0")
(set-face-attribute 'org-level-2 nil :background "#fdf6e3" :foreground "#b5006a")
(set-face-attribute 'org-level-3 nil :background "#fdf6e3" :foreground "#2C942C")
;(set-face-attribute 'org-code nil :background "#e8f1d4" :foreground "#0b0b0b")
(set-face-attribute 'org-meta-line nil :background "#fdf6e3" :foreground "#123555")
(set-face-attribute 'org-ellipsis nil :background "#fdf6e3" )
;default
;(set-face-attribute 'highlight-parentheses-highlight nil :background "#e8f1d4" :foreground "#061229")
(set-face-attribute 'region nil :background "#e8f1d4" :foreground "#061229" :inherit nil)
;show parens
(set-face-attribute 'show-paren-match nil :background "#e8f1d4" :foreground "#061229" :inherit nil)
(set-face-attribute 'show-paren-match-expression nil :background "#e8f1d4" :foreground "#061229" :inherit nil)
;webmode
(set-face-attribute 'web-mode-html-attr-value-face nil :background "#fdf6e3" :foreground "#2C942C")
(set-face-attribute 'web-mode-comment-face nil :background "#fdf6e3" :foreground "#608fb1")
(set-face-attribute 'web-mode-html-attr-name-face nil :background "#fdf6e3" :foreground "#3c5be9")
(set-face-attribute 'web-mode-style-face nil :background "#fdf6e3" :foreground "#a61fde")
(set-face-attribute 'web-mode-variable-name-face nil :background "#fdf6e3" :foreground "#3c5be9")
(set-face-attribute 'web-mode-html-attr-name-face nil :background "#fdf6e3" :foreground "#3c5be9")
(set-face-attribute 'web-mode-script-face nil :background "#fdf6e3" :foreground "#b77fdb" )
(set-face-attribute 'web-mode-html-tag-face nil :background "#fdf6e3" :foreground "#dc322f")
(set-face-attribute 'web-mode-current-element-highlight-face nil :background "#cfe8cf" :foreground "#dc322f")
(set-face-attribute 'web-mode-current-column-highlight-face nil :background "#cfe8cf" :foreground "#1b1d1e")
(set-face-attribute 'web-mode-html-tag-bracket-face nil :background "#fdf6e3" :foreground "#dc322f")
;hydra-posframe
(set-face-attribute 'hydra-posframe-border-face nil :background "#fdf6e3" :foreground "#e8f1d4" :inherit nil)
(set-face-attribute 'hydra-posframe-face nil :background "#fdf6e3" :foreground "#1b1d1e" :inherit nil)
(set-face-attribute 'pretty-hydra-toggle-off-face nil :background "#fdf6e3" :foreground "#2C942C")
(set-face-attribute 'pretty-hydra-toggle-on-face nil :background "#fdf6e3" :foreground "#2C942C")
;rainbow-delimeters
(set-face-attribute 'rainbow-delimiters-unmatched-face nil :background "#fdf6e3" :foreground "#d02b61" )
(set-face-attribute 'rainbow-delimiters-mismatched-face nil :background "#fdf6e3" :foreground "#2C942C")
;company-backgro9und
(set-face-attribute 'company-tooltip nil :background "#F2FBDE" :foreground "#1b1d1e" :inherit nil)
(set-face-background 'company-tooltip "#F2FBDE")
(set-face-foreground 'company-tooltip "#1b1d1e")
(setq pbg-swap '(background-color . "#F2FBDE"))
(setq pfg-swap '(foreground-color . "#1b1d1e"))
(and (not (equal pbg-color pbg-swap)) (not (equal pfg-color pfg-swap))
(progn
(replace-element-in-list pbg-color pbg-swap company-box-frame-parameters)
(replace-element-in-list pfg-color pfg-swap company-box-frame-parameters)
));end check frame swap loop
(setq pbg-color '(background-color . "#F2FBDE"))
(setq pfg-color '(foreground-color . "#1b1d1e"))
;company
(set-face-attribute 'company-tooltip-common t :background "#F2FBDE" :foreground "#268bd2" :inherit nil )
(set-face-attribute 'company-box-candidate t :background "#F2FBDE" :foreground "#99bf52" :inherit nil)
(set-face-attribute 'company-box-annotation t :background "#F2FBDE" :foreground "#B3D96C" :inherit nil)
(set-face-attribute 'company-tooltip-common-selection t :background "#F2FBDE" :foreground "#99bf52" :inherit nil)
(set-face-attribute 'company-box-selection t :background "#F2FBDE" :foreground "#263145" :inherit nil )
;(set-face-attribute 'company-box-scrollbar t :background "#263145" :foreground "#d02b61" :inherit nil)
;neo
(set-face-attribute 'neo-file-link-face nil :background "#fdf6e3" :foreground "#8D8D84")
(set-face-attribute 'neo-dir-link-face nil :background "#fdf6e3" :foreground "#0000FF")
(set-face-attribute 'neo-root-dir-face nil :background "#fdf6e3" :foreground "#BA36A5")
(set-face-attribute 'neo-root-dir-face nil :background "#fdf6e3" :foreground "#fff")
;rainbow identifiers
(set-face-attribute 'rainbow-identifiers-identifier-1 nil :background "#fdf6e3" :foreground "#ff6fff")
(set-face-attribute 'rainbow-identifiers-identifier-2 nil :background "#fdf6e3" :foreground "#2C942C")
(set-face-attribute 'rainbow-identifiers-identifier-3 nil :background "#fdf6e3" :foreground "#b5006a")
(set-face-attribute 'rainbow-identifiers-identifier-4 nil :background "#fdf6e3" :foreground "#5B6268")
(set-face-attribute 'rainbow-identifiers-identifier-5 nil :background "#fdf6e3" :foreground "#0C4EA0")
(set-face-attribute 'rainbow-identifiers-identifier-6 nil :background "#fdf6e3" :foreground "#99bf52")
(set-face-attribute 'rainbow-identifiers-identifier-7 nil :background "#fdf6e3" :foreground "#a61fde")
(set-face-attribute 'rainbow-identifiers-identifier-8 nil :background "#fdf6e3" :foreground "#dddddd")
(set-face-attribute 'rainbow-identifiers-identifier-9 nil :background "#fdf6e3" :foreground "#00aa80")
(set-face-attribute 'rainbow-identifiers-identifier-11 nil :background "#fdf6e3" :foreground "#bbfc20")
(set-face-attribute 'rainbow-identifiers-identifier-12 nil :background "#fdf6e3" :foreground "#6c9ef8")
(set-face-attribute 'rainbow-identifiers-identifier-13 nil :background "#fdf6e3" :foreground "#dd8844")
(set-face-attribute 'rainbow-identifiers-identifier-14 nil :background "#fdf6e3" :foreground "#991613")
(set-face-attribute 'rainbow-identifiers-identifier-15 nil :background "#fdf6e3" :foreground "#dddddd")
;zoom
(setq zoom-window-mode-line-color "#e8f1d4")
;calendar
;(set-face-attribute 'cfw:face-title nil :background "#081530" :foreground "#bbfc20" :height 3 :weight 'bold)
(set-face-attribute 'cfw:face-header nil :background "#e5e5e5" :foreground "#d0bf8f" )
(set-face-attribute 'cfw:face-sunday nil :background "#e5e5e5" :foreground "#991613" :weight 'bold)
(set-face-attribute 'cfw:face-saturday nil :background "#e5e5e5" :foreground "#b5006a" :weight 'bold)
(set-face-attribute 'cfw:face-holiday nil :background "#fdf6e3" :foreground "#06c6f5" :weight 'bold)
(set-face-attribute 'cfw:face-grid nil :foreground "DarkGrey")
(set-face-attribute 'cfw:face-default-content nil :foreground "#bfebbf")
(set-face-attribute 'cfw:face-periods nil :foreground "cyan")
(set-face-attribute 'cfw:face-day-title nil :background "#fdf6e3" )
(set-face-attribute 'cfw:face-default-day nil :weight 'bold :inherit 'cfw:face-day-title)
(set-face-attribute 'cfw:face-annotation nil :foreground "RosyBrown" :inherit 'cfw:face-day-title)
(set-face-attribute 'cfw:face-disable nil :foreground "DarkGray" :inherit 'cfw:face-day-title)
(set-face-attribute 'cfw:face-today-title nil :background "#bbfc20" :weight 'bold)
(set-face-attribute 'cfw:face-today nil :background "#bbfc20" :weight 'bold)
(set-face-attribute 'cfw:face-select nil :background "#bbfc20")
(set-face-attribute 'cfw:face-toolbar nil :background "#fdf6e3" :foreground "Steelblue4" )
(set-face-attribute 'cfw:face-toolbar-button-off nil :background "#fdf6e3" :foreground "#5B6268" :weight 'bold)
(set-face-attribute 'cfw:face-toolbar-button-on nil :background "#fdf6e3" :foreground "#608fb1" :weight 'bold)
);end progn
);end stylize-solarized-light
(defun stylize-solarized-dark ()
(interactive)
(progn
;tab bar
(set-face-attribute 'tab-bar nil :background "#063541" :foreground "#839496" :box '(:line-width 1 :color "#839496" :style pressed-button))
(set-face-attribute 'tab-bar-tab-inactive nil :background "#063541" :foreground "#839496" :underline nil :box '(:line-width 1 :color "#839496" :style pressed-button))
(set-face-attribute 'tab-bar-tab nil :background "#063541" :foreground "#d33682" :width 'expanded :box '(:line-width 1 :color "#839496" :style pressed-button))
;dired
(set-face-attribute 'all-the-icons-dired-dir-face nil :background "#002b36" :foreground "#4682b4")
(set-face-attribute 'dired-filetype-execute nil :background "#002b36" :foreground "#3c5be9")
(set-face-attribute 'dired-filetype-xml nil :background "#002b36" :foreground "#2eade2")
(set-face-attribute 'dired-filetype-js nil :background "#002b36" :foreground "#bbfc20")
(set-face-attribute 'dired-filetype-common nil :background "#002b36" :foreground "#EA0E0E")
(set-face-attribute 'dired-filetype-image nil :background "#002b36" :foreground "#dc322f")
(set-face-attribute 'dired-filetype-source nil :background "#002b36" :foreground "#2C942C")
(set-face-attribute 'dired-filetype-link nil :background "#002b36" :foreground "#b5006a")
(set-face-attribute 'dired-filetype-plain nil :background "#002b36" :foreground "#00afaf")
(set-face-attribute 'diredp-dir-name nil :background "#002b36" :foreground "#e8f1d4")
(set-face-attribute 'dired-filetype-mytype nil :background "#002b36" :foreground "#ff6fff")
;font-lock
(set-face-attribute 'font-lock-comment-face nil :background "#002b36" :foreground "#586e75")
;(set-face-attribute 'font-lock-function-name-face nil :background "#002b36" :foreground "#5f6368")
(set-face-attribute 'font-lock-builtin-face nil :background "#002b36" :foreground "#608fb1")
(set-face-attribute 'default nil :background "#002b36")
;org
(set-face-attribute 'org-document-title nil :background "#002b36" :foreground "#99bf52")
(set-face-attribute 'org-block-end-line nil :background "#002b36" :foreground "#839496")
(set-face-attribute 'org-block-begin-line nil :background "#002b36" :foreground "#839496")
(set-face-attribute 'org-todo nil :background "#002b36" )
;(set-face-attribute 'shadow nil :background "#002b36" :foreground "#dddddd")
(set-face-attribute 'org-block nil :background "#002b36" :foreground "#839496" :inherit nil :weight 'light)
(set-face-attribute 'org-level-1 nil :background "#002b36" :foreground "#2eade2")
(set-face-attribute 'org-level-2 nil :background "#002b36" :foreground "#99bf52")
(set-face-attribute 'org-level-3 nil :background "#002b36" :foreground "#ff6fff")
(set-face-attribute 'org-level-4 nil :background "#002b36" :foreground "#b5006a")
(set-face-attribute 'org-meta-line nil :background "#002b36" :foreground "#839496")
(set-face-attribute 'org-ellipsis nil :background "#002b36" )
;(set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch))
;(set-face-attribute 'org-table nil :inherit '(shadow fixed-pitch))
;(set-face-attribute 'org-formula nil :inherit 'fixed-pitch)
;(set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch))
;(set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch))
;(set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch)
;(set-face-attribute 'line-number nil :inherit 'fixed-pitch)
;(set-face-attribute 'line-number-current-line nil :inherit 'fixed-pitch)
;default
;(set-face-attribute 'highlight-parentheses-highlight nil :background "#e8f1d4" :foreground "#061229")
(set-face-attribute 'region nil :background "#004850" :foreground "#d9d6cf")
;show parens
(set-face-attribute 'show-paren-match nil :background "#004850" :foreground "#d9d6cf" :inherit nil)
(set-face-attribute 'show-paren-match-expression nil :background "#004850" :foreground "#d9d6cf" :inherit nil)
;webmode
(set-face-attribute 'web-mode-html-attr-value-face nil :background "#002b36" :foreground "#99bf52")
(set-face-attribute 'web-mode-comment-face nil :background "#002b36" :foreground "#608fb1")
(set-face-attribute 'web-mode-html-attr-name-face nil :background "#002b36" :foreground "#3c5be9")
(set-face-attribute 'web-mode-style-face nil :background "#002b36" :foreground "#a61fde")
(set-face-attribute 'web-mode-variable-name-face nil :background "#002b36" :foreground "#3c5be9")
(set-face-attribute 'web-mode-html-attr-name-face nil :background "#002b36" :foreground "#3c5be9")
(set-face-attribute 'web-mode-script-face nil :background "#002b36" :foreground "#b77fdb" )
(set-face-attribute 'web-mode-html-tag-face nil :background "#002b36" :foreground "#dc322f")
(set-face-attribute 'web-mode-current-element-highlight-face nil :background "#004850" )
(set-face-attribute 'web-mode-current-column-highlight-face nil :background "#004850" :foreground "#839496")
(set-face-attribute 'web-mode-html-tag-bracket-face nil :background "#002b36" :foreground "#839496")
;hydra-posframe
(set-face-attribute 'hydra-posframe-border-face nil :background "#ffffff" :foreground "#ffffff" )
(set-face-attribute 'hydra-posframe-face nil :background "#002b36" :foreground "#dddddd" :inherit nil)
;rainbow-delimeters
(set-face-attribute 'rainbow-delimiters-unmatched-face nil :background "#002b36" :foreground "#c61b6e")
(set-face-attribute 'rainbow-delimiters-mismatched-face nil :background "#002b36" :foreground "#2C942C")
;company-backgro9und
(set-face-attribute 'company-tooltip nil :background "#004850" :foreground "#ffffff" :inherit nil)
(set-face-background 'company-tooltip "#004850")
(set-face-foreground 'company-tooltip "#ffffff")
(setq pbg-swap '(background-color . "#004850"))
(setq pfg-swap '(foreground-color . "#ffffff"))
(and (not (equal pbg-color pbg-swap)) (not (equal pfg-color pfg-swap))
(progn
(replace-element-in-list pbg-color pbg-swap company-box-frame-parameters)
(replace-element-in-list pfg-color pfg-swap company-box-frame-parameters)
));end check frame swap loop
(setq pbg-color '(background-color . "#004850"))
(setq pfg-color '(foreground-color . "#ffffff"))
;company
(set-face-attribute 'company-tooltip-common t :background "#004850" :foreground "#4682b4" :inherit nil )
(set-face-attribute 'company-box-candidate t :background "#004850" :foreground "#ffffff" :inherit nil)
(set-face-attribute 'company-box-annotation t :background "#004850" :foreground "#608fb1" :inherit nil)
;(set-face-attribute 'company-tooltip-common-selection t :background "#005077" :foreground "#99bf52" :inherit nil)
(set-face-attribute 'company-box-selection t :background "#005077" :foreground "#dddddd" :inherit nil )
;(set-face-attribute 'company-box-scrollbar t :background "#004850" :foreground "#d02b61" :inherit nil)
;company background
; hydra faces
(set-face-attribute 'pretty-hydra-toggle-off-face nil :background "#002b36" :foreground "#4682b4" :inherit nil)
(set-face-attribute 'pretty-hydra-toggle-on-face nil :background "#002b36" :foreground "#4682b4" :inherit nil)
;neo
(set-face-attribute 'neo-file-link-face nil :background "#002b36" :foreground "#8D8D84")
(set-face-attribute 'neo-dir-link-face nil :background "#002b36" :foreground "#0000FF")
(set-face-attribute 'neo-root-dir-face nil :background "#002b36" :foreground "#BA36A5")
(set-face-attribute 'neo-root-dir-face nil :background "#002b36" :foreground "#fff")
;rainbow identifiers
(set-face-attribute 'rainbow-identifiers-identifier-1 nil :background "#002b36" :foreground "#ff6fff")
(set-face-attribute 'rainbow-identifiers-identifier-2 nil :background "#002b36" :foreground "#2C942C")
(set-face-attribute 'rainbow-identifiers-identifier-3 nil :background "#002b36" :foreground "#b5006a")
(set-face-attribute 'rainbow-identifiers-identifier-4 nil :background "#002b36" :foreground "#5B6268")
(set-face-attribute 'rainbow-identifiers-identifier-5 nil :background "#002b36" :foreground "#0C4EA0")
(set-face-attribute 'rainbow-identifiers-identifier-6 nil :background "#002b36" :foreground "#99bf52")
(set-face-attribute 'rainbow-identifiers-identifier-7 nil :background "#002b36" :foreground "#a61fde")
(set-face-attribute 'rainbow-identifiers-identifier-8 nil :background "#002b36" :foreground "#dddddd")
(set-face-attribute 'rainbow-identifiers-identifier-9 nil :background "#002b36" :foreground "#00aa80")
(set-face-attribute 'rainbow-identifiers-identifier-11 nil :background "#002b36" :foreground "#bbfc20")
(set-face-attribute 'rainbow-identifiers-identifier-12 nil :background "#002b36" :foreground "#6c9ef8")
(set-face-attribute 'rainbow-identifiers-identifier-13 nil :background "#002b36" :foreground "#dd8844")
(set-face-attribute 'rainbow-identifiers-identifier-14 nil :background "#002b36" :foreground "#991613")
(set-face-attribute 'rainbow-identifiers-identifier-15 nil :background "#002b36" :foreground "#dddddd")
;zoom
(setq zoom-window-mode-line-color "#004850")
;(set-face-attribute 'cfw:face-title nil :background "#002b36" :foreground "#bbfc20" :height 3 :weight 'bold)
(set-face-attribute 'cfw:face-header nil :background "#002b36" :foreground "#bbfc20" )
(set-face-attribute 'cfw:face-sunday nil :foreground "#b5006a" :background "#002b36" :weight 'bold)
(set-face-attribute 'cfw:face-saturday nil :foreground "#b5006a" :background "#002b36" :weight 'bold)
(set-face-attribute 'cfw:face-holiday nil :background "#002b36" :foreground "#06c6f5" :weight 'bold)
(set-face-attribute 'cfw:face-grid nil :foreground "DarkGrey")
;(set-face-attribute 'cfw:face-default-content nil :foreground "#bfebbf")
(set-face-attribute 'cfw:face-periods nil :foreground "cyan")
(set-face-attribute 'cfw:face-day-title nil :background "#002b36" )
(set-face-attribute 'cfw:face-default-day nil :weight 'bold :inherit 'cfw:face-day-title)
(set-face-attribute 'cfw:face-annotation nil :foreground "RosyBrown" :inherit 'cfw:face-day-title)
(set-face-attribute 'cfw:face-disable nil :foreground "DarkGray" :inherit 'cfw:face-day-title)
(set-face-attribute 'cfw:face-today-title nil :background "#004850" :weight 'bold)
(set-face-attribute 'cfw:face-today nil :background "#004850" :weight 'bold)
(set-face-attribute 'cfw:face-select nil :background "#bbfc20")
(set-face-attribute 'cfw:face-toolbar nil :foreground "Steelblue4" :background "#002b36")
(set-face-attribute 'cfw:face-toolbar-button-off nil :background "#002b36" :foreground "#5B6268" :weight 'bold)
(set-face-attribute 'cfw:face-toolbar-button-on nil :background "#002b36" :foreground "#608fb1" :weight 'bold)
);end progn
);end stylize-solarized-dark
;(load-theme 'color-theme-sanityinc-solarized t)
);end use-package color-theme-sanityinc-solorized
All of the code just above is in the use-package color-theme-sanityinc-solorized declaration, and most of it is under the ':config section.'
Remember 'interactive' means code that runs on the fly when called from say M-x, while 'progn' ensures everything within it is called in order (no return out of the function when something is 'true').
When this code loads a theme with 'load-solarized-dark,' it first declares stylize-solarized-dark via use-package config, then calls 'reset-theme,' sets load-theme 'sanityinc-solarized-dark' to true, and then calls 'stylize-solarized-dark,' all in order.
stylize-solarized-dark set the faces for the following packages and defaults:
- tab-bar
- dired-filetype
- font-lock (some defaults)
- org-mode
- show-parens
- web-mode
- hydra-posframe
- rainbow-delimiters
- company-mode
- pretty-hydra
- neo-dir
- rainbow-identifiers
- zoom-modeline
- cfw (calendar)
Since you cannot customize a face that emacs hasn't initialized, all of these libraries need to have been required through use-package or require at the time you call in this case 'load-stylized-dark'
If you don't use any of those faces, remove the code from your stylize function.
Next in the config go several more theme use-package declarations, which I will show in future posts.
Then the modeline code, and the startup theme hook follow as such:
Modeline Defaults
;modeline
(setq line-number-mode t)
(setq column-number-mode t)
(size-indication-mode 1)
;(display-time-mode)
Doom Mode Line
Doom Themes comes with a nice looking modeline. The default settings are good. There are different preconfigured modelines included. Select the one you want in :config
;doom-mode-line
(use-package doom-modeline
;:commands doom-modeline
:config
;(setq doom-modeline-height 25)
;
;(setq doom-modeline-minor-modes (featurep 'minions))
;;(doom-modeline-buffer-file-name-style 'truncate-except-project)
;(mode-line ((t (:height 0.85))))
; (mode-line-inactive ((t (:height 0.85))))
(setq doom-modeline-buffer-file-name-style 'buffer-name)
;(doom-modeline-set-timemachine-modeline)
;(doom-modeline-set-info-modeline)
;(doom-modeline-set-modeline 'dashboard)
;(doom-modeline-set-modeline 'project)
(doom-modeline-set-modeline 'main)
;(doom-modeline-set-modeline 'minimal)
;(doom-modeline-set-modeline 'package)
;(setq doom-modeline-bar-width 3)
(setq doom-modeline-display-default-persp-name t)
(setq doom-modeline-enable-wordcount t)
;(setq doom-modeline-window-width-limit 140)
;(doom-modeline t)
:hook
(after-init . doom-modeline-mode)
);end doom-modeline
Doom Modeline Notes
1. customize your modeline
2. Add to `doom-modeline-mode-hook` or other hooks
(doom-modeline-def-modeline 'my-simple-line
'(bar matches buffer-info remote-host buffer-position parrot selection-info)
'(misc-info minor-modes input-method buffer-encoding major-mode process vcs checker))
(defun setup-custom-doom-modeline ()
(doom-modeline-set-modeline 'my-simple-line 'default))
(add-hook 'doom-modeline-mode-hook 'setup-custom-doom-modeline)
Celestial Modeline
(use-package celestial-mode-line
;:after org-mode
;:ensure t
:init
(setq calendar-chinese-all-holidays-flag t)
(setq calendar-christian-all-holidays-flag t)
;(require 'russian-holidays)
;(setq calendar-holidays (append calendar-holidays russian-holidays))
(setq calendar-longitude x)
(setq calendar-latitude y)
(setq calendar-location-name "----xy----")
:config
(setq global-mode-string '("" celestial-mode-line-string display-time-string))
(celestial-mode-line-start-timer)
)
Startup Hook With Theme
;loads phd at start of emacs
(add-hook 'after-init-hook (lambda()
;(load-theme 'base16-phd t)
(require 'company-box)
(initialize-company-frame-parameters)
(load-Iosvkem)
;(load-leuven)
;(load-operandi)
));end after-init-hook