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

VIM中的格式列表

发布时间:2020-12-16 01:21:12 所属栏目:安全 来源:网络整理
导读:我想在Vim中找到一种简单格式列表的方法. 我检查了PAR和Vim的默认格式化程序. 体育 1. this is my text this is my text this is my text 2. this is my text this is my text this is my text 3. this is my text this is my text this is my text 4. this
我想在Vim中找到一种简单格式列表的方法.
我检查了PAR和Vim的默认格式化程序.

体育

1. this is my text this is my text this is my text 
2. this is my text this is my text this is my text 
3. this is my text this is my text this is my text 
4. this is my text this is my text this is my text  

还有这个

- this is my text this is my text this is my text 
- this is my text this is my text this is my text 
- this is my text this is my text this is my text 
- this is my text this is my text this is my text  

当我选择行并使用PAR和VIM执行默认格式为42时,结果如下:

号码列表

用par格式化:
标准错误:
(42)< =(0)(50) 用vim格式化:

1. this is my text this is my text this is
my text 
2. this is my text this is my text this is
my text 
3. this is my text this is my text this is
my text 
4. this is my text this is my text this is
   my text 

列出’ – ‘

用par格式化:
4行过滤(无变化)

用vim格式化:

- this is my text this is my text this is
  my text 
- this is my text this is my text this is
  my text 
- this is my text this is my text this is
  my text 
- this is my text this is my text this is
  my text 

Vim在格式化列表方面做得更好,但在编号列表中也不正确.
即使我使用这样的前缀(“p”)选项,Par确实有很多麻烦格式化列表:
‘<,'>!par w42p4dh或’<,'>!par w42p3dh

有谁知道如何格式化列表没有问题的好方法?

尝试设置fo = n.来自:帮助fo-table:
n       When formatting text,recognize numbered lists.  This actually uses
        the 'formatlistpat' option,thus any kind of list can be used.  The
        indent of the text after the number is used for the next line.  The
        default is to find a number,optionally followed by '.',':',')',']' or '}'.  Note that 'autoindent' must be set too.  Doesn't work
        well together with "2".                    

        Example: 
                1. the first item
                   wraps 
                2. the second item

(编辑:李大同)

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

    推荐文章
      热点阅读