How do I add a visual indicator at the start of soft-wrapped continuation lines to tell them apart from real line starts?
Answer
set showbreak=↪\
Explanation
When wrap is enabled, long lines visually wrap to the next screen row. By default, Vim gives no visual cue to distinguish a wrapped continuation from an actual new line. Setting showbreak adds a string at the beginning of every continuation row, making the distinction immediately obvious.
How it works
set showbreak=STRING— displaysSTRINGat the start of every wrapped continuation line- The string is shown in the display but is not part of the actual buffer content
- A trailing space in the value (e.g.,
↪) adds breathing room before the text - The indicator is highlighted with the
NonTexthighlight group by default
Example
With set showbreak=↪\ and a long line:
This is a very long line that wraps
↪ around to the next screen row
The ↪ prefix makes it clear that the second row is a continuation, not a new line.
Tips
- Combine with
set breakindentso wrapped lines indent to match the original line's indentation — thenshowbreakappears after the indent - Use a simple ASCII fallback for terminals without Unicode:
set showbreak=>> - The
showbreakstring counts toward the display width, reducing the space available for text on continuation lines - Clear it with
set showbreak=(empty string) - Check the current value:
:set showbreak?