Place your private configuration here! Remember, you do not need to run ‘doom sync’ after modifying this file!
Some functionality uses this to identify you, e.g. GPG configuration, email clients, file templates and snippets.
(setq user-full-name "Cobalt Space"
user-mail-address "cobaltspace@protonmail.com")
Doom exposes five (optional) variables for controlling fonts in Doom. Here are the three important ones:
- `doom-font’
- `doom-variable-pitch-font’
- `doom-big-font’ – used for `doom-big-font-mode’; use this for presentations or streaming.
They all accept either a font-spec, font string (“Input Mono-12”), or xlfd font string. You generally only need these two:
(setq doom-font (font-spec :family "Fantasque Sans Mono" :size 14)
;; (setq doom-font (font-spec :family "Source Han Mono" :size 12)
doom-variable-pitch-font (font-spec :family "Ubuntu")
doom-unicode-font doom-font)
;; (after! unicode-fonts (setq doom-unicode-font (font-spec :family "IPAexGothic")))
;; (after! unicode-fonts (setq doom-unicode-font doom-font))
testing bold italic underline code
striketrhough
There are two ways to load a theme. Both assume the theme is installed and available. You can either set `doom-theme’ or manually load a theme with the `load-theme’ function. This is the default:
(setq doom-theme 'doom-tokyo-night)
(setq rand-theme-unwanted '(
adwaita
dichromacy
doom-acario-light
doom-ayu-light
doom-bluloco-light
doom-feather-light
doom-ir-black
doom-manokai-machine
doom-meltbus
doom-opera-light
doom-one-light
doom-solarized-light
doom-tomorrow-day
modus-vivendi-deuteranopia
modus-operandi
tsdh-light
wheatgrass
))
(rand-theme)
If you use `org’ and don’t want your org files in the default location below, change `org-directory’. It must be set before org loads!
(setq org-directory "~/Documents/Org/"
org-roam-directory "~/Documents/Roam")
This determines the style of line numbers in effect. If set to `nil’, line numbers are disabled. For relative line numbers, set this to `relative’.
(setq display-line-numbers-type 'relative)
Here are some additional functions/macros that could help you configure Doom:
- `load!’ for loading external *.el files relative to this one
- `use-package’ for configuring packages
- `after!’ for running code after a package has loaded
- `add-load-path!’ for adding directories to the `load-path’, relative to this file. Emacs searches the `load-path’ when you load packages with `require’ or `use-package’.
- `map!’ for binding new keys
To get information about any of these functions/macros, move the cursor over the highlighted symbol at press ‘K’ (non-evil users must press ‘C-c g k’). This will open documentation for it, including demos of how they are used.
You can also try ‘gd’ (or ‘C-c g d’) to jump to their definition and see how they are implemented.
(global-tab-line-mode)
(setq highlight-indent-guides-method 'bitmap)
(after! fcitx (fcitx-aggressive-setup))
(setq fcitx-remote-command "fcitx5-remote")
(fcitx-aggressive-setup)
(setq auto-save-visited-mode t)
(map! :map cdlatex-mode-map :i "TAB" #'cdlatex-tab)
(setq TeX-indent-open-delimiters "[")
(setq TeX-indent-close-delimiters "]")
(defun TeX-brace-count-line ()
"Count number of open/closed braces."
(save-excursion
(let ((count 0) (limit (line-end-position)) char)
(while (progn
(skip-chars-forward "^{}[]\\\\" limit)
(when (and (< (point) limit) (not (TeX-in-comment)))
(setq char (char-after))
(forward-char)
(cond ((eq char ?\{)
(setq count (+ count TeX-brace-indent-level)))
((eq char ?\})
(setq count (- count TeX-brace-indent-level)))
((eq char ?\[)
(setq count (+ count TeX-brace-indent-level)))
((eq char ?\])
(setq count (- count TeX-brace-indent-level)))
((eq char ?\\)
(when (< (point) limit)
(forward-char)
t))))))
count)))
(custom-set-faces!
'(font-latex-subscript-face nil)
'(font-latex-superscript-face nil))
(setq font-latex-fontify-script 'multi-level)
(setq org-startup-with-inline-images t)
(setq org-startup-folded t)
(after! org (setq org-pretty-entities t))
(after! org (setq org-hide-emphasis-markers t))
(after! org (require 'org-colored-text))
(setq org-superstar-item-bullet-alist
'((42 . 8226)
(43 . 8227)
(45 . 8211)))
(setq org-startup-numerated t
org-num-skip-unnumbered t)
(add-hook! org-mode 'org-appear-mode)
(setq org-appear-autolinks 't
org-appear-autosubmarkers 't
org-appear-autoentities 't
org-appear-autokeywords 't)
(setq org-cite-csl-styles-dir "~/Zotero/styles")
(setq org-latex-packages-alist '(("dvipsnames,svgnames,x11names" "xcolor" t)
("" "mathtools" t)
("" "physics" t)
("bbsets" "jkmath" t)
("makeroom" "cancel" t)
("" "units" t)
("" "svg" nil)
("" "listings" nil)
("inline" "enumitem" nil)))
(after! oc-biblatex
(defun org-cite-biblatex-export-citation (citation style _ info)
"Export CITATION object.
STYLE is the citation style, as a pair of either strings or nil.
INFO is the export state, as a property list."
(apply
#'org-cite-biblatex--command citation info
(pcase style
;; "author" style.
(`(,(or "author" "a") . ,variant)
(pcase variant
((or "caps" "c") '("Citeauthor*"))
((or "full" "f") '("citeauthor"))
((or "caps-full" "cf") '("Citeauthor"))
(_ '("citeauthor*"))))
;; "locators" style.
(`(,(or "locators" "l") . ,variant)
(pcase variant
((or "bare" "b") '("notecite"))
((or "caps" "c") '("Pnotecite"))
((or "bare-caps" "bc") '("Notecite"))
(_ '("pnotecite"))))
;; "noauthor" style.
(`(,(or "noauthor" "na") . ,variant)
(pcase variant
((or "bare" "b") '("cite*"))
(_ '("autocite*"))))
;; "nocite" style.
(`(,(or "nocite" "n") . ,_) '("nocite" nil t))
;; "text" style.
(`(,(or "text" "t") . ,variant)
(pcase variant
((or "caps" "c") '("Textcite" t))
(_ '("textcite" t))))
;; "title" style
(`(,(or "title" "t") . ,variant)
(pcase variant
((or "full" "f") '("citetitle*"))
(_ '("citetitle"))))
;; "year" style
(`(,(or "year" "y") . ,_) '("citeyear"))
;; Default "nil" style.
(`(,_ . ,variant)
(pcase variant
((or "bare" "b") '("cite" t))
((or "caps" "c") '("Autocite" t))
((or "bare-caps" "bc") '("Cite" t))
(_ '("autocite" t))))
;; This should not happen.
(_ (error "Invalid style: %S" style))))))
(after! org
(setq org-format-latex-options
'(:foreground default
:background default
:scale 1.1
:html-foreground "Black"
:html-background "Transparent"
:html-scale 1.0
:matchers ("begin" "$1" "$" "$$" "\\(" "\\["))))
(after! org
(add-to-list 'org-preview-latex-process-alist
'(dvisvgm-svgcleaner
:programs ("latex" "dvisvgm" "svgcleaner")
:description "dvi > svg"
:message "you need to install the programs: latex and dvisvgm and svgcleaner."
:image-input-type "dvi"
:image-output-type "svg"
:image-size-adjust (1.7 . 1.5)
:latex-compiler ("latex -interaction nonstopmode -output-directory %o %f")
:image-converter ("dvisvgm %f --no-fonts --exact-bbox --scale=%S --output=%O" "svgcleaner --multipass %O %O")))
(add-to-list 'org-preview-latex-process-alist
'(dvisvgm-svgz
:programs ("latex" "dvisvgm" "svgcleaner")
:description "dvi > svg"
:message "you need to install the programs: latex and dvisvgm and svgcleaner."
:image-input-type "dvi"
:image-output-type "svgz"
:image-size-adjust (1.7 . 1.5)
:latex-compiler ("latex -interaction nonstopmode -output-directory %o %f")
:image-converter ("dvisvgm %f --no-fonts --exact-bbox --scale=%S --output=%O")))
)
(setq org-preview-latex-default-process 'dvisvgm-svgcleaner)
(setq org-latex-compiler "lualatex")
(setq org-latex-pdf-process
'("latexmk -f -pdf -%latex -interaction=nonstopmode -shell-escape -outdir=%o %f"))
(setq org-latex-image-default-width "")
(setq org-latex-listings t
org-latex-listings-options '(("basicstyle" "\\ttfamily\\footnotesize")
("breakatwhitespace" "true")
("breaklines" "true")
("commentstyle" "\\color{gray}")
("keepspaces" "true")
("keywordstyle" "\\color{red}")
("showspaces" "false")
("showstringspaces" "false")
("stringstyle" "\\color{Green}")
("tabsize" "2")))
(after! ox-latex
(add-to-list 'org-latex-classes
'("mla" "\\documentclass[mla8]{mla}"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}"))))
(after! ox-latex
(add-to-list 'org-latex-classes
'("apa" "\\documentclass[stu,biblatex]{apa7}"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}"))))
(after! ox-latex
(add-to-list 'org-latex-classes
'("standalone" "\\documentclass{standalone}"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}"))))
(setq org-pandoc-options-for-nil nil)
(setq org-pandoc-options-for-docx '((lua-filter . "pagebreak.lua")))
(setq org-log-done 'time)
(setq org-export-in-background 't)
(defadvice! fixed-+org--fix-async-export-a (fn &rest args)
:override #'+org--fix-async-export-a
(let ((old-async-init-file org-export-async-init-file)
(org-export-async-init-file (make-temp-file "doom-org-async-export")))
(with-temp-file org-export-async-init-file
(prin1 `(progn (setq org-export-async-debug
,(or org-export-async-debug
debug-on-error)
load-path ',load-path)
(unwind-protect
(let ((file ,old-async-init-file))
(if file
(load file nil t)
(load ,early-init-file nil t)
(require 'doom-start)))
(delete-file load-file-name)))
(current-buffer)))
(apply fn args)))
(flycheck-vale-setup)
(setq writeroom-width 100)
(setq plantuml-jar-path "/usr/share/java/plantuml/plantuml.jar")
(after! cc-mode
(setq c-default-style '((awk-mode . "awk")
(other . "linux")))
(setq-default c-basic-offset 2)
(c-set-offset 'innamespace 0))
(setq lsp-java-format-enabled nil)
(setq lsp-ui-sideline-update-mode 'line
lsp-ui-sideline-diagnostic-max-lines 99)
(setq lsp-ui-doc-enable nil)
(map! :leader
:desc "Find file with zoxide" "f z" #'zoxide-find-file)