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

This question is really more germane to a VIm mail list ( , but I'll tell you how'd I'd do it.

First, turn on line numbers --

   :set nu

The you'd see something like --

 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   }

Then replace the beginning of a line with a # symbol --


That's all there is too it.  BTW, VIm help is your friend

   :help replace

_______________________________________________ mailing list
To unsubscribe, send any mail to ""

Reply via email to