假设我正在vim中编辑一些Python代码,如下所示: myobj.myfunc("Some string parameter that goes on and on and on and on and sometimes doesn't" "split very" "neatly over different lines so that" "it is formatted attractively") 我希望重新格式化,以便重新设置到textwidth我设置的位置: myobj.myfunc("Some string parameter that goes on and on and " "on and on and sometimes doesn't split very " "neatly over …
我目前正在写很多纯文本(以及LaTeX,段落中的格式最少),如果可以设置vim保留每个句子(为简单起见,文本以'。','!或“?”;这是一个终止标点符号,后跟一个空格,以避免在其自己的行上出现小数点),因此VCS差异将更加有用。 最少,我想gq格式化以下文本: He lay flat on the brown, pine-needled floor of the forest, his chin on his folded arms, and high overhead the wind blew in the tops of the pine trees. The mountainside sloped gently where he lay; but below it was steep and he could see the dark …
假设我有这个Markdown文件: [Lorem ipsum dolor sit ](http://vi.stackexchange.com/many-links-are-often-very) 看起来不错。但是链接没有完成,所以我输入-long,现在Vim中断了: [Lorem ipsum dolor sit ](http://vi.stackexchange.com/many-links-are-often-very-long) 由于我的textwidth=80设置,...断开链接中间标签在技术上是有效的降价促销,但恕我直言,恕我直言;拥有漂亮外观的源文件是Markdown的重点。 随着gq这个问题往往是更糟糕: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec [Lorem ipsum dolor sit](http://vi.stackexchange.com/many-links-are-often-very-very-long) 变成这个: Lorem ipsum dolor sit amet, consectetur adipiscing …