summaryrefslogtreecommitdiff
path: root/nemacs-package-org.el
blob: 5284334f904cd1c79dc6e6c078b496927c952d37 (plain)
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
(use-package org
  :init
  (custom-declare-face '+org-todo-active  '((t (:inherit (bold font-lock-constant-face org-todo)))) "")
  (custom-declare-face '+org-todo-project '((t (:inherit (bold font-lock-doc-face org-todo)))) "")
  (custom-declare-face '+org-todo-onhold  '((t (:inherit (bold warning org-todo)))) "")
  (custom-declare-face '+org-todo-cancel  '((t (:inherit (bold error org-todo)))) "")
  (unless (file-exists-p nm/user/org-directory)
    (make-directory nm/user/org-directory))
  (setq org-directory nm/user/org-directory
	org-agenda-files (list (concat nm/user/org-directory nm/user/org-todo-file-name))
	org-todo-keywords
	'((sequence "TODO(t)"
		    "STRT(s)"
		    "WAIT(w)"
		    "|"
		    "DONE(d)"
		    "KILL(k)")
	  (sequence "[ ](T)"
		    "[-](S)"
		    "[?](W)"
		    "|"
		    "[X](D)")
	  (sequence "|"
		    "OKAY(o)"
		    "YES(y)"
		    "NO(n)"))
	org-capture-templates
	'(("n" "Notes" entry (file+olp+datetree (concat nm/user/org-directory nm/user/org-notes-file-name) "Notes")
	   "* %?\nEntered on %U\n  %i\n  %a")
	  ("t" "Todo" entry (file+headline (concat nm/user/org-directory nm/user/org-todo-file-name) "Tasks")
	   "* TODO %?\n  %i\n  %a"))
	org-todo-keyword-faces
	'(("[-]" . +org-todo-active)
	  ("STRT" . +org-todo-active)
	  ("[?]" . +org-todo-onhold)
	  ("WAIT" . +org-todo-onhold)
	  ("HOLD" . +org-todo-onhold)
	  ("PROJ" . +org-todo-project)
	  ("NO" . +org-todo-cancel)
	  ("KILL" . +org-todo-cancel)))
  :config
  (global-set-key (kbd "C-c l") 'org-store-link)
  (global-set-key (kbd "C-c a") 'org-agenda)
  (global-set-key (kbd "C-c c") 'org-capture))

(defun nemacs/hide-org-mode-stars ()
  "Hides the section stars"
  (font-lock-add-keywords
   nil
   '(("^\\*+ "
      (0
       (prog1 nil
	 (put-text-property (match-beginning 0) (match-end 0)
			    'invisible t)))))))

(if nm/user/org-hideaway
    (add-hook 'org-mode-hook #'nemacs/hide-org-mode-stars))
(setq org-hide-emphasis-markers nm/user/org-hideaway)

(custom-set-faces
 '(org-level-1 ((t (:inherit outline-1 :extend nil :weight extra-bold :height 1.4))))
 '(org-level-2 ((t (:inherit outline-2 :extend nil :slant italic :weight bold :height 1.2))))
 '(org-level-3 ((t (:inherit outline-3 :extend nil :weight semi-bold)))))

(provide 'nemacs-package-org)