Date: Wed, 8 Oct 2003 10:03:40 -0700 From: Bill Campbell <freebsd@celestial.com> To: freebsd-questions@freebsd.org Subject: Re: vi and wrap text Message-ID: <20031008170340.GA42240@alexis.mi.celestial.com> In-Reply-To: <1665244909.20031008101914@mygirlfriday.info> References: <20031008062245.7ea8c9b1.b_cassidy@bellsouth.net> <1665244909.20031008101914@mygirlfriday.info>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Oct 08, 2003, "Gary <gv-list-freebsdquestions"@mygirlfriday.info wrote: >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 <F5> {!}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: 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/ ``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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031008170340.GA42240>