Erweiterung Templates und Anpassung Init-Files

This commit is contained in:
knedlik
2026-04-10 23:27:32 +02:00
parent 7be93eb0f9
commit f8d711bb1e
15 changed files with 189 additions and 40 deletions

View File

@@ -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

View File

@@ -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)

33
lisp/init-org-roam.el Normal file
View File

@@ -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)

View File

@@ -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)

View File

@@ -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

9
lisp/init-system.el Normal file
View File

@@ -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)

View File

@@ -98,3 +98,5 @@
(save-buffer)))
(run-with-idle-timer 2 t #'my/auto-save-if-modified)