gpt4 book ai didi

Vim:如何将一组行重新格式化为一行(如果该行是一个句子)?

转载 作者:行者123 更新时间:2023-12-03 03:27:54 25 4
gpt4 key购买 nike

不是 In Vim, what is the simplest way to join all lines in a file into a single line? 的重复,因为我特别想使用 gq 重新格式化功能。

我曾经在 vim 中使用 80 个字符 textwidth 编写 Latex。不过,我现在已切换到无限的 textwidth,因此我的线条会永远持续下去。

Vim 的重新格式化(例如 gqap)将几行组合成一个段落,将它们包装为 80 个字符。我希望它将它们组合成一行。

Without a \clang{goto} statement in the HIR, we must instead use conditional
statements to check the iteration number.

应该重新格式化为

Without a \clang{goto} statement in the HIR, we must instead use conditional statements to check the iteration number.

当它突出显示并按下 gq 时。

最佳答案

如果您不喜欢 depesz 建议的“J”,那么就这样做

:set tw=9999

然后执行“gq”。根据您的需要调整 tw。

关于Vim:如何将一组行重新格式化为一行(如果该行是一个句子)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1450904/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com