[plug] vim and paragraphs
Anthony J. Breeds-Taurima
tony at cantech.net.au
Tue Aug 27 14:26:54 WST 2002
On Tue, 27 Aug 2002, Craig Ringer wrote:
> Colin Muller wrote:
> > On Tue, Aug 27, 2002 at 12:02:17PM +0800, Russell Steicke wrote:
> >
> >>Can someone please tell me how to justify a paragraph using vim? I
> >>keep starting it to edit small text documents, changing a couple of
> >>words, and ending up having to hand-edit all the lines in a
> >>paragraph to make it look pretty again.
> >
> >
> > :gq
>
> Interesting. While ":help gq" gets me info on the gq command, vim
> doesn't seem to actually accept it
>
> "Not an editor command: gq"
It's not ":gq" it's just "gq", and you need to specify some form of motion.
"gqq" will nicely format the current line.
"gq}" will nicely format the current para.
Open a borning text document and 'J' all the lines into one big line, then
gqq it You should see a formatted para.
now undo that. Insert a '> ' at the front of the line "gqq" it, Hmmm no more
anoying >80 char lines to deal with.
It's all good.
I'm on sid vim 6.1.152-1
Yours Tony
Jan 22-25 2003 Linux.Conf.AU http://linux.conf.au/
The Australian Linux Technical Conference!
More information about the plug
mailing list