~wklew/golden

Modern derivative of golden-ratio.el for automatic window sizing
readme: Improve screenshot alt text
readme: Add a note about the simplified use of hooks

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~wklew/golden
read/write
git@git.sr.ht:~wklew/golden

You can also use your local clone with git send-email.

#golden

Automatic sizing of Emacs windows according to the golden ratio.

This is an updated and greatly simplified derivative of golden-ratio.el for Emacs 27. Version 27 overhauled the way window changes are registered, obviating the need for the original code's complexity. The UX was also simplified in the process and a number of outstanding issues fixed.

#Overview

Screenshot showing three windows stacked horizontally and vertially.  The active window occupies a larger share of the frame.

Running a divider down the middle of a user interface violates basic design principles, creating a cramped editing environment. Unfortunately, this is the reality for most Emacs users. Whether or not you believe in its cosmic significance, the golden ratio is a tried and true method of sectioning space in a pleasing manner.

golden automatically expands the active window to fill 2/(1+√5) of the frame. With two windows, this corresponds to a golden rectangle. Because only the active window is resized, returns diminish with more windows but are still generally effective.

#Usage

Toggle one of the following minor modes:

  • golden-mode: Enable or disable automatic resizing when switching to windows containing this buffer

  • global-golden-mode: Enable or disable automatic resizing for all windows

The command global-golden-resize can also be used to manually resize the selected window.

#Inhibiting resizing

The golden-ratio.el customization options dedicated to inhibiting the resizing of particular buffers, major modes, etc. have been replaced by a single list of predicate functions:

  • golden-inhibit-predicates: List of functions to be called with no arguments the first time global-golden-mode might be enabled in a buffer; if any returns a non-nil value, automatic resizing is inhibited when switching to windows containing that buffer