Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Feb 2009 15:56:14 +0100
From:      "Johan Hendriks" <Johan@double-l.nl>
To:        "Doug Poland" <doug@polands.org>
Cc:        freebsd-questions@freebsd.org
Subject:   RE: vi set comment #
Message-ID:  <57200BF94E69E54880C9BB1AF714BBCB5DE58B@w2003s01.double-l.local>
References:  <57200BF94E69E54880C9BB1AF714BBCB5DE58A@w2003s01.double-l.local> <499EC3BE.7020105@polands.org>

next in thread | previous in thread | raw e-mail | index | archive | help
>> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?57200BF94E69E54880C9BB1AF714BBCB5DE58B>