1;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
2
3(setq user-full-name "Amolith"
4 user-mail-address "amolith@secluded.site")
5
6(setq doom-font (font-spec :family "{{ .font }}" :size 16)
7 doom-variable-pitch-font (font-spec :family "{{ .font }}" :size 16))
8
9(setq doom-theme 'catppuccin)
10{{- if eq .theme_variant "dark"}}
11(setq catppuccin-flavor 'macchiato)
12{{- end }}
13{{- if eq .theme_variant "light"}}
14(setq catppuccin-flavor 'latte)
15{{- end }}
16
17(setq display-line-numbers-type t)
18
19(use-package smooth-scrolling
20 :ensure t
21 :config
22 (smooth-scrolling-mode 1)
23 (setq smooth-scroll-margin 20))
24
25(global-prettify-symbols-mode t)
26
27(defun amo/split-window-below-and-switch ()
28 "Split the window horizontally, then switch to the new pane."
29 (interactive)
30 (split-window-below)
31 (balance-windows)
32 (other-window 1))
33(defun amo/split-window-right-and-switch ()
34 "Split the window vertically, then switch to the new pane."
35 (interactive)
36 (split-window-right)
37 (balance-windows)
38 (other-window 1))
39(global-set-key (kbd "C-x 2") 'amo/split-window-below-and-switch)
40(global-set-key (kbd "C-x 3") 'amo/split-window-right-and-switch)
41
42(setq lsp-ui-doc-max-height 13)
43(setq lsp-ui-doc-show-with-cursor t)
44
45(setq org-directory "~/Org/")
46
47(use-package org-bullets
48 :init
49 (add-hook 'org-mode-hook 'org-bullets-mode))
50
51(setq org-ellipsis " ⤵")
52
53(setq org-hide-emphasis-markers t)
54
55(setq org-adapt-indentation nil)
56
57(require 'ox-md)
58(require 'ox-beamer)
59
60(setq org-confirm-babel-evaluate nil)
61
62(use-package htmlize)
63
64(setq org-export-with-smart-quotes t)
65
66(use-package ox-hugo
67 :ensure t
68 :after ox)
69
70(use-package helm-bibtex
71 :custom
72 (helm-bibtex-bibliography '("~/Documents/citations.bib"))
73 (reftex-default-bibliography '("~/Documents/citations.bib"))
74 (bibtex-completion-pdf-field "file")
75 :hook (Tex . (lambda () (define-key Tex-mode-map "\C-ch" 'helm-bibtex))))
76(use-package org-ref
77 :custom
78 (org-ref-default-bibliography "~/Documents/citations.bib"))
79(defun org-export-latex-no-toc (depth)
80 (when depth
81 (format "%% Org-mode is exporting headings to %s levels.\n"
82 depth)))
83(setq org-export-latex-format-toc-function 'org-export-latex-no-toc)
84(add-to-list 'org-latex-classes
85 '("apa6"
86 "\\documentclass{apa6}"
87 ("\\section{%s}" . "\\section*{%s}")
88 ("\\subsection{%s}" . "\\subsection*{%s}")
89 ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
90 ("\\paragraph{%s}" . "\\paragraph*{%s}")
91 ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
92(setq org-latex-pdf-process
93 '("latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf -bibtex -f %f"))
94
95(add-to-list 'auto-mode-alist '("/tmp/neomutt-*" . mail-mode))
96
97(setq TeX-PDF-mode t)
98
99(setq auto-mode-alist (cons '("\\.cho$" . chordpro-mode) auto-mode-alist))
100(autoload 'chordpro-mode "chordpro-mode")
101
102(require 'lilypond-mode)
103(add-to-list 'auto-mode-alist '("\\.ly$" . LilyPond-mode))
104;; Set PDF viewer to zathura, my personal preference
105(setq LilyPond-pdf-command "zathura")
106
107(defvar prose-modes
108 '(gfm-mode
109 git-commit-mode
110 markdown-mode
111 message-mode
112 mail-mode
113 org-mode
114 text-mode))
115(defvar prose-mode-hooks
116 (mapcar (lambda (mode) (intern (format "%s-hook" mode)))
117 prose-modes))
118
119(use-package flyspell
120 :config
121 (dolist (hook prose-mode-hooks)
122 (add-hook hook 'flyspell-mode)))
123
124(dolist (hook prose-mode-hooks)
125 (add-hook hook 'turn-on-auto-fill))
126
127(use-package markdown-mode
128 :commands gfm-mode
129 :mode (("\\.md$" . gfm-mode))
130 :config
131 (custom-set-faces
132 '(markdown-pre-face ((t nil))))
133 (setq markdown-command "pandoc --standalone --mathjax --from=markdown"
134 markdown-fontify-code-blocks-natively t))
135
136(defun amo/append-to-path (path)
137 (setenv "PATH" (concat (getenv "PATH") ":" path))
138 (add-to-list 'exec-path path))
139
140(amo/append-to-path "/usr/local/bin")
141(amo/append-to-path "~/.local/bin")
142
143(add-hook 'python-mode-hook 'auto-virtualenv-set-virtualenv)
144
145(gofmt-before-save)
146(setq lsp-go-use-placeholders nil)
147(setq lsp-go-use-gofumpt t)
148;;(setq lsp-go-build-flags ["mage"])
149
150(require 'sclang)
151(add-hook 'sclang-mode-hook 'sclang-extensions-mode)
152
153(setq tidal-boot-script-path "/usr/share/x86_64-linux-ghc-9.0.2/tidal-1.7.10/BootTidal.hs")
154
155(global-tree-sitter-mode)
156(add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode)
157
158(global-wakatime-mode)
159(setq wakatime-cli-path "/usr/bin/wakatime")
160
161(add-hook 'magit-mode-hook 'turn-on-magit-gitflow)
162
163(use-package! justl
164 :config
165 (map! :n "e" 'justl-exec-recipe))
166
167(map! :leader :desc "Push upstream" "g p" #'magit-push-current-to-upstream)
168
169(use-package! copilot
170 :hook (prog-mode . copilot-mode)
171 :bind (("C-TAB" . 'copilot-accept-completion-by-word)
172 ("C-<tab>" . 'copilot-accept-completion-by-word)
173 :map copilot-completion-map
174 ("<tab>" . 'copilot-accept-completion)
175 ("TAB" . 'copilot-accept-completion)))
176
177(add-hook 'evil-local-mode-hook 'turn-on-undo-tree-mode)
178
179(after! mu4e (load "~/.config/doom/extra/mu4e.el"))