From f8d711bb1ebde016de66129aef5dac9aa485fc33 Mon Sep 17 00:00:00 2001 From: knedlik Date: Fri, 10 Apr 2026 23:27:32 +0200 Subject: [PATCH] Erweiterung Templates und Anpassung Init-Files --- .org-id-locations | 2 +- bookmarks | 10 +++---- cheatsheet.org | 42 +++++++++++++++++++++++++++ init.el | 4 +-- lisp/init-keybindings.el | 13 +++++++++ lisp/init-org-r.el | 26 ----------------- lisp/init-org-roam.el | 33 ++++++++++++++++++++++ lisp/init-org.el | 12 ++++++++ lisp/init-search.el | 8 +++--- lisp/init-system.el | 9 ++++++ lisp/init-ui.el | 2 ++ templates/org/docs-template.org | 7 +++-- templates/org/latex-template.org | 47 +++++++++++++++++++++++++++++++ templates/org/report-template.org | 13 +++++++++ templates/org/report.org | 1 + 15 files changed, 189 insertions(+), 40 deletions(-) delete mode 100644 lisp/init-org-r.el create mode 100644 lisp/init-org-roam.el create mode 100644 lisp/init-system.el create mode 100644 templates/org/latex-template.org create mode 100644 templates/org/report-template.org diff --git a/.org-id-locations b/.org-id-locations index e43a641..16bbae4 100644 --- a/.org-id-locations +++ b/.org-id-locations @@ -1,2 +1,2 @@ -(("~/org/notes/neuer_neuer_test.org" "c1f0c054-6a3b-48e9-8f63-61c1061fa080") ("~/org/notes/neuer_test.org" "e136ede2-6fe1-48d9-9b43-dcbdb6e1c925")) +(("~/org/20260410092813-bjorn_bauml.org" "6fe5a97d-02ba-40f7-ab20-068e893d99bf") ("~/org/notes/neuer_neuer_test.org" "c1f0c054-6a3b-48e9-8f63-61c1061fa080") ("~/org/notes/neuer_test.org" "e136ede2-6fe1-48d9-9b43-dcbdb6e1c925") ("~/org/daily/2026-04-09.org" "e093392c-28f3-4f90-bb36-59efb35ec079")) diff --git a/bookmarks b/bookmarks index 6a5b2e6..757259c 100644 --- a/bookmarks +++ b/bookmarks @@ -3,9 +3,9 @@ ;;; nevertheless, you probably don't want to edit it. ;;; -*- End Of Bookmark File Format Version Stamp -*- (("org-capture-last-stored" - (filename . "~/org/docs/test.org") - (front-context-string . ":PROPERTIES:\n:ID") - (rear-context-string) - (position . 1) - (last-modified 27094 28081 955795 991000)) + (filename . "~/org/20260410092813-bjorn_bauml.org") + (front-context-string) + (rear-context-string . "le: Björn Bäuml\n") + (position . 89) + (last-modified 27096 42652 302432 121000)) ) diff --git a/cheatsheet.org b/cheatsheet.org index 15425c4..ee591cd 100644 --- a/cheatsheet.org +++ b/cheatsheet.org @@ -17,6 +17,7 @@ | horizontal splitten | C-x 2 | | vertikal splitte | C-x 3 | | Fenster wechseln | C-x o | +| Fenster schließen | C-x 0 | ** Buffer Shortcuts @@ -73,3 +74,44 @@ | redo | C-g C-/ | | Zeile nach oben verschieben | M-↑ | | Zeile nach unten verschieben | M-↓ | +| Block aus-/einkommentieren | C-c # | + + +** Suchen (consult-ripgrep) + +| Funktion | Shortcut | +|--------------------------+----------| +| Über Dateiinhalte suchen | C-c s | +| In einer Datei suchen | C-c f | + + +** Dateien suchen (org-roam-nodes) + +| Funktion | Shortcut | +|--------------+----------| +| Nodes suchen | C-c r f | + + +** Links in org-roam + +| Funktion | Shortcut | +|----------------------------------+----------| +| Neuen Link erstellen bzw. suchen | C-c r i | +| Link folgen | C-c C-o | + + +Links werden i.d.R. in einem Split-Fenster geöffnet! + + +* Latex + +** Setupfile-Vorlage +#+SETUPFILE: /home/knedlik/.emacs.d/templates/org/latex-template.org + +Einfach oben über der Überschrift einfügen! Dann wird die Latex-Vorlage für der Erstellung von PDF-Files gezogen. + + +** Seitenumbruch +#+LATEX: \newpage + +An der Stelle im Dokument einfügen, an der man umbrechen möchte. diff --git a/init.el b/init.el index 6cfe932..dae03ae 100644 --- a/init.el +++ b/init.el @@ -13,8 +13,8 @@ (require 'init-markdown) (require 'init-search) (require 'init-capture) -(require 'init-org-r) - +(require 'init-org-roam) +(require 'init-system) ;; ;;; Package-System (optional, aber sinnvoll) diff --git a/lisp/init-keybindings.el b/lisp/init-keybindings.el index b770394..47e5f9c 100644 --- a/lisp/init-keybindings.el +++ b/lisp/init-keybindings.el @@ -19,6 +19,19 @@ (find-file "~/.emacs.d/cheatsheet.org")) (global-set-key (kbd "C-c c") #'my/open-cheatsheet) +;; consult-ripgrep direkt an Ordner Org binden +(defun my/search-org () + (interactive) + (consult-ripgrep (expand-file-name "~/org/"))) + +(global-set-key (kbd "C-c s") #'my/search-org) +;;(global-set-key (kbd "C-c s") #'consult-ripgrep) +(global-set-key (kbd "C-c f") #'consult-line) +(global-set-key (kbd "C-c b") #'consult-buffer) +(global-set-key (kbd "C-c g") #'consult-git-grep) + +(global-set-key (kbd "C-c #") #'comment-dwim) + (provide 'init-keybindings) ;;; init-keybindings.el ends here diff --git a/lisp/init-org-r.el b/lisp/init-org-r.el deleted file mode 100644 index 4c48478..0000000 --- a/lisp/init-org-r.el +++ /dev/null @@ -1,26 +0,0 @@ -;; -*- lexical-binding: t; -*- -(require 'org-roam) - -(setq org-roam-directory (file-truename "~/org")) -(setq org-roam-db-location - (expand-file-name "org-roam.db" user-emacs-directory)) - -(org-roam-db-autosync-mode) - -(setq org-roam-capture-templates - '(("d" "default" plain - "%?" - :if-new (file+head - "docs/${slug}.org" - "#+title: ${title}\n#+category: Docs\n") - :unnarrowed t) - - ("n" "note" plain - "%?" - :if-new (file+head - "notes/${slug}.org" - "#+title: ${title}\n#+category: Notes\n") - :unnarrowed t))) - - -(provide 'init-org-r) diff --git a/lisp/init-org-roam.el b/lisp/init-org-roam.el new file mode 100644 index 0000000..813efdf --- /dev/null +++ b/lisp/init-org-roam.el @@ -0,0 +1,33 @@ +;; -*- lexical-binding: t; -*- +(require 'org-roam) + +(setq org-roam-directory (file-truename "~/org")) +(setq org-roam-dailies-directory "notes/") +(setq org-roam-db-location + (expand-file-name "org-roam.db" user-emacs-directory)) + +(org-roam-db-autosync-mode) + +;; (setq org-roam-capture-templates +;; '(("d" "default" plain +;; "%?" +;; :if-new (file+head +;; "docs/${slug}.org" +;; "#+title: ${title}\n#+category: Docs\n") +;; :unnarrowed t) + +;; ("n" "note" plain +;; "%?" +;; :if-new (file+head +;; "notes/${slug}.org" +;; "#+title: ${title}\n#+category: Notes\n") +;; :unnarrowed t))) + +(setq org-roam-dailies-capture-templates + '(("d" "default" entry + "* %<%H:%M> %?\n" + :target + (file+head "%<%Y-%m-%d>.org" + "#+title: %<%Y-%m-%d>\n\n")))) + +(provide 'init-org-roam) diff --git a/lisp/init-org.el b/lisp/init-org.el index 8c1693a..e8e318b 100644 --- a/lisp/init-org.el +++ b/lisp/init-org.el @@ -4,6 +4,18 @@ (add-hook 'org-mode-hook #'my/text-indentation-setup) (add-hook 'org-mode-hook #'org-indent-mode) +(add-hook 'org-mode-hook + (lambda () + (local-set-key (kbd "RET") #'org-return))) + +(setq org-agenda-files '("~/org")) +(setq org-complete-tags-always-offer-all-agenda-tags t) + +(defun my/org-export-to-tmp-pdf () + (interactive) + (let ((org-export-show-temporary-export-buffer nil)) + (org-latex-export-to-pdf nil nil nil t nil "/tmp/tmp.tex"))) + (provide 'init-org) diff --git a/lisp/init-search.el b/lisp/init-search.el index 288d297..3d32ce2 100644 --- a/lisp/init-search.el +++ b/lisp/init-search.el @@ -22,10 +22,10 @@ "rg --null --line-buffered --color=never --max-columns=300 --path-separator / --smart-case --no-heading --line-number .") ;; Nützliche Keybindings -(global-set-key (kbd "C-c s") #'consult-ripgrep) -(global-set-key (kbd "C-c f") #'consult-line) -(global-set-key (kbd "C-c b") #'consult-buffer) -(global-set-key (kbd "C-c g") #'consult-git-grep) +;; (global-set-key (kbd "C-c s") #'consult-ripgrep) +;; (global-set-key (kbd "C-c f") #'consult-line) +;; (global-set-key (kbd "C-c b") #'consult-buffer) +;; (global-set-key (kbd "C-c g") #'consult-git-grep) (provide 'init-search) ;;; init-search.el ends here diff --git a/lisp/init-system.el b/lisp/init-system.el new file mode 100644 index 0000000..04c0d41 --- /dev/null +++ b/lisp/init-system.el @@ -0,0 +1,9 @@ +;;; init-system.el --- System-/OS-spezifische Konfiguration -*- lexical-binding: t; -*- + +(require 'subr-x) + +(setq org-file-apps + '((auto-mode . emacs) + ("\\.pdf\\'" . "firefox \"%s\""))) + +(provide 'init-system) diff --git a/lisp/init-ui.el b/lisp/init-ui.el index efc375c..2982d45 100644 --- a/lisp/init-ui.el +++ b/lisp/init-ui.el @@ -98,3 +98,5 @@ (save-buffer))) (run-with-idle-timer 2 t #'my/auto-save-if-modified) + + diff --git a/templates/org/docs-template.org b/templates/org/docs-template.org index b697447..27efc8d 100644 --- a/templates/org/docs-template.org +++ b/templates/org/docs-template.org @@ -1,13 +1,16 @@ :PROPERTIES: :ID: %(my/org-new-id) -:ART: doc +:DATUM: %<%Y-%m-%d> +:ART: %^{Art|allgemein|report|analyse|software} :ZUORDNUNG: %^{Bereich||co|at|ku|sp|pw|ag|us|un} :PROJEKT: %^{Projekt|none} +:ANFORDERER: none :END: #+title: %(or my/org-capture-title"") -* %(or my/org-capture-title"") + + diff --git a/templates/org/latex-template.org b/templates/org/latex-template.org new file mode 100644 index 0000000..306bab2 --- /dev/null +++ b/templates/org/latex-template.org @@ -0,0 +1,47 @@ +#+LATEX_COMPILER: xelatex +#+OPTIONS: toc:nil num:nil title:nil author:nil date:nil + +#+LATEX_CLASS: article + +#+LATEX_HEADER: \usepackage[a4paper,margin=2cm]{geometry} +#+LATEX_HEADER: \usepackage{xcolor} +#+LATEX_HEADER: \usepackage{fontspec} +#+LATEX_HEADER: \setmainfont{DejaVu Serif} +#+LATEX_HEADER: \usepackage{datetime2} +#+LATEX_HEADER: \usepackage{fancyhdr} +#+LATEX_HEADER: \usepackage{lastpage} +#+LATEX_HEADER: \usepackage{titling} + +#+LATEX_HEADER: \newcommand{\shortdate}{\ifnum\day<10 0\fi\number\day.\ifnum\month<10 0\fi\number\month.\number\year} + +#+LATEX_HEADER: \pagestyle{fancy} +#+LATEX_HEADER: \fancyhf{} +#+LATEX_HEADER: \renewcommand{\headrulewidth}{0.4pt} +#+LATEX_HEADER: \renewcommand{\footrulewidth}{0.4pt} + +#+LATEX_HEADER: \makeatletter +#+LATEX_HEADER: \lhead{\@title} +#+LATEX_HEADER: \makeatother +#+LATEX_HEADER: \rhead{\nouppercase{\leftmark}} +#+LATEX_HEADER: \lfoot{\textbf{\textcolor{blue}{GMN}} \textit{Controlling}} +#+LATEX_HEADER: \cfoot{\thepage\ /\ \pageref{LastPage}} +#+LATEX_HEADER: \rfoot{\shortdate} + +#+LATEX_HEADER: \fancypagestyle{plain}{% +#+LATEX_HEADER: \fancyhf{} +#+LATEX_HEADER: \renewcommand{\headrulewidth}{0.4pt} +#+LATEX_HEADER: \renewcommand{\footrulewidth}{0.4pt} +#+LATEX_HEADER: \lhead{Kennzahlensystem} +#+LATEX_HEADER: \rhead{\nouppercase{\leftmark}} +#+LATEX_HEADER: \lfoot{\textbf{\textcolor{blue}{GMN}} \textit{Controlling}} +#+LATEX_HEADER: \cfoot{\thepage\ /\ \pageref{LastPage}} +#+LATEX_HEADER: \rfoot{\shortdate} +#+LATEX_HEADER: } + +#+LATEX_HEADER: \pretitle{\begin{center}\Large\bfseries} +#+LATEX_HEADER: \posttitle{\par\end{center}\vspace{1em}} + +#+LATEX_HEADER: \hypersetup{hidelinks} + + +#+EXPORT_FILE_NAME: /tmp/tmp diff --git a/templates/org/report-template.org b/templates/org/report-template.org new file mode 100644 index 0000000..3bd2481 --- /dev/null +++ b/templates/org/report-template.org @@ -0,0 +1,13 @@ +:PROPERTIES: +:ID: %(my/org-new-id) +:ART: Report +:ZUORDNUNG: %^{Bereich||co|at|ku|sp|pw|ag|us|un} +:PROJEKT: %^{Projekt|none} +:END: + +#+title: %(or my/org-capture-title"") + +* %(or my/org-capture-title"") + + + diff --git a/templates/org/report.org b/templates/org/report.org index c6660d0..66258e8 100644 --- a/templates/org/report.org +++ b/templates/org/report.org @@ -21,3 +21,4 @@ #+LATEX_HEADER: \lfoot{\textbf{\textcolor{blue}{GMN}} \textit{Controlling}} #+LATEX_HEADER: \cfoot{\thepage\ /\ \pageref{LastPage}} #+LATEX_HEADER: \rfoot{\shortdate} +#+EXPORT_FILE_NAME: /tmp/tmp