summaryrefslogtreecommitdiffstats
path: root/lisp/ravi-init-org.el
blob: d66a6cf72f47a8df58d03b324f6764fdd2e9e6da (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
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
;;; ravi-init-org.el --- org initialization

;; Copyright (C) 2014

;; Author:  <ravi@nero>
;; Keywords:

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <http://www.gnu.org/licenses/>.

;;; Commentary:

;; Org mode initialization

;;; Code:

(use-package org
  :ensure org-plus-contrib
  :mode ("\\.org\\'" . org-mode)

  ;; The following lines are always needed.  Choose your own keys.
  :bind  (("C-c l" . org-store-link)
          ("H-o" . org-capture)
          ("H--" . org-agenda))
  :config
  (progn
    (use-package htmlize :ensure t)
    (use-package ox-reveal
      :config
      (progn
        (setq org-reveal-slide-number nil)
        (setq org-reveal-theme "night")
        (setq org-reveal-transition "linear")
        (setq org-reveal-mathjax t)
        (setq org-reveal-mathjax-url "./MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML")))
    (use-package ox-rst)
    (use-package ox-impress-js)

    ;; Default file locations
    (setq org-directory "~/Documents/org")
    (defvar ravi/one-org-agenda-file (expand-file-name "agenda.files" org-directory))
    (setq org-agenda-files ravi/one-org-agenda-file)
    (unless (file-exists-p ravi/one-org-agenda-file)
      ;; http://stackoverflow.com/a/14072295/1219634
      ;; touch `ravi/one-org-agenda-file'
      (write-region "" :ignore ravi/one-org-agenda-file))
    (setq org-default-notes-file (expand-file-name "notes.org" org-directory))

    (setq org-src-fontify-natively t)
    (setq org-modules (quote (org-bbdb
                          org-bibtex
                          org-crypt
                          org-gnus
                          org-id
                          org-info)))
    (setq org-use-speed-commands t)

    ;; don't prompt me to confirm everytime I want to evaluate a block
    (setq org-confirm-babel-evaluate nil)

    ;; display/update images in the buffer after I evaluate
    (add-hook 'org-babel-after-execute-hook 'org-display-inline-images 'append)

    (org-babel-do-load-languages 'org-babel-load-languages
                                 '((ipython . t)
                                   (emacs-lisp . t)))
    (use-package ob-ipython
      :init
      (progn
         )
      :config
      (progn
        (add-to-list 'org-latex-minted-langs '(ipython "python"))))
    )
  )

(use-package org-capture
  :defer t
  :ensure nil
  :config
  (when (fboundp 'ravi/setup-org-capture)
    (ravi/setup-org-capture)))

(provide 'ravi-init-org)
;;; ravi-init-org.el ends here