config.el.tmpl

  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 ox-hugo
 69  :ensure t
 70  :after ox)
 71
 72(use-package helm-bibtex
 73  :custom
 74  (helm-bibtex-bibliography '("~/Documents/citations.bib"))
 75  (reftex-default-bibliography '("~/Documents/citations.bib"))
 76  (bibtex-completion-pdf-field "file")
 77  :hook (Tex . (lambda () (define-key Tex-mode-map "\C-ch" 'helm-bibtex))))
 78(use-package org-ref
 79  :custom
 80  (org-ref-default-bibliography "~/Documents/citations.bib"))
 81(defun org-export-latex-no-toc (depth)
 82  (when depth
 83    (format "%% Org-mode is exporting headings to %s levels.\n"
 84            depth)))
 85(setq org-export-latex-format-toc-function 'org-export-latex-no-toc)
 86(add-to-list 'org-latex-classes
 87             '("apa6"
 88               "\\documentclass{apa6}"
 89               ("\\section{%s}" . "\\section*{%s}")
 90               ("\\subsection{%s}" . "\\subsection*{%s}")
 91               ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
 92               ("\\paragraph{%s}" . "\\paragraph*{%s}")
 93               ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
 94(setq org-latex-pdf-process
 95      '("latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf -bibtex -f %f"))
 96
 97(add-to-list 'auto-mode-alist '("/tmp/neomutt-*" . mail-mode))
 98
 99(setq TeX-PDF-mode t)
100
101(setq auto-mode-alist (cons '("\\.cho$" . chordpro-mode) auto-mode-alist))
102(autoload 'chordpro-mode "chordpro-mode")
103
104(require 'lilypond-mode)
105(add-to-list 'auto-mode-alist '("\\.ly$" . LilyPond-mode))
106;; Set PDF viewer to zathura, my personal preference
107(setq LilyPond-pdf-command "zathura")
108
109(defvar prose-modes
110  '(gfm-mode
111    git-commit-mode
112    markdown-mode
113    message-mode
114    mail-mode
115    org-mode
116    text-mode))
117(defvar prose-mode-hooks
118  (mapcar (lambda (mode) (intern (format "%s-hook" mode)))
119          prose-modes))
120
121(use-package flyspell
122  :config
123  (dolist (hook prose-mode-hooks)
124    (add-hook hook 'flyspell-mode)))
125
126(dolist (hook prose-mode-hooks)
127  (add-hook hook 'turn-on-auto-fill))
128
129(use-package markdown-mode
130  :commands gfm-mode
131  :mode (("\\.md$" . gfm-mode))
132  :config
133  (custom-set-faces
134   '(markdown-pre-face ((t nil))))
135  (setq markdown-command "pandoc --standalone --mathjax --from=markdown"
136        markdown-fontify-code-blocks-natively t))
137
138(defun amo/append-to-path (path)
139  (setenv "PATH" (concat (getenv "PATH") ":" path))
140  (add-to-list 'exec-path path))
141
142(amo/append-to-path "/usr/local/bin")
143(amo/append-to-path "~/.local/bin")
144
145(add-hook 'python-mode-hook 'auto-virtualenv-set-virtualenv)
146
147(gofmt-before-save)
148(setq lsp-go-use-placeholders nil)
149(setq lsp-go-use-gofumpt t)
150;;(setq lsp-go-build-flags ["mage"])
151
152(require 'sclang)
153(add-hook 'sclang-mode-hook 'sclang-extensions-mode)
154
155(setq tidal-boot-script-path "/usr/share/x86_64-linux-ghc-9.0.2/tidal-1.7.10/BootTidal.hs")
156
157(global-tree-sitter-mode)
158(add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode)
159
160(global-wakatime-mode)
161(setq wakatime-cli-path "/usr/bin/wakatime")
162
163(add-hook 'magit-mode-hook 'turn-on-magit-gitflow)
164
165(map! :leader :desc "Push upstream" "g p" #'magit-push-current-to-upstream)
166
167(use-package! copilot
168  :hook (prog-mode . copilot-mode)
169  :bind (("C-TAB" . 'copilot-accept-completion-by-word)
170         ("C-<tab>" . 'copilot-accept-completion-by-word)
171         :map copilot-completion-map
172         ("<tab>" . 'copilot-accept-completion)
173         ("TAB" . 'copilot-accept-completion)))
174
175(add-hook 'evil-local-mode-hook 'turn-on-undo-tree-mode)
176
177(after! mu4e (load "~/.config/doom/extra/mu4e.el"))