;;; 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))) ;; This package adds flashcard functionality to org files. (use-package org-fc :straight (org-fc :type git :host nil :repo "https://git.sr.ht/~l3kn/org-fc" :branch "main" :files (:defaults "awk" "demo.org")) :after org :ensure t :defer nil :custom (org-fc-directories '("~/data2/Notes/"))) ;;; 07-org.el ends here