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

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

发布时间:2020-12-15 22:34:12 所属栏目:安全 来源:网络整理
导读:这些是我在. vimrc中的格式选项: set formatoptions=tqronwset formatlistpat=^([-*]|[0-9]+[.)])s*set textwidth=72set autoindent 1) 我的文字: -?This is my text this is my text this is my text this is my text this is my text thi
这些是我在. 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

(编辑:李大同)

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

    推荐文章
      热点阅读