noXML-fold-mode
This is a minor mode that tries to enable useful folding for XML files, copying a lot from AUCTeX’s tex-fold.el. It builds on nxml-mode, and will probably break horribly if it is not the major-mode.
Quickstart
- Get the repository:
git clone https://github.com/paddymcall/noXML-fold.git /some_path_you_like
- Edit your ~/.emacs:
(add-to-list 'load-path "/some_path_you_like") (add-hook 'nxml-mode-hook (lambda () (require 'noxml-fold)))
- Then try to open an xml file, make sure you’re in nxml-mode, and load noXML-fold with `M-x noXML-fold-mode’.
The most useful entry points are `noXML-fold-dwim’, and `noXML-fold-region’. For smaller files, you can also try `noXML-fold-buffer’.
Limitations
Since this mode uses overlays, it does not scale: for very long or deeply nested XML structures, you should only fold what’s within view (`noXML-fold-visible’), or make use of `narrow-to-region’.