2022-11-16 21:10:34 +00:00
|
|
|
;;; lisp/org-mode.el --- org-mode improvements for Emacs -*- lexical-binding: t; -*-
|
|
|
|
;;; Commentary:
|
|
|
|
;;
|
|
|
|
;; A lot of people out there will agree wholeheartedly that org mode is great.
|
|
|
|
;; Tons of fine-grained control, simplicity, and extensibilty - all built-in by
|
|
|
|
;; default into a single tool that works beautifully with Emacs.
|
|
|
|
;;
|
|
|
|
;;; Code:
|
2022-11-12 17:53:29 +00:00
|
|
|
|
2022-11-12 20:44:43 +00:00
|
|
|
;; org-mode ;; org-superstar
|
2022-11-08 17:53:07 +00:00
|
|
|
(use-package org-superstar
|
2022-11-20 18:10:03 +00:00
|
|
|
:after org
|
2022-11-20 08:03:40 +00:00
|
|
|
:custom
|
2022-11-09 19:02:35 +00:00
|
|
|
;; Change org-mode's heading bullets
|
2022-11-20 08:03:40 +00:00
|
|
|
(org-superstar-headline-bullets-list
|
|
|
|
'("🞉" "🞈" "🞇" "🞆" "🞅" "🞄"))
|
|
|
|
:hook org-mode)
|
2022-11-08 17:53:07 +00:00
|
|
|
|
2022-11-20 08:03:40 +00:00
|
|
|
(with-eval-after-load 'org-superstar
|
|
|
|
;; Faces for the font sizes of org-mode headings
|
|
|
|
(set-face-attribute 'org-level-8 nil :weight 'bold :inherit 'default)
|
|
|
|
(set-face-attribute 'org-level-7 nil :inherit 'org-level-8)
|
|
|
|
(set-face-attribute 'org-level-6 nil :inherit 'org-level-8)
|
|
|
|
(set-face-attribute 'org-level-5 nil :inherit 'org-level-8)
|
|
|
|
(set-face-attribute 'org-level-4 nil :inherit 'org-level-8)
|
|
|
|
(set-face-attribute 'org-level-3 nil :inherit 'org-level-8 :height 1.15)
|
|
|
|
(set-face-attribute 'org-level-2 nil :inherit 'org-level-8 :height 1.35)
|
|
|
|
(set-face-attribute 'org-level-1 nil :inherit 'org-level-8 :height 1.65)
|
|
|
|
(set-face-attribute 'org-document-title nil
|
2022-11-08 17:53:06 +00:00
|
|
|
:height 1.85
|
|
|
|
:foreground 'unspecified
|
2022-11-20 08:03:40 +00:00
|
|
|
:inherit 'org-level-8))
|
2022-11-08 17:53:06 +00:00
|
|
|
|
2022-11-20 08:03:40 +00:00
|
|
|
(with-eval-after-load 'org
|
2022-11-20 18:10:03 +00:00
|
|
|
;; Customize org-mode's default functionality
|
|
|
|
(setq org-ellipsis "..."
|
|
|
|
org-use-property-inheritance t
|
|
|
|
org-list-allow-alphabetical t
|
|
|
|
org-catch-invisible-edits 'smart
|
|
|
|
org-startup-indented t
|
|
|
|
org-hide-emphasis-markers t
|
|
|
|
org-startup-with-inline-images t
|
|
|
|
org-image-actual-width '(300)
|
|
|
|
org-pretty-entities t
|
|
|
|
org-adapt-indentation t)
|
|
|
|
|
2022-11-20 08:03:40 +00:00
|
|
|
(plist-put org-format-latex-options :scale 2.5) ; Scale up latex elements
|
|
|
|
(setq org-directory "~/Org/") ; Set the folder used by org-mode
|
|
|
|
(setq org-agenda-files (quote ("~/Org/")))
|
|
|
|
(setq org-roam-directory "~/Org/Roam/")) ; Set the folder used by org-roam
|
2022-11-12 20:44:43 +00:00
|
|
|
;; org-roam - A plain-text personal knowledge management system
|
2022-11-08 22:05:28 +00:00
|
|
|
(use-package org-roam
|
|
|
|
:init
|
2022-11-20 08:03:40 +00:00
|
|
|
(org-roam-db-autosync-mode 1)
|
|
|
|
(setq org-roam-capture-templates
|
2022-11-08 22:05:28 +00:00
|
|
|
'(("d" "default" plain
|
|
|
|
"\n%?"
|
|
|
|
:if-new (file+head "${slug}.org" "#+title: ${title}\n#+date: %U\n#+author: %n\n")
|
2022-11-20 08:03:40 +00:00
|
|
|
:unnarrowed t)))) ; Automatically sync nodes
|
2022-11-08 22:05:28 +00:00
|
|
|
|
2022-11-12 20:44:43 +00:00
|
|
|
;; Keybinds for org-mode
|
2022-11-11 19:28:03 +00:00
|
|
|
;; evil-org - Some nice keybinds for org-mode and org-agenda
|
|
|
|
(use-package evil-org
|
|
|
|
:after org
|
|
|
|
:config
|
2022-11-11 20:16:11 +00:00
|
|
|
(add-hook 'org-mode-hook 'evil-org-mode)
|
|
|
|
(add-hook 'org-agenda-mode-hook 'evil-org-mode)
|
2022-11-11 19:28:03 +00:00
|
|
|
(require 'evil-org-agenda)
|
|
|
|
(evil-org-agenda-set-keys))
|
|
|
|
|
2022-11-20 08:03:40 +00:00
|
|
|
(with-eval-after-load 'general
|
|
|
|
(general-create-definer diancite/org :prefix leader-key)
|
|
|
|
(diancite/org
|
|
|
|
:keymaps 'normal
|
2022-12-20 21:10:08 +00:00
|
|
|
"n f" '(org-roam-node-find :wk "Find Nodes")
|
2022-11-20 08:03:40 +00:00
|
|
|
"n s" '(org-roam-db-sync :wk "Sync Nodes")
|
|
|
|
"n c" '(org-todo :wk "Cycle Todo")
|
|
|
|
"n l" '(org-latex-preview :wk "Preview Latex")
|
|
|
|
"n a" '(org-agenda :wk "Agenda")
|
2022-12-20 21:10:08 +00:00
|
|
|
"n i" '(org-insert-link :wk "Insert Link")
|
|
|
|
"n t" '(:wk "Tables")
|
|
|
|
"n t a" '(org-table-align :wk "Align Table")
|
2022-12-21 11:26:36 +00:00
|
|
|
"n t c" '(org-table-create :wk "Create Table")))
|
2022-11-16 21:10:34 +00:00
|
|
|
|
|
|
|
;;; org-mode.el ends here
|