在vim中,当我使用
gqip
原始段落:
Here is some text including a number
3 in the paragraph, which may be
regarded as the start of a numbered
list when I format it.
):
Here is some text including a number
3 in the paragraph, which may be
regarded as the start of a numbered
list when I format it.
问题是,vim将单词“视为”对齐,就像第段中的行“3…”不知怎的,意思是“(3)在段落中”。在我看来,这是格式规则中的一个缺陷,因为在普通文本中经常出现明显的反例。那么,我如何改进这个缩进规则,使其仅适用于数字上有类似列表的标点符号的情况呢?例如,我认为这是可以的:
Here is some text including a number
3) in the paragraph, which may be
regarded as the start of a numbered
list when I format it.
这条规则也有反例,但至少错误发生的频率较低。可以通过检查平衡括号来进一步完善该规则,即:
Here is some text (including a number
3) in the paragraph, which is not
regarded as the start of a numbered
list when I format it (because the
parenthesis is accounted for by the
opening parenthesis on line 1).