matrix-emacs-theme icon indicating copy to clipboard operation
matrix-emacs-theme copied to clipboard

"Unfortunately, no one can be told what The Matrix Theme is. You’ll have to see it for yourself." —Morpheus

  • "Unfortunately, no one can be told what The Matrix Theme is. You’ll have to see it for yourself" —Morpheus

I was looking for an almost monochrome green-on-black theme for the darker surroundings, because it helps me to focus, for some reason.

** Screenshots

*** Tuareg (OCaml) [[file:screenshots/tuareg.png]] *** Dired + Selectrum + Marginalia [[file:screenshots/dired.png]] *** Magit [[file:screenshots/magit.png]]

** Colors

There are only three base colors used:

  • Matrix Green: coming in different shades and luminositiy for syntax highlighting
  • Blue: for infos, hints, notifications and diff-added
  • Red: for warnings, errors and diff-removed

** Typography

Due to the the reduced amount of colors, this theme makes use of font styles: italic, a lighter weight and an alternative monospaced font, configured via ~fixed-pitch-serif~. The latter is used to distinguish strings, comments and documentation.

Monospace fonts come in different character width. If your ~default~ and ~fixed-pitch-serif~ have a different width, then the columns will not align with each other. If you don't set your ~fixed-pitch-serif~ explicitly, then a substitute font for ~fixed-pitch-serif~ will be chosen by Emacs, which may or may not go well with your ~default~ font.

For best results, I recommend to configure Emacs' primary font ~default~ and a secondary font ~fixed-pitch-serif~ (examples below). Each monospaced font should have the same width. Here are some font pairings that work well together. You can set up one as your ~default~ and the other one as ~fixed-pitch-serif~:

| ~default~ | ~fixed-pitch-serif~ | Download | |------------------------------+------------------------------+-------------------------------------------| | Iosevka | Iosevka Slab | https://typeof.net/Iosevka | | Recursive Mono Linear Static | Recursive Mono Casual Static | https://www.recursive.design | | Courier Prime Code | Courier Prime | https://quoteunquoteapps.com/courierprime | | Fira Code ~:weight 'normal~ | Fira Code ~:weight 'light~ | https://github.com/tonsky/FiraCode |

/If you know other font pairs that have exactly the same width and look nicely together, please let me know (create an issue or PR) and I will add your pairing to the table./

To disable this feature, simply set your ~fixed-pitch-serif~ to the same font as your ~default~.

#+caption: Example font config #+begin_src emacs-lisp (defun my-fonts () "Set the default fonts." (set-face-attribute 'default nil :family "Recursive Mono Linear Static" :slant 'normal :weight 'normal :width 'normal :height 120) (set-face-attribute 'fixed-pitch nil :family "Recursive Mono Linear Static" :slant 'normal :weight 'normal :width 'normal :height 120) (set-face-attribute 'fixed-pitch-serif nil :family "Recursive Mono Casual Static" :slant 'normal :weight 'normal :width 'normal :height 120) (set-face-attribute 'variable-pitch nil :family "Recursive Sans Casual Static" :slant 'normal :weight 'normal :width 'normal :height 140))

(my-fonts) ; Apply the function

(defun my-modeline () "Custom modeline styling." (set-face-attribute 'mode-line nil :family "Recursive Mono Linear Static" :slant 'normal :weight 'normal :width 'normal :height 100) (set-face-attribute 'mode-line-inactive nil :family "Recursive Mono Linear Static" :slant 'normal :weight 'normal :width 'normal :height 100))

(my-modeline) ; Apply the function #+end_src

** Themed Packages/Modes

Non-exhaustive list of explicitly themed packages:

  • ansi colors
  • term colors
  • shell-script-mode
  • dired
  • dired-subtree
  • eldoc
  • proced
  • eshell
  • comint
  • completions/icomplete
  • diff
  • package
  • customization
  • info
  • message
  • erc
  • table
  • tex
  • outline
  • org-mode
  • org-tree-slide
  • shortdoc
  • compilation
  • whitespace
  • smartparens
  • rainbow-delimiters (to make the parens /less/ visible)
  • paren-face
  • git-commit
  • magit
  • git-gutter-fringe
  • diff-hl
  • company
  • flymake
  • flycheck
  • lsp-mode
  • eglot
  • csv-mode
  • css-mode
  • web-mode
  • slime
  • sly
  • geiser
  • cider
  • clojure-mode
  • tuareg
  • merlin
  • merlin-eldoc
  • utop
  • selectrum
  • marginalia
  • consult
  • helm
  • adoc-mode
  • highlight-indent-guides
  • notmuch
  • switch-window
  • telega
  • beancount
  • w3m
  • elfeed
  • rg
  • wgrep

** Installation

*** With Emacs package manager (from Melpa)

1. 'M-x list-packages RET'

2. Search for 'the-matrix-theme'

3. Hit the 'i' key to mark the package for installation

4. Hit 'x' to execute

If you cannot find "the-matrix-theme" between all the packages, it could mean that Melpa may be not yet enabled in your Emacs. Here's the official guide how to enable Melpa: https://melpa.org/#/getting-started

*** Manual Installation

1. Create your Emacs themes directory if it does not yet exist: #+begin_src sh mkdir ~/.emacs.d/themes/ #+end_src

2. Then change into your Emacs themes directory and clone this repository: #+begin_src sh cd ~/.emacs.d/themes/ git clone https://github.com/monkeyjunglejuice/matrix-emacs-theme.git #+end_src

3. Only if you had to create the themes directory in step 1, put this in your Emacs init file (example for Linux/Unix): #+begin_src emacs-lisp (let ((basedir "~/.emacs.d/themes/")) (dolist (f (directory-files basedir)) (if (and (not (or (equal f ".") (equal f ".."))) (file-directory-p (concat basedir f))) (add-to-list 'custom-theme-load-path (concat basedir f))))) #+end_src

4. (Re)start Emacs. You can now disable your current Emacs theme 'M-x disable-theme ... RET' and then 'M-x load-theme RET the-matrix RET'

** Current Status

I'm using this theme on a daily basis for writing OCaml, Lisp, Org, HTML and CSS. So I'll improve it continiously. I'll also would like to make it work for Terminal and TTY.

  • [X] Graphical Emacs Works as expected
  • [ ] Terminal emulator Usable, but colored backgrounds (strings, errors, etc.) don't look pretty yet
  • [ ] TTY There's no workaround yet to make colored backgrounds (strings, errors, etc.) readable

*** Tested with:

  • [X] Emacs 27.1 on Ubuntu 21.10
  • [ ] Emacs 26.1 on Debian 10.9.0
  • [ ] Emacs 27 on Windows 10
  • [ ] Emacs 26 on Windows 10
  • [ ] Emacs 27 on MacOS
  • [ ] Emacs 26 on MacOS

** Contribute

If you have issues with the theme or something looks odd, please open an issue. You are very welcome to add support for further packages/modes. See also 'Current Status'