加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

Smart Wrap在Vim

发布时间:2020-12-15 16:34:01 所属栏目:安全 来源:网络整理
导读:我一直在想,如果Vim有能力智能包装代码,使它保持与缩进行相同的缩进。我注意到其他一些文本编辑器,如电子文本编辑器,并发现它帮助我理解我看起来更容易。 例如而不是 p a href="http://www.example.com" This is a bogus link,used to demonstratean exa
我一直在想,如果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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读