首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Vim只使用一个空格后的句号?

Vim只使用一个空格后的句号?
EN

Stack Overflow用户
提问于 2018-01-05 04:24:28
回答 2查看 0关注 0票数 0

当我用Vim的J命令中,大多数行都使用一个空格来填充。但是在一个句号之后,Vim总是使用两个空格。以下列例子为例:

This ends with a comma,
but this ends with a period.
Join with 'J' and what do you get?

对我来说,结果是:

This ends with a comma, but this ends with a period.  Join with 'J' and what do you get?

逗号后面有一个空格,句号后面有两个空格。如果用gq命令。

是否有一个设置,我可以使Vim只使用一个空格后的句号?

EN

回答 2

Stack Overflow用户

发布于 2018-01-05 12:29:44

:help joinspaces


'joinspaces' 'js'    boolean    (default on)
            global
            {not in Vi}
    Insert two spaces after a '.', '?' and '!' with a join command.
    When 'cpoptions' includes the 'j' flag, only do this after a '.'.
    Otherwise only one space is inserted.
    NOTE: This option is set when 'compatible' is set.

所以,你会做一个

:set nojoinspaces

得到你想要的。

或者,您可以用

:set joinspaces!
票数 0
EN

Stack Overflow用户

发布于 2018-01-05 13:41:47

你需要:set nojoinspaces摆脱双重空间。这里的文件

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/-100001330

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档