refactor(doom): move org config into separate file

This commit is contained in:
Infinidoge 2022-05-02 00:06:14 -04:00
parent 7beb908123
commit 61fd1b2b12
2 changed files with 56 additions and 54 deletions

View file

@ -17,60 +17,6 @@
doom-modeline-enable-word-count t
)
;; --- Org Mode
(setq
;; Directories
org-directory "~/Documents/Org"
org-agenda-files '("~/Documents/" "~/Documents/Notes" "~/Documents/Org/" "~/Documents/Org/agenda" "~/Projects/" "~/Documents/School")
;; General settings
org-use-speed-commands t
org-list-demote-modify-bullet '(("-" . "+") ("+" . "-") ("1." . "a."))
;; org-list-demote-modify-bullet '(("-" . "-") ("1." . "a."))
org-startup-shrink-all-tables t
org-startup-align-all-tables t
org-src-fontify-natively t
org-display-custom-times nil
org-time-stamp-custom-formats '("<%d %b %Y>" . "<%y/%m/%d %a %H:%M:%S>")
;; Export
org-latex-tables-centered nil
org-latex-listings 'minted
org-latex-packages-alist '(("" "minted" "listingsutf8"))
org-latex-pdf-process
'("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
"biber %b"
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f")
)
;; Run formatters in org src blocks on save
(defun infinidoge/format-org-src-blocks ()
(org-babel-map-src-blocks nil
(if (equal (alist-get :format (org-babel-parse-header-arguments header-args) "yes")
"yes")
(+format--org-region nil nil))))
(add-hook 'before-save-hook 'infinidoge/format-org-src-blocks)
;; Automatically tangle src blocks on save
(defun infinidoge/tangle-on-save ()
(when (eq major-mode 'org-mode)
(org-babel-tangle)))
(add-hook 'after-save-hook 'infinidoge/tangle-on-save)
;; Setup ox-extras to allow ignoring headlines while keeping content
(use-package! ox-extra
:config
(ox-extras-activate '(ignore-headlines)))
;; Load babel languages
(org-babel-do-load-languages
'org-babel-load-languages
'((R . t)
(latex . t)))
;; --- Projectile ----
(setq
projectile-indexing-method 'hybrid
@ -233,3 +179,6 @@
;;
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
;; they are implemented.
;; Other configuration files
(load! "config/org")

View file

@ -0,0 +1,53 @@
;; --- Org Mode
(setq
;; Directories
org-directory "~/Documents/Org"
org-agenda-files '("~/Documents/" "~/Documents/Notes" "~/Documents/Org/" "~/Documents/Org/agenda" "~/Projects/" "~/Documents/School")
;; General settings
org-use-speed-commands t
org-list-demote-modify-bullet '(("-" . "+") ("+" . "-") ("1." . "a."))
;; org-list-demote-modify-bullet '(("-" . "-") ("1." . "a."))
org-startup-shrink-all-tables t
org-startup-align-all-tables t
org-src-fontify-natively t
org-display-custom-times nil
org-time-stamp-custom-formats '("<%d %b %Y>" . "<%y/%m/%d %a %H:%M:%S>")
;; Export
org-latex-tables-centered nil
org-latex-listings 'minted
org-latex-packages-alist '(("" "minted" "listingsutf8"))
org-latex-pdf-process
'("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
"biber %b"
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f")
)
;; Run formatters in org src blocks on save
(defun infinidoge/format-org-src-blocks ()
(org-babel-map-src-blocks nil
(if (equal (alist-get :format (org-babel-parse-header-arguments header-args) "yes")
"yes")
(+format--org-region nil nil))))
(add-hook 'before-save-hook 'infinidoge/format-org-src-blocks)
;; Automatically tangle src blocks on save
(defun infinidoge/tangle-on-save ()
(when (eq major-mode 'org-mode)
(org-babel-tangle)))
(add-hook 'after-save-hook 'infinidoge/tangle-on-save)
;; Setup ox-extras to allow ignoring headlines while keeping content
(use-package! ox-extra
:config
(ox-extras-activate '(ignore-headlines)))
;; Load babel languages
(org-babel-do-load-languages
'org-babel-load-languages
'((R . t)
(latex . t)))