lang/org: general refactor
This commit is contained in:
parent
1946c3d8a2
commit
2c20e9d41c
1 changed files with 27 additions and 15 deletions
|
@ -44,7 +44,7 @@
|
||||||
|
|
||||||
(defun +org|hook ()
|
(defun +org|hook ()
|
||||||
"Run everytime `org-mode' is enabled."
|
"Run everytime `org-mode' is enabled."
|
||||||
(when (featurep! :feature evil)
|
(when (and (featurep 'evil) evil-mode)
|
||||||
(evil-org-mode +1))
|
(evil-org-mode +1))
|
||||||
(visual-line-mode +1)
|
(visual-line-mode +1)
|
||||||
(setq line-spacing 1)
|
(setq line-spacing 1)
|
||||||
|
@ -62,14 +62,14 @@
|
||||||
(outline-previous-visible-heading 1)
|
(outline-previous-visible-heading 1)
|
||||||
(org-show-subtree)))))
|
(org-show-subtree)))))
|
||||||
|
|
||||||
;; auto-align tables
|
|
||||||
(defun +org|realign-table-maybe ()
|
(defun +org|realign-table-maybe ()
|
||||||
|
"Auto-align table under cursor."
|
||||||
(when (org-at-table-p)
|
(when (org-at-table-p)
|
||||||
(org-table-align)))
|
(org-table-align)))
|
||||||
(add-hook 'evil-insert-state-exit-hook #'+org|realign-table-maybe nil t)
|
(add-hook 'evil-insert-state-exit-hook #'+org|realign-table-maybe nil t)
|
||||||
|
|
||||||
(defun +org|update-cookies ()
|
(defun +org|update-cookies ()
|
||||||
"Update counts on headlines (\"cookies\")."
|
"Update counts in headlines (aka \"cookies\")."
|
||||||
(when (and buffer-file-name (file-exists-p buffer-file-name))
|
(when (and buffer-file-name (file-exists-p buffer-file-name))
|
||||||
(org-update-statistics-cookies t)))
|
(org-update-statistics-cookies t)))
|
||||||
|
|
||||||
|
@ -87,12 +87,14 @@
|
||||||
:group 'evil-org)
|
:group 'evil-org)
|
||||||
|
|
||||||
(define-minor-mode +org-pretty-mode
|
(define-minor-mode +org-pretty-mode
|
||||||
""
|
"TODO"
|
||||||
:init-value nil
|
:init-value nil
|
||||||
:lighter " *"
|
:lighter " *"
|
||||||
:group 'evil-org
|
:group 'evil-org
|
||||||
(setq org-hide-emphasis-markers +org-pretty-mode)
|
(setq org-hide-emphasis-markers +org-pretty-mode)
|
||||||
(org-toggle-pretty-entities))
|
(org-toggle-pretty-entities)
|
||||||
|
;; In case the above un-align tables
|
||||||
|
(org-table-map-tables 'org-table-align t))
|
||||||
|
|
||||||
(setq-default
|
(setq-default
|
||||||
org-export-coding-system 'utf-8
|
org-export-coding-system 'utf-8
|
||||||
|
@ -130,6 +132,7 @@
|
||||||
;; Behavior
|
;; Behavior
|
||||||
org-catch-invisible-edits 'show
|
org-catch-invisible-edits 'show
|
||||||
org-checkbox-hierarchical-statistics nil
|
org-checkbox-hierarchical-statistics nil
|
||||||
|
org-enforce-todo-checkbox-dependencies t
|
||||||
org-completion-use-ido nil ; Use ivy/counsel for refiling
|
org-completion-use-ido nil ; Use ivy/counsel for refiling
|
||||||
org-confirm-elisp-link-function nil
|
org-confirm-elisp-link-function nil
|
||||||
org-default-priority ?C
|
org-default-priority ?C
|
||||||
|
@ -147,14 +150,6 @@
|
||||||
|
|
||||||
|
|
||||||
;; Latex
|
;; Latex
|
||||||
org-format-latex-options
|
|
||||||
(plist-put org-format-latex-options :scale 1.5)
|
|
||||||
org-format-latex-options
|
|
||||||
(plist-put org-format-latex-options
|
|
||||||
:background (face-attribute (or (cadr (assq 'default face-remapping-alist))
|
|
||||||
'default)
|
|
||||||
:background nil t))
|
|
||||||
|
|
||||||
org-highlight-latex-and-related '(latex)
|
org-highlight-latex-and-related '(latex)
|
||||||
org-latex-create-formula-image-program 'dvipng
|
org-latex-create-formula-image-program 'dvipng
|
||||||
org-latex-image-default-width ".9\\linewidth"
|
org-latex-image-default-width ".9\\linewidth"
|
||||||
|
@ -166,6 +161,18 @@
|
||||||
;; ("" "physics" t) TODO Install this)
|
;; ("" "physics" t) TODO Install this)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
;; LaTeX previews are too small and usually render to light backgrounds, so
|
||||||
|
;; this enlargens them and ensures their background (and foreground) match the
|
||||||
|
;; current theme.
|
||||||
|
(setq-default
|
||||||
|
org-format-latex-options
|
||||||
|
(plist-put org-format-latex-options :scale 1.5)
|
||||||
|
org-format-latex-options
|
||||||
|
(plist-put org-format-latex-options
|
||||||
|
:background (face-attribute (or (cadr (assq 'default face-remapping-alist))
|
||||||
|
'default)
|
||||||
|
:background nil t)))
|
||||||
|
|
||||||
(let ((ext-regexp (regexp-opt '("GIF" "JPG" "JPEG" "SVG" "TIF" "TIFF" "BMP" "XPM"
|
(let ((ext-regexp (regexp-opt '("GIF" "JPG" "JPEG" "SVG" "TIF" "TIFF" "BMP" "XPM"
|
||||||
"gif" "jpg" "jpeg" "svg" "tif" "tiff" "bmp" "xpm"))))
|
"gif" "jpg" "jpeg" "svg" "tif" "tiff" "bmp" "xpm"))))
|
||||||
(setq iimage-mode-image-regex-alist
|
(setq iimage-mode-image-regex-alist
|
||||||
|
@ -211,8 +218,13 @@
|
||||||
(sp-local-pair "$$" "$$" :post-handlers '((:add " | ")) :unless '(sp-point-at-bol-p))
|
(sp-local-pair "$$" "$$" :post-handlers '((:add " | ")) :unless '(sp-point-at-bol-p))
|
||||||
(sp-local-pair "{" nil))
|
(sp-local-pair "{" nil))
|
||||||
|
|
||||||
;; bullets
|
;; The standard unicode characters are usually misaligned depending on the
|
||||||
(def-package! org-bullets :commands org-bullets-mode)
|
;; font. This bugs me. Personally, the markdown #-marks for headlines are more
|
||||||
|
;; elegant, so use those.
|
||||||
|
(def-package! org-bullets
|
||||||
|
:commands org-bullets-mode
|
||||||
|
:init (add-hook 'org-mode-hook 'org-bullets-mode)
|
||||||
|
:config (setq org-bullets-bullet-list '("#")))
|
||||||
|
|
||||||
;; Keybinds
|
;; Keybinds
|
||||||
(map! (:map org-mode-map
|
(map! (:map org-mode-map
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue