Ta funkcja została zaimplementowana 25 czerwca 2014 r . W patchu 7.4.338. Nastąpiło kilka poprawek udoskonalających tę funkcję, ostatnia to 7.4.354, więc to jest wersja, którą chcesz.
:help breakindent
:help breakindentopt
Fragmenty pomocy Vima poniżej:
'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.
W tym przypadku istotne jest również showbreakustawienie, które doda wielkość zmiany do określonego znaku (ów).
Przykładowa konfiguracja
" 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=>>
Uwaga dotycząca zachowania
Jeśli nie określisz sbropcji, showbreakwszelkie znaki zostaną dołączone do wcięcia. Usunięcie sbrz powyższego przykładu powoduje efektywne wcięcie 4 znaków; z tym ustawieniem, jeśli chcesz używać tylko showbreakbez dodatkowego wcięcia, określ shift:0.
Możesz również wprowadzić przesunięcie ujemne, które spowodowałoby przeciągnięcie showbreakznaków i zawiniętego tekstu z powrotem w dowolne dostępne wcięcie.
Podczas określania minwartości przesunięta kwota zostanie zmniejszona, jeśli szerokość terminala jest węższa, ale showbreakznaki są zawsze zachowane.