From: Frederik Vanrenterghem Date: Wed, 16 Oct 2024 12:34:09 +0000 (+0800) Subject: Further configure org-mode and Denote. X-Git-Url: http://git.vanrenterghem.biz/Dotty.git/commitdiff_plain/b5a4a9f6a8bd6f46c0a7b8511ef1d84882af5593 Further configure org-mode and Denote. --- diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index 886897c..34715c2 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -63,35 +63,53 @@ vc-follow-symlinks t ([tab] . company-complete-common) ("TAB" . company-complete-common)) :config + (setq ispell-complete-word-dict + (expand-file-name (concat user-emacs-directory "aspell_words.txt"))) + ;(defun my/text-mode-hook () + ; (setq-local company-backends +; '((company-dabbrev company-ispell :separate) + ; company-files))) + ; (add-hook 'text-mode-hook #'my/text-mode-hook) (global-company-mode 1)) (use-package org :ensure t - :after - denote :bind - (("C-c c" . org-capture) - ("C-c l" . org-store-link)) - :custom - (org-default-notes-file "~/Nextcloud/notes/inbox.org") - (org-agenda-files `(,org-default-notes-file)) - (org-capture-bookmark nil) - ;; Capture templates - (org-capture-templates - '(("f" "Fleeting note" item - (file+headline org-default-notes-file "Notes") - "- %?\nEntered on %U\n %i\n %a") - ("p" "Permanent note" plain - (file denote-last-path) - #'denote-org-capture - :no-save t - :immediate-finish nil - :kill-buffer t - :jump-to-captured t) - ("t" "New task" entry - (file+headline org-default-notes-file "Tasks") - "* TODO %i%?"))) + (("C-c c" . org-capture) + ("C-c l" . org-store-link) + ("C-c a" . org-agenda)) + :custom + (org-default-notes-file "~/Nextcloud/notes/inbox.org") + (org-agenda-files `(,org-default-notes-file "~/Nextcloud/notes/calendar.org")) + (org-capture-bookmark nil) + ;; Capture templates + (org-capture-templates + '(("f" "Fleeting note" item + (file+headline org-default-notes-file "Notes") + "* %?\nEntered on %U\n %i\n %a") + ("b" "Tax receipt" item + (file "~/Documents/belastingen/FY24-25.org") + "* %t %a\n") + ("p" "Permanent note" plain + (file denote-last-path) + #'denote-org-capture + :no-save t + :immediate-finish nil + :kill-buffer t + :jump-to-captured t) + ("t" "New task" entry + (file+headline org-default-notes-file "Tasks") + "* TODO %i%?") + ("e" "Email follow-up" entry (file+headline org-default-notes-file "Tasks") + "* TODO %:fromname: %a %?\nDEADLINE: %(org-insert-time-stamp (org-read-date nil t \"+2d\"))"))) + ;; Agenda views + (org-agenda-custom-commands + '(("P" "Expired calendar events" ((tags "TIMESTAMP<=\"\""))) + ("n" "Agenda and all TODOs" ((agenda "") (alltodo ""))))) :config + (setq org-agenda-skip-scheduled-if-done t) + (setq org-agenda-skip-deadline-if-done t) + (setq org-agenda-start-on-weekday nil) ;; Automatically flow lines based on window width and use ;; variable width fonts in org-mode. (add-hook 'org-mode-hook 'visual-line-mode) @@ -100,10 +118,20 @@ vc-follow-symlinks t (org-babel-do-load-languages 'org-babel-load-languages '((R . t) - (latex . t))) - ;; Security risk - This is somewhat ill-advised it appears - (setq org-confirm-babel-evaluate nil)) - + (latex . t)))) + +(use-package org-caldav + :ensure t + :config + (setq org-caldav-url "https://owncloud.vanrenterghem.biz/remote.php/dav/calendars/frederik") + (setq org-caldav-calendar-id "orgmode") + ;; Org filename where new entries from calendar stored + (setq org-caldav-inbox "~/Nextcloud/notes/calendar.org") + ;; Additional Org files to check for calendar events + (setq org-caldav-files nil) + ;; Usually a good idea to set the timezone manually + (setq org-icalendar-timezone "Australia/Perth")) + (use-package tex :ensure auctex :config @@ -290,8 +318,15 @@ vc-follow-symlinks t ;; Denote config (use-package denote :ensure t + :hook (dired-mode . denote-dired-mode) + :bind + (("C-c n n" . denote) + ("C-c n r" . denote-rename-file) + ("C-c n l" . denote-link) + ("C-c n b" . denote-backlinks)) :config - (setq denote-directory "/home/frederik/Nextcloud/notes/")) + (setq denote-directory "/home/frederik/Nextcloud/notes/") + (denote-rename-buffer-mode 1)) (use-package nerd-icons ;; :custom