在 vim 中,我可以设置 textwidth 选项,然后将新文本格式化为换行。我还可以使用“gq”命令显式换行文本。然而,项目符号列表的行为对我来说有点出乎意料。 vim 文档讨论了使用带有连字符的项目符号列表。当我尝试这样做时,它开始正常:
- This is a bulleted list item that
has been wrapped. It looks good.
但是,如果我继续到第三行,它就会放弃缩进:
- This is a bulleted list item that
has been wrapped over more than
two lines. The indentation for lines
after the second is unexpected.
这种情况发生在:
formatoptions=tcq
comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-
需要明确的是,我想要这样的缩进:
- This is a bulleted list item that
has been wrapped over more than
two lines. I want every line after
the first to get the same indent.
经过进一步调查,看起来我只需要执行“设置自动缩进”即可获得预期的行为。这似乎对于输入文本时换行和使用“gq”命令换行都很有效。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)