From owner-freebsd-questions@FreeBSD.ORG Wed Oct 8 10:03:42 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 74B4916A4B3 for ; Wed, 8 Oct 2003 10:03:42 -0700 (PDT) Received: from mail.mi.celestial.com (dagney.celestial.com [192.136.111.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id C3DD843F85 for ; Wed, 8 Oct 2003 10:03:41 -0700 (PDT) (envelope-from bill@celestial.com) Received: by mail.mi.celestial.com (Postfix, from userid 203) id EEE8211EB0F; Wed, 8 Oct 2003 10:03:40 -0700 (PDT) Date: Wed, 8 Oct 2003 10:03:40 -0700 From: Bill Campbell To: freebsd-questions@freebsd.org Message-ID: <20031008170340.GA42240@alexis.mi.celestial.com> Mail-Followup-To: freebsd-questions@freebsd.org References: <20031008062245.7ea8c9b1.b_cassidy@bellsouth.net> <1665244909.20031008101914@mygirlfriday.info> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1665244909.20031008101914@mygirlfriday.info> User-Agent: Mutt/1.4.1i Subject: Re: vi and wrap text X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: freebsd@celestial.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Oct 2003 17:03:42 -0000 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: 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.