Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Oct 2003 16:58:02 -0700
From:      Bill Campbell <freebsd@celestial.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: vi and wrap text
Message-ID:  <20031008235802.GA59370@alexis.mi.celestial.com>
In-Reply-To: <20031008235513.GB568@moo.holy.cow>
References:  <20031008062245.7ea8c9b1.b_cassidy@bellsouth.net> <1665244909.20031008101914@mygirlfriday.info> <20031008170340.GA42240@alexis.mi.celestial.com> <20031008235513.GB568@moo.holy.cow>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Oct 08, 2003, parv wrote:
>in message <20031008170340.GA42240@alexis.mi.celestial.com>, wrote
>Bill Campbell thusly...
>>
>> Another one I use a lot in my ~.vimrc file is ``map <F5> {!}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  <Esc>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, '<Esc>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:   bill@Celestial.COM  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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031008235802.GA59370>