;;; $DOOMDIR/config.el -*- lexical-binding: t; -*- (setq user-full-name "Amolith" user-mail-address "amolith@secluded.site") (setq doom-font (font-spec :family "{{ .font }}" :size 16) doom-variable-pitch-font (font-spec :family "{{ .font }}" :size 16)) (setq doom-unicode-font (font-spec :family "{{ .font }}")) (add-to-list 'custom-theme-load-path (expand-file-name "~/.config/doom/themes/everforest")) {{- if eq .theme_variant "dark"}} (load-theme 'everforest-hard-dark t) {{- end }} {{- if eq .theme_variant "light"}} ;;(load-theme 'everforest-soft-light t) (load-theme 'doom-flatwhite t) {{- end }} (setq display-line-numbers-type t) (use-package smooth-scrolling :ensure t :config (smooth-scrolling-mode 1) (setq smooth-scroll-margin 20)) (global-prettify-symbols-mode t) (defun amo/split-window-below-and-switch () "Split the window horizontally, then switch to the new pane." (interactive) (split-window-below) (balance-windows) (other-window 1)) (defun amo/split-window-right-and-switch () "Split the window vertically, then switch to the new pane." (interactive) (split-window-right) (balance-windows) (other-window 1)) (global-set-key (kbd "C-x 2") 'amo/split-window-below-and-switch) (global-set-key (kbd "C-x 3") 'amo/split-window-right-and-switch) (setq lsp-ui-doc-max-height 13) (setq lsp-ui-doc-show-with-cursor t) (setq org-directory "~/Org/") (use-package org-bullets :init (add-hook 'org-mode-hook 'org-bullets-mode)) (setq org-ellipsis " ⤵") (setq org-hide-emphasis-markers t) (setq org-adapt-indentation nil) (require 'ox-md) (require 'ox-beamer) (setq org-confirm-babel-evaluate nil) (use-package htmlize) (setq org-export-with-smart-quotes t) (use-package helm-bibtex :custom (helm-bibtex-bibliography '("~/Documents/citations.bib")) (reftex-default-bibliography '("~/Documents/citations.bib")) (bibtex-completion-pdf-field "file") :hook (Tex . (lambda () (define-key Tex-mode-map "\C-ch" 'helm-bibtex)))) (use-package org-ref :custom (org-ref-default-bibliography "~/Documents/citations.bib")) (defun org-export-latex-no-toc (depth) (when depth (format "%% Org-mode is exporting headings to %s levels.\n" depth))) (setq org-export-latex-format-toc-function 'org-export-latex-no-toc) (add-to-list 'org-latex-classes '("apa6" "\\documentclass{apa6}" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) (setq org-latex-pdf-process '("latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf -bibtex -f %f")) (add-to-list 'auto-mode-alist '("/tmp/neomutt-*" . mail-mode)) (setq TeX-PDF-mode t) (setq auto-mode-alist (cons '("\\.cho$" . chordpro-mode) auto-mode-alist)) (autoload 'chordpro-mode "chordpro-mode") (defvar prose-modes '(gfm-mode git-commit-mode markdown-mode message-mode mail-mode org-mode text-mode)) (defvar prose-mode-hooks (mapcar (lambda (mode) (intern (format "%s-hook" mode))) prose-modes)) (use-package flyspell :config (dolist (hook prose-mode-hooks) (add-hook hook 'flyspell-mode))) (dolist (hook prose-mode-hooks) (add-hook hook 'turn-on-auto-fill)) (use-package markdown-mode :commands gfm-mode :mode (("\\.md$" . gfm-mode)) :config (custom-set-faces '(markdown-pre-face ((t nil)))) (setq markdown-command "pandoc --standalone --mathjax --from=markdown" markdown-fontify-code-blocks-natively t)) (defun amo/append-to-path (path) (setenv "PATH" (concat (getenv "PATH") ":" path)) (add-to-list 'exec-path path)) (amo/append-to-path "/usr/local/bin") (amo/append-to-path "~/.local/bin") (add-hook 'python-mode-hook 'auto-virtualenv-set-virtualenv) (gofmt-before-save) (setq lsp-go-use-placeholders nil) (setq lsp-go-use-gofumpt t) ;;(setq lsp-go-build-flags ["mage"]) (setq tidal-boot-script-path "/usr/share/x86_64-linux-ghc-9.0.2/tidal-1.7.10/BootTidal.hs") (setq +tree-sitter-hl-enabled-modes '(not fundamental-mode)) (add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode) (global-wakatime-mode) (setq wakatime-cli-path "/usr/bin/wakatime") (add-hook 'magit-mode-hook 'turn-on-magit-gitflow) (map! :leader :desc "Push upstream" "g p" #'magit-push-current-to-upstream) (use-package! copilot :hook (prog-mode . copilot-mode) :bind (("C-TAB" . 'copilot-accept-completion-by-word) ("C-" . 'copilot-accept-completion-by-word) :map copilot-completion-map ("M-" . 'copilot-accept-completion) ("M-TAB" . 'copilot-accept-completion) :map copilot-mode-map ("C-M-" . 'copilot-next-completion) ("C-M-TAB" . 'copilot-next-completion))) (after! mu4e (load "~/.config/doom/extra/mu4e.el")) (defun magit-am-apply-buffer (buffer &optional args) "Apply the patch in BUFFER." (interactive (list (read-buffer "Apply contents of buffer: ") (magit-am-arguments))) (let ((patch (with-current-buffer buffer (buffer-substring-no-properties (point-min) (point-max))))) (with-temp-buffer (insert patch) (magit-run-git-with-input "am" args "-")) (magit-refresh))) (use-package edit-server :ensure t :commands edit-server-start :init (if after-init-time (edit-server-start) (add-hook 'after-init-hook #'(lambda() (edit-server-start)))) :config (setq edit-server-new-frame-alist '((name . "Edit with Emacs FRAME") (top . 200) (left . 200) (width . 80) (height . 25) (minibuffer . t) (menu-bar-lines . t) (window-system . x)))) (after! lsp-haskell (setq lsp-haskell-formatting-provider "ormolou"))