Display horizontal rulers in Org files as a full-width line

This commit is contained in:
Gergely Polonkai 2023-09-29 08:14:03 +02:00
parent 16e31aec48
commit 2ceecc5a21
No known key found for this signature in database
GPG Key ID: 2D2885533B869ED4

View File

@ -1290,6 +1290,25 @@ This emulates how Orgzly work with my current settings.
(org-set-property "CREATED" timestamp)))
#+end_src
*** Display horizontal rulers as a full-width line
From [[https://matrix.to/#/@suckless_shill:matrix.org][viz]] in the [[https://matrix.to/#/#org-mode:matrix.org][org-mode]] Matrix room.
#+begin_src emacs-lisp
(defun vz/org-fontify-horizontal-break ()
"Display Orgs horizontal break (-----) as a full-width horizontal line"
(push '("^[[:space:]]*\\(------*\\)\n"
(0 (progn
(put-text-property (match-beginning 1) (match-end 1)
'display (make-string (- (match-end 1) (match-beginning 1)) ?\s))
(put-text-property (match-beginning 1) (match-end 0)
'face '(:strike-through t :extend t)))))
org-font-lock-extra-keywords)
(setq-local font-lock-extra-managed-props (cons 'display font-lock-extra-managed-props)))
(add-hook 'org-font-lock-set-keywords-hook #'vz/org-fontify-horizontal-break)
#+end_src
** Org Roam
Lets see if i can get my brain more organised this way…