org-config.el Wed, Jul 16, 2025

;;; org-config.el --- Org mode configuration -*- lexical-binding: t -*-

;;; Commentary:
;; Configuration for Org mode and related features

;;; Code:

(use-package org
  :commands (org-agenda org-switchb org-capture)
  :bind (("C-c a" . org-agenda)
         ("C-c b" . org-switchb)
         ("M-c" . org-capture)
         ("M-t". org-set-tags-command))
  :mode ("\\.org\\'" . org-mode)
  :custom
  (org-stuck-projects
   '("+LEVEL=2/-DONE"
     ("TODO" "WAITING" "DONE")
     ("FLAGGED")
     ""))
  (org-adapt-indentation nil)
  (org-fontify-whole-heading-line t)
  (org-log-done 'time)
  (org-log-into-drawer t)
  (org-agenda-files '("~/Sync/org/gtd.org"
                      "~/Sync/org/blog.org"
                      "~/Sync/org/docs.org"
                      "~/Sync/org/guitar.org"))
  (org-return-follows-link t)
  (org-refile-use-outline-path 'file)
  (org-outline-path-complete-in-steps nil)
  (org-agenda-include-diary t)
  :config
  (setq org-refile-targets
        '((org-agenda-files . (:maxlevel . 4))))
  
  (defun dws/org-mode-hook ()
    "Setup for org mode."
    (visual-line-mode 1)
    (flyspell-mode 1)
    (auto-fill-mode 1))
  (add-hook 'org-mode-hook 'dws/org-mode-hook)
  
  (setq org-capture-templates
        '(("j" "Journal" entry
           (file+olp+datetree "~/Sync/org/journal.org" "Journal")
           "***** %^{Description}\n%?\n")
          ("n" "Notes - in journal" entry
           (file+olp+datetree "~/Sync/org/journal.org" "Notes")
           "***** %^{Description}\n%?\n")
          ("g" "gtd" entry
           (file+olp "~/Sync/org/gtd.org" "Inbox")
           "** %^{Description}\n%?\n\n")
          ("b" "Blog" entry
           (file+olp "~/Sync/org/blog.org" "Ideas")
           "** %?\n*** concept\n***draft\n\n"))))

(provide 'org-config)
;;; org-config.el ends here