;; (use-package! benchmark-init ;; :ensure t ;; :config ;; ;; To disable collection of benchmark data after init is done. ;; (add-hook 'after-init-hook 'benchmark-init/deactivate)) (setf meow-expand-hint-remove-delay 0) (pcase system-type ('darwin ; macOS (setq doom-font (font-spec :family "Maple Mono" :size 20)) (add-to-list 'default-frame-alist '(height . 53)) (add-to-list 'default-frame-alist '(width . 120))) ('gnu/linux ; Linux (including Debian) (setq doom-font (font-spec :family "Maple Mono" :size 24)) ; 20 * 1.5 (add-to-list 'default-frame-alist '(height . 40)) (add-to-list 'default-frame-alist '(width . 100)))) (setq catppuccin-flavor 'catppuccin) (setq doom-theme 'doom-material-dark) (setq display-line-numbers-type 'relative) (setq org-directory "~/org/") ;; (use-package! ef-themes ;; :ensure t ;; :init ;; ;; This makes the Modus commands listed below consider only the Ef ;; ;; themes. For an alternative that includes Modus and all ;; ;; derivative themes (like Ef), enable the ;; ;; `modus-themes-include-derivatives-mode' instead. The manual of ;; ;; the Ef themes has a section that explains all the possibilities: ;; ;; ;; ;; - Evaluate `(info "(ef-themes) Working with other Modus themes or taking over Modus")' ;; ;; - Visit ;; (ef-themes-take-over-modus-themes-mode 1) ;; :bind ;; (("" . modus-themes-rotate) ;; ("C-" . modus-themes-select) ;; ("M-" . modus-themes-load-random)) ;; :config ;; ;; All customisations here. ;; (setq modus-themes-mixed-fonts t) ;; (setq modus-themes-italic-constructs t) ;; ;; ;; Finally, load your theme of choice (or a random one with ;; ;; ;; `modus-themes-load-random', `modus-themes-load-random-dark', ;; ;; ;; `modus-themes-load-random-light'). ;; ;; (modus-themes-load-theme 'ef-light) ;; ) (use-package! yasnippet :config (defun my-yas-try-expanding-auto-snippets () (when yas-minor-mode (let ((yas-buffer-local-condition ''(require-snippet-condition . auto))) (yas-expand)))) (add-hook 'post-command-hook #'my-yas-try-expanding-auto-snippets) ) (use-package! rainbow-delimiters :hook ((prog-mode . rainbow-delimiters-mode) (typst-ts-mode . rainbow-delimiters-mode) (foo-mode . rainbow-delimiters-mode))) (use-package! gptel :config (setq! gptel-api-key "e994f45f9b46cc8608bd2e9cd508417255514e96913b1764aab612512aa66449") (setq gptel-model 'claude-sonnet-4.5) (setq gptel-backend (gptel-make-gh-copilot "Copilot")) ) (use-package! typst-ts-mode :init (add-hook 'typst-ts-mode-hook #'eglot-ensure) :custom ;; (typst-ts-watch-options "--open") (typst-ts-mode-grammar-location (expand-file-name "tree-sitter/libtree-sitter-typst.so" user-emacs-directory)) (typst-ts-mode-enable-raw-blocks-highlight t) :config (keymap-set typst-ts-mode-map "C-c C-c" #'typst-ts-tmenu)) (with-eval-after-load 'eglot (with-eval-after-load 'typst-ts-mode (add-to-list 'eglot-server-programs `((typst-ts-mode) . ,(eglot-alternatives `(,"tinymist" "typst-lsp")))))) (use-package! websocket) (use-package! typst-preview ;; :load-path "path/to/typst-preview.el" ;; if installed manually :init (setq typst-preview-autostart t) ; start preview automatically when typst-preview-mode is activated (setq typst-preview-open-browser-automatically t) ; open browser automatically when typst-preview-start is run :custom (typst-preview-browser "default") ; this is the default option; other options are `eaf-browser' or `xwidget'. (typst-preview-invert-colors "auto") ; invert colors depending on system theme (typst-preview-executable "tinymist") ; path to tinymist binary (relative or absolute) (typst-preview-partial-rendering t) ; enable partial rendering :config (define-key typst-preview-mode-map (kbd "C-c C-j") 'typst-preview-send-position) (define-key typst-ts-mode-map (kbd "C-c C-l") #'typst-preview-mode) ) (use-package org-latex-preview :hook ((org-mode . org-latex-preview-mode) (org-latex-preview-mode . org-latex-preview-center-mode)) :config ;; Increase preview width ;; (plist-put org-latex-preview-appearance-options ;; :page-width 0.8) ;; ;; Enable consistent equation numbering (setq org-latex-preview-numbered t) ;; Bonus: Turn on live previews. This shows you a live preview of a LaTeX ;; fragment and updates the preview in real-time as you edit it. ;; To preview only environments, set it to '(block edit-special) instead (setq org-latex-preview-mode-display-live t) ;; More immediate live-previews -- the default delay is 1 second (setq org-latex-preview-mode-update-delay 0) ;; code for centering LaTeX previews -- a terrible idea (defun my/org-latex-preview-uncenter (ov) (overlay-put ov 'before-string nil)) (defun my/org-latex-preview-recenter (ov) (overlay-put ov 'before-string (overlay-get ov 'justify))) (defun my/org-latex-preview-center (ov) (save-excursion (goto-char (overlay-start ov)) (when-let* ((elem (org-element-context)) ((or (eq (org-element-type elem) 'latex-environment) (string-match-p "^\\\\\\[" (org-element-property :value elem)))) (img (overlay-get ov 'display)) (prop `(space :align-to (- center (0.55 . ,img)))) (justify (propertize " " 'display prop 'face 'default))) (overlay-put ov 'justify justify) (overlay-put ov 'before-string (overlay-get ov 'justify))))) (define-minor-mode org-latex-preview-center-mode "Center equations previewed with `org-latex-preview'." :global nil (if org-latex-preview-center-mode (progn (add-hook 'org-latex-preview-overlay-open-functions #'my/org-latex-preview-uncenter nil :local) (add-hook 'org-latex-preview-overlay-close-functions #'my/org-latex-preview-recenter nil :local) (add-hook 'org-latex-preview-overlay-update-functions #'my/org-latex-preview-center nil :local)) (remove-hook 'org-latex-preview-overlay-close-functions #'my/org-latex-preview-recenter) (remove-hook 'org-latex-preview-overlay-update-functions #'my/org-latex-preview-center) (remove-hook 'org-latex-preview-overlay-open-functions #'my/org-latex-preview-uncenter))) ) (add-to-list 'org-modules 'org-habit) (use-package! org-modern :config (setq org-modern-table nil)) (setq org-capture-templates '(("t" "Personal todo" entry (file+headline +org-capture-todo-file "Inbox") "* TODO %?\n%i\n%a" :prepend t) ("n" "Personal notes" entry (file+headline +org-capture-notes-file "Inbox") "* %u %?\n%i\n%a" :prepend t) ("j" "Journal" entry (file+olp+datetree +org-capture-journal-file) "* %U %?\n%i\n%a" :prepend t) ("p" "Templates for projects") ("pt" "Project-local todo" entry (file+headline +org-capture-project-todo-file "Inbox") "* TODO %?\n%i\n%a" :prepend t) ("pn" "Project-local notes" entry (file+headline +org-capture-project-notes-file "Inbox") "* %U %?\n%i\n%a" :prepend t) ("pc" "Project-local changelog" entry (file+headline +org-capture-project-changelog-file "Unreleased") "* %U %?\n%i\n%a" :prepend t) ("o" "Centralized templates for projects") ("ot" "Project todo" entry #'+org-capture-central-project-todo-file "* TODO %?\n %i\n %a" :heading "Tasks" :prepend nil) ("on" "Project notes" entry #'+org-capture-central-project-notes-file "* %U %?\n %i\n %a" :heading "Notes" :prepend t) ("oc" "Project changelog" entry #'+org-capture-central-project-changelog-file "* %U %?\n %i\n %a" :heading "Changelog" :prepend t)) )