Skip to content

An Emacs minor mode to open files with function (or method) bodies folded by default

Notifications You must be signed in to change notification settings

necaris/folded-by-default-mode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

folded-by-default-mode

A minor mode to open files with function (or method) bodies folded by default. Inspired by @matklad’s blog post.

Help sought!

This has only rudimentary tests, run by loading sample files from GitHub from open-source projects in each of a dozen popular languages (see test/ directory). I am not an expert in each of these languages, and do not know what is idiomatic – if I have missed common patterns, please let me know!

Currently, this only implements code folding using tree-sitter-mode from MELPA.

There are lots of TODO comments left in the code, too ;-)

Installation

With Doom Emacs:

(package! folded-by-default-mode :recipe (:host github :repo "necaris/folded-by-default-mode"))

Using =straight.el=:

(straight-use-package
  '(folded-by-default-mode :host github
                           :repo "necaris/folded-by-default-mode"
                           :branch "main"))

Usage

(use-package! folded-by-default-mode
  :defer t
  :config
  (setq-default global-folded-by-default-mode t))

Next Steps

  • [ ] Publish to MELPA
  • [0/2] Implement alternative methods:
    • [ ] Emacs 29+ native treesit
    • [ ] hideshow
    • [ ] outline
  • [ ] Port to Helix?

About

An Emacs minor mode to open files with function (or method) bodies folded by default

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published