Quantcast
Channel: vim command to restructure/force text to 80 columns - Stack Overflow
Viewing all articles
Browse latest Browse all 7

vim command to restructure/force text to 80 columns

$
0
0

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


Viewing all articles
Browse latest Browse all 7

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>