vim command to restructure/force text to 80 columns

I know there are ways to automatically set the width of text in vim using set textwidth (like Vim 80 column layout concerns). What I am looking for is something similar to = (the indent line command) but to wrap to 80. The use case is sometimes you edit text with textwidth and after joining lines or deleting/adding text it comes out poorly wrapped.

Ideally, this command would completely reorganize the lines I select and chop off long lines while adding to short ones. An example:

long line is long!  
short

After running the command (assuming the wrap was 13 cols):

long line is  
long! short

If this isn’t possible with a true vim command, perhaps there is a command-line program which does this that I can pipe the input to?

After searching I found this reference which has some more options: http://www.cs.swarthmore.edu/help/vim/reformatting.html

6 Answers
6

Leave a Comment