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