;;; init-notes.el --- for notes and tasks -*- lexical-binding: t -*- ;; Author: Franck Cuny ;;; Commentary: ;; commentary ;;; Code: (use-package org :hook (org-mode . turn-on-flyspell) (org-mode . visual-line-mode) (org-mode . org-indent-mode) :config (font-lock-add-keywords 'org-mode '(("^ *\\(-\\) " (0 (ignore (compose-region (match-beginning 1) (match-end 1) "•")))))) :custom (org-directory "~/Documents/org") (org-default-notes-file (expand-file-name "notes.org" org-directory)) (org-agenda-files '("inbox.org" "notes.org" "contacts.org" "hardware.org")) (org-startup-folded t) (org-startup-indented t) (org-startup-with-inline-images t) ;; enable todo and checkbox dependencies (org-enforce-todo-dependencies t) (org-enforce-todo-checkbox-dependencies t) ;; quick access for todo states (org-todo-keywords '((sequence "TODO(t)" "NEXT(n)" "WAITING(w!)" "SOMEDAY(S!)" "|" "DONE(d)") (sequence "|" "CANCELLED(c)"))) (org-log-done 'time) (org-log-into-drawer t) ;; org-refile options ;;; the tag 'rt' means 'refile target'. I don't want this tag to be inherited, I set it explicitly. (org-tags-exclude-from-inheritance '(rt)) (org-refile-targets '((org-agenda-files :tag . "rt"))) (org-refile-allow-creating-parent-nodes (quote confirm)) (org-hide-emphasis-markers t) (org-hide-leading-stars t) (org-pretty-entities t) (org-return-follows-link t) (org-export-backends '(html md)) (org-imenu-depth 4) (org-insert-heading-respect-content t) (org-outline-path-complete-in-steps nil) (org-src-fontify-natively t) (org-src-preserve-indentation t) (org-src-tab-acts-natively t) (org-src-window-setup 'current-window) (org-yank-adjusted-subtrees t) (org-structure-template-alist '(("s" . "src") ("E" . "src emacs-lisp") ("p" . "src python") ("e" . "example") ("q" . "quote")))) (use-package org-capture :ensure nil :after org :bind ("C-c c" . org-capture) :config (setq org-capture-templates `(("n" "Note" entry (file "notes.org") "* %?\n:PROPERTIES:\n:CREATED: %T\n:END:\n" :prepend t :empty-lines 1) ("j" "Journal" entry (file+olp+datetree "notes.org" "journal") "* %U %?\n:PROPERTIES:\n:CREATED: %T\n:END:\n" :prepend t :empty-lines 1 :tree-type month) ("t" "Tasks" entry (file "inbox.org") "* TODO %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n" :prepend t :empty-lines 1)))) (use-package org-agenda :ensure nil :after org :bind ("C-c a" . org-agenda) :custom (org-agenda-start-on-weekday 1)) (use-package org-auto-tangle :ensure t :hook (org-mode . org-auto-tangle-mode)) (use-package org-babel :no-require t :after (org) :config (org-babel-do-load-languages 'org-babel-load-languages '((python . t) (emacs-lisp . t) (calc . t) (shell . t) (sql . t) (dot . t))) (remove-hook 'kill-emacs-hook 'org-babel-remove-temporary-directory) (advice-add 'org-babel-edit-prep:emacs-lisp :after #'(lambda (_info) (run-hooks 'emacs-lisp-mode-hook)))) (provide 'init-notes) ;;; init-notes.el ends here