From owner-freebsd-questions@FreeBSD.ORG Fri Feb 20 14:56:19 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0551B1065709 for ; Fri, 20 Feb 2009 14:56:19 +0000 (UTC) (envelope-from Johan@double-l.nl) Received: from smtp-vbr5.xs4all.nl (smtp-vbr5.xs4all.nl [194.109.24.25]) by mx1.freebsd.org (Postfix) with ESMTP id 94C468FC1B for ; Fri, 20 Feb 2009 14:56:18 +0000 (UTC) (envelope-from Johan@double-l.nl) Received: from w2003s01.double-l.local (double-l.xs4all.nl [80.126.205.144]) by smtp-vbr5.xs4all.nl (8.13.8/8.13.8) with ESMTP id n1KEuGYM090327; Fri, 20 Feb 2009 15:56:16 +0100 (CET) (envelope-from Johan@double-l.nl) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1250" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.5 Date: Fri, 20 Feb 2009 15:56:14 +0100 Message-ID: <57200BF94E69E54880C9BB1AF714BBCB5DE58B@w2003s01.double-l.local> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: vi set comment # Thread-Index: AcmTa2C5rPW4Fk/dQiO0+MHQcXYNowAAGHig References: <57200BF94E69E54880C9BB1AF714BBCB5DE58A@w2003s01.double-l.local> <499EC3BE.7020105@polands.org> From: "Johan Hendriks" To: "Doug Poland" X-Virus-Scanned: by XS4ALL Virus Scanner Cc: freebsd-questions@freebsd.org Subject: RE: vi set comment # X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 14:56:19 -0000 >> How can i in vi set a # on multiple Lines to comment out some text. >>=20 >> I know it must be a simple thing but i can not seem to get it right. >>=20 >> Like in a config file i have the following >>=20 >> define service{ >> use generic-service >> host_name w2003hk03 >> service_description Explorer >> check_command check_nt!PROCSTATE!-d SHOWALL -l = Explorer.exe >> } >>=20 >> And now i want to set a # to all the 6 lines. >>=20 >> Thanks for your time >> Regards, >> Johan=20 >> >This question is really more germane to a VIm mail list=20 >(http://www.vim.org/) , but I'll tell you how'd I'd do it. >First, turn on line numbers -- > > :set nu > >The you'd see something like -- > > 1 > 2 > 3 define service{ > 4 use generic-service > 5 host_name w2003hk03 > 6 service_description Explorer > 7 check_command check_nt!PROCSTATE!-d SHOWALL -l > 8 } > 9 > 10 > >Then replace the beginning of a line with a # symbol -- > > :3,8s/^/#/ > >That's all there is too it. BTW, VIm help is your friend > > :help replace > > >-- >Regards, >Doug Thanks all for the fast and usefull response. Regards, Johan Hendriks No virus found in this outgoing message. Checked by AVG - www.avg.com=20 Version: 8.0.237 / Virus Database: 270.11.1/1962 - Release Date: = 02/20/09 07:26:00