当我用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只使用一个空格后的句号?
发布于 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!
发布于 2018-01-05 13:41:47
你需要:set nojoinspaces
摆脱双重空间。这里的文件
https://stackoverflow.com/questions/-100001330
复制相似问题