“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.
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
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
.
(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
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
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
1. Create your Emacs themes directory if it does not yet exist:
mkdir ~/.emacs.d/themes/
2. Then change into your Emacs themes directory and clone this repository:
cd ~/.emacs.d/themes/
git clone https://github.com/monkeyjunglejuice/matrix-emacs-theme.git
3. Only if you had to create the themes directory in step 1, put this in your Emacs init file (example for Linux/Unix):
(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)))))
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’
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
- [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
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’