【发布时间】:2012-11-29 11:13:02
【问题描述】:
我使用自动格式化 (textwidth = 72) 在 vim 中编写电子邮件。
问题是每次我写一个列表或短语时,vim 都会将它加入到上面的行中。
p.e.
These are my options:
- option nr. 1
当我写“-”时,“-”立即与上面的短语相连:
These are my options: -
当我使用其他类型的列表时也是如此。编号列表或列表前的其他符号。
当我写短于 72 个字符的短语时也是如此
This is my text.
This is my text on the 2nd line.
自动格式化将其更改为:
This is my text. This is my text on the 2nd line.
如何改变这种行为?
我只想在前 72 个字符中没有回车 <CR> 时格式化长行。
如果有<CR>,它必须在那里中断。
【问题讨论】:
-
所以你不想摆脱自动格式化,但是 vim 应该如何知道你想在哪里中断?
-
我想在 72 个字符处中断(即我在 vimrc 中添加的 textwidth)。因此,如果我写的一行比 72 长,它必须在 72 处中断并继续下面的行。如果我写一行 p.e. 60 个字符,然后按我键盘上的 enter 键转到下面的行 Vim 必须保持原样。
标签: vim scripting format autoformatting