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

How do I add a visual indicator at the start of soft-wrapped continuation lines?

Answer

:set showbreak=+++

Explanation

When wrap is enabled, Vim wraps long lines at the screen edge, but there is no built-in visual marker to distinguish a wrapped continuation from a brand-new line. The showbreak option lets you specify a string that appears at the beginning of every soft-wrapped continuation, making the layout immediately clear.

How it works

  • :set showbreak=+++ — puts +++ at the start of each wrapped portion
  • :set showbreak=↪\ — uses a return-arrow symbol (Unicode works in most terminals)
  • :set showbreak= — clears the indicator (no marker)

The showbreak string is highlighted using the NonText highlight group, so it is visually distinct from buffer text. It does not appear in the actual file contents.

Example

With :set showbreak=↪ and a long line that wraps:

This is a very long line that wraps because it exceeds the screen
↪ width by quite a few characters and keeps going.

Without showbreak, the wrapped portion is indistinguishable from a separate line.

Tips

  • Combine with :set breakindent to also indent the continuation to match the first line's indentation level
  • Combine with :set linebreak to break at word boundaries instead of mid-word
  • To use a Unicode symbol in your vimrc, write the literal character: set showbreak=↪\ (note the escaped trailing space)
  • In Neovim, you can use vim.o.showbreak = '↪ ' in your Lua config

Next

How do I highlight all occurrences of a yanked word without typing a search pattern?