19

I have the following wrapped text, especially when you use a lot of windows:

Wrapped lines in Emacs

I'm wondering if the indentation of wrapped text could be changed like in Vim:

Indentation of wrapped lines in Vim

When figuring out, it seems the AutoFillMode is responsible for this. I was hoping this might be improved in Emacs 25. After upgraded to a compiled binary of Emacs 25, I see the same behaviour.

So I'm wondering if I could solve this in an another way?

3

1 Answer 1

19

After M-x package-install RET adaptive-wrap RET:

(setq-default adaptive-wrap-extra-indent 2)
(add-hook 'visual-line-mode-hook #'adaptive-wrap-prefix-mode)
(global-visual-line-mode +1)
14
  • adaptive-wrap-prefix-mode is not a global mode by default. But you can make it global if you like and not tie it with the activation of visual-line-mode. Commented Aug 8, 2015 at 18:49
  • Surprising to see how easily this could be achieved. Why is this not included in the default package of Emacs?
    – ReneFroger
    Commented Aug 8, 2015 at 19:38
  • The package itself is in ELPA, so that could be fairly easily arranged, at least from a legal standpoint. I'd much rather have Tetris be the external package and adaptive-wrap be built-in but such is life.
    – PythonNut
    Commented Aug 8, 2015 at 19:56
  • 2
    @PythonNut On further thought, I might start doing just what you do.. enable adaptive-wrap-prefix-mode using the visual-line-mode-hook :) Commented Jan 6, 2016 at 19:27
  • 1
    @kaushalmodi Thanks for the tip. I fixed this in my config a while ago (idk, there's some other stuff in that commit too :|), but I haven't updated my answer. Should be updated now.
    – PythonNut
    Commented Jan 6, 2016 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.