improved org mode styling

This commit is contained in:
paul-loedige
2024-02-08 10:53:13 +01:00
parent 2a7b896fd5
commit abbd518f76
+53 -6
View File
@@ -4,11 +4,10 @@
#+property: header-args: mkdirp yes :comments no #+property: header-args: mkdirp yes :comments no
#+startup: fold #+startup: fold
:END: :END:
#+TITLE: PWL Doom Config
#+AUTHOR: PWL #+AUTHOR: PWL
#+EMAIL: paul@gve-loedige.de #+EMAIL: paul@gve-loedige.de
#+OPTIONS: toc:2 #+OPTIONS: toc:2
#+TITLE: PWL Doom Config
* Table of Contents :toc: * Table of Contents :toc:
- [[#config-file-headers][Config File Headers]] - [[#config-file-headers][Config File Headers]]
@@ -451,23 +450,61 @@ This function could also become useful if we ever want to extend the compile com
(setq org-directory "~/org/") (setq org-directory "~/org/")
#+end_src #+end_src
** Visual ** Visual
*** Enable Header Numbering *** Header Styling
**** Enable Header Numbering
#+begin_src emacs-lisp :tangle config.el #+begin_src emacs-lisp :tangle config.el
(after! org (after! org
(setq org-startup-numerated t)) (setq org-startup-numerated t))
#+end_src #+end_src
**** Header Font Size
#+begin_src emacs-lisp :tangle config.el
(after! org
(custom-set-faces
(set-face-attribute 'org-document-title nil :height 2.0)
'(org-level-1 ((t(:inherit outline-1 :height 1.5))))
'(org-level-2 ((t(:inherit outline-2 :height 1.3))))
'(org-level-3 ((t(:inherit outline-3 :height 1.2))))
'(org-level-4 ((t(:inherit outline-4 :height 1.1))))))
#+end_src
*** Misc Text Styling
**** Hide Emphasis Markers
*bold* /italic/ +strikethrough+ etc. should not have markers next to them
#+begin_src emacs-lisp :tangle config.el
(after! org
(setq org-hide-emphasis-markers t))
#+end_src
*** Image Display as Default *** Image Display as Default
[[https://emacs.stackexchange.com/questions/57603/how-to-always-display-inline-images-by-default-existing-solutions-dont-seem-to#comment89772_57607][this stackexchange comment]] states that this has to be done before the [[Add "~/org" to Agenda][adding the ~/org directory to Org Agenda]] [[https://emacs.stackexchange.com/questions/57603/how-to-always-display-inline-images-by-default-existing-solutions-dont-seem-to#comment89772_57607][this stackexchange comment]] states that this has to be done before the [[Add "~/org" to Agenda][adding the ~/org directory to Org Agenda]]
#+begin_src emacs-lisp :tangle config.el #+begin_src emacs-lisp :tangle config.el
(after! org (after! org
(setq org-startup-with-inline-images t)) (setq org-startup-with-inline-images t)
(setq org-image-actual-width '(300)))
#+end_src
*** Open Video in VLC
this requires the [[https://www.emacswiki.org/emacs/OpenWith][OpenWith]] minor mode
#+begin_src emacs-lisp :tangle packages.el
(package! openwith)
#+end_src
then the configuration from [[https://www.reddit.com/r/emacs/comments/cgbpvl/comment/euhscqj/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button][this reddit post]] can be used to achieve the desired behavior
#+begin_src emacs-lisp :tangle config.el
(after! openwith
(setq openwith-associations
(cond
((string-equal system-type "darwin")
'(("\\.\\(dmg\\|doc\\|docs\\|xls\\|xlsx\\)$"
"open" (file))
("\\.\\(mp4\\|mp3\\|webm\\|avi\\|flv\\|mov\\)$"
"open" ("-a" "VLC" file))))
((string-equal system-type "gnu/linux")
'(("\\.\\(mp4\\|mp3\\|webm\\|avi\\|flv\\|mov\\)$"
"xdg-open" (file))))))
(openwith-mode +1))
#+end_src #+end_src
*** Enable \LaTeX preview on default *** Enable \LaTeX preview on default
#+begin_src emacs-lisp :tangle init.el #+begin_src emacs-lisp :tangle config.el
(after! org (after! org
(setq org-startup-latex-with-latex-preview t)) (setq org-startup-latex-with-latex-preview t))
#+end_src #+end_src
** CalDAV Sync ** CalDAV Sync
[[https://github.com/dengste/org-caldav][org-caldav]] provides a tool for syncing with a CalDAV server (in my case Nextcloud). [[https://github.com/dengste/org-caldav][org-caldav]] provides a tool for syncing with a CalDAV server (in my case Nextcloud).
A lot of the config is also taken from [[https://www.reddit.com/r/orgmode/comments/8rl8ep/comment/e0sb5j0/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button][this]] reddit post. A lot of the config is also taken from [[https://www.reddit.com/r/orgmode/comments/8rl8ep/comment/e0sb5j0/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button][this]] reddit post.
@@ -515,6 +552,16 @@ Also set the percent states for [[*CalDAV Sync][CalDAV Sync]]
(string= (f-ext f) "org")) (string= (f-ext f) "org"))
'recursive))) 'recursive)))
#+end_src #+end_src
*** Styling
**** Priorities
using [[https://github.com/harrybournis/org-fancy-priorities][org-fancy-priorites]] the displayed priorities can be styled
#+begin_src emacs-lisp :tangle config.el
(after! org-fancy-priorities
(setq org-fancy-priorities-list '((?A . "HIGH")
(?B . "MID")
(?C . "LOW")
(?D . "OPTIONAL"))))
#+end_src
** Org Roam ** Org Roam
*** set base directory *** set base directory
Both the org files themselves and the database should be located in the same directory to enable syncing via Nextcloud Both the org files themselves and the database should be located in the same directory to enable syncing via Nextcloud