From owner-freebsd-questions Wed Nov 1 12:20:32 2000 Delivered-To: freebsd-questions@freebsd.org Received: from relay.intercom.es (relay.intercom.es [212.66.160.20]) by hub.freebsd.org (Postfix) with ESMTP id 07F4737B4E5 for ; Wed, 1 Nov 2000 12:20:29 -0800 (PST) Received: from lix.intercom.es (root@lix.intercom.es [212.66.160.2]) by relay.intercom.es (8.9.3/8.9.3) with ESMTP id UAA19022; Wed, 1 Nov 2000 20:09:08 +0100 Received: from intercom.es (iv2-201.intercom.es [212.66.169.201]) by lix.intercom.es (8.9.3/8.9.3) with ESMTP id VAA02693; Wed, 1 Nov 2000 21:17:20 +0100 Received: (from megarcia@localhost) by intercom.es (8.11.0/8.11.0) id eA1KLJm01782; Wed, 1 Nov 2000 21:21:19 +0100 (CET) (envelope-from megarcia) Date: Wed, 1 Nov 2000 21:21:19 +0100 From: Manuel Enrique Garcia Cuesta To: 8773836928@skytel.com Cc: freebsd-questions@FreeBSD.ORG Subject: Re: vi question Message-ID: <20001101212119.C748@ilex.kicelo.org> Mail-Followup-To: 8773836928@skytel.com, freebsd-questions@FreeBSD.ORG References: <200011014727.589586540@skytel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Mailer: Mutt 1.0pre2i In-Reply-To: <200011014727.589586540@skytel.com> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi. === 8773836928@skytel.com escribía (Wed, Nov 01, 2000 at 01:47:27PM -0600): > Hello, > > I have been editing some > Perl scripts in vi recently, > and I find it very annoying > that Perl cannot comment > blocks of code, only lines. > > I have been reading the docs in vi, but I can't quite figure out how to do a substitute command that will, say, prepend a # to the next n lines, and later remove the # ( well, the second one I could always use :s and replace the first # with nothing for the next n lines. But the first one is still a mystery to me ). > Move the cursor to the first line of the block, then type :.,+5s/^/#/ and you have commented out the current line and the five next. Something in that line to remove the #s. > Any insight would be greatly appreciated. > > Thanks! HTH Manuel Garcia P.S.: Please please please make your lines shorter, like 72 or so. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message