UPDATE http://git.savannah.nongnu.org/cgit/so-long.git/tree/so-long.el is a part of Emacs 27.1!
OLD I usually unroll long lines and indent by tags (like HTML, XML, JSON).
In order to make such operation possible I add:
(setq line-number-display-limit large-file-warning-threshold)
(setq line-number-display-limit-width 200)
(defun my--is-file-large ()
"If buffer too large and my cause performance issue."
(< large-file-warning-threshold (buffer-size)))
(define-derived-mode my-large-file-mode fundamental-mode "LargeFile"
"Fixes performance issues in Emacs for large files."
;; (setq buffer-read-only t)
(setq bidi-display-reordering nil)
(jit-lock-mode nil)
(buffer-disable-undo)
(set (make-variable-buffer-local 'global-hl-line-mode) nil)
(set (make-variable-buffer-local 'line-number-mode) nil)
(set (make-variable-buffer-local 'column-number-mode) nil) )
(add-to-list 'magic-mode-alist (cons #'my--is-file-large #'my-large-file-mode))
I split line by regex, for XML it: C-M-% >< RET >NL< RET !
.
After Emacs split long lines - it is possible to enable many *-modes
and re-indent code.
For the note: How to prevent slow-down when an inferior processes generates long lines?