This simple package allows you to enforce the number of blanks lines after elements in an org-mode document.
This package is experimental and might delete some contents of your buffer other than blank lines if there are bugs. Contribution is very welcome.
(el-get-bundle org-spacer
:url "https://github.com/dustinlacewell/org-spacer.el.git"
:features org-spacer)
(use-package org-spacer
:straight (org-spacer :type git :host github :repo "dustinlacewell/org-spacer.el")
This variable controls which org elements you want processed and how many blank lines to enforce for each.
It is a list of lists. Each inner list’s car is the number of blanks. One or more org element symbols may follow:
(setq org-spacer-element-blanks
'((0 headline)
(1 paragraph src-block table property-drawer)))
Just execute M-x org-spacer-enforce
to apply spacings.
Alternatively, add it to a before-save-hook
:
(add-hook 'org-mode-hook
(lambda () (add-hook 'before-save-hook
'org-spacer-enforce nil 'make-it-local)))