Vim Tips Wiki
(Change to TipImported template + severe manual clean)
(Move categories to tip template)
Line 9: Line 9:
 
|version=6.0
 
|version=6.0
 
|rating=15/6
 
|rating=15/6
  +
|category1=
  +
|category2=
 
}}
 
}}
 
You want to format/wrap long lines, but not touch shorter lines.
 
You want to format/wrap long lines, but not touch shorter lines.

Revision as of 09:05, 25 April 2008

Tip 1131 Printable Monobook Previous Next

created February 15, 2006 · complexity basic · author Anon · version 6.0


You want to format/wrap long lines, but not touch shorter lines.

Example: For each line longer than 80 chars, run that line thru the par text formatter.

:g/.\{80,\}/ .!par w70

This need arises when you cut/paste a programming snippet from your web browser into Vim, and you want to leave the indented code alone, but format the long explanation.

See VimTip584, on the capabilities of par.

Comments

How is this better than gq with a line width of 80?