PAR如何避免某些格式化?

时间:2011-07-18 16:19:53

标签: vim formatting

PAR做了i.m.o.作为Vim默认格式化程序的格式要好得多。

但有时PAR不能很好地运作。

体育课。

this is a test this is a test this is a test.
this is my text this is my text this is my text.

使用par 44格式化为:

this is a test this is a test this is a   t.
this is tes my text this is my text this  t.
this is is my tex                         t.

有没有办法解决这种格式?

1 个答案:

答案 0 :(得分:2)

帕尔是非常强大,复杂的。我不知道它的10%的容量,但会 值得花一整个星期来掌握它。

您的文字发生的事情与每行中的最后一个字符有关。 如您所见,每一行都在:

this is a test this is a test this is a test.
this is my text this is my text this is my text.

以“t。”结尾。 Par手册在 DESCRIPTION 部分中说明了

Each output paragraph is generated from the corresponding input paragraph
as follows:

1) An optional prefix and/or suffix is removed from each input line.
2) The remainder is divided into words (separated by spaces).
3) The words are joined into lines to make an eye-pleasing paragraph.
4) The prefixes and suffixes are reattached.

可能 1 Par猜测t.是后缀,因此删除 它们在步骤1中。在完成所有格式后,Par将t.对齐 它们。

要解决此问题,请传递s选项,其值为0.这样后缀将是 禁用。

:%!par s0w44

1 我说可能因为我不完全确定。就像我一样 早些时候我说我不是大师,也许还有其他的东西。