微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

vim – 如何格式化如下所示?

这些是我在. vimrc中的格式选项:

set formatoptions=tqronw
set formatlistpat=^\\([\\-\\*]\\\|[0-9]\\+[.)]\\)\\s*
set textwidth=72
set autoindent

1)
我的文字

- 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 this is my text this is my 
  text this is my text.

2)
我的文字

for Biochemistry,conducted a quality clinical study to determine the effects of microwave cooking on food

格式化后输出

for Biochemistry,conducted a quality clinical study to determine the
 effects of microwave cooking on food

预期产量:

for Biochemistry,conducted a quality clinical study to determine the
effects of microwave cooking on food

编辑
找到我的第一个问题的解决方案:)
文中有(不可见)(没有空格).
当我使用普通空格替换时,格式符合预期

解决方法

让我猜测你的第二个问题.尝试添加

set nosmartindent

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐