A minor mode to open files with function (or method) bodies folded by default. Inspired by @matklad’s blog post.
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 ;-)
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"))
(use-package! folded-by-default-mode
:defer t
:config
(setq-default global-folded-by-default-mode t))
- [ ] Publish to MELPA
- [0/2] Implement alternative methods:
- [ ] Emacs 29+ native
treesit
- [ ] hideshow
- [ ] outline
- [ ] Emacs 29+ native
- [ ] Port to Helix?