improved org mode styling

This commit is contained in:
paul-loedige
2024-02-28 15:13:52 +01:00
parent 8f7b621a6b
commit 37930ad47e
+74 -9
View File
@@ -2074,7 +2074,7 @@ This function could also become useful if we ever want to extend the compile com
#+end_src
*** Org Mode
install dependencies
**** Dependencies
#+begin_src conf :tangle pkg-list.txt
xclip
gnome-screenshot
@@ -2090,18 +2090,68 @@ graphviz
(after! org
(setq org-startup-numerated t))
#+end_src
***** Header Font Sizes
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/doom/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 :mkdirp yes :tangle ~/.config/doom/config.el
(after! org
(setq org-hide-emphasis-markers t))
#+end_src
***** 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]]
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/doom/config.el
(after! org
(setq org-startup-with-inline-images t))
(setq org-startup-with-inline-images t)
(setq org-image-actual-width '(600)))
#+end_src
***** Enable \LaTeX preview on default
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/doom/init.el
***** Open Video in VLC
this requires the [[https://www.emacswiki.org/emacs/OpenWith][OpenWith]] minor mode and VLC
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/doom/packages.el
(package! openwith)
#+end_src
#+begin_src shell :tangle pkg-list.txt
vlc
#+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 :mkdirp yes :tangle ~/.config/doom/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
***** Enable $\LaTeX$ preview on default
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/doom/config.el
(after! org
(setq org-startup-latex-with-latex-preview t))
#+end_src
***** Fix $\LaTeX$ block alignment in tables with valign
install valign
#+begin_src emacs-lisp :tangle ~/.config/doom/packages.el
(package! valign)
#+end_src
and start it automatically in org mode
#+begin_src emacs-lisp :tangle ~/.config/doom/config.el
(after! org
(add-hook 'org-mode-hook #'valign-mode))
#+end_src
**** CalDAV Sync
[[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.
@@ -2149,6 +2199,16 @@ Also set the percent states for [[*CalDAV Sync][CalDAV Sync]]
(string= (f-ext f) "org"))
'recursive)))
#+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 :mkdirp yes :tangle ~/.config/doom/config.el
(after! org-fancy-priorities
(setq org-fancy-priorities-list '((?A . "HIGH")
(?B . "MID")
(?C . "LOW")
(?D . "OPTIONAL"))))
#+end_src
**** Org Roam
***** set base directory
Both the org files themselves and the database should be located in the same directory to enable syncing via Nextcloud
@@ -2167,11 +2227,16 @@ Adding the "#+category: " tag improves the Org Agenda View for tasks captured in
"%?"
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n#+category: ${title}\n")
:unnarrowed t)
("m" "Meeting Templates")
("mm" "Meeting Master Thesis" plain
("m" "Master Thesis Templates")
("md" "Default Master Thesis Template" plain
"%?"
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n#+category: Master Thesis\n")
:unnarrowed t)
("mm" "Master Thesis Meeting Template" plain
"* Current Progress\n\n* Open Questions\n\n* TODOs\n"
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: Master Thesis Meeting ${title}\n#+category: Master Thesis\n")
:unnarrowed t))))
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title} Master Thesis Meeting\n#+category: Master Thesis\n")
:unnarrowed t)
)))
#+end_src
***** Misc
****** Follow Links on RET