summaryrefslogtreecommitdiff
path: root/modules/org-config.el
diff options
context:
space:
mode:
Diffstat (limited to 'modules/org-config.el')
-rw-r--r--modules/org-config.el204
1 files changed, 106 insertions, 98 deletions
diff --git a/modules/org-config.el b/modules/org-config.el
index 753b1092..75d4c7db 100644
--- a/modules/org-config.el
+++ b/modules/org-config.el
@@ -6,102 +6,6 @@
;;; Code:
-
-;; ---------------------------------- Org Mode ---------------------------------
-
-(use-package org
- :defer t
- :ensure nil ;; use the built-in package
- :pin manual ;; never upgrade from the version built-into Emacs
- :init
- (defvar-keymap cj/org-table-map
- :doc "org table operations.")
- (keymap-set cj/custom-keymap "T" cj/org-table-map)
- :bind
- ("C-c c" . org-capture)
- ("C-c a" . org-agenda)
- (:map org-mode-map
- ("C-c I" . org-table-field-info) ;; was C-c ?
- ("C-\\" . org-match-sparse-tree)
- ("C-c t" . org-set-tags-command)
- ("C-c l" . org-store-link)
- ("C-c C-l" . org-insert-link)
- ("s-<up>" . org-priority-up)
- ("s-<down>" . org-priority-down)
- ("C-c N" . org-narrow-to-subtree)
- ("C-c >" . cj/org-narrow-forward)
- ("C-c <" . cj/org-narrow-backwards)
- ("<f5>" . org-reveal)
- ("C-c <ESC>" . widen))
- (:map cj/org-table-map
- ("r i" . org-table-insert-row)
- ("r d" . org-table-kill-row)
- ("c i" . org-table-insert-column)
- ("c d" . org-table-delete-column))
-
- ;; backward and forward day are ',' and '.'
- ;; shift & meta moves by week or year
- ;; C-. jumps to today
- ;; original keybindings blocked by windmove keys
- ;; these are consistent with plain-old calendar mode
- (:map org-read-date-minibuffer-local-map
- ("," . (lambda () (interactive)
- (org-eval-in-calendar '(calendar-backward-day 1))))
- ("." . (lambda () (interactive)
- (org-eval-in-calendar '(calendar-forward-day 1))))
- ("<" . (lambda () (interactive)
- (org-eval-in-calendar '(calendar-backward-month 1))))
- (">" . (lambda () (interactive)
- (org-eval-in-calendar '(calendar-forward-month 1))))
- ("M-," . (lambda () (interactive)
- (org-eval-in-calendar '(calendar-backward-year 1))))
- ("M-." . (lambda () (interactive)
- (org-eval-in-calendar '(calendar-forward-year 1)))))
-
- :init
- ;; windmove's keybindings conflict with org-agenda-todo-nextset/previousset keybindings
- ;; solution: map the super key so that
- ;; - super up/down increases and decreases the priority
- ;; - super left/right changes the todo state
- (setq org-replace-disputed-keys t)
- (setq org-disputed-keys
- '(([(shift left)] . [(super left)])
- ([(shift right)] . [(super right)])
- ([(shift up)] . [(super up)])
- ([(shift down)] . [(super down)])
- ([(control shift right)] . [(meta shift +)])
- ([(control shift left)] . [(meta shift -)])))
-
- (defun cj/org-narrow-forward ()
- "Narrow to the next subtree at the same level."
- (interactive)
- (widen)
- (org-forward-heading-same-level 1)
- (org-narrow-to-subtree))
-
- (defun cj/org-narrow-backwards ()
- "Narrow to the previous subtree at the same level."
- (interactive)
- (widen)
- (org-backward-heading-same-level 1)
- (org-narrow-to-subtree))
-
- :hook
- (org-mode . turn-on-visual-line-mode)
- (org-mode . (lambda () (setq-local tab-width 8)))
-
- :config
- ;; Load org-protocol for org-protocol:// URL handling
- (require 'org-protocol nil t)
-
- ;; Set archive location (must be done after org loads)
- (setq org-archive-location
- (concat org-dir "/archives/archive.org::datetree/"))
-
- (cj/org-general-settings)
- (cj/org-appearance-settings)
- (cj/org-todo-settings))
-
;; ---------------------------- Org General Settings ---------------------------
(defun cj/org-general-settings ()
@@ -164,11 +68,11 @@
(set-face-attribute 'org-link nil :underline t)
(setq org-ellipsis " ▾") ;; change ellipses to down arrow
- (setq org-hide-emphasis-markers t) ;; remove emphasis markers to keep the screen clean
+ (setq org-hide-emphasis-markers t) ;; hide emphasis markers (org-appear shows them when editing)
(setq org-hide-leading-stars t) ;; hide leading stars, just show one per line
(setq org-pretty-entities t) ;; render special symbols
(setq org-pretty-entities-include-sub-superscripts nil) ;; ...except superscripts and subscripts
- (setq org-fontify-emphasized-text nil) ;; ...and don't render bold and italic markup
+ (setq org-fontify-emphasized-text t) ;; render bold and italic markup
(setq org-fontify-whole-heading-line t) ;; fontify the whole line for headings (for face-backgrounds)
(add-hook 'org-mode-hook 'prettify-symbols-mode))
@@ -213,6 +117,101 @@
;; inherit parents properties (sadly not schedules or deadlines)
(setq org-use-property-inheritance t))
+;; ---------------------------------- Org Mode ---------------------------------
+
+(use-package org
+ :defer t
+ :ensure nil ;; use the built-in package
+ :pin manual ;; never upgrade from the version built-into Emacs
+ :init
+ (defvar-keymap cj/org-table-map
+ :doc "org table operations.")
+ (keymap-set cj/custom-keymap "T" cj/org-table-map)
+ :bind
+ ("C-c c" . org-capture)
+ ("C-c a" . org-agenda)
+ (:map org-mode-map
+ ("C-c I" . org-table-field-info) ;; was C-c ?
+ ("C-\\" . org-match-sparse-tree)
+ ("C-c t" . org-set-tags-command)
+ ("C-c l" . org-store-link)
+ ("C-c C-l" . org-insert-link)
+ ("s-<up>" . org-priority-up)
+ ("s-<down>" . org-priority-down)
+ ("C-c N" . org-narrow-to-subtree)
+ ("C-c >" . cj/org-narrow-forward)
+ ("C-c <" . cj/org-narrow-backwards)
+ ("<f5>" . org-reveal)
+ ("C-c <ESC>" . widen))
+ (:map cj/org-table-map
+ ("r i" . org-table-insert-row)
+ ("r d" . org-table-kill-row)
+ ("c i" . org-table-insert-column)
+ ("c d" . org-table-delete-column))
+
+ ;; backward and forward day are ',' and '.'
+ ;; shift & meta moves by week or year
+ ;; C-. jumps to today
+ ;; original keybindings blocked by windmove keys
+ ;; these are consistent with plain-old calendar mode
+ (:map org-read-date-minibuffer-local-map
+ ("," . (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-backward-day 1))))
+ ("." . (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-forward-day 1))))
+ ("<" . (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-backward-month 1))))
+ (">" . (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-forward-month 1))))
+ ("M-," . (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-backward-year 1))))
+ ("M-." . (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-forward-year 1)))))
+
+ :init
+ ;; windmove's keybindings conflict with org-agenda-todo-nextset/previousset keybindings
+ ;; solution: map the super key so that
+ ;; - super up/down increases and decreases the priority
+ ;; - super left/right changes the todo state
+ (setq org-replace-disputed-keys t)
+ (setq org-disputed-keys
+ '(([(shift left)] . [(super left)])
+ ([(shift right)] . [(super right)])
+ ([(shift up)] . [(super up)])
+ ([(shift down)] . [(super down)])
+ ([(control shift right)] . [(meta shift +)])
+ ([(control shift left)] . [(meta shift -)])))
+
+ (defun cj/org-narrow-forward ()
+ "Narrow to the next subtree at the same level."
+ (interactive)
+ (widen)
+ (org-forward-heading-same-level 1)
+ (org-narrow-to-subtree))
+
+ (defun cj/org-narrow-backwards ()
+ "Narrow to the previous subtree at the same level."
+ (interactive)
+ (widen)
+ (org-backward-heading-same-level 1)
+ (org-narrow-to-subtree))
+
+ :hook
+ (org-mode . turn-on-visual-line-mode)
+ (org-mode . (lambda () (setq-local tab-width 8)))
+
+ :config
+ ;; Load org-protocol for org-protocol:// URL handling
+ (require 'org-protocol nil t)
+
+ ;; Set archive location (must be done after org loads)
+ (setq org-archive-location
+ (concat org-dir "/archives/archive.org::datetree/"))
+
+ (cj/org-general-settings)
+ (cj/org-appearance-settings)
+ (cj/org-todo-settings))
+
;; ------------------------------- Org Superstar -------------------------------
(use-package org-superstar
@@ -222,6 +221,15 @@
(org-superstar-configure-like-org-bullets)
(setq org-superstar-leading-bullet ?\s))
+;; -------------------------------- Org-Appear ---------------------------------
+
+(use-package org-appear
+ :hook (org-mode . org-appear-mode)
+ :custom
+ (org-appear-autoemphasis t) ;; Show * / _ when cursor is on them
+ (org-appear-autolinks t) ;; Also works for links
+ (org-appear-autosubmarkers t)) ;; And sub/superscripts
+
;; ------------------------------- Org-Checklist -------------------------------
;; needed for org-habits to reset checklists once task is complete