diff --git a/config/doom/config.el b/config/doom/config.el new file mode 100644 index 00000000..12147437 --- /dev/null +++ b/config/doom/config.el @@ -0,0 +1,852 @@ +;;; $DOOMDIR/config.el -*- lexical-binding: t; -*- + +;; Place your private configuration here! Remember, you do not need to run 'doom +;; sync' after modifying this file! + + +;; Some functionality uses this to identify you, e.g. GPG configuration, email +;; clients, file templates and snippets. +(setq! user-full-name "Christoph Urlacher" + user-mail-address "tobi@urpost.de") + +;; Doom exposes five (optional) variables for controlling fonts in Doom. Here +;; are the three important ones: +;; +;; + `doom-font' +;; + `doom-variable-pitch-font' +;; + `doom-big-font' -- used for `doom-big-font-mode'; use this for +;; presentations or streaming. +;; +;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd +;; font string. You generally only need these two: +;; (setq doom-font (font-spec :family "monospace" :size 12 :weight 'semi-light) +;; doom-variable-pitch-font (font-spec :family "sans" :size 13)) +(setq! doom-font (font-spec :family "Victor Mono" :weight 'semi-bold :size 17) ;; Victor Mono + doom-big-font (font-spec :family "Victor Mono" :weight 'semi-bold :size 21) ;; Victor Mono + doom-variable-pitch-font (font-spec :family "Noto Sans CJK SC" :size 17) ;; Overpass, Source Han Sans CN + doom-unicode-font (font-spec :family "Noto Sans CJK SC" :size 17) ;; Use this for chinese characters 汉字 + ;; doom-serif-font (font-spec :family "IBM Plex Mono" :weight 'light) + ) + +;; There are two ways to load a theme. Both assume the theme is installed and +;; available. You can either set `doom-theme' or manually load a theme with the +;; `load-theme' function. This is the default: +;; 'doom-one-light +;; 'doom-vibrant ist noch nett +;; 'doom-one default +(setq! doom-theme 'doom-one-light) +(delq! t custom-theme-load-path) ;; we don't need defaults + +(custom-set-faces! + '(doom-modeline-buffer-modified :foreground "orange")) ;; no red color in modeline + + + +;; If you use `org' and don't want your org files in the default location below, +;; change `org-directory'. It must be set before org loads! +(setq! org-directory "~/Notes/Org") +(setq! org-roam-directory "~/Notes/Org") + +;; This determines the style of line numbers in effect. If set to `nil', line +;; numbers are disabled. For relative line numbers, set this to `relative'. +(setq! display-line-numbers-type 'relative) + +;; Here are some additional functions/macros that could help you configure Doom: +;; +;; - `load!' for loading external *.el files relative to this one +;; - `use-package!' for configuring packages +;; - `after!' for running code after a package has loaded +;; - `add-load-path!' for adding directories to the `load-path', relative to +;; this file. Emacs searches the `load-path' when you load packages with +;; `require' or `use-package'. +;; - `map!' for binding new keys +;; +;; To get information about any of these functions/macros, move the cursor over +;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k'). +;; This will open documentation for it, including demos of how they are used. +;; +;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how +;; they are implemented. + +;; set variables +(setq! undo-limit 80000000 ;; 80Mb + gc-cons-threshold 100000000 ;; 100Mb + ;; evil-want-fine-undo t ;; may too fine as single character strokes are recognized + create-lockfiles nil + vc-follow-symlinks t + auto-save-default t ;; restore with M-x recover-file + ;; mouse-wheel-scroll-amount '(1 ((shift) . 1) ((control) . nil)) + ;; mouse-wheel-progressive-speed nil ;; don't increase amount on faster scroll + ;; pixel-scroll-precision-large-scroll-height 40.0 + ;; pixel-scroll-precision-interpolation-factor 30 + mouse-wheel-follow-mouse t ;; scroll window where the mouse is over + doom-fallback-buffer-name "Doom" + +doom-dashboard-name "Doom" + +workspaces-on-switch-project-behavior t + confirm-kill-processes nil ;; dont ask to kill procs + bidi-paragraph-direction 'left-to-right ;; no lang direction scan for speed + bidi-inhibit-bpa t ;; speed with long nested lines + tab-width 4 + indent-tabs-mode nil ;; use spaces + tab-always-indent t ;; don't toggle completion just indentation + fast-but-imprecise-scrolling t + redisplay-skip-fontification-on-input t + frame-resize-pixelwise t + frame-inhibit-implied-resize t + idle-update-delay 1.0 ;; don't update as often to speed things up + scroll-margin 10 ;; don't scroll to last line + evil-vsplit-window-right t ;; switch to new windows + evil-split-window-below t + evil-kill-on-visual-paste nil ;; don't copy overwritten selection + ;; history-delete-duplicates t + ) + + +(setq-default tab-width 4 + indent-tabs-mode nil ;; use spaces + display-line-numbers-width 4 + line-spacing 0.1 ;; slightly more space + tab-always-indent t + major-mode 'org-mode + delete-by-moving-to-trash t + window-combination-resize t ;; take space from all windows, not current + x-stretch-cursor t + history-length 1000 + use-short-answers t + confirm-nonexistent-file-or-buffer nil + select-enable-clipboard t + ) + + +;; modes, functions +;; (delete-selection-mode -1) ;; TODO: not sure how it works with evil +(global-subword-mode 1) ;; iterate through CamelCase +(delete-selection-mode 1) ;; replace selection +(display-time-mode -1) ;; no clock +(scroll-bar-mode -1) ;; no scroll bar +(set-fringe-mode 5) ;; left hand side change marker width +;; (save-place-mode 1) ;; save buffer cursor position ;; agenda can't jump to right heading anymore +(semantic-mode 1) +(tooltip-mode -1) ;; no hover button tooltips +(global-auto-revert-mode 1) ;; refrashe buffer if changed on disk +(keychain-refresh-environment) ;; keychain ssh +;; (global-tree-sitter-mode) ;; faster syntax highlighting for all buffers that support tree-sitter +;; (pixel-scroll-precision-mode) ;; better mouse scroll + +;; clean starup screen +;; (remove-hook '+doom-dashboard-functions #'doom-dashboard-widget-shortmenu) +;; (add-hook! '+doom-dashboard-mode-hook (hide-mode-line-mode 1) (hl-line-mode -1)) +;; (setq-hook! '+doom-dashboard-mode-hook evil-normal-state-cursor (list nil)) + +;; doom modeline (not needed for +light) +(after! doom-modeline + (setq! doom-modeline-major-mode-icon t + doom-modeline-major-mode-color-icon t + doom-modeline-checker-simple-format t + doom-modeline-bar-width 3 + doom-modeline-height 35 + doom-modeline-indent-info t + doom-modeline-github t + doom-modeline-minor-modes nil + doom-modeline-window-width-limit 80 + doom-modeline-lsp t + doom-modeline-enable-word-count t + doom-modeline-buffer-file-name-style 'truncate-with-project + )) + +;; theme, fonts +(after! doom-theme + (setq! doom-themes-enable-bold t + doom-themes-enable-italic t + doom-themes-padded-modeline t + )) +(custom-set-faces! + '(font-lock-comment-face :slant italic) + '(font-lock-keyword-face :slant italic) + ) +(custom-set-faces! + '(org-document-title :height 1.2) + ) +(custom-set-faces! + '(outline-1 :weight extra-bold :height 1.25) + '(outline-2 :weight bold :height 1.15) + '(outline-3 :weight bold :height 1.12) + '(outline-4 :weight semi-bold :height 1.09) + '(outline-5 :weight semi-bold :height 1.06) + '(outline-6 :weight semi-bold :height 1.03) + '(outline-8 :weight semi-bold) + '(outline-9 :weight semi-bold) + ) + +(add-to-list 'default-frame-alist '(inhibit-double-buffering . t)) + +;; remove text properties from kill ring when closing emacs +(defun unpropertize-kill-ring () + (setq kill-ring (mapcar 'substring-no-properties kill-ring))) +(add-hook! 'kill-emacs-hook 'unpropertize-kill-ring) + +;; which-key +(after! which-key + (setq! which-key-idle-delay 0.5 ;; faster key help + which-key-sort-order 'which-key-key-order)) ;; sort by keys but separate upper and lowercase + +(after! evil + (setq! evil-ex-substitute-global t + evil-move-cursor-back nil ;; don't move cursor back when leaving insert mode + evil-kill-on-visual-paste nil ;; don't copy replaced text to kill ring ;; TODO: This is duplicated, where does it belong? + ;; evil-backspace-join-lines nil ;; can't backspace but C- still fucked + )) + +;; smartparens +(use-package! smartparens + :init (add-hook! 'smartparens-enabled-hook #'evil-smartparens-mode) + :hook ( + ;; Enable strict smartparens in lisps + (clojure-mode . smartparens-strict-mode) + (lisp-mode . smartparens-strict-mode) + (emacs-lisp-mode . smartparens-strict-mode) + )) + +;; use this to load before evil-snipe, as and conflict +(use-package! evil-smartparens) + +;; bindings +(map! :map global-map + "M-l" nil ;; downcase word + "M-h" nil + ) + +(map! :after evil-org-agenda + :map evil-org-agenda-mode-map + :m "j" #'org-agenda-next-item + :m "k" #'org-agenda-previous-item + :m "h" #'org-agenda-todo + :m "l" #'org-agenda-goto + ) + +(map! :after company + :map company-active-map + "TAB" #'indent-for-tab-command + ) + +(map! :after evil + :map evil-normal-state-map + "M-j" #'drag-stuff-down + "M-k" #'drag-stuff-up + "C-" #'subword-backward-kill + "M-m" #'evil-multiedit-match-and-next + "M-h" #'rotate-text-backward + "M-l" #'rotate-text + + "C-" #'centaur-tabs-forward + "C-" #'centaur-tabs-backward + + "" #'doom/dumb-indent + "" #'doom/dumb-dedent + "M-L" #'dumb-jump-go + "M-H" #'dumb-jump-back + + ;; window bindings + "C-" #'evil-window-decrease-width + "C-" #'evil-window-increase-width + "C-" #'evil-window-decrease-height + "C-" #'evil-window-increase-height + ) + +(map! :after evil + :map evil-insert-state-map + "M-j" #'drag-stuff-down + "M-k" #'drag-stuff-up + + "M-h" #'rotate-text-backward + "M-l" #'rotate-text + ) + +(map! :after smartparens + :map smartparens-mode-map + "M-r" #'sp-raise-sexp + "M-d" #'sp-kill-hybrid-sexp + "M-s" #'sp-splice-sexp + + "C-M-j" #'sp-backward-slurp-sexp + "M-K" #'sp-forward-slurp-sexp + "C-M-k" #'sp-backward-barf-sexp + "M-J" #'sp-forward-barf-sexp + + "M-S" #'sp-split-sexp + "C-S" #'sp-join-sexp + + "C-(" #'sp-wrap-round + ;; "C-[" #'sp-wrap-square ;; C-[ can't be rebound + "C-{" #'sp-wrap-curly + ) + +;; other binding is leader o p +(map! :desc "Toggle Treemacs" + :leader + "0" #'treemacs) + +(map! :desc "Insert Snippet" + "M-/" #'yas-expand) + +;; rotate text +(after! rotate-text + (pushnew! rotate-text-words'("true" "false")) + ) + +;; cider +(setq! cider-overlays-use-font-lock t + cider-show-error-buffer nil + cider-eval-result-prefix "⟹ " + ) +(setq! eros-eval-result-prefix "⟹ ") + +;; Always display workspaces +(after! persp-mode + (defun display-workspaces-in-minibuffer () + (with-current-buffer " *Minibuf-0*" + (erase-buffer) + (insert (+workspace--tabline)))) + (run-with-idle-timer 1 t #'display-workspaces-in-minibuffer) + (+workspace/display)) + +(after! minimap + (setq! minimap-always-recenter nil + minimap-update-delay 0.25 + minimap-hide-fringes t + )) + +;; projectile +(after! projectile + (setq! projectile-track-known-projects-automatically t + projectile-indexing-method 'alien ;; alien is faster than hybrid but doesn't recognize .projectile markers + projectile-sort-order 'recentf + projectile-ignored-projects '("~/.emacs.d" "/tmp" "~/" "~/.emacs.d/.local/straight/repos/") + ;; projectile-project-root-files #'(".projectile") ;; only recognize .projectile projects + ;; projectile-project-root-functions #'(projectile-root-top-down + ;; projectile-root-top-down-recurring + ;; projectile-root-bottom-up + ;; projectile-root-local) + )) + +;; marginalia +(after! marginalia + (setq marginalia-censor-variables nil) + (defadvice! +marginalia--anotate-local-file-colorful (cand) + "Just a more colourful version of ` marginalia--anotate-local-file'." + :override #'marginalia--annotate-local-file + (when-let (attrs (file-attributes (substitute-in-file-name + (marginalia--full-candidate cand)) + 'integer)) + (marginalia--fields + ((marginalia--file-owner attrs) + :width 12 :face 'marginalia-file-owner) + ((marginalia--file-modes attrs)) + ((+marginalia-file-size-colorful (file-attribute-size attrs)) + :width 7) + ((+marginalia--time-colorful (file-attribute-modification-time attrs)) + :width 12)))) + (defun +marginalia--time-colorful (time) + (let* ((seconds (float-time (time-subtract (current-time) time))) + (color (doom-blend + (face-attribute 'marginalia-date :foreground nil t) + (face-attribute 'marginalia-documentation :foreground nil t) + (/ 1.0 (log (+ 3 (/ (+ 1 seconds) 345600.0))))))) + ;; 1 - log(3 + 1/(days + 1)) % grey + (propertize (marginalia--time time) 'face (list :foreground color)))) + (defun +marginalia-file-size-colorful (size) + (let* ((size-index (/ (log10 (+ 1 size)) 7.0)) + (color (if (< size-index 10000000) ; 10m + (doom-blend 'orange 'green size-index) + (doom-blend 'red 'orange (- size-index 1))))) + (propertize (file-size-human-readable size) 'face (list :foreground color))))) + +;; tabs +(after! centaur-tabs + (centaur-tabs-group-by-projectile-project) + (setq centaur-tabs-height 36 + centaur-tabs-set-icons t + centaur-tabs-style "rounded" + centaur-tabs-modified-marker "o" + centaur-tabs-close-button "×" + centaur-tabs-set-bar 'above + centaur-tabs-gray-out-icons 'buffer + ) + (push "Doom" centaur-tabs-excluded-prefixes) + ) +(add-hook! 'org-mode-hook 'centaur-tabs-local-mode) ;; disable tabs in selected buffers +(add-hook! 'latex-mode-hook 'centaur-tabs-local-mode) + +;; workspaces +(after! persp-mode + (setq persp-emacsclient-init-frame-behaviour-override "main")) + +;; latex +(setq! +latex-viewers '(pdf-tools) + TeX-command-extra-options "-shell-escape" ;; for package minted + TeX-auto-save t ;; parse on save + TeX-parse-self t ;; parse on load + LaTeX-indent-level 4 + TeX-source-correlate-method 'synctex + ) +(add-hook! 'LaTeX-mode-hook 'turn-on-auto-fill 'LaTeX-math-mode) + +;; page break character as line +(use-package! page-break-lines + :commands page-break-lines-mode + :init + (autoload 'turn-on-page-break-lines-mode "page-break-lines")) + +(after! elcord + (setq elcord-use-major-mode-as-main-icon t + elcord-display-elapsed nil)) + +;; org =================================================================================================================================================================================================== + +;; (use-package! org-pretty-table +;; :after org +;; :config (org-pretty-table-mode global-org-pretty-table-mode)) + +(global-org-modern-mode) +(after! org-modern + (setq + ;; Edit settings + org-auto-align-tags nil + org-tags-column 0 + org-catch-invisible-edits 'show-and-error + org-special-ctrl-a/e t + org-insert-heading-respect-content t + + ;; Org styling, hide markup etc. + org-hide-emphasis-markers t + org-pretty-entities t + org-ellipsis "…" + + ;; Agenda styling + org-agenda-block-separator ?─ + org-agenda-time-grid + '((daily today require-timed) + (800 1000 1200 1400 1600 1800 2000) + " ┄┄┄┄┄ " "┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄") + org-agenda-current-time-string + "⭠ now ─────────────────────────────────────────────────")) + +(use-package! org-appear + :hook (org-mode . org-appear-mode) + :config + (setq org-appear-autoemphasis t + org-appear-autosubmarkers t + org-appear-autolinks nil) + ;; for proper first-time setup, `org-appear--set-elements' + ;; needs to be run after other hooks have acted. + (run-at-time nil nil #'org-appear--set-elements)) + +(use-package! org-super-agenda + :after org-agenda + :init + (setq! org-super-agenda-groups '((:name "Lectures" + :tag "class" + :tag "session") + (:name "Renesas" + :tag "workhours" + :tag "worktask" + :tag "meeting") + (:name "Sheets" + :category "sheet" + :tag "sheet") + (:name "Organization" + :tag "orga") + (:name "Computer" + :tag "computer") + (:name "Today" + :scheduled today + :deadline today) + (:name "Overdue" + :deadline past) + (:name "Upcoming Tasks" + :scheduled future) + (:name "Upcoming Deadlines" + :deadline future) + (:name "Projects" + :tag "project")) + org-super-agenda-header-map nil) + :commands + (org-super-agenda-mode)) + +(use-package! websocket + :after org-roam) + +(use-package! org-roam-ui + :after org-roam ;; or :after org + ;; normally we'd recommend hooking orui after org-roam, but since org-roam does not have + ;; a hookable mode anymore, you're advised to pick something yourself + ;; if you don't care about startup time, use + ;; :hook (after-init . org-roam-ui-mode) ;; emacs-startup-hook? + :config + (setq org-roam-ui-sync-theme t + org-roam-ui-follow t + org-roam-ui-update-on-save t + org-roam-ui-open-on-start t)) + +(after! org + (setq! org-default-notes-file (expand-file-name "notes-personal.org" org-directory) + org-attach-id-dir "/home/christoph/Notes/Org/Attach/" + + org-attach-method 'cp ;; copy to be able to sync with nextcloud, hope the duplicates don't matter as much + org-link-file-path-type 'noabbrev ;; don't abbreviate home dir and use absolute path + ;; org-ellipsis " ⮟ " ;; collapsed headline character ( ▼, ⮟, ⌄ ) ;; not always displayed properly (no idea why) + org-startup-folded 'fold + org-startup-numerated nil + org-startup-indented t + org-startup-with-inline-images t + org-display-remote-inline-images 'download + org-startup-with-latex-preview nil ;; has long loading times if preview isn't cached yet, also use texfrag + org-startup-truncated t + org-list-allow-alphabetical t + org-hide-emphasis-markers nil ;; org-pretty-mode does that + org-hide-leading-stars nil ;; org-superstar does that + org-log-done 'time + org-use-property-inheritance t + org-cycle-separator-lines 2 ;; keep empty line between collapsed trees (1) org not (2) + org-confirm-babel-evaluate nil ;; shut up + org-export-babel-evaluate t + ;; org-export-in-background t + org-fontify-quote-and-verse-blocks t + + org-superstar-remove-leading-stars t + org-superstar-item-bullet-alist '((?* . ?•) ;; Old dash: – + (?+ . ?➤) + (?- . ?•)) + + + org-todo-keywords '((sequence "TODO(t)" "IN-PROGRESS(p)" "HALT(h)" "WAITING(w)" "OPTIONAL(o)" "|" "DONE(d)" "CANCELED(c)")) + org-todo-keyword-faces '(("TODO" . org-todo) + ("IN-PROGRESS" . (:foreground "green" :weight bold)) + ("HALT" . (:foreground "orange" :weight bold)) + ("WAITING" . (:foreground "yellow" :weight bold)) + ("DONE" . org-done) + ("CANCELED" . org-warning) + ) + + org-tag-alist '((:startgrouptag) + ("@work" . ?w) ;; the letter is for quick selection + (:grouptags) + ("workhours") + ("meeting" . ?m) + ("worktask" . ?t) + (:endgrouptag) + + (:startgrouptag) + ("@uni" . ?u) + (:grouptags) + ("class" . ?l) + ("session" . ?e) + ("sheet" . ?s) + ("reflect" . ?r) + ("orga" . ?o) + (:endgrouptag) + + (:startgrouptag) + ("@home" . ?h) + (:grouptags) + ("guitar") + ("appointment" . ?a) + ("project" . ?p) + ("computer" . ?c) + (:endgrouptag) + + ;; ungrouped tags + ) + + org-capture-templates '(("t" "Personal Todo" entry (file+headline "~/Notes/Org/todo_private.org" "Allgemeine Tasks") + "* TODO %^{Title} :@home:%^g\n%?" :empty-lines 1) + ("s" "Personal Scheduled Todo" entry (file+headline "~/Notes/Org/todo_private.org" "Allgemeine Tasks") + "* TODO %^{Title} :@home:%^g\nSCHEDULED: %^{Scheduled to Begin}t\n%?" :empty-lines 1) + ("d" "Personal Scheduled Todo with Deadline" entry (file+headline "~/Notes/Org/todo_private.org" "Allgemeine Tasks") + "* TODO %^{Title} :@home:%^g\nSCHEDULED: %^{Scheduled to Begin}t DEADLINE: %^{Deadline}T\n%?" :empty-lines 1) + ("a" "Personal Appointment" entry (file+headline "~/Notes/Org/todo_private.org" "Termine") + "* %^{Title} :@home:appointment:\nSCHEDULED: %^{Appointment Date/Time}T\n%?" :empty-lines 1) + ("p" "Project" entry (file+headline "~/Notes/Org/Projects/coding_projects.org" "Projects") + "* TODO %^{Title} :@home:project:\n%?" :empty-lines 1) + ("T" "Uni Todo" entry (file+headline "~/Notes/Org/todo_ss_2022.org" "Allgemeine Tasks") + "* TODO %^{Title} :@uni:%^g\n%?" :empty-lines 1) + ("S" "Uni Sheduled Todo" entry (file+headline "~/Notes/Org/todo_ss_2022.org" "Allgemeine Tasks") + "* TODO %^{Title} :@uni:%^g\nSCHEDULED: %^{Scheduled to Begin}t\n%?" :empty-lines 1) + ("D" "Uni Scheduled Todo with Deadline" entry (file+headline "~/Notes/Org/todo_ss_2022.org" "Allgemeine Tasks") + "* TODO %^{Title} :@uni:%^g\nSCHEDULED: %^{Scheduled to Begin}t DEADLINE: %^{Deadline}T\n%?" :empty-lines 1) + ("A" "Uni Appointment" entry (file+headline "~/Notes/Org/todo_ss_2022.org" "Termine") + "* %^{Title} :@uni:appointment:\nSCHEDULED: %^{Appointment Date/Time}T\n%?" :empty-lines 1) + ("E" "Uni Exercise" entry (file+headline "~/Notes/Org/todo_ss_2022.org" "Übungsblätter") + "* TODO %^{Title} :@uni:sheet:%^g\n%?" :empty-lines 1) + ("F" "Uni Follow Up" entry (file+headline "~/Notes/Org/todo_ss_2022.org" "Nachbereiten") + "* TODO %^{Title} :@uni:reflect:%^g\nSCHEDULED: %^{Scheduled for}t\n%?" :empty-lines 1) + ) + + ;; agenda + org-agenda-show-all-dates nil + org-agenda-block-separator 9472 ;; this: ─ Character + org-agenda-show-current-time-in-grid nil + org-agenda-use-time-grid nil + org-agenda-skip-scheduled-if-done t + org-agenda-skip-deadline-if-done t + org-agenda-skip-timestamp-if-done t + org-agenda-include-deadlines t + org-deadline-warning-days 7 + org-agenda-tags-column 90 + org-agenda-start-on-weekday nil ;; start today + org-agenda-start-day nil ;; start today + org-agenda-span 7 + org-agenda-skip-scheduled-if-deadline-is-shown nil + org-agenda-skip-deadline-prewarning-if-scheduled t + org-agenda-prefix-format '((agenda . " %i %-20:c%?-12t% s") ;; mehr platz für category + (todo . " %i %-15:c") + (tags . " %i %-15:c") + (search . " %i %-15:c")) + org-agenda-compact-blocks nil + org-agenda-format-date (lambda (date) (concat "\n" + (make-string (window-width) 9472) + "\n" + (org-agenda-format-date-aligned date))) ;; add separators between agenda days + + ;; latex + org-highlight-latex-and-related '(native script entities) ;; don't highlight latex + org-latex-listings 'minted + org-latex-minted-options '(("frame" "lines") + ("linenos=true")) + ;; org-latex-image-default-width nil ;; to avoid resizing + org-format-latex-options (plist-put org-format-latex-options :scale 1.2) ;; bigger inline latex + org-format-latex-options (plist-put org-format-latex-options :background "Transparent") + org-preview-latex-default-process 'dvisvgm ;; Funktioniert mit Tikz + org-latex-default-class "koma-article" + ;; for latex preview, not export + org-latex-packages-alist '( + ("" "minted") ;; use org src block instead + ("" "tikz" t) ;; use org graphviz block instead + ("" "mathtools" t) + ("" "beton" t) + ("" "eulerpx" t) + ("" "centernot" t) + ("" "ellipsis" t) + ;; ("" "christex" t) ;; way too slow for preview generation + ) + org-latex-compiler "lualatex" ;; sets the -%latex option for latexmk + org-latex-pdf-process '("latexmk -shell-escape -f -pdf -%latex -interaction=nonstopmode -output-directory=%o %f") + ;; org-latex-pdf-process '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f") ;; Old process + + org-latex-tables-booktabs t + ) + (add-to-list 'org-src-lang-modes '("dot" . graphviz-dot)) + (add-to-list 'org-src-block-faces '("latex" (:inherit default :extend t))) ;; don't use org-block faces + + ) + +(setq org-agenda-deadline-faces + '((1.001 . error) + (1.0 . org-warning) + (0.5 . org-upcoming-deadline) + (0.0 . org-upcoming-distant-deadline))) + +;; Org-LaTeX-Export +(after! ox-latex + (add-to-list 'org-latex-classes + '("koma-article" + "\\documentclass[12pt,a4paper,ngerman,parskip=full]{scrartcl} +\\usepackage{christex} + [NO-DEFAULT-PACKAGES] + [NO-PACKAGES] + [NO-EXTRA]" + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}") + ("\\paragraph{%s}" . "\\paragraph*{%s}") + ("\\subparagraph{%s}" . "\\subparagraph*{%s}") + ))) + +;; TODO: Investigate how texfrag works, I want it to use lualatex and christex +;; better inline latex preview +(use-package! texfrag + :after org + :hook (org-mode . texfrag-mode) + :config + (setq! texfrag-scale 1.3 + texfrag-preview-buffer-at-start t + texfrag-header-default "\\documentclass{article} +\\usepackage{amsmath,amsfonts} +\\usepackage[utf8]{inputenc} +\\usepackage[T1]{fontenc} +\\usepackage{beton} +\\usepackage{eulerpx} +\let\\openbox\\relax +\\usepackage{mathtools} +\\usepackage{ellipsis} +\\usepackage{centernot}" + )) +;; texfrag again on font size change +(add-hook 'writeroom-mode-hook (lambda () (when texfrag-mode (run-with-timer 0.1 nil 'texfrag-document)))) +;; texfrag org detect starred envs \begin{align*} +(add-hook 'org-mode-hook (lambda () (setq! texfrag-frag-alist + '((("\\\\(" texfrag-org-latex-p) "\\\\)" "$" "$") ;; usual inline math \( ... \) + (("\\\\\\[" texfrag-org-latex-p) "\\\\\\]" "\\\\[" "\\\\]" :display t) ;; usual display math \[ ... \] + (("\\\\begin{\\([a-z*]+\\)}" texfrag-org-latex-p) "\\\\end{\\1}" "\\\\begin{\\2}" "\\\\end{\\2}" :display t) ;; enumerated environments + ;; TODO: (("\\\\begin{\\([a-z*]+\\)}" texfrag-org-latex-p) "\\\\end{\\1}" "\\\\begin{\\2}" "\\\\end{\\2}" :display t) ;; unenumerated environments + )))) +;; TODO: texfrag regenerate preview at point after editing latex +;; (define-advice org-edit-src-exit (:before (&rest _) regenerate-preview-at-point) +;; (when (eq major-mode 'latex-mode) +;; (message "Regenerating LaTeX preview...") +;; (preview-at-point))) + +(after! org-agenda + (org-super-agenda-mode)) + +(after! org-noter + (setq! org-noter-notes-search-path '("~/Notes/Org") + org-noter-always-create-frame nil + org-noter-notes-window-behavior '(start scroll) + org-noter-notes-window-location 'horizontal-split)) + +(after! org-roam + (setq! org-roam-index-file "index.org")) +(add-to-list 'display-buffer-alist + '("\\*org-roam\\*" + (display-buffer-in-direction) + (direction . right) + (window-width . 0.33) + (window-height . fit-window-to-buffer))) + +;; (add-hook 'org-mode-hook 'org-fragtog-mode) ;; toggle inline previews (slow) +(add-hook! 'org-mode-hook #'+org-pretty-mode) ;; removed #'mixed-pitch-mode +;; (remove-hook 'text-mode-hook #'visual-line-mode) +;; (add-hook 'text-mode-hook #'auto-fill-mode) +;; (add-hook 'writeroom-mode-hook #'visual-line-mode) + +;; For font-lock lag +(defun locally-defer-font-lock () + "Set jit-lock defer and stealth, when buffer is over a certain size." + (when (> (buffer-size) 50000) + (setq-local jit-lock-defer-time 0.05 + jit-lock-stealth-time 1))) +(add-hook 'org-mode-hook #'locally-defer-font-lock) + + +;; end org ============================================================================================================================================================================================= + +;; info-colors +(use-package! info-colors + :commands (info-colors-fontify-node)) +(add-hook 'Info-selection-hook 'info-colors-fontify-node) +(add-hook 'Info-mode-hook #'mixed-pitch-mode) + +;; calc +(setq calc-angle-mode 'rad ; radians are rad + calc-symbolic-mode t) + +;; emojify +(setq emojify-emoji-set "twemoji-v2") + +;; zen +(after! writeroom-mode + (setq! writeroom-fullscreen-effect 'maximized + writeroom-global-effects (remove 'writeroom-set-alpha writeroom-global-effects) + writeroom-maximize-window t)) +;; disable lsp/flycheck overlays during zen mode +(add-hook! 'writeroom-mode-enable-hook (flycheck-posframe-mode -1) (lsp-ui-mode -1)) +(add-hook! 'writeroom-mode-disable-hook (flycheck-posframe-mode 1) (lsp-ui-mode 1)) + +;; cpp +(after! cc-mode + (setq! c-default-style "stroustrup" + c-basic-offset 4) + ;; (set-docsets! 'cc-mode "C" "C++" "CMake") + (add-to-list 'auto-mode-alist '("\\.h\\'" . c++-mode)) + ) +(setq lsp-clients-clangd-args '( + "-j=3" ;; Number of async workers (also used by background index) + "--background-index" ;; Index in background and persist on disk + "--clang-tidy" + "--completion-style=detailed" + "--header-insertion=never" + "--header-insertion-decorators=0" + )) +(after! lsp-clangd (set-lsp-priority! 'clangd 2)) +(after! flycheck + (setq! flycheck-clang-args '("--checks='*'") + flycheck-clang-pedantic t)) + +;; python +(after! python + (set-popup-rule! "^\\*Python" :side 'bottom :size 0.3 :quit nil) ;; keep python repl open + (set-popup-rule! "^\\*lsp-help\\*" :side 'right :size 0.3 :quit t) + (setq! python-shell-completion-native-enable nil)) +(after! lsp-python-ms + (set-lsp-priority! 'pyright 1)) + +;; haskell +(after! haskell-mode + (set-popup-rule! "^\\*haskell repl\\*" :ignore t :quit nil)) + +;; lsp +(after! lsp-mode + (setq! read-process-output-max (* 1024 1024) + lsp-auto-guess-root t + lsp-signature-auto-activate nil + lsp-enable-file-watchers nil + lsp-enable-suggest-server-download nil + lsp-lens-enable nil + lsp-enable-symbol-highlighting nil)) +(after! lsp-ui + (setq lsp-ui-doc-enable nil)) ;; disable bc slow + +;; company +(after! company + (setq! company-minimum-prefix-length 1 + company-show-numbers t + company-idle-delay 0.3 ;; disable automatic completion + company-global-modes '(not erc-mode message-mode help-mode gud-mode)) + ) + + +;; flycheck +(after! flycheck + (setq! flycheck-global-modes '(not latex-mode LaTeX-mode org-mode))) + +;; magit +(setq! magit-repository-directories '(("~/Notes/HHU" . 3) + ("~/Notes/Org" . 0) + ("~/Arch" . 0) + ("~/Documents" . 1) + ("~/Projects" . 2) + ("~/NoSync" . 1)) + magit-repolist-columns '(("Name" 25 magit-repolist-column-ident nil) + ("Version" 25 magit-repolist-column-version nil) + ("N/U/S" 5 magit-repolist-column-flag + ((:right-align t) + (:help-echo "N: Untracked, U: Unstaged, S: Staged"))) + ("BrUp" 5 magit-repolist-column-unpushed-to-upstream + ((:right-align t) + (:help-echo "Local changes not in upstream"))) + ("Path" 99 magit-repolist-column-path nil))) + +;; treemacs +(after! treemacs + (setq! treemacs-follow-after-init t + treemacs-project-follow-mode t + treemacs-follow-mode t + treemacs-filewatch-mode t + ;; treemacs-git-mode 'extended ;; always prompts? + ;; treemacs-git-integration t + treemacs-collapse-dirs 0 + treemacs-silent-refresh t + treemacs-change-root-without-asking t + treemacs-sorting 'alphabetic-case-insensitive-desc + treemacs-show-hidden-files nil + treemacs-never-persist nil + treemacs-is-never-other-window nil + treemacs-displacurrent-project-exclusively t + )) +(add-hook! 'treemacs-mode-hook 'treemacs-follow-mode) +(add-hook! 'treemacs-mode-hook 'treemacs-project-follow-mode) +;; (add-hook! 'treemacs-mode-hook 'treemacs-fringe-indicator-mode) diff --git a/config/doom/custom.el b/config/doom/custom.el new file mode 100644 index 00000000..6d27aa7f --- /dev/null +++ b/config/doom/custom.el @@ -0,0 +1,27 @@ +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(org-agenda-files + '("~/Notes/Org/20220425205309-bseos_todo.org" "/home/christoph/Notes/Org/coding_projects.org" "/home/christoph/Notes/Org/20220324131647-ss2022.org" "/home/christoph/Notes/Org/20220406001207-renesas.org" "/home/christoph/Notes/Org/todo_private.org" "/home/christoph/Notes/Org/todo_ss_2022.org")) + '(safe-local-variable-values + '((projectile-project-root . "~/Dotfiles/doom/.config/doom")))) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(doom-modeline-buffer-modified ((t (:foreground "orange")))) + '(font-lock-comment-face ((t (:slant italic)))) + '(font-lock-keyword-face ((t (:slant italic)))) + '(org-document-title ((t (:height 1.2)))) + '(outline-1 ((t (:weight extra-bold :height 1.25)))) + '(outline-2 ((t (:weight bold :height 1.15)))) + '(outline-3 ((t (:weight bold :height 1.12)))) + '(outline-4 ((t (:weight semi-bold :height 1.09)))) + '(outline-5 ((t (:weight semi-bold :height 1.06)))) + '(outline-6 ((t (:weight semi-bold :height 1.03)))) + '(outline-8 ((t (:weight semi-bold)))) + '(outline-9 ((t (:weight semi-bold)))) + '(ts-fold-replacement-face ((t (:foreground nil :box nil :inherit font-lock-comment-face :weight light))))) diff --git a/config/doom/init.el b/config/doom/init.el new file mode 100644 index 00000000..399dcbbd --- /dev/null +++ b/config/doom/init.el @@ -0,0 +1,193 @@ +;;; init.el -*- lexical-binding: t; -*- + +;; This file controls what Doom modules are enabled and what order they load +;; in. Remember to run 'doom sync' after modifying it! + +;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's +;; documentation. There you'll find a link to Doom's Module Index where all +;; of our modules are listed, including what flags they support. + +;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or +;; 'C-c c k' for non-vim users) to view its documentation. This works on +;; flags as well (those symbols that start with a plus). +;; +;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its +;; directory (for easy access to its source code). + +(doom! :input + ;; chinese + ;;japanese + ;;layout ; auie,ctsrnm is the superior home row + + :completion + (company +childframe) ; the ultimate code completion backend + ;;helm ; the *other* search engine for love and life + ;;ido ; the other *other* search engine... + ;;ivy ; a search engine for love and life + (vertico +icons) ; the search engine of the future + + :ui + ;;deft ; notational velocity for Emacs + doom ; what makes DOOM look the way it does + doom-dashboard ; a nifty splash screen for Emacs + ;;doom-quit ; DOOM quit-message prompts when you quit Emacs + (emoji +unicode) ; 🙂 + hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW + ;;hydra + ;;indent-guides ; highlighted indent columns + ligatures ; ligatures and symbols to make your code pretty again + minimap ; show a map of the code on the side + modeline ; snazzy, Atom-inspired modeline, plus API + nav-flash ; blink cursor line after big motions + ;;neotree ; a project drawer, like NERDTree for vim + ophints ; highlight the region an operation acts on + (popup +defaults) ; tame sudden yet inevitable temporary windows + tabs ; a tab bar for Emacs + (treemacs +lsp) ; a project drawer, like neotree but cooler + unicode ; extended unicode support for various languages + vc-gutter ; vcs diff in the fringe + ;;vi-tilde-fringe ; fringe tildes to mark beyond EOB + ;;window-select ; visually switch windows + workspaces ; tab emulation, persistence & separate workspaces + zen ; distraction-free coding or writing + + :editor + (evil +everywhere); come to the dark side, we have cookies + file-templates ; auto-snippets for empty files + fold ; (nigh) universal code folding + (format +onsave) ; automated prettiness + ;;god ; run Emacs commands without modifier keys + ;;lispy ; vim for lisp, for people who don't like vim + multiple-cursors ; editing in many places at once + ;;objed ; text object editing for the innocent + ;;parinfer ; turn lisp into python, sort of + rotate-text ; cycle region at point between text candidates + snippets ; my elves. They type so I don't have to + ;;word-wrap ; soft wrapping with language-aware indent + + :emacs + (dired +icons) ; making dired pretty [functional] + electric ; smarter, keyword-based electric-indent + (ibuffer +icons) ; interactive buffer management + undo ; persistent, smarter undo for your inevitable mistakes + vc ; version-control and Emacs, sitting in a tree + + :term + ;;eshell ; the elisp shell that works everywhere + ;;shell ; simple shell REPL for Emacs + ;;term ; basic terminal emulator for Emacs + vterm ; the best terminal emulation in Emacs + + :checkers + (syntax +childframe) ; tasing you for every semicolon you forget + ;;(spell +flyspell) ; tasing you for misspelling mispelling + ;;grammar ; tasing grammar mistake every you make + + :tools + ;;ansible + biblio ; Writes a PhD for you (citation needed) + (debugger +lsp) ; FIXME stepping through code, to help you add bugs + direnv + (docker +lsp) + ;;editorconfig ; let someone else argue about tabs vs spaces + ;;ein ; tame Jupyter notebooks with emacs + (eval +overlay) ; run code, run (also, repls) + gist ; interacting with github gists + lookup ; navigate your code and its documentation + (lsp +peek) ; M-x vscode + magit ; a git porcelain for Emacs + ;;make ; run make tasks from Emacs + ;;pass ; password manager for nerds + pdf ; pdf enhancements + ;;prodigy ; FIXME managing external services & code builders + rgb ; creating color strings + taskrunner ; taskrunner for all your projects + ;;terraform ; infrastructure as code + ;;tmux ; an API for interacting with tmux + tree-sitter ; syntax and parsing, sitting in a tree... + ;;upload ; map local to remote projects via ssh/ftp + + :os + (:if IS-MAC macos) ; improve compatibility with macOS + tty ; improve the terminal Emacs experience + + :lang + ;;agda ; types of types of types of types... + ;;beancount ; mind the GAAP + (cc +lsp +tree-sitter) ; C > C++ == 1 + (clojure +lsp +tree-sitter) ; java with a lisp + ;;common-lisp ; if you've seen one lisp, you've seen them all + ;;coq ; proofs-as-programs + ;;crystal ; ruby at the speed of c + ;;csharp ; unity, .NET, and mono shenanigans + (data +tree-sitter) ; config/data formats + ;;(dart +flutter) ; paint ui and not much else + ;;dhall + ;;elixir ; erlang done right + ;;elm ; care for a cup of TEA? + (emacs-lisp +tree-sitter) ; drown in parentheses + ;;erlang ; an elegant language for a more civilized age + ;;ess ; emacs speaks statistics + ;;factor + ;;faust ; dsp, but you get to keep your soul + ;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER) + ;;fsharp ; ML stands for Microsoft's Language + ;;fstar ; (dependent) types and (monadic) effects and Z3 + ;;gdscript ; the language you waited for + ;;(go +lsp) ; the hipster dialect + ;;(graphql +lsp) ; Give queries a REST + (haskell +lsp +tree-sitter) ; a language that's lazier than I am + ;;hy ; readability of scheme w/ speed of python + ;;idris ; a language you can depend on + (json +tree-sitter) ; At least it ain't XML + (java +lsp +tree-sitter) ; the poster child for carpal tunnel syndrome + (javascript +lsp +tree-sitter) ; all(hope(abandon(ye(who(enter(here)))))) + (julia +lsp +tree-sitter) ; a better, faster MATLAB + (kotlin +lsp +tree-sitter) ; a better, slicker Java(Script) + (latex +latexmk +lsp +fold +tree-sitter) ; writing papers in Emacs has never been so fun + ;;lean ; for folks with too much to prove + ;;ledger ; be audit you can be + (lua +tree-sitter) ; one-based indices? one-based indices + (markdown +tree-sitter) ; writing docs for people to ignore + ;;nim ; python + lisp at the speed of c + (nix +tree-sitter) ; I hereby declare "nix geht mehr!" + ;;ocaml ; an objective camel + (org +dragndrop +gnuplot +jupyter +noter +pandoc +present +roam2 +tree-sitter) ; organize your plain life in plain text ; disabled +pretty for org-modern + ;;php ; perl's insecure younger brother + ;;plantuml ; diagrams for confusing people more + ;;purescript ; javascript, but functional + (python +lsp +pyright +tree-sitter) ; beautiful is better than ugly + ;;qt ; the 'cutest' gui framework ever + ;;racket ; a DSL for DSLs + ;;raku ; the artist formerly known as perl6 + rest ; Emacs as a REST client + ;;rst ; ReST in peace + ;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} + (rust +lsp +tree-sitter) ; Fe2O3.unwrap().unwrap().unwrap().unwrap() + (scala +lsp +tree-sitter) ; java, but good + ;;(scheme +guile) ; a fully conniving family of lisps + (sh +fish +tree-sitter) ; she sells {ba,z,fi}sh shells on the C xor + ;;sml + ;;solidity ; do you need a blockchain? No. + ;;swift ; who asked for emoji variables? + ;;terra ; Earth and Moon in alignment for performance. + (web +tree-sitter) ; the tubes + (yaml +lsp +tree-sitter) ; JSON, but readable + ;;zig ; C, but simpler + + :email + ;;(mu4e +org +gmail) + ;;notmuch + ;;(wanderlust +gmail) + + :app + calendar + ;;emms + everywhere ; *leave* Emacs!? You must be joking + ;;irc ; how neckbeards socialize + ;;(rss +org) ; emacs as an RSS reader + ;;twitter ; twitter client https://twitter.com/vnought + + :config + ;;literate + (default +bindings +smartparens)) diff --git a/config/doom/packages.el b/config/doom/packages.el new file mode 100644 index 00000000..722c1e9d --- /dev/null +++ b/config/doom/packages.el @@ -0,0 +1,75 @@ +;; -*- no-byte-compile: t; -*- +;;; $DOOMDIR/packages.el + +;; To install a package with Doom you must declare them here and run 'doom sync' +;; on the command line, then restart Emacs for the changes to take effect -- or +;; use 'M-x doom/reload'. + + +;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror: + +;; (package! some-package) +(package! org-super-agenda) ;; org mode +(package! org-appear :recipe (:host github :repo "awth13/org-appear")) ;; make ++, --, ~~ visible on cursor enter +;; (package! valign) ;; visual alignment for org tables + +(package! graphviz-dot-mode) ;; file modes +(package! systemd) + +(package! keychain-environment) ;; get github ssh-keys from keychain +(package! page-break-lines) ;; display page breaks as lines +(package! evil-smartparens) +(package! info-colors) ;; help buffer colors +(package! texfrag) ;; better org inline latex preview +;; (package! org-pretty-table :recipe (:host github :repo "Fuco1/org-pretty-table")) +(package! org-modern) + +(unpin! org-roam) ;; recommended by org-roam-ui +(package! websocket) ;; for org-roam-ui +(package! org-roam-ui) ;; successor of org-roam-server, roamV2 + +(package! elcord) +;; (package! keycast :pin "72d9add8ba16e0cae8cfcff7fc050fa75e493b4e") ;; didn't show anything + +(package! pacfiles-mode) + + +;; To install a package directly from a remote git repo, you must specify a +;; `:recipe'. You'll find documentation on what `:recipe' accepts here: +;; https://github.com/raxod502/straight.el#the-recipe-format + ;(package! another-package + ; :recipe (:host github :repo "username/repo")) + +;; If the package you are trying to install does not contain a PACKAGENAME.el +;; file, or is located in a subdirectory of the repo, you'll need to specify +;; `:files' in the `:recipe': + ;(package! this-package + ; :recipe (:host github :repo "username/repo" + ; :files ("some-file.el" "src/lisp/*.el"))) + +;; If you'd like to disable a package included with Doom, you can do so here +;; with the `:disable' property: + ;(package! builtin-package :disable t) + +;; You can override the recipe of a built in package without having to specify +;; all the properties for `:recipe'. These will inherit the rest of its recipe +;; from Doom or MELPA/ELPA/Emacsmirror: + ;(package! builtin-package :recipe (:nonrecursive t)) + ;(package! builtin-package-2 :recipe (:repo "myfork/package")) + +;; Specify a `:branch' to install a package from a particular branch or tag. +;; This is required for some packages whose default branch isn't 'master' (which +;; our package manager can't deal with; see raxod502/straight.el#279) + ;(package! builtin-package :recipe (:branch "develop")) + +;; Use `:pin' to specify a particular commit to install. + ;(package! builtin-package :pin "1a2b3c4d5e") + + +;; Doom's packages are pinned to a specific commit and updated from release to +;; release. The `unpin!' macro allows you to unpin single packages... + ;(unpin! pinned-package) +;; ...or multiple packages + ;(unpin! pinned-package another-pinned-package) +;; ...Or *all* packages (NOT RECOMMENDED; will likely break things) + ;(unpin! t) diff --git a/config/doom/snippets/latex-mode/.yas-compiled-snippets.el b/config/doom/snippets/latex-mode/.yas-compiled-snippets.el new file mode 100644 index 00000000..492d548e --- /dev/null +++ b/config/doom/snippets/latex-mode/.yas-compiled-snippets.el @@ -0,0 +1,19 @@ +;;; Compiled snippets and support files for `latex-mode' +;;; Snippet definitions: +;;; +(yas-define-snippets 'latex-mode + '(("theorem" "\\begin{theorem}{$1}\n $0\n\\end{theorem}" "theorem" nil nil nil "/home/christoph/.config/doom/snippets/latex-mode/theorem.yasnippet" nil nil) + ("sum" "\\sum\\limits${1:$(when (> (length yas-text) 0) \"_\")\n}${1:$(when (> (length yas-text) 1) \"{\")\n}${1:i=0}${1:$(when (> (length yas-text) 1) \"}\")\n}${2:$(when (> (length yas-text) 0) \"^\")\n}${2:$(when (> (length yas-text) 1) \"{\")\n}${2:n}${2:$(when (> (length yas-text) 1) \"}\")} $0" "sum" nil nil nil "/home/christoph/.config/doom/snippets/latex-mode/sum.yasnippet" nil nil) + ("subfile" "\\documentclass[main.tex]{subfiles}\n\n\\begin{document}\n\n\\section{$1}\n\n$0\n\n\\end{document}" "subfile" nil nil nil "/home/christoph/.config/doom/snippets/latex-mode/subfile.yasnippet" nil nil) + ("remark" "\\begin{remark}{$1}\n $0\n\\end{remark}" "remark" nil nil nil "/home/christoph/.config/doom/snippets/latex-mode/remark.yasnippet" nil nil) + ("proof" "\\begin{proof}{$1}\n $0\n\\end{proof}\n" "proof" nil nil nil "/home/christoph/.config/doom/snippets/latex-mode/proof.yasnippet" nil nil) + ("mainfile" "\\input{../pre.tex}\n\n\\begin{document}\n\n\\title{$1} \\subtitle{$2} \\author{Christoph Urlacher} \\date{\\today}\n\n\\maketitle\n\\newpage\n\\tableofcontents\n\\newpage\n\n$0\n\n\\end{document}" "main file" nil nil nil "/home/christoph/.config/doom/snippets/latex-mode/main_file.yasnippet" nil nil) + ("lemma" "\\begin{lemma}{$1}\n $0\n\\end{lemma}\n" "lemma" nil nil nil "/home/christoph/.config/doom/snippets/latex-mode/lemma.yasnippet" nil nil) + ("int" "\\int\\limits${1:$(when (> (length yas-text) 0) \"_\")\n}${1:$(when (> (length yas-text) 1) \"{\")\n}${1:left}${1:$(when (> (length yas-text) 1) \"}\")\n}${2:$(when (> (length yas-text) 0) \"^\")\n}${2:$(when (> (length yas-text) 1) \"{\")\n}${2:right}${2:$(when (> (length yas-text) 1) \"}\")} $0\n" "int" nil nil nil "/home/christoph/.config/doom/snippets/latex-mode/int.yasnippet" nil nil) + ("im" "\\\\( $1 \\\\)$0" "inline math" nil nil nil "/home/christoph/.config/doom/snippets/latex-mode/inline_math.yasnippet" nil nil) + ("dm" "\\\\[ $1 \\\\]$0" "display math" nil nil nil "/home/christoph/.config/doom/snippets/latex-mode/display_math.yasnippet" nil nil) + ("definition" "\\begin{definition}{$1}\n $0\n\\end{definition}" "definition" nil nil nil "/home/christoph/.config/doom/snippets/latex-mode/definition.yasnippet" nil nil) + ("corollary" "\\begin{corollary}{$1}\n $0\n\\end{corollary}\n" "corollary" nil nil nil "/home/christoph/.config/doom/snippets/latex-mode/corollary.yasnippet" nil nil))) + + +;;; Do not edit! File generated at Wed Apr 13 20:49:27 2022 diff --git a/config/doom/snippets/latex-mode/corollary.yasnippet b/config/doom/snippets/latex-mode/corollary.yasnippet new file mode 100644 index 00000000..1d3e8b82 --- /dev/null +++ b/config/doom/snippets/latex-mode/corollary.yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: corollary +# key: corollary +# -- +\begin{corollary}{$1} + $0 +\end{corollary} diff --git a/config/doom/snippets/latex-mode/definition.yasnippet b/config/doom/snippets/latex-mode/definition.yasnippet new file mode 100644 index 00000000..69a222df --- /dev/null +++ b/config/doom/snippets/latex-mode/definition.yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: definition +# key: definition +# -- +\begin{definition}{$1} + $0 +\end{definition} \ No newline at end of file diff --git a/config/doom/snippets/latex-mode/display_math.yasnippet b/config/doom/snippets/latex-mode/display_math.yasnippet new file mode 100644 index 00000000..484e9671 --- /dev/null +++ b/config/doom/snippets/latex-mode/display_math.yasnippet @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: display math +# key: dm +# -- +\\[ $1 \\]$0 \ No newline at end of file diff --git a/config/doom/snippets/latex-mode/inline_math.yasnippet b/config/doom/snippets/latex-mode/inline_math.yasnippet new file mode 100644 index 00000000..0f3b5f03 --- /dev/null +++ b/config/doom/snippets/latex-mode/inline_math.yasnippet @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: inline math +# key: im +# -- +\\( $1 \\)$0 \ No newline at end of file diff --git a/config/doom/snippets/latex-mode/int.yasnippet b/config/doom/snippets/latex-mode/int.yasnippet new file mode 100644 index 00000000..2fe4d9a0 --- /dev/null +++ b/config/doom/snippets/latex-mode/int.yasnippet @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: int +# key: int +# -- +\int\limits${1:$(when (> (length yas-text) 0) "_") +}${1:$(when (> (length yas-text) 1) "{") +}${1:left}${1:$(when (> (length yas-text) 1) "}") +}${2:$(when (> (length yas-text) 0) "^") +}${2:$(when (> (length yas-text) 1) "{") +}${2:right}${2:$(when (> (length yas-text) 1) "}")} $0 diff --git a/config/doom/snippets/latex-mode/lemma.yasnippet b/config/doom/snippets/latex-mode/lemma.yasnippet new file mode 100644 index 00000000..673151a3 --- /dev/null +++ b/config/doom/snippets/latex-mode/lemma.yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: lemma +# key: lemma +# -- +\begin{lemma}{$1} + $0 +\end{lemma} diff --git a/config/doom/snippets/latex-mode/main_file.yasnippet b/config/doom/snippets/latex-mode/main_file.yasnippet new file mode 100644 index 00000000..6fa82644 --- /dev/null +++ b/config/doom/snippets/latex-mode/main_file.yasnippet @@ -0,0 +1,18 @@ +# -*- mode: snippet -*- +# name: main file +# key: mainfile +# -- +\input{../pre.tex} + +\begin{document} + +\title{$1} \subtitle{$2} \author{Christoph Urlacher} \date{\today} + +\maketitle +\newpage +\tableofcontents +\newpage + +$0 + +\end{document} \ No newline at end of file diff --git a/config/doom/snippets/latex-mode/proof.yasnippet b/config/doom/snippets/latex-mode/proof.yasnippet new file mode 100644 index 00000000..13ac5886 --- /dev/null +++ b/config/doom/snippets/latex-mode/proof.yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: proof +# key: proof +# -- +\begin{proof}{$1} + $0 +\end{proof} diff --git a/config/doom/snippets/latex-mode/remark.yasnippet b/config/doom/snippets/latex-mode/remark.yasnippet new file mode 100644 index 00000000..790b739f --- /dev/null +++ b/config/doom/snippets/latex-mode/remark.yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: remark +# key: remark +# -- +\begin{remark}{$1} + $0 +\end{remark} \ No newline at end of file diff --git a/config/doom/snippets/latex-mode/subfile.yasnippet b/config/doom/snippets/latex-mode/subfile.yasnippet new file mode 100644 index 00000000..82f7a27b --- /dev/null +++ b/config/doom/snippets/latex-mode/subfile.yasnippet @@ -0,0 +1,13 @@ +# -*- mode: snippet -*- +# name: subfile +# key: subfile +# -- +\documentclass[main.tex]{subfiles} + +\begin{document} + +\section{$1} + +$0 + +\end{document} \ No newline at end of file diff --git a/config/doom/snippets/latex-mode/sum.yasnippet b/config/doom/snippets/latex-mode/sum.yasnippet new file mode 100644 index 00000000..106719c9 --- /dev/null +++ b/config/doom/snippets/latex-mode/sum.yasnippet @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: sum +# key: sum +# -- +\sum\limits${1:$(when (> (length yas-text) 0) "_") +}${1:$(when (> (length yas-text) 1) "{") +}${1:i=0}${1:$(when (> (length yas-text) 1) "}") +}${2:$(when (> (length yas-text) 0) "^") +}${2:$(when (> (length yas-text) 1) "{") +}${2:n}${2:$(when (> (length yas-text) 1) "}")} $0 \ No newline at end of file diff --git a/config/doom/snippets/latex-mode/theorem.yasnippet b/config/doom/snippets/latex-mode/theorem.yasnippet new file mode 100644 index 00000000..c2c9beba --- /dev/null +++ b/config/doom/snippets/latex-mode/theorem.yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: theorem +# key: theorem +# -- +\begin{theorem}{$1} + $0 +\end{theorem} \ No newline at end of file diff --git a/config/doom/snippets/org-mode/.yas-compiled-snippets.el b/config/doom/snippets/org-mode/.yas-compiled-snippets.el new file mode 100644 index 00000000..4c932d19 --- /dev/null +++ b/config/doom/snippets/org-mode/.yas-compiled-snippets.el @@ -0,0 +1,18 @@ +;;; Compiled snippets and support files for `org-mode' +;;; Snippet definitions: +;;; +(yas-define-snippets 'org-mode + '(("cdot" "·" "multiplication sign" nil nil nil "/home/christoph/.config/doom/snippets/org-mode/multiplication_sign.yasnippet" nil nil) + ("im" "\\\\( $0 \\\\)" "inline math" nil nil + ((yas-after-exit-snippet-hook #'org-edit-special)) + "/home/christoph/.config/doom/snippets/org-mode/inline_math.yasnippet" nil nil) + ("latexp" "#+OPTIONS: tags:nil date:nil num:nil toc:nil tags:nil\n#+TAGS: $0\n" "latex export preamble" nil nil nil "/home/christoph/.config/doom/snippets/org-mode/export.yasnippet" nil nil) + ("lrarr" "⇔" "equivalent sign" nil nil nil "/home/christoph/.config/doom/snippets/org-mode/equivalent_sign.yasnippet" nil nil) + ("begin" "\\\\begin{$1}\n $0\n\\\\end{$1}" "new environment" nil nil nil "/home/christoph/.config/doom/snippets/org-mode/environment.yasnippet" nil nil) + ("dm" "\\\\[ $1 \\\\]$0" "display math" nil nil nil "/home/christoph/.config/doom/snippets/org-mode/display_math.yasnippet" nil nil) + ("dfa" "#+BEGIN_SRC dot :file $1.png :cmdline -Kdot -Tpng\ndigraph {\n rankdir = LR;\n splines = true;\n node [shape = doublecircle]; Z1;\n node [shape = circle];\n Z0 -> Z1 [label = \"\"];\n $0\n}\n#+END_SRC\n" "graphviz deterministic finite automaton" nil nil nil "/home/christoph/.config/doom/snippets/org-mode/dfa.yasnippet" nil nil) + ("delta" "Δ" "Delta" nil nil nil "/home/christoph/.config/doom/snippets/org-mode/big_delta.yasnippet" nil nil) + ("srcR" "#+begin_src R :session *R* :tangle yes :exports both\n\n#+end_src\n" "R source block" nil nil nil "/home/christoph/.config/doom/snippets/org-mode/R_source_block" nil nil))) + + +;;; Do not edit! File generated at Wed Apr 13 20:49:27 2022 diff --git a/config/doom/snippets/org-mode/R_source_block b/config/doom/snippets/org-mode/R_source_block new file mode 100644 index 00000000..f6191a6f --- /dev/null +++ b/config/doom/snippets/org-mode/R_source_block @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: R source block +# key: srcR +# -- +#+begin_src R :session *R* :tangle yes :exports both + +#+end_src diff --git a/config/doom/snippets/org-mode/big_delta.yasnippet b/config/doom/snippets/org-mode/big_delta.yasnippet new file mode 100644 index 00000000..5be66b0b --- /dev/null +++ b/config/doom/snippets/org-mode/big_delta.yasnippet @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: Delta +# key: delta +# -- +Δ \ No newline at end of file diff --git a/config/doom/snippets/org-mode/dfa.yasnippet b/config/doom/snippets/org-mode/dfa.yasnippet new file mode 100644 index 00000000..aa30f566 --- /dev/null +++ b/config/doom/snippets/org-mode/dfa.yasnippet @@ -0,0 +1,14 @@ +# -*- mode: snippet -*- +# name: graphviz deterministic finite automaton +# key: dfa +# -- +#+BEGIN_SRC dot :file $1.png :cmdline -Kdot -Tpng +digraph { + rankdir = LR; + splines = true; + node [shape = doublecircle]; Z1; + node [shape = circle]; + Z0 -> Z1 [label = ""]; + $0 +} +#+END_SRC diff --git a/config/doom/snippets/org-mode/display_math.yasnippet b/config/doom/snippets/org-mode/display_math.yasnippet new file mode 100644 index 00000000..484e9671 --- /dev/null +++ b/config/doom/snippets/org-mode/display_math.yasnippet @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: display math +# key: dm +# -- +\\[ $1 \\]$0 \ No newline at end of file diff --git a/config/doom/snippets/org-mode/environment.yasnippet b/config/doom/snippets/org-mode/environment.yasnippet new file mode 100644 index 00000000..b50331b6 --- /dev/null +++ b/config/doom/snippets/org-mode/environment.yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: new environment +# key: begin +# -- +\\begin{$1} + $0 +\\end{$1} \ No newline at end of file diff --git a/config/doom/snippets/org-mode/equivalent_sign.yasnippet b/config/doom/snippets/org-mode/equivalent_sign.yasnippet new file mode 100644 index 00000000..54241eb7 --- /dev/null +++ b/config/doom/snippets/org-mode/equivalent_sign.yasnippet @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: equivalent sign +# key: lrarr +# -- +⇔ \ No newline at end of file diff --git a/config/doom/snippets/org-mode/export.yasnippet b/config/doom/snippets/org-mode/export.yasnippet new file mode 100644 index 00000000..87553040 --- /dev/null +++ b/config/doom/snippets/org-mode/export.yasnippet @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: latex export preamble +# key: latexp +# -- +#+OPTIONS: tags:nil date:nil num:nil toc:nil tags:nil +#+TAGS: $0 diff --git a/config/doom/snippets/org-mode/inline_math.yasnippet b/config/doom/snippets/org-mode/inline_math.yasnippet new file mode 100644 index 00000000..8b05848a --- /dev/null +++ b/config/doom/snippets/org-mode/inline_math.yasnippet @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: inline math +# key: im +# expand-env: ((yas-after-exit-snippet-hook #'org-edit-special)) +# -- +\\( $0 \\) \ No newline at end of file diff --git a/config/doom/snippets/org-mode/multiplication_sign.yasnippet b/config/doom/snippets/org-mode/multiplication_sign.yasnippet new file mode 100644 index 00000000..88151ed5 --- /dev/null +++ b/config/doom/snippets/org-mode/multiplication_sign.yasnippet @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: multiplication sign +# key: cdot +# -- +· \ No newline at end of file