[Gllug] formatting a paragraph in vi(m)

Warwick Harvey warwick.harvey at btinternet.com
Thu Jul 26 22:25:45 UTC 2001


"Stig Brautaset" <stig at brautaset.org> wrote:
> Is it possible in vi(m) to stand in a paragraph with bad formatting
> (e.g. you just have added/deleted text in the middle of a paragraph)
> and use some function similar to M-q in Emacs(*)?

I have keys mapped to the sequences "gq}" and "gqj" --- the first reformats
to the end of the paragraph, the second reformats just to the next line
(which can be done multiple times until you reach the line you want to stop
formatting at).

Note that there is a lot you can do to control how the formatting works.
See the docs about, e.g. the `formatoptions' settings, and for controlling
paragraph prefixes (e.g. for comments or quoting or whatever), see the
`comment' option.

Cheers,
Warwick


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list