Monday, November 30, 2009

Custom Paragraph Formatting with gq

I have logbook entries that have the following structure:

[entry title 1]
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse blandit ipsum vel elit ultrices pharetra rhoncus tellus aliquam. Donec quis dolor ac elit vestibulum rhoncus. Quisque adipiscing dolor vitae urna molestie in vulputate arcu mattis. Donec felis augue, aliquam dictum mattis vitae, pretium in massa.

What I would like to do is apply 'gq' command to format all the paragraphs in the file, but the [entry title 1] header also gets formatted (which I don't want.) So it turns out something like this:

[entry title 1] Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Suspendisse blandit ipsum vel elit ultrices pharetra rhoncus tellus aliquam.
Donec quis dolor ac elit vestibulum rhoncus. Quisque adipiscing dolor vitae
urna molestie in vulputate arcu mattis. Donec felis augue, aliquam dictum
mattis vitae, pretium in massa.

I want it to result in this way:

[entry title 1]
Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Suspendisse blandit
ipsum vel elit ultrices pharetra rhoncus tellus aliquam.  Donec quis dolor ac
elit vestibulum rhoncus. Quisque adipiscing dolor vitae urna molestie in
vulputate arcu mattis. Donec felis augue, aliquam dictum mattis vitae, pretium
in massa.

Any ideas?

(I've been reading 'formatoptions' and fo-table but could not find anything of related to custom paragraph settings.)

Thanks.

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

No comments: