当我使用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!