vimtricks.wiki Concise Vim tricks, one at a time.

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 — displays STRING at 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 NonText highlight 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 breakindent so wrapped lines indent to match the original line's indentation — then showbreak appears after the indent
  • Use a simple ASCII fallback for terminals without Unicode: set showbreak=>>
  • The showbreak string 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?

Next

How do I prevent Vim from inserting two spaces after a period when joining lines with J?