Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's only a problem if you're using a line-wrap method which doesn't account for indentation and just blindly wraps (which yes, is awful). If you want to have nice indentation aware plain text line wrapping, your text editor almost certainly supports it.

If you use vim, look into the "breakindent" option.

If you use Emacs, you can use the "adaptive-wrap" package with a configuration like this:

    ;; Indentation of softwraped code
    (use-package adaptive-wrap
      :ensure t
      :init (defun my-activate-adaptive-wrap-prefix-mode ()
              "Toggle `visual-line-mode' and `adaptive-wrap-prefix-mode' simultaneously."
              (adaptive-wrap-prefix-mode (if visual-line-mode 1 -1)))
      (add-hook 'visual-line-mode-hook 'my-activate-adaptive-wrap-prefix-mode))


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: