How to get par formatter to not mangle paragraphs with non-space character prefixes, suffixes?

2

1

I can't get the par formatter to do what I want, specifically with automated prefixes and suffixes. Details:

My .vimrc excerpt:

set formatprg=par\ -w72reqh
map t gqip

This example input-to-par text that demonstrates the problem:

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.

Applying my vim-par-formatting (pressing the t key in vim command mode) settings to the above results in:

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                                               .

Notice the left-side/prefix T's and right-side/suffix periods are "justified." Obviously not what I want. I instead want the results (of pressing the t key in vim command mode) to look like this:

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.

This answer appears to simply disable par suffixes and prefixes and won't generate my preferred (above) result. I'm hopeful there's some way to get par to prefix only space characters, or some such?

The solution may involve breaking other par functionality, like "justifying" the C-code-comment characters in the example found here. But I'm taking this one step at a time. Maybe I (eventually) employ 2 different par-formatting vim commands, one for space-delimited text like above, another for C-comment formatting, etc. For now, let's solve the above and then I'll investigate the next (C-comment, etc) steps as need be.

My environment:

$ 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
$ 

Johnny Utahh

Posted 2015-06-02T15:37:27.427

Reputation: 503

Does this question better suited to stackoverflow.com? – Johnny Utahh – 2015-06-03T14:38:23.357

No answers