Home

hardwrapped

Hard wrapped, or hard wrapping, is the practice of inserting explicit newline characters to end lines at a fixed width, so the text becomes a series of physically separate lines. This is distinct from soft wrapping or word wrap, where lines are visually broken without changing the underlying text.

Hard wrapping is commonly used in plain text contexts such as emails, plain-text documentation, and source code

Editors provide various ways to enforce hard wrapping. Auto-fill or wrap modes insert line breaks as you

Trade-offs exist: hard-wrapped text is compatible with older systems and can simplify diffing, but it can disrupt

where
line-length
constraints
or
compatibility
with
older
terminals
require
fixed-width
lines.
Typical
line
widths
range
from
72
to
80
characters,
though
some
guidelines
specify
78
or
other
values.
It
helps
ensure
readability
on
narrow
displays
and
can
make
diffs
clearer
in
version
control
systems.
type,
while
explicit
commands
or
options
can
set
a
fixed
text
width.
Examples
include
Emacs
auto-fill-mode,
Vim's
textwidth
setting,
and
many
modern
editors
that
offer
a
hard
wrap
command.
When
enabled,
typing
beyond
the
wrap
point
creates
new
lines
and
can
affect
indentation
and
the
formatting
of
lists
or
code
blocks.
paragraph
structure,
complicate
reformatting,
and
interfere
with
content
like
code
comments
or
prose
that
benefits
from
natural
wrapping.
In
formats
like
Markdown
or
code
files,
soft
wrapping
is
often
preferable
unless
the
target
format
requires
hard
line
breaks.