Files
emacs-dotfiles/.config.d/07-org.el

82 lines
2.4 KiB
EmacsLisp

;;; 07-org.el --- Setup org-mode. -*- no-byte-compile: t; lexical-binding: t; -*-
;;; Description:
;; This file contains the configuration for org mode and related packages.
;;; Code:
;; Org Mode the almighty
(use-package org
:ensure nil
:defer nil
:commands (org-mode)
:bind (:map org-mode-map
("C-c c" . org-fc-cloze-dwim)))
;; By default, LaTeX rendered in org is too small. This makes is 2 times bigger.
(setq org-format-latex-options (plist-put org-format-latex-options ':scale 2.0))
;; This is a package that helps use org to manage knowledge. As the name
;; suggests, it mimics the behavior of Roam Research.
(use-package org-roam
:ensure t
:defer t
:after org-roam
:commands (org-roam-node-insert
org-roam-node-find
org-roam-capture))
;; This package provides us with a *very* nice graph of our knowledge base in
;; our browser.
(use-package org-roam-ui
:ensure t
:defer t
:diminish (org-roam-ui-mode . "ORUI")
:diminish org-roam-ui-follow-mode
:commands (org-roam-ui-mode))
;; Auto Fill all org files.
(add-hook 'org-mode-hook 'auto-fill-mode)
;; Sometimes you gotta cite some sources, and that is where the bibliography
;; comes in.
(setq org-cite-global-bibliography
'("/home/dizzar/data2/Notes/references/bibliography.bib"))
;; This variable controls where org-roam will search for notes, and I store mine
;; here.
(setq org-roam-directory (file-truename "~/data2/Notes"))
;; This tells org-roam to sync notes with its index in the background.
(if (file-directory-p org-roam-directory)
(org-roam-db-autosync-mode)
(message "Org Roam directory (%s) does not exist. Autosync disabled." org-roam-directory))
(setq global-roam-map (make-sparse-keymap "Roam Keys"))
(global-set-key "\C-cr" global-roam-map)
(define-key global-roam-map "i" 'org-roam-node-insert)
(define-key global-roam-map "f" 'org-roam-node-find)
(define-key global-roam-map "c" 'org-roam-capture)
(setq global-org-map (make-sparse-keymap "Org Keys"))
(global-set-key "\C-co" global-org-map)
(define-key global-org-map "c" 'org-capture)
(define-key global-org-map "\C-c" 'org-capture)
(setq org-capture-templates
;; other capture templates
`(("s"
"Slipbox"
entry
(file
"~/data2/Notes/inbox.org")
"* %?\n")
("w"
"Sentence list"
plain
(file+headline
"~/data2/Notes/inbox.org" "Words")
#'tatoeba-get-capture-template)))
;;; 07-org.el ends here