n
Vim 设置的选项将使formatoptions
列表项的第二行缩进与第一行的缩进一致。但是,第三并且后续行将恢复为无缩进,因此:
1. Doing a list. This is my list. I am writing
a list. It's quite a long list. It's really
long. I can't believe how long it is. And
this just the first item!
2. Another list item.
我真的很想让它缩进全部像这样的行:
1. Doing a list. This is my list. I am writing
a list. It's quite a long list. It's really
long. I can't believe how long it is. And
this just the first item!
2. Another list item.
这是否可行,是使用 Vim 自己的选项、脚本还是外部格式化程序(例如 par)?
答案1
我认为只需设置“自动缩进”即可解决该问题。对我来说确实如此。
set ai
答案2
对于你的情况我会这样做:
:set autoindent " just for interactive indenting (see answer of @Rich)
:set fo+=2n " :help fo-table
:set tw=47 " your text shall wrap at xyz
(tw=47
对于...很重要),然后按以下方式重新格式化段落gqap
注意:我无法用任何一种方式重新缩进该段落=,也许其他人已经解决了这个问题。