commit a1cb5967b145115bd5c890e8531fbf7e5b74f2ef
parent 9bdfd9509693b018d4087974ce56423dcf04e114
Author: Ethan Long <ethan@Ethans-MBP.lan>
Date: Wed, 26 Jul 2023 00:42:10 +1000
Moved emacs config to org, set up org.
And more!
Diffstat:
| A | config.org | | | 372 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | early-init.el | | | 1 | + |
| M | init.el | | | 328 | ++++++++++++++++++++++--------------------------------------------------------- |
| A | opam-user-setup.el | | | 131 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| D | themes/catppuccin-theme.el | | | 1102 | ------------------------------------------------------------------------------- |
5 files changed, 595 insertions(+), 1339 deletions(-)
diff --git a/config.org b/config.org
@@ -0,0 +1,372 @@
+* My emacs config
+This is my emacs configuration, it is designed to be portable across Unix-like operating systems, working on both Linux and Mac (maybe Windows in the future, but for now it's a no-go). I prefer to have a manual configuration like this rather than Doom Emacs, because then I know every package that goes into this bloated mess of an editor. The aim of this configuration is to make emacs as sufferable as possible. It turns out to be quite an okay & customisable editor after you give it vi bindings.
+** Elpaca
+The elpaca package manager is an alternative to ~use-package~ that works asynchronously in the background. Beyond the initial set-up, it is faster and more reliable than using ~package.el~. The main downside is also that it is asynchronous, as this means you need to put thought into the configuration of the rest of emacs, everything needs to be set up with ~use-package~ and a special ~elpaca-after-init-hook~ unless you want the blocking ~elpaca-wait~ function that completely defeats the purpose of elpaca.
+
+Elpaca is installed in =init.el=, as we need to install the latest version of org before we enter here.
+** Catppuccin Theme
+Catppuccin is best (dark) theme.
+#+begin_src emacs-lisp
+ ;; Catppuccin Mocha theme
+ (use-package catppuccin-theme)
+ (unless (fboundp 'catppuccin-reload)
+ (elpaca-wait))
+ (load-theme 'catppuccin t)
+ (setq catppuccin-flavor 'mocha)
+ (catppuccin-reload)
+#+end_src
+** General Emacs/editor settings
+We can use ~use-package~ to configure emacs at startup. On MacOS we leave things mostly default because emacs-mac doesn't look fugly, but on Linux we might as well get rid of all the clutter. Also we use spaces not tabs, begone tabs.
+#+begin_src emacs-lisp
+ ;; Emacs init config
+ (use-package emacs
+ :elpaca nil
+ :init
+ ;; If there are 3 or more completions, cycle around when reaching the end of the completions
+ (setq completion-cycle-threshold 3)
+ ;; Get rid of default crud
+ (setq inhibit-startup-screen t)
+ (unless (eq system-type 'darwin)
+ (menu-bar-mode 0)
+ (tool-bar-mode 0)
+ (scroll-bar-mode 0))
+ ;; Modeline line and col number
+ (line-number-mode 1)
+ (column-number-mode 1)
+ ;; Indentation
+ (setq-default indent-tabs-mode nil)
+ ;; SILENCE
+ (setq ring-bell-function 'ignore))
+#+end_src
+Let's get rid of the autosave and backup crap that emacs puts into the active working directories.
+#+begin_src emacs-lisp
+ ;; Put autosave files (ie #foo#) and backup files (ie foo~) in ~/.emacs.d/.
+ (custom-set-variables
+ '(auto-save-file-name-transforms '((".*" "~/.config/emacs/autosaves/\\1" t)))
+ '(backup-directory-alist '((".*" . "~/.config/emacs/backups/"))))
+
+ ;; create the autosave dir if necessary, since emacs won't.
+ (make-directory "~/.config/emacs/autosaves/" t)
+#+end_src
+*** Fonts & Ligatures
+#+begin_src emacs-lisp
+ ;; Set the fonts
+ (defun custom-set-fonts (&optional frame)
+ (with-selected-frame (or frame (selected-frame))
+ ;;(set-face-attribute 'default nil :font "Comic Code Ligatures-16")
+ (set-face-attribute 'default nil :font "Victor Mono-16")
+ (set-face-attribute 'font-lock-comment-face nil :slant 'italic)
+ (set-face-attribute 'font-lock-keyword-face nil :slant 'italic)))
+ (custom-set-fonts)
+ (add-hook 'after-make-frame-functions 'custom-set-fonts)
+#+end_src
+#+begin_src emacs-lisp
+ (setq comic-code-ligs '(("-" (rx (+ "-"))) ("-" (rx (* "-") ">"))
+ ("+" (rx (+ "+"))) ("<" (rx (+ "=")))
+ ("<" (rx (+ "=") ">")) ("<" (rx (+ "~")))
+ ("<" (rx (+ "~") ">")) ("<" (rx "!" (+ "-")))
+ ("<" (rx (+ "-"))) ("<" (rx (+ "-") ">")) ("<" (rx "|"))
+ (">" (rx (+ "="))) (">" (rx ">" (+ "=")))
+ (">" (rx ">" (+ "=") ">")) (">" (rx (+ "-")))
+ (">" (rx (+ "-") "<")) ("~" (rx (+ "~")))
+ ("~" (rx (+ "~") ">")) ("=" (rx (* "=") ">"))
+ ("=" (rx (+ (or ">" "<" "|" "/" "~" ":" "!" "="))))
+ "!=" "!==" "[|" "|]" "{|" "|}" "|>" "||" "&&"))
+
+ (setq victor-mono-ligs '("</" "</>" "/>" "~-" "-~" "~@" "<~" "<~>" "<~~" "~>"
+ "~~" "~~>" ">=" "<=" "<!--" "##" "###" "####" "|-" "-|"
+ "|->" "<-|" ">-|" "|-<" "|=" "|=>" ">-" "<-" "<--"
+ "-->" "->" "-<" ">->" ">>-" "<<-" "<->" "->>" "-<<"
+ "<-<" "==>" "=>" "=/=" "!==" "!=" "<==" ">>=" "=>>"
+ ">=>" "<=>" "<=<" "<<=" "=<<" ".-" ".=" "=:=" "=!="
+ "==" "===" "::" ":=" ":>" ":<" ">:" ";;" "<|" "<|>"
+ "|>" "<>" "<$" "<$>" "$>" "<+" "<+>" "+>" "?=" "/="
+ "/==" "/\\" "\\/" "__" "&&" "++" "+++"))
+#+end_src
+
+** Packages
+*** Ivy and Counsel (Better Text Navigation)
+[[https://github.com/abo-abo/swiper][Ivy and Counsel]] are replacements for the default ~find-file~ and =M-x= menus.
+#+begin_src emacs-lisp
+ ;; ivy mode instead of ido mode:
+ (use-package ivy)
+ (add-hook 'elpaca-after-init-hook (lambda () (ivy-mode t)))
+ ;; counsel extends ivy:
+ (use-package counsel)
+ (add-hook 'elpaca-after-init-hook (lambda () (counsel-mode t)))
+#+end_src
+*** Ligature.el / Ligature set up
+Ligatures are native on =emacs-mac=, so we just call the built in helper function if we are on MacOS. If not, we will use [[https://github.com/mickeynp/ligature.el][ligature.el]] to give ligatures with Harfbuzz.
+#+begin_src emacs-lisp
+ ;; Font ligatures:
+ (if (not (eq system-type 'darwin))
+ (use-package ligature
+ :config
+ (ligature-set-ligatures 'prog-mode victor-mono-ligs)
+ (global-ligature-mode t))
+ ;; Else, on mac we have ligatures already
+ (mac-auto-operator-composition-mode))
+
+#+end_src
+*** Rainbow Delimiters
+Rainbow delimiters are essential for working with LISP, and are just nice to have elsewhere. This package has apparently got a very small footprint, and I can't be arsed actually benchmarking anything in this emacs config so I trust them.
+#+begin_src emacs-lisp
+ ;; Rainbow delimiters:
+ (use-package rainbow-delimiters
+ :hook (prog-mode . rainbow-delimiters-mode))
+#+end_src
+*** Doom Modeline
+This modeline is supposedly sexier than the original, honestly I don't mind the original either, it's also very nice. If there's ever a reason to ditch this because of some bug or performance issue, etc. then don't be afraid to.
+#+begin_src emacs-lisp
+ ;; Doom modeline:
+ (use-package doom-modeline)
+
+ (add-hook 'elpaca-after-init-hook (lambda () (doom-modeline-mode t)))
+#+end_src
+*** Which Key?
+Fix my ineptitude in this keyboard chord hell.
+#+begin_src emacs-lisp
+ ;; Which key (this is the thing responsible for coming up with the minibuffer of keys that you can pick):
+ (use-package which-key
+ :init (which-key-mode)
+ :diminish which-key-mode
+ :config
+ (setq which-key-idle-delay 0.3))
+#+end_src
+*** Evil mode
+Fix my ineptitude in this chord hell that is emacs. I mean seriously, chords just to navigate? I don't want even more RSI & carpel tunnel.
+#+begin_src emacs-lisp
+ ;; Evil mode :D
+ (use-package evil
+ :init
+ (setq evil-want-integration t)
+ (setq evil-want-keybinding nil)
+ (setq evil-want-C-d-scroll t)
+ (setq evil-want-C-u-scroll t)
+ (setq evil-want-C-i-jump nil)
+ (setq evil-undo-system 'undo-redo)
+ :config
+ (evil-mode 1)
+ ;; Enabling C-g to exit from normal mode, and C-h to do what it normally does in emacs
+ (define-key evil-insert-state-map (kbd "C-g") 'evil-normal-state)
+ (define-key evil-insert-state-map (kbd "C-h") 'evil-delete-backward-char-and-join)
+
+ ;; Use visual line motions outside of visual-line-mode buffers
+ (evil-global-set-key 'motion "j" 'evil-next-visual-line)
+ (evil-global-set-key 'motion "k" 'evil-previous-visual-line)
+
+ ;; Set initial states to be in normal mode for some buffers
+ (evil-set-initial-state 'messages-buffer-mode 'normal)
+ (evil-set-initial-state 'dashboard-mode 'normal))
+#+end_src
+**** Evil Collection
+#+begin_src emacs-lisp
+ ;; Extra modes for evil, if evil is playing up this would be the first thing to check
+ (use-package evil-collection
+ :after evil
+ :config
+ (evil-collection-init))
+#+end_src
+*** Corfu & Cape (Completion)
+Based completion. This is an overhaul of the autocomplete. Company mode sucks because when you resize a buffer with C-x-+ everything breaks.
+#+begin_src emacs-lisp
+ ;; Cape
+ (use-package cape)
+
+ ;; Completion & Modernisation
+ (use-package corfu
+ :after cape
+ :custom
+ (corfu-cycle t)
+ (corfu-auto t)
+ (corfu-scroll-margin 5)
+ :init
+ (global-corfu-mode)
+ ;; Shouldn't have to do this, but lsp is a little bugged:
+ (advice-add #'lsp-completion-at-point :around #'cape-wrap-noninterruptible))
+#+end_src
+*** Scrolling Patches
+Scrolling via cursor movement is too slow in default emacs, this fixes that.
+#+begin_src emacs-lisp
+ ;; Faster scrolling:
+ (use-package fast-scroll
+ :config
+ (fast-scroll-config)
+ (fast-scroll-mode 1))
+#+end_src
+Here are a few more nice things for scrolling.
+#+begin_src emacs-lisp
+ (unless (eq system-type 'darwin)
+ ;; Change the default scroll behaviour to smooth scroll
+ (pixel-scroll-precision-mode t))
+ ;; Scrolling down a file only goes down a single line when reaching the bottom
+ (setq scroll-step 1)
+ ;; The region that the curser needs to enter to trigger scrolling
+ (setq scroll-margin 5)
+ ;; Necessary to stop random jumps
+ (setq scroll-conservatively 10000)
+#+end_src
+
+** Org Mode
+My org mode is based on [[https://orgmode.org/guide/Hyperlinks.html][a post by Diego Zamboni]]. The general idea is that we want headings to be bigger and more noticable than text, all regular text should be non-monospace, and all code should be in the regular monospace font.
+Starting out, let's configure the basics, we want indentation and variable pitch fonts, as well as lines that fill the whole screen well with variable font. We also want all code blocks to be fontified properly. We will wrap this all up in a function called ~org-mode-base~.
+#+begin_src emacs-lisp
+ (defun ethandl/org-mode-base ()
+ (require 'org)
+ (org-indent-mode 1)
+ (variable-pitch-mode 1)
+ (visual-line-mode 1)
+ (setq org-src-fontify-natively t
+ org-src-tab-acts-natively t))
+#+end_src
+Now let's make org prettier, we want all non-textual markers gone, our fonts to be correct, and bullet points for our headings as well as bullet lists. This is all wrapped up in the ~org-mode-prettify~ function.
+#+begin_src emacs-lisp
+ (use-package org-bullets
+ :config
+ (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))))
+
+ (use-package org-autolist
+ :hook (org-mode . org-autolist-mode))
+
+ (defun ethandl/org-mode-prettify ()
+ (setq org-hide-emphasis-markers t)
+ (setq org-ellipsis "▾")
+ (font-lock-add-keywords 'org-mode
+ '(("^ *\\([-]\\) "
+ (0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•"))))))
+
+ (let* ((variable-tuple
+ (cond ((x-list-fonts "ETBookOT") '(:font "ETBookOT"))
+ ((x-family-fonts "Sans Serif") '(:family "Sans Serif"))
+ (nil (warn "Cannot find a Sans Serif Font. Install Source Sans Pro."))))
+ (base-font-color (face-foreground 'default nil 'default))
+ (headline `(:inherit default :weight bold :foreground ,base-font-color)))
+
+
+ (custom-theme-set-faces
+ 'user
+ `(org-level-8 ((t (,@headline ,@variable-tuple :height 1.1))))
+ `(org-level-7 ((t (,@headline ,@variable-tuple :height 1.1))))
+ `(org-level-6 ((t (,@headline ,@variable-tuple :height 1.1))))
+ `(org-level-5 ((t (,@headline ,@variable-tuple :height 1.1))))
+ `(org-level-4 ((t (,@headline ,@variable-tuple :height 1.1))))
+ `(org-level-3 ((t (,@headline ,@variable-tuple :height 1.25))))
+ `(org-level-2 ((t (,@headline ,@variable-tuple :height 1.5))))
+ `(org-level-1 ((t (,@headline ,@variable-tuple :height 1.75))))
+ `(org-document-title ((t (,@headline ,@variable-tuple :height 2.0 :underline nil))))))
+
+ (custom-theme-set-faces
+ 'user
+ '(variable-pitch ((t (:family "ETBookOT" :height 200 :weight thin))))
+ '(fixed-pitch ((t (:family "Victor Mono" :height 160 :weight regular)))))
+
+ (custom-theme-set-faces
+ 'user
+ '(org-block ((t (:inherit fixed-pitch))))
+ '(org-code ((t (:inherit (shadow fixed-pitch)))))
+ '(org-document-info ((t (:foreground "dark orange"))))
+ '(org-document-info-keyword ((t (:inherit (shadow fixed-pitch)))))
+ '(org-indent ((t (:inherit (org-hide fixed-pitch)))))
+ '(org-link ((t (:foreground "royal blue" :underline t))))
+ '(org-meta-line ((t (:inherit (font-lock-comment-face fixed-pitch)))))
+ '(org-property-value ((t (:inherit fixed-pitch))) t)
+ '(org-special-keyword ((t (:inherit (font-lock-comment-face fixed-pitch)))))
+ '(org-table ((t (:inherit fixed-pitch :foreground "#83a598"))))
+ '(org-tag ((t (:inherit (shadow fixed-pitch) :weight bold :height 0.8))))
+ '(org-verbatim ((t (:inherit (shadow fixed-pitch)))))))
+#+end_src
+
+Unfortunately, there are some source mode highlighting issues with the Catppuccin theme in org mode, so this is the current fix until it is built into the Catppuccin theme.
+#+begin_src emacs-lisp
+ (add-to-list 'org-src-block-faces (list "" (list :foreground (catppuccin-get-color 'green))))
+
+ (defun ctp/text-org-blocks ()
+ (face-remap-add-relative 'org-block (list :foreground (catppuccin-get-color 'text))))
+ (add-hook 'org-mode-hook 'ctp/text-org-blocks)
+#+end_src
+
+Finally, we need to configure the ~org~ package. Technically we could install the git version here with elpaca, but that version is just broken. We therefore will just use the built-in package that comes with emacs. This initial setup will hook into the ~org-mode-base~ and ~org-mode-prettify~ functions that we made before to give us the final result 😌.
+#+begin_src emacs-lisp
+ ;; We already installed the latest version of org in our init.el
+ (use-package org
+ :elpaca nil
+ :hook (org-mode . ethandl/org-mode-base)
+ :config
+ (ethandl/org-mode-prettify))
+#+end_src
+** Languages
+*** LSP Setup
+LSP, the Language Server Protocol. Very nice for debugging code live as you write it. It depends on the language as to how useful this really is.
+
+*Warning:* Some LSPs are godawful slow and can chew through CPU and memory. Be careful, tinker, and don't be afraid to disable the training wheels.
+#+begin_src emacs-lisp
+ ;; LSP mode
+ (use-package lsp
+ :elpaca lsp-mode
+ :init
+ (setq gc-cons-threshold 100000000)
+ (setq read-process-output-max (* 1024 1024))
+ (setq lsp-completion-provider :none))
+#+end_src
+*** C
+There is nothing to report here, yet...
+#+begin_src emacs-lisp
+#+end_src
+*** Haskell
+This setup is just a combination of =haskell-mode= and the Haskell Language Server.
+Haskell mode is really good for the indenting and overall behaviour of the editor, and the Haskell language server is definitely there... (It can be slow, so can be turned off on larger projects)
+#+begin_src emacs-lisp
+ ;; Haskell setup
+ (use-package haskell-mode)
+ (use-package lsp-haskell
+ :config
+ (add-hook 'haskell-mode-hook #'lsp)
+ (add-hook 'haskell-literate-mode-hook #'lsp))
+#+end_src
+*** Rust
+Rust mode alongside LSP again. The rust LSP is very good as far as LSPs go, very helpful. Though sometimes it's better to compile and see the rustc errors as they tend to be more verbose.
+#+begin_src emacs-lisp
+ ;; Rust setup
+ (use-package rust-mode
+ :config
+ (add-hook 'rust-mode-hook #'lsp))
+#+end_src
+*** Go
+Nothing to see here, yet...
+#+begin_src emacs-lisp
+#+end_src
+*** Java
+A.K.A. OO hell.
+=lsp-java= is actually pretty okay, and uses the Eclipse Language Server. So basically emacs becomes eclipse but better (not hard). In general IntelliJ is probably still your best bet when it comes to Java development.
+#+begin_src emacs-lisp
+;; Java setup
+(use-package lsp-java
+ :config
+ (add-hook 'java-mode-hook #'lsp))
+#+end_src
+*** Python
+A.K.A. the most overused and overhyped language. This language is incredibly slow, which is why its language server is not written in Python LMAO. Anywho the =pyright= LSP is made by Microshit so maybe this is proprietary software or telemetry, idk.
+#+begin_src emacs-lisp
+ ;; Python setup
+ (use-package lsp-pyright
+ :hook (python-mode . (lambda ()
+ (require 'lsp-pyright)
+ (lsp))))
+#+end_src
+*** OCaml
+This is the basic OCaml config provided by opam on installation. It may be actually better to just use the language server that OCaml installed...
+#+begin_src emacs-lisp
+ ;; OCaml configuration
+ ;; - better error and backtrace matching
+
+ (defun set-ocaml-error-regexp ()
+ (set
+ 'compilation-error-regexp-alist
+ (list '("[Ff]ile \\(\"\\(.*?\\)\", line \\(-?[0-9]+\\)\\(, characters \\(-?[0-9]+\\)-\\([0-9]+\\)\\)?\\)\\(:\n\\(\\(Warning .*?\\)\\|\\(Error\\)\\):\\)?"
+ 2 3 (5 . 6) (9 . 11) 1 (8 compilation-message-face)))))
+
+ (add-hook 'tuareg-mode-hook 'set-ocaml-error-regexp)
+ (add-hook 'caml-mode-hook 'set-ocaml-error-regexp)
+ ;; ## added by OPAM user-setup for emacs / base ## 56ab50dc8996d2bb95e7856a6eddb17b ## you can edit, but keep this line
+ (require 'opam-user-setup "~/.config/emacs/opam-user-setup.el")
+#+end_src
diff --git a/early-init.el b/early-init.el
@@ -0,0 +1 @@
+(setq package-enable-at-startup nil)
diff --git a/init.el b/init.el
@@ -1,239 +1,93 @@
-;; This emacs config is designed to function on both Mac & Linux,
-;; using emacs-mac on mac.
-;; I Wanted to get away from doom because it was very slow,
-;; this turns out to be not much faster :(
-;; At least I know how my emacs actually functions now
-;; Elpa & Melpa:
-(require 'package)
-(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
-(package-initialize)
-
-
-;; This is only needed once, near the top of the file
-(eval-when-compile
- ;; Following line is not needed if use-package.el is in ~/.emacs.d
- (add-to-list 'load-path "~/.emacs.d/elpa/use-package-2.4.5")
- (require 'use-package))
-
-;; Catppuccin Mocha theme
-(add-to-list 'custom-theme-load-path "~/.emacs.d/themes")
-(load-theme 'catppuccin t)
-(setq catppuccin-flavor 'mocha)
-(catppuccin-reload)
-
-;; Get rid of default crud
-(setq inhibit-startup-screen t)
-(unless (eq system-type 'darwin)
- (menu-bar-mode 0)
- (tool-bar-mode 0)
- (scroll-bar-mode 0))
-;; Modeline line and col number
-(line-number-mode 1)
-(column-number-mode 1)
-
-;; Indentation
-(setq-default indent-tabs-mode nil)
-
-;; SILENCE
-(setq ring-bell-function 'ignore)
-
-
-;; ivy mode instead of ido mode:
-(use-package ivy
- :ensure t)
-(ivy-mode t)
-;; counsel extends ivy:
-(use-package counsel
- :ensure t)
-(counsel-mode t)
-
-
-;; Set the fonts
-(defun custom-set-fonts (&optional frame)
- (with-selected-frame (or frame (selected-frame))
- ;;(set-face-attribute 'default nil :font "Comic Code Ligatures-16")
- (set-face-attribute 'default nil :font "Victor Mono-16")
- (set-face-attribute 'font-lock-comment-face nil :slant 'italic)
- (set-face-attribute 'font-lock-keyword-face nil :slant 'italic)))
-(custom-set-fonts)
-(add-hook 'after-make-frame-functions 'custom-set-fonts)
-
-(setq comic-code-ligs '(("-" (rx (+ "-"))) ("-" (rx (* "-") ">"))
- ("+" (rx (+ "+"))) ("<" (rx (+ "=")))
- ("<" (rx (+ "=") ">")) ("<" (rx (+ "~")))
- ("<" (rx (+ "~") ">")) ("<" (rx "!" (+ "-")))
- ("<" (rx (+ "-"))) ("<" (rx (+ "-") ">")) ("<" (rx "|"))
- (">" (rx (+ "="))) (">" (rx ">" (+ "=")))
- (">" (rx ">" (+ "=") ">")) (">" (rx (+ "-")))
- (">" (rx (+ "-") "<")) ("~" (rx (+ "~")))
- ("~" (rx (+ "~") ">")) ("=" (rx (* "=") ">"))
- ("=" (rx (+ (or ">" "<" "|" "/" "~" ":" "!" "="))))
- "!=" "!==" "[|" "|]" "{|" "|}" "|>" "||" "&&"))
-
-(setq victor-mono-ligs '("</" "</>" "/>" "~-" "-~" "~@" "<~" "<~>" "<~~" "~>"
- "~~" "~~>" ">=" "<=" "<!--" "##" "###" "####" "|-" "-|"
- "|->" "<-|" ">-|" "|-<" "|=" "|=>" ">-" "<-" "<--"
- "-->" "->" "-<" ">->" ">>-" "<<-" "<->" "->>" "-<<"
- "<-<" "==>" "=>" "=/=" "!==" "!=" "<==" ">>=" "=>>"
- ">=>" "<=>" "<=<" "<<=" "=<<" ".-" ".=" "=:=" "=!="
- "==" "===" "::" ":=" ":>" ":<" ">:" ";;" "<|" "<|>"
- "|>" "<>" "<$" "<$>" "$>" "<+" "<+>" "+>" "?=" "/="
- "/==" "/\\" "\\/" "__" "&&" "++" "+++"))
-
-;; Font ligatures:
-(if (not (eq system-type 'darwin))
- (use-package ligature
- :ensure t
- :config
- (ligature-set-ligatures 'prog-mode victor-mono-ligs)
- (global-ligature-mode t))
- ;; Else, on mac we have ligatures already
- (mac-auto-operator-composition-mode))
-
-;; Rainbow delimiters:
-(use-package rainbow-delimiters
- :ensure t
- :hook (prog-mode . rainbow-delimiters-mode))
-
-;; OLD Doom modeline icons
-;; Icons for the modeline (and other things probably)
-;;(use-package all-the-icons
-;; :ensure t)
-
-;; Doom modeline:
-(use-package doom-modeline
- :ensure t
- :hook (after-init . doom-modeline-mode))
-
-
-;; Which key (this is the thing responsible for coming up with the minibuffer of keys that you can pick):
-(use-package which-key
- :ensure t
- :init (which-key-mode)
- :diminish which-key-mode
- :config
- (setq which-key-idle-delay 0.3))
-
-;; Evil mode :D
-(use-package evil
- :ensure t
- :init
- (setq evil-want-integration t)
- (setq evil-want-keybinding nil)
- (setq evil-want-C-d-scroll t)
- (setq evil-want-C-u-scroll t)
- (setq evil-want-C-i-jump nil)
- (setq evil-undo-system 'undo-redo)
- :config
- (evil-mode 1)
- ;; Enabling C-g to exit from normal mode, and C-h to do what it normally does in emacs
- (define-key evil-insert-state-map (kbd "C-g") 'evil-normal-state)
- (define-key evil-insert-state-map (kbd "C-h") 'evil-delete-backward-char-and-join)
-
- ;; Use visual line motions outside of visual-line-mode buffers
- (evil-global-set-key 'motion "j" 'evil-next-visual-line)
- (evil-global-set-key 'motion "k" 'evil-previous-visual-line)
-
- ;; Set initial states to be in normal mode for some buffers
- (evil-set-initial-state 'messages-buffer-mode 'normal)
- (evil-set-initial-state 'dashboard-mode 'normal))
-
-;; Extra modes for evil, if evil is playing up this would be the first thing to check
-(use-package evil-collection
- :ensure t
- :after evil
- :config
- (evil-collection-init))
-
-;; Cape
-(use-package cape
- :ensure t)
-
-;; Completion & Modernisation
-(use-package corfu
- :ensure t
- :after cape
- :custom
- (corfu-cycle t)
- (corfu-auto t)
- (corfu-scroll-margin 5)
- :init
- (global-corfu-mode)
- ;; Shouldn't have to do this, but lsp is a little bugged:
- (advice-add #'lsp-completion-at-point :around #'cape-wrap-noninterruptible))
-
-;; Some more useful configs
-(use-package emacs
- :init
- ;; TAB cycle if there are only a few candidates
- (setq completion-cycle-threshold 3))
-
-(unless (eq system-type 'darwin)
- ;; Change the default scroll behaviour to smooth scroll
- (pixel-scroll-precision-mode t))
-;; Scrolling down a file only goes down a single line when reaching the bottom
-(setq scroll-step 1)
-;; The region that the curser needs to enter to trigger scrolling
-(setq scroll-margin 5)
-;; Necessary to stop random jumps
-(setq scroll-conservatively 10000)
-;; Faster scrolling:
-(use-package fast-scroll
- :ensure t
- :config
- (fast-scroll-config)
- (fast-scroll-mode 1))
-
-
-;; Set the backup/autorecover dir to not be in the local directory of the file
-(setq backup-directory-alist '(("." . "~/.emacs.d/backups"))
- backup-by-copying t ; Don't delink hardlinks
- version-control t ; Use version numbers on backups
- delete-old-versions t ; Automatically delete excess backups
- kept-new-versions 20 ; Number of new versions to keep
- kept-old-versions 5 ; Number of old versions to keep
- )
-
-
-;; LSP mode
-(use-package lsp
- :ensure lsp-mode
- :init
- (setq gc-cons-threshold 100000000)
- (setq read-process-output-max (* 1024 1024))
- (setq lsp-completion-provider :none))
-
-
-;; Haskell setup
-(use-package haskell-mode
- :ensure t)
-(use-package lsp-haskell
- :ensure t
- :config
- (add-hook 'haskell-mode-hook #'lsp)
- (add-hook 'haskell-literate-mode-hook #'lsp))
-
-
-;; Rust setup
-(use-package rust-mode
- :ensure t
- :config
- (add-hook 'rust-mode-hook #'lsp))
-
-
-;; Java setup
-(use-package lsp-java
- :ensure t
- :config
- (add-hook 'java-mode-hook #'lsp))
-
-
-;; Python setup
-(use-package lsp-pyright
- :ensure t
- :hook (python-mode . (lambda ()
- (require 'lsp-pyright)
- (lsp))))
-
+;; Elpaca package manager
+(defvar elpaca-installer-version 0.5)
+(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
+(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
+(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory))
+(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git"
+ :ref nil
+ :files (:defaults (:exclude "extensions"))
+ :build (:not elpaca--activate-package)))
+(let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory))
+ (build (expand-file-name "elpaca/" elpaca-builds-directory))
+ (order (cdr elpaca-order))
+ (default-directory repo))
+ (add-to-list 'load-path (if (file-exists-p build) build repo))
+ (unless (file-exists-p repo)
+ (make-directory repo t)
+ (when (< emacs-major-version 28) (require 'subr-x))
+ (condition-case-unless-debug err
+ (if-let ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*"))
+ ((zerop (call-process "git" nil buffer t "clone"
+ (plist-get order :repo) repo)))
+ ((zerop (call-process "git" nil buffer t "checkout"
+ (or (plist-get order :ref) "--"))))
+ (emacs (concat invocation-directory invocation-name))
+ ((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch"
+ "--eval" "(byte-recompile-directory \".\" 0 'force)")))
+ ((require 'elpaca))
+ ((elpaca-generate-autoloads "elpaca" repo)))
+ (progn (message "%s" (buffer-string)) (kill-buffer buffer))
+ (error "%s" (with-current-buffer buffer (buffer-string))))
+ ((error) (warn "%s" err) (delete-directory repo 'recursive))))
+ (unless (require 'elpaca-autoloads nil t)
+ (require 'elpaca)
+ (elpaca-generate-autoloads "elpaca" repo)
+ (load "./elpaca-autoloads")))
+(add-hook 'after-init-hook #'elpaca-process-queues)
+(elpaca `(,@elpaca-order))
+
+;; Install use-package support
+(elpaca elpaca-use-package
+ ;; Enable :elpaca use-package keyword.
+ (elpaca-use-package-mode)
+ ;; Assume :elpaca t unless otherwise specified.
+ (setq elpaca-use-package-by-default t))
+
+(unless (fboundp 'use-package)
+ (elpaca-wait))
+
+;; Unfortunately have to install git org before going into config.org
+(use-package org
+ :load-path "~/.config/emacs/elpaca/builds/org/")
+;; Unfortunately we need to wait for org to install to proceed, otherwise it will use the built-in and destroy everything
+(elpaca-wait)
+
+(org-babel-load-file "~/.config/emacs/config.org")
;; Emacs crap that it does automatically:
+(custom-set-variables
+ ;; custom-set-variables was added by Custom.
+ ;; If you edit it by hand, you could mess it up, so be careful.
+ ;; Your init file should contain only one such instance.
+ ;; If there is more than one, they won't work right.
+ '(auto-save-file-name-transforms '((".*" "~/.config/emacs/autosaves/\\1" t)))
+ '(backup-directory-alist '((".*" . "~/.config/emacs/backups/")))
+ '(warning-suppress-types '((comp) (comp) (org-element-cache) (org-element-cache))))
+(custom-set-faces
+ ;; custom-set-faces was added by Custom.
+ ;; If you edit it by hand, you could mess it up, so be careful.
+ ;; Your init file should contain only one such instance.
+ ;; If there is more than one, they won't work right.
+ '(fixed-pitch ((t (:family "Victor Mono" :height 160 :weight regular))))
+ '(org-block ((t (:inherit fixed-pitch))))
+ '(org-code ((t (:inherit (shadow fixed-pitch)))))
+ '(org-document-info ((t (:foreground "dark orange"))))
+ '(org-document-info-keyword ((t (:inherit (shadow fixed-pitch)))))
+ '(org-document-title ((t (:inherit default :weight bold :foreground "#cdd6f4" :font "ETBookOT" :height 2.0 :underline nil))))
+ '(org-indent ((t (:inherit (org-hide fixed-pitch)))))
+ '(org-level-1 ((t (:inherit default :weight bold :foreground "#cdd6f4" :font "ETBookOT" :height 1.75))))
+ '(org-level-2 ((t (:inherit default :weight bold :foreground "#cdd6f4" :font "ETBookOT" :height 1.5))))
+ '(org-level-3 ((t (:inherit default :weight bold :foreground "#cdd6f4" :font "ETBookOT" :height 1.25))))
+ '(org-level-4 ((t (:inherit default :weight bold :foreground "#cdd6f4" :font "ETBookOT" :height 1.1))))
+ '(org-level-5 ((t (:inherit default :weight bold :foreground "#cdd6f4" :font "ETBookOT" :height 1.1))))
+ '(org-level-6 ((t (:inherit default :weight bold :foreground "#cdd6f4" :font "ETBookOT" :height 1.1))))
+ '(org-level-7 ((t (:inherit default :weight bold :foreground "#cdd6f4" :font "ETBookOT" :height 1.1))))
+ '(org-level-8 ((t (:inherit default :weight bold :foreground "#cdd6f4" :font "ETBookOT" :height 1.1))))
+ '(org-link ((t (:foreground "royal blue" :underline t))))
+ '(org-meta-line ((t (:inherit (font-lock-comment-face fixed-pitch)))))
+ '(org-property-value ((t (:inherit fixed-pitch))) t)
+ '(org-special-keyword ((t (:inherit (font-lock-comment-face fixed-pitch)))))
+ '(org-table ((t (:inherit fixed-pitch :foreground "#83a598"))))
+ '(org-tag ((t (:inherit (shadow fixed-pitch) :weight bold :height 0.8))))
+ '(org-verbatim ((t (:inherit (shadow fixed-pitch)))))
+ '(variable-pitch ((t (:family "ETBookOT" :height 200 :weight thin)))))
diff --git a/opam-user-setup.el b/opam-user-setup.el
@@ -0,0 +1,131 @@
+;; ## added by OPAM user-setup for emacs / base ## cfd3c9b7837c85cffd0c59de521990f0 ## you can edit, but keep this line
+(provide 'opam-user-setup)
+
+;; Base configuration for OPAM
+
+(defun opam-shell-command-to-string (command)
+ "Similar to shell-command-to-string, but returns nil unless the process
+ returned 0, and ignores stderr (shell-command-to-string ignores return value)"
+ (let* ((return-value 0)
+ (return-string
+ (with-output-to-string
+ (setq return-value
+ (with-current-buffer standard-output
+ (process-file shell-file-name nil '(t nil) nil
+ shell-command-switch command))))))
+ (if (= return-value 0) return-string nil)))
+
+(defun opam-update-env (switch)
+ "Update the environment to follow current OPAM switch configuration"
+ (interactive
+ (list
+ (let ((default
+ (car (split-string (opam-shell-command-to-string "opam switch show --safe")))))
+ (completing-read
+ (concat "opam switch (" default "): ")
+ (split-string (opam-shell-command-to-string "opam switch list -s --safe") "\n")
+ nil t nil nil default))))
+ (let* ((switch-arg (if (= 0 (length switch)) "" (concat "--switch " switch)))
+ (command (concat "opam config env --safe --sexp " switch-arg))
+ (env (opam-shell-command-to-string command)))
+ (when (and env (not (string= env "")))
+ (dolist (var (car (read-from-string env)))
+ (setenv (car var) (cadr var))
+ (when (string= (car var) "PATH")
+ (setq exec-path (split-string (cadr var) path-separator)))))))
+
+(opam-update-env nil)
+
+(defvar opam-share
+ (let ((reply (opam-shell-command-to-string "opam config var share --safe")))
+ (when reply (substring reply 0 -1))))
+
+(add-to-list 'load-path (concat opam-share "/emacs/site-lisp"))
+;; OPAM-installed tools automated detection and initialisation
+
+(defun opam-setup-tuareg ()
+ (add-to-list 'load-path (concat opam-share "/tuareg") t)
+ (load "tuareg-site-file"))
+
+(defun opam-setup-add-ocaml-hook (h)
+ (add-hook 'tuareg-mode-hook h t)
+ (add-hook 'caml-mode-hook h t))
+
+(defun opam-setup-complete ()
+ (if (require 'company nil t)
+ (opam-setup-add-ocaml-hook
+ (lambda ()
+ (company-mode)
+ (defalias 'auto-complete 'company-complete)))
+ (require 'auto-complete nil t)))
+
+(defun opam-setup-ocp-indent ()
+ (opam-setup-complete)
+ (autoload 'ocp-setup-indent "ocp-indent" "Improved indentation for Tuareg mode")
+ (autoload 'ocp-indent-caml-mode-setup "ocp-indent" "Improved indentation for Caml mode")
+ (add-hook 'tuareg-mode-hook 'ocp-setup-indent t)
+ (add-hook 'caml-mode-hook 'ocp-indent-caml-mode-setup t))
+
+(defun opam-setup-ocp-index ()
+ (autoload 'ocp-index-mode "ocp-index" "OCaml code browsing, documentation and completion based on build artefacts")
+ (opam-setup-add-ocaml-hook 'ocp-index-mode))
+
+(defun opam-setup-merlin ()
+ (opam-setup-complete)
+ (require 'merlin)
+ (opam-setup-add-ocaml-hook 'merlin-mode)
+
+ (defcustom ocp-index-use-auto-complete nil
+ "Use auto-complete with ocp-index (disabled by default by opam-user-setup because merlin is in use)"
+ :group 'ocp_index)
+ (defcustom merlin-ac-setup 'easy
+ "Use auto-complete with merlin (enabled by default by opam-user-setup)"
+ :group 'merlin-ac)
+
+ ;; So you can do it on a mac, where `C-<up>` and `C-<down>` are used
+ ;; by spaces.
+ (define-key merlin-mode-map
+ (kbd "C-c <up>") 'merlin-type-enclosing-go-up)
+ (define-key merlin-mode-map
+ (kbd "C-c <down>") 'merlin-type-enclosing-go-down)
+ (set-face-background 'merlin-type-face "skyblue"))
+
+(defun opam-setup-utop ()
+ (autoload 'utop "utop" "Toplevel for OCaml" t)
+ (autoload 'utop-minor-mode "utop" "Minor mode for utop" t)
+ (add-hook 'tuareg-mode-hook 'utop-minor-mode))
+
+(defvar opam-tools
+ '(("tuareg" . opam-setup-tuareg)
+ ("ocp-indent" . opam-setup-ocp-indent)
+ ("ocp-index" . opam-setup-ocp-index)
+ ("merlin" . opam-setup-merlin)
+ ("utop" . opam-setup-utop)))
+
+(defun opam-detect-installed-tools ()
+ (let*
+ ((command "opam list --installed --short --safe --color=never")
+ (names (mapcar 'car opam-tools))
+ (command-string (mapconcat 'identity (cons command names) " "))
+ (reply (opam-shell-command-to-string command-string)))
+ (when reply (split-string reply))))
+
+(defvar opam-tools-installed (opam-detect-installed-tools))
+
+(defun opam-auto-tools-setup ()
+ (interactive)
+ (dolist (tool opam-tools)
+ (when (member (car tool) opam-tools-installed)
+ (funcall (symbol-function (cdr tool))))))
+
+(opam-auto-tools-setup)
+;; ## end of OPAM user-setup addition for emacs / base ## keep this line
+;; ## added by OPAM user-setup for emacs / ocp-indent ## dbe5bfcf29ff0e6137a583f7be1bef1d ## you can edit, but keep this line
+;; Load ocp-indent from its original switch when not found in current switch
+(when (not (assoc "ocp-indent" opam-tools-installed))
+ (autoload 'ocp-setup-indent "/Users/ethan/.opam/5.0.0/share/emacs/site-lisp/ocp-indent.el" "Improved indentation for Tuareg mode")
+ (autoload 'ocp-indent-caml-mode-setup "/Users/ethan/.opam/5.0.0/share/emacs/site-lisp/ocp-indent.el" "Improved indentation for Caml mode")
+ (add-hook 'tuareg-mode-hook 'ocp-setup-indent t)
+ (add-hook 'caml-mode-hook 'ocp-indent-caml-mode-setup t)
+ (setq ocp-indent-path "/Users/ethan/.opam/5.0.0/bin/ocp-indent"))
+;; ## end of OPAM user-setup addition for emacs / ocp-indent ## keep this line
diff --git a/themes/catppuccin-theme.el b/themes/catppuccin-theme.el
@@ -1,1102 +0,0 @@
-;;; catppuccin-theme.el --- Catppuccin for Emacs - 🍄 Soothing pastel theme for Emacs -*- lexical-binding: t; no-byte-compile: 0; -*-
-
-;; Copyright 2022-present, All rights reserved
-;;
-;; Code licensed under the MIT license
-
-;; Maintainer: Carsten Kragelund <carsten@kragelund.me>
-;; Author: nyxkrage
-;; Original-Author: film42
-;; Version: 1.0.0
-;; Package-Requires: ((emacs "25.1"))
-;; URL: https://github.com/catppuccin/emacs
-
-;;; Commentary:
-
-;; 🍄 Soothing pastel theme for Emacs
-
-;;; Code:
-(deftheme catppuccin)
-
-;;;; Configuration options:
-
-(defgroup catppuccin nil
- "Catppuccin theme options.
-
-The theme has to be reloaded after changing anything in this group."
- :group 'faces)
-
-(defcustom catppuccin-enlarge-headings t
- "Use different font sizes for some headings and titles."
- :type 'boolean
- :group 'catppuccin)
-
-(defcustom catppuccin-height-title-1 1.3
- "Header 1 font size."
- :type 'number
- :group 'catppuccin)
-
-(defcustom catppuccin-height-title-2 1.2
- "Header 2 font size."
- :type 'number
- :group 'catppuccin)
-
-(defcustom catppuccin-height-title-3 1.2
- "Header 3 font size."
- :type 'number
- :group 'catppuccin)
-
-(defcustom catppuccin-height-doc-title 1.44
- "Documentation Title font size."
- :type 'number
- :group 'catppuccin)
-
-(defcustom catppuccin-flavor 'mocha
- "The flavor to use for the Catppuccin theme.
-Must be one of `mocha`, `macchiato`, `frappe`, or `latte`."
- :type '(choice (const :tag "Mocha" mocha)
- (const :tag "Macchiato" macchiato)
- (const :tag "Frappe" frappe)
- (const :tag "Latte" latte))
- :group 'catppuccin)
-
-(defcustom catppuccin-mocha-colors '((rosewater . "#f5e0dc")
- (flamingo . "#f2cdcd")
- (pink . "#f5c2e7")
- (mauve . "#cba6f7")
- (red . "#f38ba8")
- (maroon . "#eba0ac")
- (peach . "#fab387")
- (yellow . "#f9e2af")
- (green . "#a6e3a1")
- (teal . "#94e2d5")
- (sky . "#89dceb")
- (sapphire . "#74c7ec")
- (blue . "#89b4fa")
- (lavender . "#b4befe")
- (text . "#cdd6f4")
- (subtext1 . "#bac2de")
- (subtext0 . "#a6adc8")
- (overlay2 . "#9399b2")
- (overlay1 . "#7f849c")
- (overlay0 . "#6c7086")
- (surface2 . "#585b70")
- (surface1 . "#45475a")
- (surface0 . "#313244")
- (base . "#1e1e2e")
- (mantle . "#181825")
- (crust . "#11111b"))
- "Colors used for catppuccin-mocha."
- :tag "Mocha Colors"
- :options '(rosewater flamingo pink mauve red maroon peach yellow green teal sky sapphire blue lavender text subtext1 subtext0 overlay2 overlay1 overlay0 surface2 surface1 surface0 base mantle crust)
- :type '(alist :key-type symbol :value-type string)
- :group 'catppuccin)
-
-(defcustom catppuccin-macchiato-colors '((rosewater . "#f4dbd6")
- (flamingo . "#f0c6c6")
- (pink . "#f5bde6")
- (mauve . "#c6a0f6")
- (red . "#ed8796")
- (maroon . "#ee99a0")
- (peach . "#f5a97f")
- (yellow . "#eed49f")
- (green . "#a6da95")
- (teal . "#8bd5ca")
- (sky . "#91d7e3")
- (sapphire . "#7dc4e4")
- (blue . "#8aadf4")
- (lavender . "#b7bdf8")
- (text . "#cad3f5")
- (subtext1 . "#b8c0e0")
- (subtext0 . "#a5adcb")
- (overlay2 . "#939ab7")
- (overlay1 . "#8087a2")
- (overlay0 . "#6e738d")
- (surface2 . "#5b6078")
- (surface1 . "#494d64")
- (surface0 . "#363a4f")
- (base . "#24273a")
- (mantle . "#1e2030")
- (crust . "#181926"))
- "Colors used for catppuccin-macchiato."
- :tag "Macchiato Colors"
- :options '(rosewater flamingo pink mauve red maroon peach yellow green teal sky sapphire blue lavender text subtext1 subtext0 overlay2 overlay1 overlay0 surface2 surface1 surface0 base mantle crust)
- :type '(alist :key-type symbol :value-type string)
- :group 'catppuccin)
-
-(defcustom catppuccin-frappe-colors '((rosewater . "#f2d5cf")
- (flamingo . "#eebebe")
- (pink . "#f4b8e4")
- (mauve . "#ca9ee6")
- (red . "#e78284")
- (maroon . "#ea999c")
- (peach . "#ef9f76")
- (yellow . "#e5c890")
- (green . "#a6d189")
- (teal . "#81c8be")
- (sky . "#99d1db")
- (sapphire . "#85c1dc")
- (blue . "#8caaee")
- (lavender . "#babbf1")
- (text . "#c6d0f5")
- (subtext1 . "#b5bfe2")
- (subtext0 . "#a5adce")
- (overlay2 . "#949cbb")
- (overlay1 . "#838ba7")
- (overlay0 . "#737994")
- (surface2 . "#626880")
- (surface1 . "#51576d")
- (surface0 . "#414559")
- (base . "#303446")
- (mantle . "#292c3c")
- (crust . "#232634"))
- "Colors used for catppuccin-frappe."
- :tag "Frappe Colors"
- :options '(rosewater flamingo pink mauve red maroon peach yellow green teal sky sapphire blue lavender text subtext1 subtext0 overlay2 overlay1 overlay0 surface2 surface1 surface0 base mantle crust)
- :type '(alist :key-type symbol :value-type string)
- :group 'catppuccin)
-
-(defcustom catppuccin-latte-colors '((rosewater . "#dc8a78")
- (flamingo . "#dd7878")
- (pink . "#ea76cb")
- (mauve . "#8839ef")
- (red . "#d20f39")
- (maroon . "#e64553")
- (peach . "#fe640b")
- (yellow . "#df8e1d")
- (green . "#40a02b")
- (teal . "#179299")
- (sky . "#04a5e5")
- (sapphire . "#209fb5")
- (blue . "#1e66f5")
- (lavender . "#7287fd")
- (text . "#4c4f69")
- (subtext1 . "#5c5f77")
- (subtext0 . "#6c6f85")
- (overlay2 . "#7c7f93")
- (overlay1 . "#8c8fa1")
- (overlay0 . "#9ca0b0")
- (surface2 . "#acb0be")
- (surface1 . "#bcc0cc")
- (surface0 . "#ccd0da")
- (base . "#eff1f5")
- (mantle . "#e6e9ef")
- (crust . "#dce0e8"))
- "Colors used for catppuccin-latte."
- :tag "Latte Colors"
- :options '(rosewater flamingo pink mauve red maroon peach yellow green teal sky sapphire blue lavender text subtext1 subtext0 overlay2 overlay1 overlay0 surface2 surface1 surface0 base mantle crust)
- :type '(alist :key-type symbol :value-type string)
- :group 'catppuccin)
-
-;;;; Internal functions
-
-(defun catppuccin-quantize-color (color)
- "Quantize COLOR to a 256 color palette."
- (let ((i 1)
- (str "#"))
- (while (<= i 5)
- (setq str
- (concat
- str
- (format
- "%02x"
- (* (round
- (/
- (string-to-number (substring color i (+ i 2)) 16)
- 17))
- 17))))
- (setq i (+ i 2)))
- str))
-
-;; Color operations
-(let* ((hex-to-rgb (lambda (color)
- (mapcar
- (lambda (i) (string-to-number (substring color i (+ i 2)) 16))
- '(1 3 5))))
- (rgb-to-hex (lambda (r g b)
- (format "#%02x%02x%02x" r g b)))
- (rnd (lambda (n) (round (+ .5 n)))))
-
- (defun catppuccin-lighten (color value)
- "Lighten COLOR by VALUE%."
- (let* ((factor (/ value 100.0)))
- (apply rgb-to-hex (mapcar (lambda (v) (funcall rnd (min 255 (+ (* (- 255 v) factor) v))))
- (funcall hex-to-rgb color)))))
-
- (defun catppuccin-darken (color value)
- "Darken COLOR by VALUE%."
- (let* ((factor (/ value 100.0)))
- (apply rgb-to-hex (mapcar (lambda (v) (floor (* (- 1 factor) v)))
- (funcall hex-to-rgb color))))))
-
-;;;; User functions
-
-(defun catppuccin-reload ()
- "Reload the Catppuccin theme, useful for after having set custom colors with `catppuccin-set-color`."
- (interactive)
- (disable-theme 'catppuccin)
- (load-theme 'catppuccin t))
-
-(defun catppuccin-set-color (color value &optional flavor)
- "Set the COLOR of FLAVOR or the current flavor to VALUE."
- (interactive "SChange color: \nsSet %s to: ")
- (setcdr (assoc color (symbol-value (intern-soft (concat "catppuccin-" (symbol-name (or flavor catppuccin-flavor)) "-colors")))) value))
-
-(defun catppuccin-get-color (color &optional flavor)
- "Get the COLOR of FLAVOR or the current flavor."
- (interactive "SThe color to get: ")
- (alist-get color (symbol-value (intern-soft (concat "catppuccin-" (symbol-name (or flavor catppuccin-flavor)) "-colors")))))
-
-;;;; Theme definition:
-(let ((colors '((undef "#ff00ff" "#ff00ff")
- (ctp-rosewater (catppuccin-get-color 'rosewater) (catppuccin-quantize-color (catppuccin-get-color 'rosewater)))
- (ctp-flamingo (catppuccin-get-color 'flamingo) (catppuccin-quantize-color (catppuccin-get-color 'flamingo)))
- (ctp-pink (catppuccin-get-color 'pink) (catppuccin-quantize-color (catppuccin-get-color 'pink)))
- (ctp-mauve (catppuccin-get-color 'mauve) (catppuccin-quantize-color (catppuccin-get-color 'mauve)))
- (ctp-red (catppuccin-get-color 'red) (catppuccin-quantize-color (catppuccin-get-color 'red)))
- (ctp-maroon (catppuccin-get-color 'maroon) (catppuccin-quantize-color (catppuccin-get-color 'maroon)))
- (ctp-peach (catppuccin-get-color 'peach) (catppuccin-quantize-color (catppuccin-get-color 'peach)))
- (ctp-yellow (catppuccin-get-color 'yellow) (catppuccin-quantize-color (catppuccin-get-color 'yellow)))
- (ctp-green (catppuccin-get-color 'green) (catppuccin-quantize-color (catppuccin-get-color 'green)))
- (ctp-teal (catppuccin-get-color 'teal) (catppuccin-quantize-color (catppuccin-get-color 'teal)))
- (ctp-sky (catppuccin-get-color 'sky) (catppuccin-quantize-color (catppuccin-get-color 'sky)))
- (ctp-sapphire (catppuccin-get-color 'sapphire) (catppuccin-quantize-color (catppuccin-get-color 'sapphire)))
- (ctp-blue (catppuccin-get-color 'blue) (catppuccin-quantize-color (catppuccin-get-color 'blue)))
- (ctp-lavender (catppuccin-get-color 'lavender) (catppuccin-quantize-color (catppuccin-get-color 'lavender)))
- (ctp-text (catppuccin-get-color 'text) (catppuccin-quantize-color (catppuccin-get-color 'text)))
- (ctp-subtext1 (catppuccin-get-color 'subtext1) (catppuccin-quantize-color (catppuccin-get-color 'subtext1)))
- (ctp-subtext0 (catppuccin-get-color 'subtext0) (catppuccin-quantize-color (catppuccin-get-color 'subtext0)))
- (ctp-overlay2 (catppuccin-get-color 'overlay2) (catppuccin-quantize-color (catppuccin-get-color 'overlay2)))
- (ctp-overlay1 (catppuccin-get-color 'overlay1) (catppuccin-quantize-color (catppuccin-get-color 'overlay1)))
- (ctp-overlay0 (catppuccin-get-color 'overlay0) (catppuccin-quantize-color (catppuccin-get-color 'overlay0)))
- (ctp-surface2 (catppuccin-get-color 'surface2) (catppuccin-quantize-color (catppuccin-get-color 'surface2)))
- (ctp-surface1 (catppuccin-get-color 'surface1) (catppuccin-quantize-color (catppuccin-get-color 'surface1)))
- (ctp-surface0 (catppuccin-get-color 'surface0) (catppuccin-quantize-color (catppuccin-get-color 'surface0)))
- (ctp-base (catppuccin-get-color 'base) (catppuccin-quantize-color (catppuccin-get-color 'base)))
- (ctp-mantle (catppuccin-get-color 'mantle) (catppuccin-quantize-color (catppuccin-get-color 'mantle)))
- (ctp-crust (catppuccin-get-color 'crust) (catppuccin-quantize-color (catppuccin-get-color 'crust)))
-
- (ctp-current (if (eq catppuccin-flavor 'latte)
- (catppuccin-darken (catppuccin-get-color 'base) 5)
- (catppuccin-lighten (catppuccin-get-color 'base) 5))
- (catppuccin-quantize-color (if (eq catppuccin-flavor 'latte)
- (catppuccin-darken (catppuccin-get-color 'base) 5)
- (catppuccin-lighten (catppuccin-get-color 'base) 5))))))
- (faces '(;; default / basic faces
- (cursor :background ,ctp-rosewater)
- (default :background ,ctp-base :foreground ,ctp-text)
- (default-italic :slant italic)
- (hl-todo :foreground ,ctp-peach)
- (error :foreground ,ctp-maroon)
- (ffap :foreground ,undef)
- (fringe :background ,ctp-base :foreground ,ctp-surface1)
- (header-line :inherit 'mode-line)
- (highlight :foreground ,ctp-text :background ,ctp-current)
- (hl-line :background ,ctp-current :extend t)
- (info-quoted-name :foreground ,undef)
- (info-string :foreground ,ctp-green)
- (lazy-highlight :foreground ,ctp-subtext1 :background ,ctp-surface1)
- (link :foreground ,ctp-rosewater :underline t)
- (link-unvisited :foreground ,ctp-mauve :underline t)
- (linum :foreground ,ctp-surface1 :background ,ctp-base)
- (line-number :foreground ,ctp-surface1 :background ,ctp-base)
- (line-number-current-line :inherit line-number :foreground ,ctp-lavender)
- (match :background ,ctp-surface1 :foreground ,ctp-text)
- (menu :background ,ctp-current :inverse-video nil :foreground ,ctp-text)
- (minibuffer-prompt :weight normal :foreground ,ctp-subtext0)
- (mode-line :background ,ctp-mantle nil :foreground ,ctp-text)
- (mode-line-inactive
- :background ,ctp-crust :inverse-video nil :foreground ,ctp-overlay0)
- (read-multiple-choice-face :inherit completions-first-difference)
- (region :background ,ctp-surface0 :extend t)
- (shadow :foreground ,ctp-surface2)
- (success :foreground ,ctp-green)
- (warning :foreground ,ctp-peach)
- (tooltip :foreground ,ctp-overlay2 :background ,ctp-surface0)
- (trailing-whitespace :inherit warning)
- (window-divider :foreground ,ctp-mantle)
- (vertical-border :foreground ,ctp-mantle)
- ;; solaire-mode
- (solaire-default-face :background ,ctp-mantle :foreground ,ctp-text)
- (solaire-fringe-face :background ,ctp-mantle :foreground ,ctp-surface1)
- (solaire-line-number-face :foreground ,ctp-surface1 :background ,ctp-mantle)
- (solaire-mode-line-face :background ,ctp-crust nil :foreground ,ctp-text)
- (solaire-mode-line-inactive-face
- :background ,ctp-crust :inverse-video nil :foreground ,ctp-subtext1)
- (solaire-header-line-face :inherit 'solaire-mode-line-face)
-
- ;; evil
- (evil-ex-lazy-highlight :inherit lazy-highlight)
- (evil-ex-substitute-matches :foreground ,ctp-red :underline t)
- (evil-ex-substitute-replacement :foreground ,ctp-green :underline t)
-
- ;; syntax / font-lock
- (font-lock-builtin-face :foreground ,ctp-lavender)
- (font-lock-comment-face :inherit shadow)
- (font-lock-comment-delimiter-face :inherit shadow)
- (font-lock-constant-face :foreground ,ctp-peach)
- (font-lock-doc-face :inherit font-lock-comment-face)
- (font-lock-function-name-face :foreground ,ctp-blue)
- (font-lock-keyword-face :foreground ,ctp-mauve)
- (font-lock-negation-char-face :foreground ,ctp-sky)
- (font-lock-preprocessor-face :foreground ,ctp-yellow)
- (font-lock-reference-face :inherit font-lock-constant-face) ;; obsolete
- (font-lock-regexp-grouping-backslash :foreground ,undef)
- (font-lock-regexp-grouping-construct :foreground ,undef)
- (font-lock-string-face :foreground ,ctp-green)
- (font-lock-type-face :inherit font-lock-builtin-face)
- (font-lock-variable-name-face :foreground ,ctp-text)
- (font-lock-warning-face :inherit warning)
- ;; auto-complete
- (ac-completion-face :underline t :foreground ,undef)
- ;; avy
- (avy-background-face :foreground ,ctp-text :background ,ctp-base)
- (avy-goto-char-timer-face :foreground ,ctp-blue :background ,ctp-surface0)
- (avy-lead-face :foreground ,ctp-base :background ,ctp-mauve)
- (avy-lead-face-0 :foreground ,ctp-base :background ,ctp-yellow)
- (avy-lead-face-1 :foreground ,ctp-base :background ,ctp-overlay0)
- (avy-lead-face-2 :foreground ,ctp-base :background ,ctp-sky)
- ;; company
- ;; TODO: find undef'ed faces
- (company-echo-common :foreground ,ctp-base :background ,ctp-text)
- (company-preview :background ,ctp-current :foreground ,undef)
- (company-preview-common :inherit company-preview
- :foreground ,ctp-green)
- (company-preview-search :inherit company-preview
- :foreground ,undef)
- (company-scrollbar-bg :background ,ctp-surface0)
- (company-scrollbar-fg :foreground ,undef)
- (company-tooltip :inherit tooltip)
- (company-tooltip-search :foreground ,undef
- :underline t)
- (company-tooltip-search-selection :background ,undef
- :foreground ,ctp-base)
- (company-tooltip-selection :inherit match)
- (company-tooltip-mouse :background ,ctp-base)
- (company-tooltip-common :foreground ,ctp-text :weight bold)
- ;;(company-tooltip-common-selection :inherit company-tooltip-common)
- (company-tooltip-annotation :foreground ,ctp-green)
- (company-tooltip-annotation-selection :foreground ,ctp-mauve)
- ;; completions (minibuffer.el)
- (completions-annotations :inherit font-lock-comment-face)
- (completions-common-part :foreground ,ctp-rosewater)
- (completions-first-difference :foreground ,ctp-text)
- ;; diff-hl
- (diff-hl-change :foreground ,ctp-peach :background ,ctp-peach)
- (diff-hl-delete :foreground ,ctp-red :background ,ctp-red)
- (diff-hl-insert :foreground ,ctp-green :background ,ctp-green)
- ;; diff-refine
- (diff-refine-removed :weight bold)
- (diff-refine-added :weight bold)
- ;; git-gutter
- (git-gutter:modified :foreground ,ctp-peach)
- (git-gutter:deleted :foreground ,ctp-red)
- (git-gutter:added :foreground ,ctp-green)
- (git-gutter:seperator :inherit font-lock-comment-face)
- (git-gutter:unchanged :foreground ,ctp-surface0)
- ;; git-gutter fringe
- (git-gutter-fr:modified :inherit git-gutter:modified)
- (git-gutter-fr:deleted :inherit git-gutter:deleted)
- (git-gutter-fr:added :inherit git-gutter:added)
- ;; dired
- (dired-flagged :foreground ,ctp-maroon :weight bold)
- (dired-marked :weight bold)
- (dired-mark :inherit dired-marked)
- (dired-header :foreground ,ctp-sapphire :weight bold)
- (dired-ignored :inherit font-lock-comment-face)
- (dired-special :foreground ,ctp-yellow)
- (dired-symlink :foreground ,ctp-pink)
- (dired-warning :inherit warning)
- (dired-directory :foreground ,ctp-blue)
- (dired-perm-write :foreground ,ctp-green)
- (dired-broken-symlink :foreground ,ctp-text :background ,ctp-red)
- ;; dired+ (kept for legacy support)
- ;; TODO (maybe): Show deprecation warning
- ;; This doesn't make sense to keep around
- (diredp-compressed-file-name :inherit dired-file-name)
- (diredp-compressed-file-suffix :foreground ,ctp-green)
- (diredp-date-time :foreground ,ctp-subtext0)
- (diredp-deletion-file-name :inherit dired-flagged)
- (diredp-deletion :inherit dired-flagged)
- (diredp-dir-heading :inherit dired-header)
- (diredp-dir-name :inherit dired-directory)
- (diredp-dir-priv :inherit dired-directory)
- (diredp-executable-tag :foreground ,ctp-red)
- (diredp-file-suffix :inherit dired-file-name)
- (diredp-flag-mark-line :inherit dired-marked)
- (diredp-flag-mark :inherit dired-mark)
- (diredp-ignored-file-name :foreground ,ctp-text)
- (diredp-mode-line-flagged :foreground ,undef)
- (diredp-mode-line-marked :foreground ,undef)
- (diredp-no-priv :foreground ,ctp-surface2)
- (diredp-number :foreground ,ctp-yellow)
- (diredp-other-priv :inherit diredp-exec-priv)
- (diredp-rare-priv :inherit diredp-exec-priv)
- (diredp-read-priv :foreground ,ctp-sky)
- (diredp-write-priv :inherit dired-perm-write)
- (diredp-exec-priv :foreground ,ctp-red)
- (diredp-symlink :inherit dired-symlink)
- (diredp-link-priv :inherit dired-symlink)
- (diredp-autofile-name :foreground ,undef)
- (diredp-tagged-autofile-name :foreground ,undef)
- ;; diredfl (more modernly published dired+)
- (diredfl-file-name :inherit dired-file-name)
- (diredfl-compressed-file-name :inherit dired-file-name)
- (diredfl-compressed-file-suffix :foreground ,ctp-green)
- (diredfl-date-time :foreground ,ctp-subtext0)
- (diredfl-deletion-file-name :inherit dired-flagged)
- (diredfl-deletion :inherit dired-flagged)
- (diredfl-dir-heading :inherit dired-header)
- (diredfl-dir-name :inherit dired-directory)
- (diredfl-dir-priv :inherit dired-directory)
- (diredfl-executable-tag :foreground ,ctp-red)
- (diredfl-file-suffix :inherit dired-file-name)
- (diredfl-flag-mark-line :inherit dired-marked)
- (diredfl-flag-mark :inherit dired-mark)
- (diredfl-ignored-file-name :foreground ,ctp-text)
- (diredfl-mode-line-flagged :foreground ,undef)
- (diredfl-mode-line-marked :foreground ,undef)
- (diredfl-no-priv :foreground ,ctp-surface2)
- (diredfl-number :foreground ,ctp-yellow)
- (diredfl-other-priv :inherit diredfl-exec-priv)
- (diredfl-rare-priv :inherit diredfl-exec-priv)
- (diredfl-read-priv :foreground ,ctp-sky)
- (diredfl-write-priv :inherit dired-perm-write)
- (diredfl-exec-priv :foreground ,ctp-red)
- (diredfl-symlink :inherit dired-symlink)
- (diredfl-link-priv :inherit dired-symlink)
- (diredfl-autofile-name :foreground ,undef)
- (diredfl-tagged-autofile-name :foreground ,undef)
- ;; eldoc-box
- (eldoc-box-border :background ,ctp-current)
- (eldoc-box-body :background ,ctp-current)
- ;; elfeed
- (elfeed-search-date-face :foreground ,ctp-subtext0)
- (elfeed-search-title-face :foreground ,ctp-text)
- (elfeed-search-unread-title-face :foreground ,ctp-rosewater)
- (elfeed-search-feed-face :foreground ,ctp-text :weight bold)
- (elfeed-search-tag-face :foreground ,ctp-green)
- (elfeed-search-last-update-face :weight bold)
- (elfeed-search-unread-count-face :foreground ,ctp-pink)
- (elfeed-search-filter-face :foreground ,ctp-green :weight bold)
- (elfeed-log-date-face :inherit elfeed-search-date-face)
- (elfeed-log-error-level-face :inherit error)
- (elfeed-log-warn-level-face :foreground ,ctp-peach)
- (elfeed-log-info-level-face :weight bold)
- (elfeed-log-debug-level-face :weight bold)
- ;; elpher
- (elpher-gemini-heading1 :weight bold :foreground ,ctp-blue
- ,@(when catppuccin-enlarge-headings
- (list :height catppuccin-height-title-1)))
- (elpher-gemini-heading2 :foreground ,ctp-blue
- ,@(when catppuccin-enlarge-headings
- (list :height catppuccin-height-title-2)))
- (elpher-gemini-heading3 :foreground ,ctp-blue
- ,@(when catppuccin-enlarge-headings
- (list :height catppuccin-height-title-3)))
- (elpher-gemini-preformatted :inherit fixed-pitch
- :foreground ,ctp-green)
- ;; enh-ruby
- (enh-ruby-heredoc-delimiter-face :foreground ,ctp-yellow)
- (enh-ruby-op-face :inherit haskell-operator-face)
- (enh-ruby-regexp-delimiter-face :foreground ,ctp-yellow)
- (enh-ruby-string-delimiter-face :foreground ,ctp-yellow)
- ;; flyspell
- (flyspell-duplicate :underline (:style wave :color ,ctp-teal))
- (flyspell-incorrect :underline (:style wave :color ,ctp-maroon))
- ;; font-latex
- (font-latex-bold-face :foreground ,ctp-red :weight bold)
- (font-latex-italic-face :foreground ,ctp-yellow :slant italic)
- (font-latex-match-reference-keywords :foreground ,ctp-teal)
- (font-latex-match-variable-keywords :foreground ,ctp-text)
- (font-latex-string-face :foreground ,ctp-green)
- (font-latex-warning-face :inherit warning)
- ;; TODO: More latex faces to be themed, especially sections
- ;; gemini
- (gemini-heading-face-1 :weight bold :foreground ,ctp-blue
- ,@(when catppuccin-enlarge-headings
- (list :height catppuccin-height-title-1)))
- (gemini-heading-face-2 :foreground ,ctp-blue
- ,@(when catppuccin-enlarge-headings
- (list :height catppuccin-height-title-2)))
- (gemini-heading-face-3 :foreground ,ctp-blue
- ,@(when catppuccin-enlarge-headings
- (list :height catppuccin-height-title-3)))
- (gemini-heading-face-rest :foreground ,ctp-blue)
- (gemini-quote-face :foreground ,ctp-green)
- ;; go-test
- (go-test--ok-face :inherit success)
- (go-test--error-face :inherit error)
- (go-test--warning-face :inherit warning)
- (go-test--pointer-face :foreground ,ctp-pink)
- (go-test--standard-face :foreground ,ctp-teal)
- ;; haskell-mode
- (haskell-operator-face :foreground ,ctp-sky)
- (haskell-constructor-face :foreground ,ctp-mauve)
- ;; helm
- ;; TODO: Theme helm
- (helm-bookmark-w3m :foreground ,undef)
- (helm-buffer-not-saved :foreground ,undef)
- (helm-buffer-process :foreground ,undef)
- (helm-buffer-saved-out :foreground ,undef)
- (helm-buffer-size :foreground ,undef)
- (helm-candidate-number :foreground ,undef)
- (helm-ff-directory :foreground ,undef)
- (helm-ff-dotted-directory :foreground ,undef)
- (helm-ff-executable :foreground ,undef)
- (helm-ff-file :foreground ,undef)
- (helm-ff-invalid-symlink :foreground ,undef)
- (helm-ff-prefix :foreground ,undef)
- (helm-ff-symlink :foreground ,undef)
- (helm-grep-cmd-line :foreground ,undef)
- (helm-grep-file :foreground ,undef)
- (helm-grep-finish :foreground ,undef)
- (helm-grep-lineno :foreground ,undef)
- (helm-grep-match :inherit match)
- (helm-grep-running :foreground ,undef)
- (helm-header :foreground ,undef)
- (helm-moccur-buffer :foreground ,undef)
- (helm-selection :underline nil)
- (helm-selection-line)
- (helm-separator :foreground ,undef)
- (helm-source-go-package-godoc-description :foreground ,undef)
- (helm-source-header :foreground ,undef)
- (helm-time-zone-current :foreground ,undef)
- (helm-time-zone-home :foreground ,undef)
- (helm-visible-mark :foreground ,undef)
- ;; consult
- (consult-async-split :foreground ,ctp-mauve)
- ;; corfu
- (corfu-default :background ,ctp-surface0)
- (corfu-current :background ,ctp-surface1)
- (corfu-bar :background ,ctp-subtext0)
- (corfu-border :inherit corfu-default)
- (corfu-annotations :inherit font-lock-comment-face)
- (corfu-deprecated :strike-through t)
- ;; highlight-indentation minor mode
- (highlight-indentation-face :background ,ctp-mantle)
- ;; icicle
- ;; TODO: Verify this looks proper
- (icicle-whitespace-highlight :background ,ctp-text)
- (icicle-special-candidate :foreground ,ctp-subtext1)
- (icicle-extra-candidate :foreground ,ctp-subtext1)
- (icicle-search-main-regexp-others :foreground ,ctp-text)
- (icicle-search-current-input :foreground ,ctp-pink)
- (icicle-search-context-level-8 :foreground ,ctp-blue)
- (icicle-search-context-level-7 :foreground ,ctp-blue)
- (icicle-search-context-level-6 :foreground ,ctp-blue)
- (icicle-search-context-level-5 :foreground ,ctp-blue)
- (icicle-search-context-level-4 :foreground ,ctp-blue)
- (icicle-search-context-level-3 :foreground ,ctp-blue)
- (icicle-search-context-level-2 :foreground ,ctp-blue)
- (icicle-search-context-level-1 :foreground ,ctp-blue)
- (icicle-search-main-regexp-current :foreground ,ctp-text)
- (icicle-saved-candidate :foreground ,ctp-text)
- (icicle-proxy-candidate :foreground ,ctp-text)
- (icicle-mustmatch-completion :foreground ,ctp-mauve)
- (icicle-multi-command-completion :foreground ,ctp-subtext0)
- (icicle-msg-emphasis :foreground ,ctp-green)
- (icicle-mode-line-help :foreground ,ctp-overlay2)
- (icicle-match-highlight-minibuffer :foreground ,ctp-mauve)
- (icicle-match-highlight-Completions :foreground ,ctp-green)
- (icicle-key-complete-menu-local :foreground ,ctp-text)
- (icicle-key-complete-menu :foreground ,ctp-text)
- (icicle-input-completion-fail-lax :foreground ,ctp-maroon)
- (icicle-input-completion-fail :foreground ,ctp-maroon)
- (icicle-historical-candidate-other :foreground ,ctp-text)
- (icicle-historical-candidate :foreground ,ctp-text)
- (icicle-current-candidate-highlight :foreground ,ctp-pink)
- (icicle-Completions-instruction-2 :foreground ,ctp-overlay2)
- (icicle-Completions-instruction-1 :foreground ,ctp-overlay2)
- (icicle-completion :foreground ,ctp-text)
- (icicle-complete-input :foreground ,ctp-peach)
- (icicle-common-match-highlight-Completions :foreground ,ctp-mauve)
- (icicle-candidate-part :foreground ,ctp-text)
- (icicle-annotation :foreground ,ctp-overlay2)
- ;; icomplete
- (icompletep-determined :foreground ,ctp-blue)
- ;; ido
- (ido-first-match :foreground ,ctp-green)
- (ido-only-match :foreground ,ctp-green)
- (ido-subdir :inherit dired-directory)
- (ido-virtual :foreground ,ctp-sapphire)
- (ido-incomplete-regexp :inherit warning)
- (ido-indicator :foreground ,ctp-text :weight bold)
- ;; ivy
- (ivy-current-match :background ,ctp-blue :foreground ,ctp-mantle :bold t)
- (ivy-action :background nil :foreground ,ctp-lavender)
- (ivy-grep-line-number :background nil :foreground ,ctp-peach)
- (ivy-minibuffer-match-face-1 :background nil :foreground ,ctp-blue :bold t)
- (ivy-minibuffer-match-face-2 :background nil :foreground ,ctp-sapphire)
- (ivy-minibuffer-match-face-3 :background nil :foreground ,ctp-lavender)
- (ivy-minibuffer-match-face-4 :background nil :foreground ,ctp-mauve)
- (ivy-minibuffer-match-highlight :foreground ,ctp-blue)
- (ivy-grep-info :foreground ,ctp-blue)
- (ivy-grep-line-number :foreground ,ctp-mauve)
- (ivy-confirm-face :foreground ,ctp-green)
- (ivy-remote :foreground ,ctp-mauve)
- (ivy-match-required-face :foreground ,ctp-red)
- ;; isearch
- (isearch :inherit match :weight bold)
- (isearch-fail :inherit error)
- ;; jde-java
- (jde-java-font-lock-constant-face :inherit font-lock-constant-face)
- (jde-java-font-lock-modifier-face :inherit font-lock-keyword-face)
- (jde-java-font-lock-number-face :foreground ,ctp-text)
- (jde-java-font-lock-package-face :foreground ,ctp-text)
- (jde-java-font-lock-private-face :inherit font-lock-keyword-face)
- (jde-java-font-lock-public-face :inherit font-lock-keyword-face)
- ;; js2-mode
- (js2-external-variable :foreground ,ctp-red)
- (js2-function-param :inherit tree-sitter-hl-face:variable.parameter)
- (js2-jsdoc-html-tag-delimiter :inherit web-mode-html-tag-bracket-face)
- (js2-jsdoc-html-tag-name :inherit web-mode-html-tag-face)
- (js2-jsdoc-value :foreground ,ctp-text)
- (js2-private-function-call :inherit tree-sitter-hl-face:function.call)
- (js2-private-member :inherit font-lock-variable-name-face)
- ;; js3-mode
- (js3-error-face :inherit error)
- (js3-external-variable-face :foreground ,ctp-text)
- (js3-function-param-face :inherit js2-function-param)
- (js3-instance-member-face :inherit font-lock-variable-name-face)
- (js3-jsdoc-tag-face :inherit web-mode-html-tag-face)
- (js3-warning-face :inherit warning)
- ;; lsp
- (lsp-ui-peek-peek :background ,ctp-base)
- (lsp-ui-peek-list :background ,ctp-surface2)
- (lsp-ui-peek-filename :foreground ,ctp-text)
- (lsp-ui-peek-line-number :foreground ,ctp-surface1)
- (lsp-ui-peek-highlight :inherit highlight :distant-foreground ,ctp-base)
- (lsp-ui-peek-header :foreground ,ctp-sapphire, :weight bold)
- (lsp-ui-peek-footer :inherit lsp-ui-peek-header)
- (lsp-ui-peek-selection :inherit match)
- (lsp-ui-sideline-symbol :foreground ,ctp-subtext0)
- (lsp-ui-sideline-current-symbol :foreground ,ctp-text :weight bold)
- (lsp-ui-sideline-code-action :foreground ,ctp-yellow)
- (lsp-ui-sideline-symbol-info :slant italic :height 0.99)
- (lsp-ui-doc-background :background ,ctp-base)
- (lsp-ui-doc-header :foreground ,ctp-sapphire)
- ;; magit
- (magit-branch-local :foreground ,ctp-teal)
- (magit-branch-remote :foreground ,ctp-green)
- (magit-tag :foreground ,ctp-peach)
- (magit-section-heading :foreground ,ctp-blue :weight bold)
- (magit-section-highlight :background ,ctp-surface0 :extend t)
- (magit-diff-context-highlight :background ,ctp-surface0
- :foreground ,ctp-text
- :extend t)
- (magit-diff-revision-summary :foreground ,ctp-blue
- :weight bold)
- (magit-diff-revision-summary-highlight :foreground ,ctp-blue
- :weight bold)
- (magit-diff-added :foreground ,ctp-green
- :extend t)
- (magit-diff-added-highlight :background ,ctp-surface1
- :foreground ,ctp-green
- :extend t)
- (magit-diff-removed :foreground ,ctp-red
- :extend t)
- (magit-diff-removed-highlight :background ,ctp-surface1
- :foreground ,ctp-red
- :extend t)
- (magit-diff-file-heading :foreground ,ctp-text)
- (magit-diff-file-heading-highlight :inherit magit-section-highlight)
- (magit-diffstat-added :foreground ,ctp-green)
- (magit-diffstat-removed :foreground ,ctp-red)
- (magit-hash :foreground ,ctp-subtext0)
- (diff-header :foreground ,ctp-blue)
- (diff-hunk-header :foreground ,ctp-text :background ,ctp-surface2)
- (magit-diff-hunk-heading :inherit diff-hunk-header)
- (magit-diff-hunk-heading-highlight :inherit diff-hunk-header :weight bold)
- (magit-item-highlight :background ,undef)
- (magit-log-author :foreground ,ctp-subtext0)
- (magit-process-ng :foreground ,ctp-peach :weight bold)
- (magit-process-ok :foreground ,ctp-green :weight bold)
- ;; markdown
- (markdown-blockquote-face :foreground ,ctp-green)
- (markdown-code-face :foreground ,ctp-text)
- (markdown-footnote-face :foreground ,ctp-yellow)
- (markdown-header-face :weight normal)
- (markdown-header-face-1
- :foreground ,ctp-blue
- ,@(when catppuccin-enlarge-headings
- (list :height catppuccin-height-title-1)))
- (markdown-header-face-2
- :foreground ,ctp-blue
- ,@(when catppuccin-enlarge-headings
- (list :height catppuccin-height-title-2)))
- (markdown-header-face-3
- :foreground ,ctp-blue
- ,@(when catppuccin-enlarge-headings
- (list :height catppuccin-height-title-3)))
- (markdown-header-face-4 :foreground ,ctp-blue)
- (markdown-header-face-5 :foreground ,ctp-blue)
- (markdown-header-face-6 :foreground ,ctp-blue)
- (markdown-inline-code-face :foreground ,ctp-green)
- (markdown-plain-url-face :inherit link)
- (markdown-pre-face :foreground ,ctp-green)
- (markdown-table-face :foreground ,ctp-text)
- (markdown-list-face :foreground ,ctp-mauve)
- (markdown-language-keyword-face :inherit font-lock-comment-face)
- ;; message
- (message-header-to :foreground ,ctp-text :weight bold)
- (message-header-cc :foreground ,ctp-text :weight bold)
- (message-header-subject :foreground ,ctp-blue)
- (message-header-newsgroups :foreground ,ctp-mauve)
- (message-header-other :foreground ,ctp-mauve)
- (message-header-name :foreground ,ctp-green)
- (message-header-xheader :foreground ,ctp-lavender)
- (message-separator :inherit font-lock-comment-face)
- (message-cited-text :foreground ,ctp-green)
- (message-cited-text-1 :foreground ,ctp-yellow)
- (message-cited-text-2 :inherit font-lock-comment-face)
- (message-cited-text-3 :inherit font-lock-comment-face)
- (message-cited-text-4 :inherit font-lock-comment-face)
- (message-mml :foreground ,ctp-green :weight normal)
- ;; mini-modeline
- (mini-modeline-mode-line :inherit mode-line :height 0.1 :box nil)
- ;; mu4e
- (mu4e-unread-face :foreground ,ctp-rosewater)
- (mu4e-view-url-number-face :foreground ,ctp-yellow)
- (mu4e-highlight-face :background ,ctp-base
- :weight bold
- :extend t)
- (mu4e-header-highlight-face :background ,ctp-current
- :foreground ,ctp-text
- :underline nil :weight bold
- :extend t)
- (mu4e-header-key-face :inherit message-mml)
- (mu4e-header-marks-face :foreground ,ctp-mauve)
- (mu4e-cited-1-face :foreground ,ctp-green)
- (mu4e-cited-2-face :foreground ,ctp-yellow)
- (mu4e-cited-3-face :inherit font-lock-comment-face)
- (mu4e-cited-4-face :inherit font-lock-comment-face)
- (mu4e-cited-5-face :inherit font-lock-comment-face)
- ;; neotree
- (neo-banner-face :foreground ,ctp-blue :weight bold)
- ;;(neo-button-face :underline nil)
- (neo-dir-link-face :inherit link)
- (neo-expand-btn-face :foreground ,ctp-text)
- (neo-file-link-face :inherit link)
- (neo-header-face :weight bold)
- (neo-root-dir-face :foreground ,ctp-blue :weight bold)
- (neo-vc-added-face :foreground ,ctp-green)
- (neo-vc-conflict-face :inherit error)
- (neo-vc-default-face :inherit default)
- (neo-vc-edited-face :foreground ,ctp-peach)
- (neo-vc-ignored-face :inherit font-lock-comment-face)
- (neo-vc-missing-face :foreground ,ctp-maroon)
- (neo-vc-needs-merge-face :foreground ,ctp-maroon
- :weight bold)
- ;;(neo-vc-needs-update-face :underline t)
- (neo-vc-removed-face :foreground ,ctp-red)
- (neo-vc-unlocked-changes-face :foreground ,ctp-red)
- ;;(neo-vc-unregistered-face nil)
- (neo-vc-up-to-date-face :foreground ,ctp-text)
- (neo-vc-user-face :foreground ,ctp-mauve)
- ;; orderless
- (orderless-match-face-0 :foreground ,ctp-blue :weight bold)
- (orderless-match-face-1 :foreground ,ctp-mauve :weight bold)
- (orderless-match-face-2 :foreground ,ctp-teal :weight bold)
- (orderless-match-face-3 :foreground ,ctp-peach :weight bold)
- ;; org
- (org-agenda-date :foreground ,ctp-subtext0 :weight normal)
- (org-agenda-date-today :foreground ,ctp-subtext0 :weight bold)
- (org-agenda-date-weekend :inherit org-agenda-date)
- (org-agenda-date-weekend-today :inherit org-agenda-date :weight bold)
- (org-agenda-dimmed-todo-face :inherit font-lock-comment-face)
- (org-agenda-done :foreground ,ctp-green)
- (org-agenda-structure :foreground ,ctp-subtext0)
- (org-block :foreground ,ctp-green)
- (org-code :foreground ,ctp-green)
- (org-column :background ,ctp-surface0)
- (org-column-title :inherit org-column :weight bold :underline t)
- (org-date :inherit org-agenda-date)
- (org-document-info :foreground ,ctp-sapphire)
- (org-document-info-keyword :inherit font-lock-comment-face)
- (org-document-title :weight bold :foreground ,ctp-blue
- ,@(when catppuccin-enlarge-headings
- (list :height catppuccin-height-doc-title)))
- (org-done :inherit font-lock-comment-face)
- (org-ellipsis :inherit font-lock-comment-face)
- (org-footnote :foreground ,ctp-mauve)
- (org-formula :foreground ,ctp-pink)
- (org-headline-done :inherit org-done)
- (org-hide :foreground ,ctp-crust :background ,ctp-base)
- (org-level-1 :inherit bold :foreground ,ctp-blue
- ,@(when catppuccin-enlarge-headings
- (list :height catppuccin-height-title-1)))
- (org-level-2 :inherit bold :foreground ,ctp-blue
- ,@(when catppuccin-enlarge-headings
- (list :height catppuccin-height-title-2)))
- (org-level-3 :weight normal :foreground ,ctp-blue
- ,@(when catppuccin-enlarge-headings
- (list :height catppuccin-height-title-3)))
- (org-level-4 :weight normal :foreground ,ctp-blue)
- (org-level-5 :weight normal :foreground ,ctp-blue)
- (org-level-6 :weight normal :foreground ,ctp-blue)
- (org-level-7 :weight normal :foreground ,ctp-blue)
- (org-level-8 :weight normal :foreground ,ctp-blue)
- (org-link :inherit link)
- (org-priority :foreground ,ctp-yellow)
- (org-quote :inherit markdown-blockquote-face)
- (org-scheduled :foreground ,ctp-green)
- (org-scheduled-previously :foreground ,ctp-teal)
- (org-scheduled-today :foreground ,ctp-green :weight bold)
- (org-sexp-date :foreground ,ctp-subtext0)
- (org-special-keyword :inherit font-lock-keyword-face)
- (org-table :foreground ,ctp-surface2)
- (org-tag :foreground ,ctp-mauve :weight bold)
- (org-todo :foreground ,ctp-peach)
- (org-upcoming-deadline :foreground ,ctp-maroon)
- (org-verbatim :inherit org-quote)
- (org-warning :inherit warning)
- ;; calfw
- (cfw:face-title :foreground ,ctp-blue :weight bold :height 1.5)
- (cfw:face-header :foreground ,ctp-text)
- (cfw:face-sunday :foreground ,ctp-overlay1)
- (cfw:face-saturday :foreground ,ctp-overlay1)
- (cfw:face-holiday :foreground ,ctp-green)
- (cfw:face-grid :foreground ,ctp-surface0)
- (cfw:face-default-content :foreground ,ctp-peach)
- (cfw:face-periods :foreground ,undef)
- (cfw:face-day-title :foreground ,ctp-subtext0)
- (cfw:face-default-day :foreground ,ctp-text)
- (cfw:face-annotation :foreground ,undef)
- (cfw:face-disable :foreground ,ctp-surface1)
- (cfw:face-today-title :foreground ,ctp-peach)
- (cfw:face-today :inherit cfw:face-today-title)
- (cfw:face-select :background ,ctp-surface1 :foregournd ,ctp-text)
- (cfw:face-toolbar :background ,ctp-base)
- (cfw:face-toolbar-button-off :foreground ,ctp-rosewater)
- (cfw:face-toolbar-button-on :foreground ,ctp-mauve)
- ;; outline
- (outline-1 :foreground ,ctp-blue)
- (outline-2 :foreground ,ctp-blue)
- (outline-3 :foreground ,ctp-blue)
- (outline-4 :foreground ,ctp-blue)
- (outline-5 :foreground ,ctp-blue)
- (outline-6 :foreground ,ctp-blue)
- ;; perspective
- (persp-selected-face :weight bold :foreground ,ctp-pink)
- ;; rainbow-delimiters
- (rainbow-delimiters-depth-1-face :foreground ,ctp-red)
- (rainbow-delimiters-depth-2-face :foreground ,ctp-peach)
- (rainbow-delimiters-depth-3-face :foreground ,ctp-yellow)
- (rainbow-delimiters-depth-4-face :foreground ,ctp-green)
- (rainbow-delimiters-depth-5-face :foreground ,ctp-sapphire)
- (rainbow-delimiters-depth-6-face :foreground ,ctp-red)
- (rainbow-delimiters-depth-7-face :foreground ,ctp-peach)
- (rainbow-delimiters-depth-8-face :foreground ,ctp-yellow)
- (rainbow-delimiters-unmatched-face :inherit warning)
- ;; rst (reStructuredText)
- (rst-level-1 :foreground ,ctp-blue)
- (rst-level-2 :foreground ,ctp-blue)
- (rst-level-3 :foreground ,ctp-blue)
- (rst-level-4 :foreground ,ctp-blue)
- (rst-level-5 :foreground ,ctp-blue)
- (rst-level-6 :foreground ,ctp-blue)
- (rst-level-7 :foreground ,ctp-blue)
- (rst-level-8 :foreground ,ctp-blue)
- ;; show-paren
- (show-paren-match :foreground ,ctp-pink
- :weight bold)
- (show-paren-match-expression :inherit match)
- (show-paren-mismatch :inherit warning)
- ;; slime
- (slime-repl-inputed-output-face :foreground ,ctp-mauve)
- ;; spam
- (spam :inherit gnus-summary-normal-read :foreground ,ctp-peach
- :strike-through t :slant oblique)
- ;; tab-bar & tab-line (since Emacs 27.1)
- (tab-bar :foreground ,ctp-subtext0 :background ,ctp-base)
- (tab-bar-tab :foreground ,ctp-text :background ,ctp-current)
- (tab-bar-tab-inactive :foreground ,ctp-subtext0 :background ,ctp-base)
- (tab-line :inherit tab-bar)
- (tab-line-tab :inherit tab-bar-tab)
- (tab-line-tab-inactive :inherit tab-bar-tab-inactive)
- (tab-line-tab-current :inherit tab-line-tab)
- (tab-line-highlight :background ,ctp-surface1)
- ;; centaur-tabs
- (centaur-tabs-default :foreground ,ctp-subtext0, :background ,ctp-base)
- (centaur-tabs-unselected :foreground ,ctp-subtext0 :background ,ctp-mantle)
- (centaur-tabs-selected :foreground ,ctp-text :background ,ctp-current)
- (centaur-tabs-unselected-modified :foreground ,ctp-maroon :background ,ctp-mantle)
- (centaur-tabs-selected-modified :foreground ,ctp-red :background ,ctp-current)
- (centaur-tabs-close-unselected :foreground ,ctp-subtext0 :background ,ctp-mantle)
- (centaur-tabs-close-selected :foreground ,ctp-text :background ,ctp-current)
- (centaur-tabs-name-mouse-face :foreground ,ctp-text :background ,ctp-surface1)
- (centaur-tabs-close-mouse-face :foreground ,ctp-red :background ,ctp-surface1)
- (centaur-tabs-modified-marker-selected :inherit centaur-tabs-selected-modified)
- (centaur-tabs-modified-marker-unselected :inherit centaur-tabs-unselected-modified)
- ;; term
- (term :foreground ,ctp-text :background ,ctp-base)
- (term-color-black ,@(if (eq catppuccin-flavor 'latte)
- (list :foreground ctp-subtext1 :background ctp-subtext1)
- (list :foreground ctp-surface1 :background ctp-surface1)))
- (term-color-black-white ,@(if (eq catppuccin-flavor 'latte)
- (list :foreground ctp-subtext0 :background ctp-subtext0)
- (list :foreground ctp-surface2 :background ctp-surface2)))
- (term-color-red :foreground ,ctp-red :background ,ctp-red)
- (term-color-bright-red :foreground ,ctp-red :background ,ctp-red)
- (term-color-green :foreground ,ctp-green :background ,ctp-green)
- (term-color-bright-green :foreground ,ctp-green :background ,ctp-green)
- (term-color-yellow :foreground ,ctp-yellow :background ,ctp-yellow)
- (term-color-bright-yellow :foreground ,ctp-yellow :background ,ctp-yellow)
- (term-color-blue :foreground ,ctp-blue :background ,ctp-blue)
- (term-color-bright-blue :foreground ,ctp-blue :background ,ctp-blue)
- (term-color-magenta :foreground ,ctp-pink :background ,ctp-pink)
- (term-color-bright-magenta :foreground ,ctp-pink :background ,ctp-pink)
- (term-color-cyan :foreground ,ctp-teal :background ,ctp-teal)
- (term-color-bright-cyan :foreground ,ctp-teal :background ,ctp-teal)
- (term-color-white ,@(if (eq catppuccin-flavor 'latte)
- (list :foreground ctp-surface2 :background ctp-surface2)
- (list :foreground ctp-subtext1 :background ctp-subtext1)))
- (term-color-bright-white ,@(if (eq catppuccin-flavor 'latte)
- (list :foreground ctp-surface1 :background ctp-surface1)
- (list :foreground ctp-subtext0 :background ctp-subtext0)))
- ;; tree-sitter
- (tree-sitter-hl-face:attribute :inherit font-lock-constant-face)
- (tree-sitter-hl-face:comment :inherit font-lock-comment-face)
- (tree-sitter-hl-face:constant :inherit font-lock-constant-face)
- (tree-sitter-hl-face:constant.builtin :inherit font-lock-builtin-face)
- (tree-sitter-hl-face:constructor :inherit font-lock-constant-face)
- (tree-sitter-hl-face:escape :foreground ,undef)
- (tree-sitter-hl-face:function :inherit font-lock-function-name-face)
- (tree-sitter-hl-face:function.builtin :inherit font-lock-builtin-face)
- (tree-sitter-hl-face:function.call :inherit font-lock-function-name-face
- :weight normal)
- (tree-sitter-hl-face:function.macro :inherit font-lock-preprocessor-face)
- (tree-sitter-hl-face:function.special :inherit font-lock-preprocessor-face)
- (tree-sitter-hl-face:keyword :inherit font-lock-keyword-face)
- (tree-sitter-hl-face:punctuation :foreground ,undef)
- (tree-sitter-hl-face:punctuation.bracket :foreground ,ctp-text)
- (tree-sitter-hl-face:punctuation.delimiter :foreground ,ctp-text)
- (tree-sitter-hl-face:punctuation.special :foreground ,undef)
- (tree-sitter-hl-face:string :inherit font-lock-string-face)
- (tree-sitter-hl-face:string.special :foreground ,undef)
- (tree-sitter-hl-face:tag :inherit font-lock-keyword-face)
- (tree-sitter-hl-face:type :inherit font-lock-type-face)
- (tree-sitter-hl-face:type.parameter :foreground ,ctp-sapphire)
- (tree-sitter-hl-face:variable :inherit font-lock-variable-name-face)
- (tree-sitter-hl-face:variable.parameter :foreground ,ctp-red)
- ;; undo-tree
- (undo-tree-visualizer-current-face :foreground ,ctp-peach)
- (undo-tree-visualizer-default-face :foreground ,ctp-subtext0)
- (undo-tree-visualizer-register-face :foreground ,ctp-mauve)
- (undo-tree-visualizer-unmodified-face :foreground ,ctp-text)
- ;; web-mode
- (web-mode-builtin-face :inherit font-lock-builtin-face)
- (web-mode-comment-face :inherit font-lock-comment-face)
- (web-mode-constant-face :inherit font-lock-constant-face)
- (web-mode-css-property-name-face :inherit font-lock-constant-face)
- (web-mode-doctype-face :inherit font-lock-comment-face)
- (web-mode-function-name-face :inherit font-lock-function-name-face)
- (web-mode-html-attr-name-face :foreground ,ctp-blue)
- (web-mode-html-attr-value-face :foreground ,ctp-green)
- (web-mode-html-tag-face :foreground ,ctp-mauve)
- (web-mode-keyword-face :inherit font-lock-keyword-face)
- (web-mode-string-face :inherit font-lock-string-face)
- (web-mode-type-face :inherit font-lock-type-face)
- (web-mode-warning-face :inherit warning)
- ;; which-func
- (which-func :inherit font-lock-function-name-face)
- ;; which-key
- (which-key-key-face :inherit font-lock-builtin-face)
- (which-key-command-description-face :inherit default)
- (which-key-separator-face :inherit font-lock-comment-delimiter-face)
- (which-key-local-map-description-face :foreground ,ctp-green)
- ;; whitespace
- (whitespace-big-indent :foreground ,ctp-peach)
- (whitespace-empty :inherit warning)
- (whitespace-hspace :background ,undef :foreground ,undef)
- (whitespace-indentation :foreground ,ctp-surface0)
- (whitespace-line :underline (:style wave :color ,ctp-mauve))
- (whitespace-newline :inherit font-lock-comment-face)
- (whitespace-space :inherit font-lock-comment-face)
- (whitespace-space-after-tab :inherit warning)
- (whitespace-space-before-tab :inherit warning)
- (whitespace-tab :inherit whitespace-newline)
- (whitespace-trailing :inherit trailing-whitespace)
- ;; yard-mode
- (yard-tag-face :inherit font-lock-builtin-face)
- (yard-directive-face :inherit font-lock-builtin-face)
- ;; line-reminder
- (line-reminder-modified-sign-face :foreground ,ctp-green)
- ;; highlight-indent-guides
- ;; (highlight-indent-guides-odd-face :background ,ctp-base)
- ;; (highlight-indent-guides-even-face :background ,ctp-base)
- (highlight-indent-guides-character-face :foreground ,ctp-surface0)
- ;; (highlight-indent-guides-top-odd-face :background ,ctp-base)
- ;; (highlight-indent-guides-top-even-face :background ,ctp-base)
- (highlight-indent-guides-top-character-face :foreground ,ctp-pink)
- ;; (highlight-indent-guides-stack-odd-face :background ,ctp-base)
- ;; (highlight-indent-guides-stack-even-face :background ,ctp-base)
- (highlight-indent-guides-stack-character-face :foreground ,ctp-flamingo))))
-
- (apply #'custom-theme-set-faces
- 'catppuccin
- (let* ((expand-with-func
- (lambda (func spec)
- (let (reduced-color-list)
- (dolist (col colors reduced-color-list)
- (push (list (car col) (funcall func col))
- reduced-color-list))
- (eval `(let ,reduced-color-list
- (backquote ,spec))))))
- whole-theme)
- (pcase-dolist (`(,face . ,spec) faces)
- (push `(,face
- ((((min-colors 16777216)) ; fully graphical envs
- ,(funcall expand-with-func 'cadr spec))
- (t ; terminal with 256 colors
- ,(funcall expand-with-func '(lambda (v) (cadr (cdr v))) spec))))
- whole-theme))
- whole-theme))
-
- (apply #'custom-theme-set-variables
- 'catppuccin
- (let ((get-func
- (pcase (display-color-cells)
- ((pred (<= 16777216)) 'car) ; fully graphical envs
- (_ 'cadr)))) ; terminal withs 256 colors
- `((ansi-color-names-vector
- [,(funcall get-func (alist-get (if (eq catppuccin-flavor 'latte) 'ctp-subtext1 'ctp-surface1) colors))
- ,(funcall get-func (alist-get 'ctp-red colors))
- ,(funcall get-func (alist-get 'ctp-green colors))
- ,(funcall get-func (alist-get 'ctp-yellow colors))
- ,(funcall get-func (alist-get 'ctp-blue colors))
- ,(funcall get-func (alist-get 'ctp-pink colors))
- ,(funcall get-func (alist-get 'ctp-teal colors))
- ,(funcall get-func (alist-get (if (eq catppuccin-flavor 'latte) 'ctp-surface2 'ctp-subtext1) colors))]))
- `((rustic-ansi-faces
- (vector
- ,(funcall get-func (alist-get (if (eq catppuccin-flavor 'latte) 'ctp-subtext1 'ctp-surface1) colors))
- ,(funcall get-func (alist-get 'ctp-red colors))
- ,(funcall get-func (alist-get 'ctp-green colors))
- ,(funcall get-func (alist-get 'ctp-yellow colors))
- ,(funcall get-func (alist-get 'ctp-blue colors))
- ,(funcall get-func (alist-get 'ctp-pink colors))
- ,(funcall get-func (alist-get 'ctp-teal colors))
- ,(funcall get-func (alist-get (if (eq catppuccin-flavor 'latte) 'ctp-surface2 'ctp-subtext1) colors))))))))
-
-
-
-
-;;;###autoload
-(when load-file-name
- (add-to-list 'custom-theme-load-path
- (file-name-as-directory (file-name-directory load-file-name))))
-
-(provide-theme 'catppuccin)
-
-;; Unbind functions used for internal use
-(fmakunbound 'catppuccin-quantize-color)
-(fmakunbound 'catppuccin-lighten-color)
-(fmakunbound 'catppuccin-darken-color)
-
-;; Local Variables:
-;; indent-tabs-mode: nil
-;; End:
-
-;;; catppuccin-theme.el ends here