This feature was implemented on June 25, 2014 as a patch 7.4.338. The following are a few patches that refine this feature, the last of which is 7.4.354, so you need a version.
:help breakindent :help breakindentopt
Excerpts from vim help below:
'breakindent' 'bri' boolean (default off) local to window {not in Vi} {not available when compiled without the |+linebreak| feature} Every wrapped line will continue visually indented (same amount of space as the beginning of that line), thus preserving horizontal blocks of text. 'breakindentopt' 'briopt' string (default empty) local to window {not in Vi} {not available when compiled without the |+linebreak| feature} Settings for 'breakindent'. It can consist of the following optional items and must be seperated by a comma: min:{n} Minimum text width that will be kept after applying 'breakindent', even if the resulting text should normally be narrower. This prevents text indented almost to the right window border occupying lot of vertical space when broken. shift:{n} After applying 'breakindent', wrapped line beginning will be shift by given number of characters. It permits dynamic French paragraph indentation (negative) or emphasizing the line continuation (positive). sbr Display the 'showbreak' value before applying the additional indent. The default value for min is 20 and shift is 0.
For this, also showbreak parameter wherein the change amount will be showbreak characters you specified.
Configuration example
" enable indentation set breakindent " ident by an additional 2 characters on wrapped lines, when line >= 40 characters, put 'showbreak' at start of line set breakindentopt=shift:2,min:40,sbr " append '>>' to indent set showbreak=>>
Pay attention to the behavior
If you do not specify the sbr option, any showbreak any characters you put is attached to the indent. Removing sbr from the above example results in an effective indent of 4 characters; with this option, if you just want to use showbreak without extra indentation, specify shift:0 .
You can also showbreak negative shift, which will drag the showbreak and showbreak characters back into any available indentation space.
If the min value is specified, the offset number will be squeezed if the width of the terminal is showbreak , but showbreak characters showbreak always saved.
Dominykas Mostauskis Sep 24 '14 at 11:30 2014-09-24 11:30
source share