Skip to content

Enforce the number of blank lines between elements in an org-mode document

Notifications You must be signed in to change notification settings

dustinlacewell/org-spacer.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

org-spacer.el

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.

Installation

el-get

(el-get-bundle org-spacer
  :url "https://github.com/dustinlacewell/org-spacer.el.git"
  :features org-spacer)

straight.el

(use-package org-spacer
  :straight (org-spacer :type git :host github :repo "dustinlacewell/org-spacer.el")

Configuration

org-spacer-element-blanks

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)))

Usage

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)))

About

Enforce the number of blank lines between elements in an org-mode document

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published