此功能已于2014年6月25日作为7.4.338补丁实施。接下来是一些完善功能的补丁,最后一个是7.4.354,所以这就是您想要的版本。
:help breakindent
:help breakindentopt
以下是vim帮助的节选:
'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.
与此showbreak
设置也相关,该设置将在您的班次数量后加上您指定的字符。
配置示例
" 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=>>
注意行为
如果您未指定该sbr
选项,则任何showbreak
任何字符都将附加在缩进之后。sbr
从上面的示例中删除会导致有效缩进4个字符;使用该设置,如果您只想使用showbreak
而没有其他缩进,请指定shift:0
。
您还可以进行负移,以将showbreak
字符和换行文本拖回任何可用的缩进空间。
指定min
值时,如果终端宽度较窄,则移位量将被压缩,但showbreak
始终保留字符。