summaryrefslogtreecommitdiff
path: root/mms-ox.org
blob: bb8783ed2f0f68709ec21d953fd8cefee8685abb (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
#+TITLE: mms Emacs Config - OX
#+AUTHOR: MichaƂ Sapka (https://michal.sapka.me)
#+STARTUP: showall indent logdoneGeneral settings

#+HUGO_BASE_DIR: ~/ghq/vcs.sapka.me/michal-sapka-me/
#+HUGO_WEIGHT: 400 
#+HUGO_SECTION: emacs/config
#+HUGO_CATEGORIES: emacs emacs-config
#+HUGO_MENU :menu "emacs-config" :name "Org mode"
#+HUGO_CUSTOM_FRONT_MATTER: :abstract "My emacs config - Org mode"
#+HUGO_CUSTOM_FRONT_MATTER: :menu-abstract "Basic org mode and babel config"
#+EXPORT_FILE_NAME: org

* Todo

I want to set done date autoatically

#+begin_src
(setq org-log-done 'time)
#+end_src


* Babel

Babel allows for evaluation of code blocks inside Org files.
I want to use all available languages.

#+begin_src emacs-lisp
  (org-babel-do-load-languages 'org-babel-load-languages
                               '((shell      . t)
                                 (js         . t)
                                 (emacs-lisp . t)
                                 (clojure    . t)
                                 (python     . t)
                                 (ruby       . t)
                                 (dot        . t)
                                 (css        . t)
                                 (sql      . t)
                                 (plantuml   . t)))
#+end_src

Don't ask for confirmation when evaluating, don't be annoying.

#+begin_src emacs-lisp
  (setq org-confirm-babel-evaluate nil)
  (setq org-babel-default-header-args '((:eval . "never-export")
                                        (:exports . "both")
                                        (:cache . "no")
                                        (:results . "replace")))
#+end_src

Org-tempo allows for =<s<TAB>= quick expansion into a full-blown code block.
Pretty neat.

#+begin_src emacs-lisp
  (require 'org-tempo)
  (setq org-structure-template-alist
        '(("a" . "export ascii\n")
          ("c" . "center\n")
          ("C" . "comment\n")
          ("e" . "example\n")
          ("E" . "export")
          ("h" . "export html\n")
          ("l" . "export latex\n")
          ("q" . "quote\n")
          ("s" . "src")
          ("v" . "verse\n")))
#+end_src

* Github export

Why do markdown when you don't need to?

#+begin_src emacs-lisp
  (use-package ox-gfm)
#+end_src