WingDust / org-center-headings

Test of an idea to center org-headings pixel wise in Emacs windows.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About

./screenshot.png

A small experiment to play with pixelwise centering of org-headings in a buffer. OBS: this is just an experiment, the purpose is not to propose a final product, but just to illustrate an idea.

It means there are probably lots of places where it will break. I have put it together just as a small demo, to showcase it is possible to do text alignement in Emacs. With other words, this is not an application to use on every day basis.

There is a small video showing how it works in practice:

https://youtu.be/Z5DO8GXbbrs

Installation

Either clone this repo or just download ‘org-cebter-headings.el’.

Put org-center-headings.el somewhere in Emacs load-path. From there you have option to either:

M-x package-install-file RET org-center-headings.el RET

or just require file in your init file somewhere.

Requirements

Really none, should be compatible with Emacs 22.1 but package.el does not recognize requirements older than Emacs 24.1.

Usage

Place cursor on a line with org-heading and type

M-x org-center-headings-center

to center a heading, or

M-x org-center-headings-remove-centering

to remove the center alignement.

This introduces also experimental formatting string for headings: ‘<>’ (without quotes). It should be placed after space that follows leading stars in a heading. The string is used together with a minor mode org-center-headings-mode to control wich headings will be centered. Alternatively it is possible to bypass the format string and center all headings in a buffer by setting value of:

org-center-headings-formatted-only

to nil.

As a small plus, there is also a minor mode to hide the format string used to center headings.

License

GPL v3. For details, see the atached license file.

About

Test of an idea to center org-headings pixel wise in Emacs windows.


Languages

Language:Emacs Lisp 100.0%