如何让 par 格式化程序不破坏具有非空格字符前缀和后缀的段落?

如何让 par 格式化程序不破坏具有非空格字符前缀和后缀的段落?

我无法获得par 格式化程序做我想做的事,特别是使用自动前缀和后缀。详情:

我的.vimrc摘录:

set formatprg=par\ -w72reqh
map t gqip

此示例输入至平价说明问题的文本:

1. This is some text with similar sentence beginnings and endings.
   The snake slithered through the grass, sliding back and forth.
   Tactfully approaching its prey.

将我的 vim-par-formatting(t在 vim 命令模式下按下键)设置应用于上述结果:

1. This is some text with similar sentence beginnings and endings he   .
   Tsnake slithered through the grass, sliding back and forth actfully .
   Tapproaching its prey                                               .

请注意,左侧/前缀T和右侧/后缀句点是“对齐的”。显然不是我想要的。我希望结果(t在 vim 命令模式下按下键)看起来像这样:

1. This is some text with similar sentence beginnings and endings. The
   snake slithered through the grass, sliding back and forth. Tactfully
   approaching its prey.

这个答案似乎只是禁用平价后缀和前缀,不会产生我想要的结果(上述)。我希望有办法平价仅在前缀中添加空格字符,或者类似字符?

解决方案可能涉及打破其他平价功能,例如“对齐”示例中的 C 代码注释字符找到这里。但我一步一步来。也许我(最终)会使用 2 个不同的 par-formatting vim 命令,一个用于像上面那样的空格分隔文本,另一个用于 C 注释格式等。现在,让我们解决上述问题,然后我会根据需要研究下一步(C 注释等)。

我的环境:

$ par version
par 1.52-i18n.4
$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.9.5
BuildVersion:   13F1077
$ brew list par
/usr/local/Cellar/par/1.52/bin/par
/usr/local/Cellar/par/1.52/share/man/man1/par.1.gz
$ which par
/usr/local/bin/par
$ vim --version | head -2
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Apr 21 2014 14:54:22)
MacOS X (unix) version
$ 

相关内容