summary refs log tree commit diff
path: root/emacs.d/custom/fcuny-org.el
blob: d331a52903f312b5a2e1da1088186dd47d9b67cb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
(require 'fcuny-vars)

(use-package htmlize
  :ensure t)

(use-package org
  :ensure t
  :mode (("\\.txt\\'" . org-mode))
  :hook ((org-mode                     . org-indent-mode)
         (org-mode                     . org-hide-block-all)
         (org-mode                     . visual-line-mode)
         (org-capture-after-finalize   . org-save-all-org-buffers)
         (org-capture-prepare-finalize . org-save-all-org-buffers))
  :bind (("C-c c" . org-capture)
         ("C-c a" . org-agenda))

  :config
  (defvar load-language-list '((emacs-lisp . t)
                               (python . t)
                               (shell . t)))
  (use-package org-id :ensure t)
  (use-package ob-go
    :ensure t
    :init (cl-pushnew '(go . t) load-language-list))

  (org-babel-do-load-languages 'org-babel-load-languages
                               load-language-list)

  :custom
  (org-id-locations-file (concat fcuny/path-emacs-var "/org-id-locations"))

  (org-directory (expand-file-name "~/Documents/Notebooks"))
  (org-default-inbox-file (concat org-directory "/inbox.org"))
  (org-default-notes-file (concat org-directory "/notes.org"))
  (org-default-habit-file (concat org-directory "/habits.org"))
  (org-default-tasks-file (concat org-directory "/personal-tasks.org"))
  (org-default-work-tasks-file (concat org-directory "/work-tasks.org"))
  (org-default-journal-file (concat org-directory "/personal-journal.org"))
  (org-default-work-journal-file (concat org-directory "/work-journal.org"))
  (org-default-interview-file (concat org-directory "/interviews.org"))

  ;; when archiving, inherit the tags from the parent
  (org-archive-subtree-add-inherited-tags t)

  ;; display unicode characters
  (org-pretty-entities t)

  ;; log the time of completion
  (org-log-done 'time)

  ;; priorities
  (org-priority-start-cycle-with-default nil) ;; Start one over/under default value.
  (org-lowest-priority ?F)
  (org-default-priority ?D) ;; Ensures unset tasks have low priority.

  ;; agenda related
  (calendar-week-start-day 1)      ;; org-mode uses calendar for the date picker, and I want this to start on Monday
  (org-agenda-start-on-weekday 1)  ;; this is specific to org-agenda
  (org-agenda-files `(,org-default-tasks-file
                      ,org-default-work-tasks-file
                      ,org-default-habit-file))

  ;; org babel related
  ;; prevent the conversion of spaces into tabs (necessary for Python code exports)
  (org-src-fontify-natively t)
  (org-src-preserve-indentation t)
  (org-edit-src-content-indentation t)

  ;; I want to follow links on RET
  (org-return-follows-link t)

  ;; some configurations for exporting document
  (org-export-with-toc nil)
  (org-export-with-section-numbers nil)

  ;; A few abbreviations I use regularly
  (org-link-abbrev-alist
   '(("src"  . "~/workspace/%s")
     ("jira" . "https://jira.twitter.biz/browse/%s")
     ("ph"   . "https://phabricator.twitter.biz/%s")
     ("go"   . "http://go/%s")))

  ;; entries
  (org-blank-before-new-entry nil)
  (org-blank-before-new-entry (quote ((heading . nil)
				      (plain-list-item . nil))))

  ;; see https://github.com/abo-abo/swiper/issues/986
  (org-goto-interface 'outline-path-completion)

  (org-reverse-note-order t)

  (org-capture-templates
   `(("t" "Todo [inbox]" entry
      (file+headline ,org-default-inbox-file "Tasks")
      "* TODO [#D] %?\n:PROPERTIES:\n:ID: %(shell-command-to-string \"uuidgen\"):CREATED: %U\n:END:\n")

     ("n" "Note" entry
      (file ,org-default-notes-file)
      "* NOTE %?\n:PROPERTIES:\n:ID: %(shell-command-to-string \"uuidgen\"):CREATED: %U\n:END:\n")

     ("j" "Journal" entry
      (file+olp+datetree ,org-default-journal-file)
      "* %?\n:PROPERTIES:\n:ID: %(shell-command-to-string \"uuidgen\"):CREATED: %U\n:END:\n" :tree-type month)

     ("i" "Interview notes" entry
      (file+olp+datetree ,org-default-interview-file)
      (file ,(concat fcuny/path-emacs-etc "/interview.org")))

     ("J" "Work Journal" entry
      (file+olp+datetree ,org-default-work-journal-file)
      "* %?\n:PROPERTIES:\n:ID: %(shell-command-to-string \"uuidgen\"):CREATED: %U\n:END:\n" :tree-type month))))

(provide 'fcuny-org)