2026-02-06T15:12:18

This commit is contained in:
2026-02-06 15:12:15 +01:00
parent 198946aad8
commit e39cd80040
5 changed files with 171 additions and 202 deletions

330
config.el Executable file → Normal file
View File

@@ -33,6 +33,18 @@
;; available. You can either set `doom-theme' or manually load a theme with the
;; `load-theme' function. This is the default:
;; (setq doom-theme 'doom-one)
;; (setq doom-theme 'catppuccin)
;; (setq doom-theme 'doom-palenight)
;;
;; (use-package evangelion-theme
;; :custom
;; ;; `nil' to disable background for comments
;; (evangelion-comment-background-enabled . t)
;; :config (load-theme 'evangelion t))
(setq doom-theme 'doom-dracula)
(add-hook 'pdf-view-mode-hook (lambda () (pdf-view-themed-minor-mode t)))
;; 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'.
@@ -40,7 +52,17 @@
;; 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 "/mnt/c/Users/q669019/Bachelor/org/")
;; either system-name or doom-system
(if (eq 'linux (car doom-system))
(if (eq 'wsl (cadr doom-system))
(progn
(setq org-directory "/mnt/c/Users/q669019/Bachelor/org/")
(setq default-directory "/mnt/c/Users/q669019/Bachelor/"))
(progn
(setq org-directory "~/org/")
(setq default-directory "~/org/"))))
;; Whenever you reconfigure a package, make sure to wrap your config in an
@@ -75,10 +97,6 @@
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
;; they are implemented.
;; (setq doom-theme 'catppuccin)
;; (setq doom-theme 'doom-palenight)
;;(setq org-startup-with-inline-images t)
;; for inline images in org mode
(setq org-display-inline-images t)
(setq org-redisplay-inline-images t)
@@ -103,49 +121,7 @@
;; :leader
;; "i l" #'my/org-insert-latest-screenshot)
;; (with-eval-after-load "ispell"
;; ;; Configure `LANG`, otherwise ispell.el cannot find a 'default
;; ;; dictionary' even though multiple dictionaries will be configured
;; ;; in next line.
;; (setenv "LANG" "en_US.UTF-8")
;; (setq ispell-program-name "hunspell")
;; ;; Configure German, Swiss German, and two variants of English.
;; (setq ispell-dictionary "de_DE,en_US")
;; ;; ispell-set-spellchecker-params has to be called
;; ;; before ispell-hunspell-add-multi-dic will work
;; (ispell-set-spellchecker-params)
;; (ispell-hunspell-add-multi-dic "de_DE,en_US")
;; ;; For saving words to the personal dictionary, don't infer it from
;; ;; the locale, otherwise it would save to ~/.hunspell_de_DE.
;; (setq ispell-personal-dictionary "~/.hunspell_personal"))
;;
;; ;; The personal dictionary file has to exist, otherwise hunspell will
;; ;; silently not use it.
;; (unless (file-exists-p ispell-personal-dictionary)
;; (write-region "" nil ispell-personal-dictionary nil 0))
;;
;; (use-package flycheck
;; :ensure t
;; :config
;; (add-hook 'after-init-hook #'global-flycheck-mode))
;; (after! lsp-mode
;; (setq lsp-diagnostics-provider :flycheck))
;;
;;
;; (add-hook 'spell-fu-mode-hook
;; (lambda ()
;; (spell-fu-dictionary-add (spell-fu-get-ispell-dictionary "de_DE"))
;; (spell-fu-dictionary-add (spell-fu-get-ispell-dictionary "en_US"))
;; ))
;;
;;
;; (setq ispell-program-name "aspell"
;; aspell-dictionary "de_DE"
;; aspell-dictionary "en_US"
;; aspell-program-name "aspell"
;; ispell-dictionary "de_DE"
;; ispell-dictionary "en_US"
;; ispell-program-name "aspell")
(after! ispell
(setq ispell-really-hunspell t
@@ -154,6 +130,13 @@
(ispell-set-spellchecker-params)
(ispell-hunspell-add-multi-dic "en_US,de_DE"))
;; (use-package flycheck
;; :ensure t
;; :config
;; (add-hook 'after-init-hook #'global-flycheck-mode))
;; (after! lsp-mode
;; (setq lsp-diagnostics-provider :flycheck))
(use-package! flycheck)
(use-package flycheck-languagetool
:ensure t
@@ -161,7 +144,6 @@
:init
(setq flycheck-languagetool-server-jar "~/.languagetool-server.jar"))
(require 'ansi-color)
(defun display-ansi-colors ()
(interactive)
@@ -170,12 +152,13 @@
(remove-hook 'org-mode-hook #'ws-butler-mode)
(add-hook 'org-mode-hook (lambda () (ws-butler-mode -1)))
;;(use-package! org-fragtog
;; :after org
;; :hook (org-mode . org-fragtog) ; this auto-enables it when you enter an org-buffer, remove if you do not want this
;; :config
;; ;; whatever you want
;; )
;; typst export:
;; (use-package ox-typst
;; :after org)
;; (use-package! ox-typst
;; :after ox)
;; (require 'ox-typst)
(defun toggle-org-latex-preview-on-save ()
"adds or removes after save hook to org-latex-preview"
@@ -203,67 +186,7 @@
(setq org-startup-with-latex-preview t)
(setq font-lock-maximum-decoration t))
(add-hook 'org-mode-hook #'turn-on-font-lock)
(menu-bar--display-line-numbers-mode-relative)
;; (setq org-preview-latex-default-process :imagemagick)
;;
;; (setq org-babel-latex-htlatex "htlatex")
;; (defmacro by-backend (&rest body)
;; `(case org-export-current-backend ,@body))
;; #+REVEAL_ROOT: https://cdn.jsdelivr.net/npm/reveal.js
;; Reveal.js + Org mode
(use-package ox-reveal
:after org)
(use-package! ox-reveal
:after ox)
(require 'ox-reveal)
(setq Org-Reveal-title-slide nil)
;; Wrong number of arguments?!?!
;;(setq org-export-backends md ascii html icalendar latex odt typst reveal)
;; (defun org-insert-src-block (src-code-type)
;; "Insert a `SRC-CODE-TYPE' type source code block in org-mode."
;; (interactive
;; (let ((src-code-types
;; '("emacs-lisp" "python" "C" "sh" "java" "js" "clojure" "C++" "css"
;; "calc" "asymptote" "dot" "gnuplot" "ledger" "lilypond" "mscgen"
;; "octave" "oz" "plantuml" "R" "sass" "screen" "sql" "awk" "ditaa"
;; "haskell" "latex" "lisp" "matlab" "ocaml" "org" "perl" "ruby"
;; "scheme" "sqlite")))
;; (list (ido-completing-read "Source code type: " src-code-types))))
;; (progn
;; (newline-and-indent)
;; (insert (format "#+BEGIN_SRC %s\n" src-code-type))
;; (newline-and-indent)
;; (insert "#+END_SRC\n")
;; (previous-line 2)
;; (org-edit-src-code)
;; )
;; )
(defun org-insert-c-src()
"Insert a C src block with a helper function to run it."
(interactive)
(progn
(newline-and-indent)
(insert "#+NAME: cprog\n#+BEGIN_SRC C :tangle (concat (org-get-heading t t t t) \".c\") :results output")
(newline-and-indent)
(insert "#+END_SRC\n")
(newline-and-indent)
;;(insert "#+BEGIN_SRC sh :dir . :results output :exports both :var filename=(concat (org-get-heading t t t t) \".c\") output=(concat (org-get-heading t t t t) \".o\")\n# output=${filename%.*}.o\ngcc $filename -o $output\n./$output\n# ./$output <<EOF\n# input here\n# EOF\n#+END_SRC")
(org-insert-c-helper)
(previous-line 15)
(back-to-indentation)
;; (insert "#+END_SRC\n")
;; (previous-line 2)
;; (evil-insert-state)
)
)
;; (evil-insert-state)
(defun org-insert-c-helper ()
(interactive)
(progn
@@ -282,6 +205,9 @@
)
)
;; =====================
;; AI Stuff
(setq gptel-model 'gpt-5
gptel-backend (gptel-make-gh-copilot "Copilot"
))
@@ -299,6 +225,7 @@
(advice-add 'gptel--url-retrieve :around #'my/gptel-url-retrieve)
;; (advice-add 'gptel-send :around #'my/gptel-url-retrieve)
;; =====================
;; Determine the specific system type.
;; Emacs variable system-type doesn't yet have a "wsl/linux" value,
@@ -323,6 +250,8 @@
;; browse-url-browser-function 'browse-url-generic)
;; )))
;; =============================
(setq calendar-week-start-day 1)
(setq calendar-intermonth-text
@@ -337,6 +266,7 @@
(propertize "W" ; or e.g. "KW" in Germany
'font-lock-face 'font-lock-keyword-face))
;; =============================
(use-package! org-roam-bibtex
:after org-roam
@@ -358,6 +288,7 @@
org-roam-ui-update-on-save t
org-roam-ui-open-on-start t))
;; TODO: add if thingy like with org directory
(use-package! citar
:custom
;;(org-cite-global-bibliography '("C:/Users/q669019/Bachelor/Bibliothek/Bibliothek.bib"))
@@ -365,8 +296,73 @@
;;(citar-bibliography '("C:/Users/q669019/Bachelor/Bibliothek/")))
(citar-bibliography '("/mnt/c/Users/q669019/Bachelor/Literatur/Bibliothek/Bibliothek.bib")))
;;(setq default-directory "C:/Users/q669019/Bachelor/")
(setq default-directory "/mnt/c/Users/q669019/Bachelor/")
;; =====================
;; for image splash
;; (setq fancy-splash-image (concat doom-private-dir "e.png"))
;; https://x-e.ro _ ____
;; : \ | \ .
;; | \ . | : |\ /\
;; . | :|\__ | | | \ / \
;; |\ | |! \ \ | | | |\ / /
;; \"-.______ | \: ||\ \ \ | | | | \ / /
;; \_ "-_| |\ || \ \/ | |___| ! |\____/ _/-. /\
;; "-_ ____: |_\ || \/ ___\ __ _// | | ___ \---" /
;; \ \ | _____, /___\___\/ / / \_! | // _/ / /
;; ___\_ \__| | | __. _/____ / / / > // / \/
;; //_________| / |/ |/ \__// / / /_/ \/
;; | / | : | / /__/
;; |/ |/ E V A N G E L I O N
;;
(defun evangelion-splash ()
(let* ((banner '(" _ ____ "
" : \\ | \\ . "
" | \\ . | : |\\ /\\ "
" . | :|\\__ | | | \\ / \\ "
" |\\ | |! \\ \\ | | | |\\ / / "
" \\\"-.______ | \\: ||\\ \\ \\ | | | | \\ / / "
" \\_ \"-_| |\\ || \\ \\/ | |___| ! |\\____/ _/-. /\\ "
" \"-_ ____: |_\\ || \\/ ___\\ __ _// | | ___ \\---\" / "
" \\ \\ | _____, /___\\___\\/ / / \\_! | // _/ / / "
" ___\\_ \\__| | | __. _/____ / / / > // / \\/ "
" //_________| / |/ |/ \\__// / / /_/ \\/ "
" | / | : | / /__/ "
" |/ |/ "
" E M A C S "))
(longest-line (apply #'max (mapcar #'length banner))))
(put-text-property
(point)
(dolist (line banner (point))
(insert (+doom-dashboard--center
+doom-dashboard--width
(concat line (make-string (max 0 (- longest-line (length line))) 50)))
"\n"))
'face 'doom-dashboard-banner)))
(setq +doom-dashboard-ascii-banner-fn #'evangelion-splash)
;; .doom.d/config.el
;; (let ((alternatives '("nameoffirstfile.svg"
;; "nameofanotherfile.png"
;; "nameofathirdfile.svg")))
;; (setq fancy-splash-image
;; (concat doom-private-dir "splash/"
;; (nth (random (length alternatives)) alternatives))))
;; (setq vterm-shell "/usr/bin/env zsh")
;; for installing c and cpp tree sitter languages
;; probably only need this once and run
;; M-x treesit-install-language-grammar RET c RET
;; M-x treesit-install-language-grammar RET cpp RET
;; can comment out after
;; (after! treesit
;; (setq treesit-language-source-alist
;; '((c "https://github.com/tree-sitter/tree-sitter-c")
;; (cpp "https://github.com/tree-sitter/tree-sitter-cpp"))))
;; from https://pragmaticemacs.wordpress.com/2017/11/08/more-pdf-tools-tweaks/
@@ -400,7 +396,7 @@
;; ====================
;; insert date and time
;; maybe also snippet?
(defvar current-date-time-format "%Y-%m-%dT%H:%M:%S"
"Format of date to insert with `insert-current-date-time' func
See help of `format-time-string' for possible replacements")
@@ -430,11 +426,9 @@ Uses `current-date-time-format' for the formatting the date/time."
(map! :map evil-normal-state-map "SPC i t" #'insert-current-date-time)
(use-package! csv-mode)
;; (setenv "MSYSTEM" "UCRT64") ;; Tell MSYS2 which subsystem
;; (setenv "CHERE_INVOKING" "1") ;; Avoid directory change
(setq +latex-viewers '(pdf-tools))
(setq lsp-tex-server 'texlab)
;; (add-hook LaTeX-mode-hook #'xenops-mode)
@@ -482,12 +476,6 @@ Uses `current-date-time-format' for the formatting the date/time."
(use-package! n4js)
(setq n4js-cli-arguments '("-port" "7474"))
(use-package! n4js)
;;(use-package evangelion-theme
;; :custom
;; ;; `nil' to disable background for comments
;; (evangelion-comment-background-enabled . t)
;; :config (load-theme 'evangelion t))
;;(setq doom-theme 'evangelion)
(use-package ob-cypher
:ensure t
@@ -537,29 +525,6 @@ Uses `current-date-time-format' for the formatting the date/time."
(use-package! csv-mode)
(defun evangelion-splash ()
(let* ((banner '(" _ ____ "
" : \\ | \\ . "
" | \\ . | : |\\ /\\ "
" . | :|\\__ | | | \\ / \\ "
" |\\ | |! \\ \\ | | | |\\ / / "
" \\\"-.______ | \\: ||\\ \\ \\ | | | | \\ / / "
" \\_ \"-_| |\\ || \\ \\/ | |___| ! |\\____/ _/-. /\\ "
" \"-_ ____: |_\\ || \\/ ___\\ __ _// | | ___ \\---\" / "
" \\ \\ | _____, /___\\___\\/ / / \\_! | // _/ / / "
" ___\\_ \\__| | | __. _/____ / / / > // / \\/ "
" //_________| / |/ |/ \\__// / / /_/ \\/ "
" | / | : | / /__/ "
" |/ |/ "
" E M A C S "))
(longest-line (apply #'max (mapcar #'length banner))))
(put-text-property (point) (dolist (line banner (point))
(insert (+doom-dashboard--center
+doom-dashboard--width
(concat line (make-string (max 0 (- longest-line (length line))) 50)))
"\n")) 'face 'doom-dashboard-banner)))
(setq +doom-dashboard-ascii-banner-fn #'evangelion-splash)
;; (use-package! company-org-block)
(use-package company-org-block
;; :ensure t
@@ -569,6 +534,7 @@ Uses `current-date-time-format' for the formatting the date/time."
(setq-local company-backends '(company-org-block))
(company-mode +1)))))
;; for org blocks:
(setq company-org-block-edit-style 'auto) ;; 'auto, 'prompt, or 'inline
(add-hook 'org-mode-hook
@@ -576,31 +542,9 @@ Uses `current-date-time-format' for the formatting the date/time."
(add-to-list (make-local-variable 'company-backends)
'company-org-block)))
;; (use-package evangelion-theme
;; :config (load-theme 'evangelion t))
;; (evangelion-comment-background-enabled . t)
;; (setq doom-theme 'evangelion)
(setq doom-theme 'doom-palenight)
(defun org-insert-cite-eol ()
(interactive)
(progn
(evil-org-end-of-line)
(insert " ")
(call-interactively 'org-cite-insert)
))
;; (map! :map evil-normal-state-map "SPC m $" #'org-cite-insert-eol)
;; (add-hook 'csv-mode-hook
;; (lambda ()
;; (visual-line-mode -1)
;; (toggle-truncate-lines 1)))
;; for better csv handling
;; disable line wrap
(defun disable-linewrap ()
"csv line wrap setup"
@@ -609,9 +553,6 @@ Uses `current-date-time-format' for the formatting the date/time."
(add-hook 'csv-mode-hook #'disable-linewrap)
;; später entfernen:
;; (remove-hook 'csv-mode-hook #'disable-linewrap)
;; auto detect separator
(add-hook 'csv-mode-hook #'csv-guess-set-separator)
;; turn on field alignment
@@ -656,6 +597,37 @@ Uses `current-date-time-format' for the formatting the date/time."
(setq! glyphless-char-display-control '((format-control . empty-box) (variation-selectors . thin-space) (no-font . hex-code)))
;; A starting point for a conservative, MISRA-friendly layout.
;; CC Mode style approximating the example (Allman + 4 spaces + aligned args).
;; (c-add-style
;; "misra-allman"
;; '("bsd"
;; (c-basic-offset . 4)
;; (indent-tabs-mode . nil)
;;
;; ;; Make { for functions and control statements go on the next line when typing.
;; ;; Note: this affects "on-the-fly" formatting; reindent won't move braces by itself.
;; (c-hanging-braces-alist . ((defun-open before)
;; (substatement-open before)))
;;
;; ;; Keep the brace itself not additionally indented relative to the if/for/while.
;; ;; After-the-fact cleanup: turn "} else {" into "}\nelse\n{".
;; (c-cleanup-list . (brace-else-brace)) ; key part for else placement
;;
;; (c-offsets-alist . ((statement-block-intro . +)
;; (substatement-open . 0)
;; (case-label . +)
;; (statement-case-intro . +)
;; (arglist-cont-nonempty . c-lineup-arglist)
;; ;; Align wrapped function call/decl arguments under the first arg.
;; (arglist-intro . +)
;; (arglist-cont-nonempty . c-lineup-arglist)
;; (arglist-close . 0)))))
(with-eval-after-load 'ob-cypher
;; Eigene Variante von org-babel-execute:cypher
(defun my/org-babel-execute:cypher (body params)
@@ -740,7 +712,7 @@ Verhalten:
(setq doom-snippets-dir (expand-file-name "doom-snippets/" doom-user-dir))
(setq +snippets-dir (expand-file-name "private-snippets/" doom-user-dir))
(setq +snippets-dir (expand-file-name "private-snippets/" doom-user-dir))
(use-package org-noter)
@@ -760,4 +732,4 @@ Verhalten:
(map! :map evil-normal-state-map "SPC j n" #'evil-jump-forward)
(map! :map evil-normal-state-map "SPC j N" #'evil-jump-backward)
(map! :after latex-mode :map latex-mode-map :n "SPC i c" #'citar-insert-citation)
(map! :after citar :map LaTeX-mode-map :n "SPC i c" #'citar-insert-citation)