[CALUG] text edit- flow wrap at set # chars

John Alan Hastings jah1066 at aol.com
Wed Dec 21 20:30:44 EST 2011

Another utility that can do it is fold:

    $ fold --spaces --width=60

The --spaces option tells it to break at spaces rather than a fixed
column or byte count (which it can also do).

You can do it from within vi as well:

    :%! fold -s -w 60

And of course you can do it over parts of a file as well.


Walt Smith wrote:
> hi,
> I want to do a simple text wrap at 60 chars per line
> in google groups mail compose.
> The google groups compose window gives a very long line
> that one can type in, but after a post, I see it automatically
> moves end-of line words to the next line in display.  Apparently,
> it's 60 chars.  Don't know if thats a user set option
> or not.  Haven't used it enough.  I like shorter lines and
> don't want to type the whole dang document letting google
> flow all of it.  I want to set my own width.
> In any event, I'd  like to cut the entire text and paste it
> into an editor and allow the editor  to flow all the text
> with a preset 60 char max width ( or other width).
> I've needed this  feature for other docs when pasting in
> yahoo, or  transferring from a simple gedit.
> Preferrably, I'd like to do it in gedit, abiword, or OO.
> Or some other popular/distro supplied editor...
> gedit or abiword won't seem to be able to do it.
> I can't find a setting or setup in OO to do it, as I would
> expect OO to do it.
> How about another text editor ?  Prefer to use common guii's.
> I don't mind editors like nano or pico but prefer not to
> script or use long control sequences in vi.  
> thx,
> Walt . . . . 
> (FYI: crosspost- I also put this on the google maillist for
> unallocatedspace)
> There's a shortage of technical workers for jobs that don't exist yet.
> _______________________________________________
> CALUG mailing list
> CALUG at unknownlamer.org
> http://lists.unknownlamer.org/listinfo/calug

| The single biggest problem in communication is the illusion
| that it has taken place.
|                 -- George Bernard Shaw
Alan Hastings
jah1066 at aol.com
GnuPG/PGP Public key, 2011: 031FB886

More information about the CALUG mailing list