Re: vi and wrap text
in message <[EMAIL PROTECTED]>, wrote Bill Campbell thusly... > > I also have a locally written version of fmt that will take > a ``-q'' option to handle e- mail quoted text that removes the > quotes, reformats, then puts a single level of quotes back on I hear par(1) can out do both fmt(1) & vim's wrapping functions. After installing it once, had not the time to pour over its (massive) documentation. So i personally have not used it, but i think it will/should fit you. > (nothing nearly as neat as Damian Conway's perl modules for > formatting, but I've never gotten my head around them :-). Quite a while ago, i had tried Text::Autoformat for a brief period, right inside a procmail recipe (to wrap the e-mail message bodies of those who do not), but it mangled the quoted text very badly of just about every message. (IIRC, in this context i became aware of par by the way.) Text::Autoformat does work quite good on regular text (non e-mail like text). - Parv -- ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: vi and wrap text
On Wed, Oct 08, 2003, parv wrote: >in message <[EMAIL PROTECTED]>, wrote >Bill Campbell thusly... >> >> Another one I use a lot in my ~.vimrc file is ``map {!}fmt'' > >So you add other arguments to pass to fmt (for carriage-return >character is missing).(?) I press ENTER manually just in case I change my mind. I also have a locally written version of fmt that will take a ``-q'' option to handle e- mail quoted text that removes the quotes, reformats, then puts a single level of quotes back on (nothing nearly as neat as Damian Conway's perl modules for formatting, but I've never gotten my head around them :-). > >> which rewraps the current paragraph the cursor is in when I press >> the F5 key. > >Do you find vim's internal wrapping functions to be inadequate? >Just curious. No, but often I hack the text enough so that it's got the jaggies, and this is a quick way to clean it up. >In my case, "gq*" commands work just fine except when it comes to >putting each line, of a text block, in center. Then i use... > > " center block with in 68 columns > nmap E !}/usr/bin/fmt -c -68 > > >> This maps the key sequence ``{!}fmt'' to the F5 key ``{'' top of >> paragraph, ``!'' execute command ``}'' to bottom of paragraph, >> ``fmt'' the command to execute. > >For anybody else who is still reading, 'E' works as described >above except the formatting point is the line containing the current >position of the cursor. The formatting commands of vi/vim are truly amazing, and I frequently learn new tricks after 20+ years of vi use. Bill -- INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC UUCP: camco!bill PO Box 820; 6641 E. Mercer Way FAX:(206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676 URL: http://www.celestial.com/ ``Anyone who thinks Microsoft never does anything truly innovative isn't paying attention to the part of the company that pushes the state of its art: Microsoft's legal department.'' --Ed Foster, InfoWorld Gripe Line columnist ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: vi and wrap text
in message <[EMAIL PROTECTED]>, wrote Bill Campbell thusly... > > Another one I use a lot in my ~.vimrc file is ``map {!}fmt'' So you add other arguments to pass to fmt (for carriage-return character is missing).(?) > which rewraps the current paragraph the cursor is in when I press > the F5 key. Do you find vim's internal wrapping functions to be inadequate? Just curious. In my case, "gq*" commands work just fine except when it comes to putting each line, of a text block, in center. Then i use... " center block with in 68 columns nmap E !}/usr/bin/fmt -c -68 > This maps the key sequence ``{!}fmt'' to the F5 key ``{'' top of > paragraph, ``!'' execute command ``}'' to bottom of paragraph, > ``fmt'' the command to execute. For anybody else who is still reading, 'E' works as described above except the formatting point is the line containing the current position of the cursor. - Parv -- ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: vi and wrap text
On Wed, Oct 08, 2003, "Gary Hi Bryan, > >On Wednesday, October 8, 2003, 6:22:45 AM, you wrote: > >B> I want to know is there a way to wrap the text in vi? In emacs you can >B> just hit Esc+q and it will wrap the text. How about vi? >I don't know any in VI, but if you install the VIM package, to wrap text, >you can just hit esc gqip and it is done.. Adding ``set wm=15'' to your ~/.exrc or ~.vimrc file will cause vi or vim to automatically wrap margins 15 characters to the left of the right margin. ``set wm=0'' turns off automatic wrapping. Another one I use a lot in my ~.vimrc file is ``map {!}fmt'' which rewraps the current paragraph the cursor is in when I press the F5 key. This maps the key sequence ``{!}fmt'' to the F5 key ``{'' top of paragraph, ``!'' execute command ``}'' to bottom of paragraph, ``fmt'' the command to execute. Bill -- INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC UUCP: camco!bill PO Box 820; 6641 E. Mercer Way FAX:(206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676 URL: http://www.celestial.com/ ``Are we at last brought to such a humiliating and debasing degradation, that we cannot be trusted with arms for our own defense? Where is the difference between having our arms in our own possession and under our own direction, and having them under the management of Congress? If our defense be the real object of having those arms, in whose hands can they be trusted with more propriety, or equal safety to us, as in our own hands?'' -- Patrick Henry June 9, 1788, in the Virginia Convention on the ratification of the Constitution. ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: vi and wrap text
Hi Bryan, On Wednesday, October 8, 2003, 10:30:50 AM, you wrote: B> Thanks for all the replies. I'm gonna read up on some of the B> things everyone told me but in the mean time I think I'm gonna B> take garys advise and try vim. It works great, and you can alias it in your shell .rc file, so vi=vim B> On Wed, 8 Oct 2003 10:19:14 -0500 "Gary B> > Hi Bryan, > > On Wednesday, October 8, 2003, 6:22:45 AM, you wrote: >> > B> I want to know is there a way to wrap the text B> in vi? In emacs you can > B> just hit Esc+q and it will wrap B> the text. How about vi? > > I don't know any in VI, but if B> you install the VIM package, to wrap text, > you can just hit B> esc gqip and it is done.. > > -- > Gary > > Life is what B> happens to you when you're making other plans. > > BTW, if you use vim as your email text editor, it will eliminate the above problem and automatically reformat the >> for you.. -- Gary Try to relax and enjoy the crisis. ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: vi and wrap text
Thanks for all the replies. I'm gonna read up on some of the things everyone told me but in the mean time I think I'm gonna take garys advise and try vim. On Wed, 8 Oct 2003 10:19:14 -0500 "Gary Hi Bryan, > > On Wednesday, October 8, 2003, 6:22:45 AM, you wrote: > > B> I want to know is there a way to wrap the text in vi? In emacs you can > B> just hit Esc+q and it will wrap the text. How about vi? > > I don't know any in VI, but if you install the VIM package, to wrap text, > you can just hit esc gqip and it is done.. > > -- > Gary > > Life is what happens to you when you're making other plans. > > ___ > [EMAIL PROTECTED] mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "[EMAIL PROTECTED]" ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: vi and wrap text
Hi Bryan, On Wednesday, October 8, 2003, 6:22:45 AM, you wrote: B> I want to know is there a way to wrap the text in vi? In emacs you can B> just hit Esc+q and it will wrap the text. How about vi? I don't know any in VI, but if you install the VIM package, to wrap text, you can just hit esc gqip and it is done.. -- Gary Life is what happens to you when you're making other plans. ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: vi and wrap text
On Wed, 8 Oct 2003 06:22:45 -0500 Bryan Cassidy <[EMAIL PROTECTED]> wrote: > I want to know is there a way to wrap the text in vi? In emacs you can > just hit Esc+q and it will wrap the text. How about vi? I dont use emacs, but isn't Esc+q the command to rewrap text? I'm not aware of any such command in vi but instead you can invoke the external command fmt. To rewrap the whole text to 60 columns: :%!fmt 60 To rewrap the text between lines 50 to 100: :50,100!fmt 60 You can of course also set markers, say a and b, and then :'a,'b!fmt 60 Check man fmt! It is capable of doing other things you might find useful, like centering a piece of text. (Hint: other useful external commands that can be used to extend vi in this way includes expand, unexpand and awk, especially awk is very powerful for advanced text processing. You can also write your own shellscripts and programs, the possibilites are almost unlimited.) ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: vi and wrap text
On Wed, Oct 08, 2003 at 06:22:45AM -0500, Bryan Cassidy wrote: > I want to know is there a way to wrap the text in vi? In emacs you can > just hit Esc+q and it will wrap the text. How about vi? > ___ > [EMAIL PROTECTED] mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "[EMAIL PROTECTED]" > end of the original message From vi(1) manpage : [...] wraplen, wl [0] Vi only. Break lines automatically, the specified number of columns from the left-hand margin. If both the wraplen and wrapmargin edit options are set, the wrapmargin value is used. wrapmargin, wm [0] Vi only. Break lines automatically, the specified number of columns from the right-hand margin. If both the wraplen and wrapmargin edit options are set, the wrapmargin value is used. wrapscan, ws [on] Set searches to wrap around the end or beginning of the file. [...] So, for example, the command ':set wl=72' will wrap lines at 72 characters. Francesco Casadei -- You can download my public key from http://digilander.libero.it/fcasadei/ or retrieve it from a keyserver (pgpkeys.mit.edu, wwwkeys.pgp.net, ...) Key fingerprint is: 1671 9A23 ACB4 520A E7EE 00B0 7EC3 375F 164E B17B pgp0.pgp Description: PGP signature
vi and wrap text
I want to know is there a way to wrap the text in vi? In emacs you can just hit Esc+q and it will wrap the text. How about vi? ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"