diff --git a/config.el b/config.el old mode 100755 new mode 100644 index 58b43f7..03050e1 --- a/config.el +++ b/config.el @@ -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 < // / \/ +;; //_________| / |/ |/ \__// / / /_/ \/ +;; | / | : | / /__/ +;; |/ |/ 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) diff --git a/init.el b/init.el index 8d7563e..ec5b866 100755 --- a/init.el +++ b/init.el @@ -29,7 +29,7 @@ vertico ; the search engine of the future :ui - ;;deft ; notational velocity for Emacs + 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 @@ -92,7 +92,7 @@ ;;collab ; buffers with friends debugger ; FIXME stepping through code, to help you add bugs ;;direnv - ;;docker + docker ;;editorconfig ; let someone else argue about tabs vs spaces ;;ein ; tame Jupyter notebooks with emacs (eval +overlay) ; run code, run (also, repls) @@ -104,7 +104,7 @@ ;;pass ; password manager for nerds pdf ; pdf enhancements ;;terraform ; infrastructure as code - ;;tmux ; an API for interacting with tmux + 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 @@ -152,14 +152,14 @@ ;;lua ; one-based indices? one-based indices markdown ; writing docs for people to ignore ;;nim ; python + lisp at the speed of c - ;;nix ; I hereby declare "nix geht mehr!" + nix ; I hereby declare "nix geht mehr!" ;;ocaml ; an objective camel - (org +roam2) ; organize your plain life in plain text + (org +pretty +present +journal +roam) ; organize your plain life in plain text ;;php ; perl's insecure younger brother ;;plantuml ; diagrams for confusing people more ;;graphviz ; diagrams for confusing yourself even more ;;purescript ; javascript, but functional - python ; beautiful is better than ugly + python +lsp ; beautiful is better than ugly ;;qt ; the 'cutest' gui framework ever ;;racket ; a DSL for DSLs ;;raku ; the artist formerly known as perl6 @@ -174,12 +174,12 @@ ;;solidity ; do you need a blockchain? No. ;;swift ; who asked for emoji variables? ;;terra ; Earth and Moon in alignment for performance. - ;;web ; the tubes - ;;yaml ; JSON, but readable + web ; the tubes + yaml ; JSON, but readable ;;zig ; C, but simpler :email - ;;(mu4e +org +gmail) + (mu4e +org +gmail) ;;notmuch ;;(wanderlust +gmail) @@ -187,8 +187,8 @@ calendar ;;emms everywhere ; *leave* Emacs!? You must be joking - ;;irc ; how neckbeards socialize - ;;(rss +org) ; emacs as an RSS reader + irc ; how neckbeards socialize + (rss +org) ; emacs as an RSS reader :config ;;literate diff --git a/packages.el b/packages.el index 03e3fbd..e9d0f14 100755 --- a/packages.el +++ b/packages.el @@ -47,12 +47,15 @@ ;; (unpin! pinned-package another-pinned-package) ;; ...Or *all* packages (NOT RECOMMENDED; will likely break things) ;; (unpin! t) -(package! catppuccin-theme) +;; (package! catppuccin-theme) (package! flycheck) (package! ox-typst) (package! org-fragtog) (package! ox-reveal) (package! pdf-tools) +;; do i need these? +;; (package! cdlatex) +;; (package! citeproc) ;; When using org-roam via the `+roam` flag (unpin! org-roam) @@ -64,18 +67,12 @@ ;; When using bibtex-completion via the `biblio` module (unpin! bibtex-completion helm-bibtex ivy-bibtex) - (package! org-ref) (package! xenops) -(package! typit) -(package! typing) -(package! monkeytype) - (package! org-mind-map) -;;(package! evangelion-theme) (package! n4js) (package! cypher-mode) (package! ob-cypher) @@ -84,7 +81,7 @@ (package! graphviz-dot-mode) (package! csv-mode) (package! company-org-block) -(package! evangelion-theme) +;; (package! evangelion-theme) (package! ws-butler) (package! flycheck-languagetool) diff --git a/private-snippets/LaTeX-mode/newglossaryentry b/private-snippets/LaTeX-mode/newglossaryentry index c4f68df..ed00d35 100644 --- a/private-snippets/LaTeX-mode/newglossaryentry +++ b/private-snippets/LaTeX-mode/newglossaryentry @@ -4,6 +4,6 @@ # uuid: gl # -- \newglossaryentry{${1}}{ - name=${2}, - description={${4}} -} + name=${1:$(capitalize yas-text)}, + description={${3}} +} \ No newline at end of file diff --git a/private-snippets/fundamental-mode/time b/private-snippets/fundamental-mode/time index a51303a..e7d5634 100644 --- a/private-snippets/fundamental-mode/time +++ b/private-snippets/fundamental-mode/time @@ -3,4 +3,4 @@ # key: time # uuid: time # -- -`(format-time-string "%Y-%m-%dT%H:%M:%S" (current-time))` +`(format-time-string "%Y-%m-%dT%H:%M:%S" (current-time))` \ No newline at end of file