The outline-indent Emacs package provides a minor mode that enables code folding and outlining based on indentation levels for various indentation-based text files, such as YAML, Python, and other indented text files.
In addition to code folding, outline-indent
allows moving indented sub-trees up and down, promoting and demoting sections to adjust indentation levels, customizing the ellipsis, and inserting a new line with the same indentation level as the current line, among other features.
The outline-indent
package leverages the built-in outline-minor-mode, which is maintained by the Emacs developers and has less chance of being abandoned like origami.el.
The outline-indent
Emacs package offers a similar functionality to Vim’s set foldmethod=indent
setting. Just as in Vim, it allows to fold and unfold code sections based on their indentation levels.
Installation
To install the outline-indent
from MELPA:
- If you haven’t already done so, add MELPA repository to your Emacs configuration.
- Add the following code to your Emacs init file to install the
outline-indent
package from MELPA:
(use-package outline-indent
:ensure t
:custom
(outline-indent-ellipsis " ▼ "))
Code language: Lisp (lisp)