jdtsmith / outli

Simple comment-based outline folding for Emacs
GNU General Public License v3.0
105 stars 6 forks source link

outli

Simple and stylish comment-based outlines with speed keys for Emacs.

image

outli is a simple Emacs outliner for code, documents, and more which provides hierarchical hide/show, styles your headings, and emulates org-mode navigation and structure editing. It builds on the built-in outline-minor-mode and is simple by design, providing just a few key additional features beyond what outline already offers:

Configuration

Not yet in a package database; simply clone and point use-package at the correct path (or use straight, etc.).

(use-package outli
  :load-path "~/code/emacs/outli"
  ;:after lispy ; uncomment only if you use lispy; it also sets speed keys on headers!
  :bind (:map outli-mode-map ; convenience key to get back to containing heading
          ("C-c C-p" . (lambda () (interactive) (outline-back-to-heading))))
  :hook ((prog-mode text-mode) . outli-mode)) ; or whichever modes you prefer

You should probably not enable outli in org-mode (which by default is prevented), or with other packages which operate on headings or use similar short bindings, like outshine or pdf-tools. If you want to disable individual modes within some larger mode hierarchy (like text-mode), you can either opt-in by adding them one-by-one, or include those modes in outli-heading-config with a disable entry; see below.

Customization

Headline style

The main variable to customize is outli-heading-config, where you can set the stem and repeat char, and influence the styling, including whether to style the stem and repeat chars the same, whether to include the overline, or whether to omit styling altogether. Note that the t member of this alist is the default used for all modes whih are not explicitly specified.

Configured defaults are:

The custom variable outli-blend controls whether a blended background is used to start the headline. After configuring outli-heading-config, you should restart outli-mode in any open buffers using it.

Style Defaults

You can set defaults for the STYLE and NOBAR properties for all modes, which take effect if these parameters are omitted or nil in the outli-heading-config; see outli-default-style and outli-default-nobar.

Speed keys

Customize outli-speed-commands to alter or disable speed keys, which work at the beginning of heading lines only (similar to org speed keys).

Folding/unfolding automatically when hopping around buffers

Try reveal-mode; see below.

FAQ

Tips

Related Packages