Smart Wrap在Vim

前端之家收集整理的这篇文章主要介绍了Smart Wrap在Vim前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我一直在想,如果Vim有能力智能包装代码,使它保持与缩进行相同的缩进。我注意到其他一些文本编辑器,如电子文本编辑器,并发现它帮助我理解我看起来更容易。

例如而不是

<p>
    <a href="http://www.example.com">
        This is a bogus link,used to demonstrate
an example
    </a>
</p>

它会显示

<p>
    <a href="somelink">
        This is a bogus link,used to demonstrate
        an example
    </a>
</p>
功能已作为修补程序7.4.338的 implemented on June 25,2014。接下来是几个补丁细化功能,最后一个是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.

猜你在找的Bash相关文章