Emacs Advent Calendar 18: Line Breaking
When a (logical) line is wider than an Emacs window it is wrapped around into the next (screen) line. There are alternatives to this behavior.
When line truncation is enabled with
toggle-truncate-lines, the remainder of a line is cut at the
right window border. Moving point to the right in such a line scrolls
the buffer horizontally.
To get line wrapping, but only on word boundaries, enable Visual Line
M-x visual-line-mode. Here the commands
C-k will operate on screen lines and not on
logical lines. The line breaks inserted by Visual Line Mode will not
be saved to the final file.
auto-fill-mode can be enabled. Here, hard line
breaks will be inserted at word boundaries so that no text will be
wider than the current value of
fill-column, usually 70
This text by Ludger Sandig is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.