+(use-package org
+ :ensure t
+ :bind
+ (("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<=\"<now>\"")))
+ ("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)
+ (add-hook 'org-mode-hook 'variable-pitch-mode)
+ ;; org-mode support for R and LaTeX
+ (org-babel-do-load-languages
+ 'org-babel-load-languages
+ '((R . t)
+ (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
+ (setq TeX-auto-save t
+ TeX-parse-self t
+ TeX-view-program-selection
+ '(((output-dvi has-no-display-manager)
+ "dvi2tty")
+ ((output-dvi style-pstricks)
+ "dvips and gv")
+ (output-dvi "xdvi")
+ (output-pdf "PDF Tools")
+ (output-html "xdg-open"))))
+;; (load "preview-latex.el" nil t t)