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

如何使Vim的`J`和`gq`命令在一段时间后使用一个空格?

发布时间:2020-12-15 16:43:49 所属栏目:安全 来源:网络整理
导读:当我使用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
当我使用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在周期后只使用一个空格?

: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!

(编辑:李大同)

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

    推荐文章
      热点阅读