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