Update to org-mode settings

This commit is contained in:
William Moore 2024-12-18 09:30:28 -06:00
parent 7bb5af5c83
commit 96a67e3d8e

View File

@ -72,6 +72,25 @@
(shell . t)))
(add-hook 'org-mode-hook 'whomp/org-agenda-files-update)
(add-hook 'org-mode-hook 'visual-line-mode)
(defun generate-new-file-name () "Ask for a title and generate a file name based on it"
(let* ((file-name (read-string "Title: "))
(my-path (concat
"~/org/" ; Or whatever path you want
(format-time-string "%Y%m%d%H%M%S") "-"
(replace-regexp-in-string "[^a-zA-Z0-9-]+" "-" file-name) ".org"))) ; Replace invalid path characters
(setq mc/org-capture-filename file-name) ; Save variable to be used later in the template
my-path))
(setq org-capture-templates
'(
; ....
("n" "Note" entry (file (lambda () (generate-new-file-name)))
"* %(format mc/org-capture-filename) \n:PROPERTIES:\n:ID: %(org-id-new)\n:CREATED: %U\n:END:\n%?")
; ....
))
;; Org mode stuff
(whomp/add-key-binding "o l" 'org-store-link "Store a link to the current location in the kill ring.")
(whomp/add-key-binding "o C-l" 'org-toggle-link-display "Toggle the display of links.")