From owner-freebsd-questions@FreeBSD.ORG Fri Feb 20 15:31:44 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 048D7106564A for ; Fri, 20 Feb 2009 15:31:44 +0000 (UTC) (envelope-from r.rajamani@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.239]) by mx1.freebsd.org (Postfix) with ESMTP id CDF2B8FC16 for ; Fri, 20 Feb 2009 15:31:43 +0000 (UTC) (envelope-from r.rajamani@gmail.com) Received: by rv-out-0506.google.com with SMTP id g9so891309rvb.3 for ; Fri, 20 Feb 2009 07:31:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=9VvNa2hbklAY3E16DMS80m2vqWLV8IrXnrxqEqRMsPA=; b=kTCUMcgH0EAbwRsyGDNKEh7Ps1KtawQyPPGJd36wnY9J23XyTpmiO0BLoEH4z2MV9I bkk0f1QqJPUtGBxL8RN4+jIwyWGM6gn9gKBBvKNBW1D9X1uGRqvfkL88G4OsyhDzhtf/ qMEvs2TN9qvPpCc+E7JaQdP1S/+haUPxSRpHA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=oF3UiXjbmlSp5EOypQTWG+lrzKs/GGpt5MQW5a0i7SHc5V62qLnqS+LZYvBB/kkKsr GbiXBahRqKl+Pfd3+y6Lbv2W9iMDG5ASptjyh43WASATKa+ywwgDHUxz8aPUBTVB+d/A BVixUXlvQsJwtk8v7M9KuOrgjDGuvWHvkqKVo= MIME-Version: 1.0 Received: by 10.143.5.21 with SMTP id h21mr449123wfi.180.1235142005768; Fri, 20 Feb 2009 07:00:05 -0800 (PST) In-Reply-To: <499EC3BE.7020105@polands.org> References: <57200BF94E69E54880C9BB1AF714BBCB5DE58A@w2003s01.double-l.local> <499EC3BE.7020105@polands.org> Date: Fri, 20 Feb 2009 10:00:05 -0500 Message-ID: <4af955a20902200700q21fedab4w764c5f114279052b@mail.gmail.com> From: Rajarajan Rajamani To: Johan@double-l.nl, freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: 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 15:31:44 -0000 On Fri, Feb 20, 2009 at 9:52 AM, Doug Poland wrote: > Johan Hendriks wrote: >> >> How can i in vi set a # on multiple Lines to comment out some text. >> >> I know it must be a simple thing but i can not seem to get it right. >> >> Like in a config file i have the following >> >> define service{ >> use generic-service >> host_name w2003hk03 >> service_description Explorer >> check_command check_nt!PROCSTATE!-d SHOWALL -l >> Explorer.exe >> } >> >> And now i want to set a # to all the 6 lines. >> >> Thanks for your time >> Regards, >> Johan > >> > > This question is really more germane to a VIm mail list > (http://www.vim.org/) , but I'll tell you how'd I'd do it. > > First, turn on line numbers -- > > :set nu > > :3,8s/^/#/ > > That's all there is too it. BTW, VIm help is your friend > OR just mark the block visually and then do a :'<,'> s:/^/#/ the '<,'> will appear automatically as soon as you hit : after marking the visual block.