Word wrap

Posted on:

ov lets you switch between line wrapping modes. By default, wrapping is character-based (-w / -w=char), which may split words at the edge of the screen.

Wrap modes

Character-based wrapping Character-based wrapping

  • -w or -w=char: Wrap at the screen width (character-based).
  • -w=word: Wrap at word boundaries.
  • -w=none: Disable wrapping.
ov -w=word README.md

Word wrap

With word wrap enabled, long text is less likely to be split in the middle of a word.

word wrap word wrap

After launch, you can toggle word wrap with the default key Alt+w.

Indentation with word wrap

Since v0.55.0, you can set the indentation of wrapped lines in -w=word mode with --break-indent. You can also configure it after launch with the default key Ctrl+Alt+n.

Indentation options for word wrap

0: No indentation (default)

No indentation No indentation

Positive number: Indent by the specified width

Set to 2:

Positive indentation Positive indentation

L: Align with the leading whitespace of the original line

Set to L (L+0):

Align with the leading whitespace of the original line Align with the leading whitespace of the original line

L+N / L-N: Increase or decrease the width relative to the leading whitespace of the original line

Set to L+2. The leading L is optional, so L+2 means the same as +2.

Adjust indentation relative to the leading whitespace of the original line Adjust indentation relative to the leading whitespace of the original line

ov -w=word --break-indent=L+2 README.md

Display markers

Since v0.55.0, you can show markers for wrap positions, line continuations, and truncation at the screen width. Configure them with --sign-mode, or toggle them after launch with the default key Ctrl+Alt+m. The default value 0 hides all markers. Specify a value by adding the bit values for each marker.

Display markers 1 Display markers 1

Display markers 2 Display markers 2

ValueMarkers shownConditions
1↳At the beginning of a wrapped line
2↵At the end of a line before it wraps
4…At the end of a line that exceeds the screen width when wrapping is disabled
3↳ and ↵Combines 1 and 2
5↳ and …Combines 1 and 4
6↵ and …Combines 2 and 4
7AllCombines 1, 2, and 4

↳ and ↵ are shown when wrapping is enabled. … is shown when wrapping is disabled and a line exceeds the screen width.

ov -w=word --sign-mode=3 README.md