From owner-freebsd-questions@FreeBSD.ORG Sat Feb 21 14:50:25 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 A774A1065673 for ; Sat, 21 Feb 2009 14:50:25 +0000 (UTC) (envelope-from af300wsm@gmail.com) Received: from rv-out-0304.google.com (rv-out-0304.google.com [209.85.198.221]) by mx1.freebsd.org (Postfix) with ESMTP id 873168FC20 for ; Sat, 21 Feb 2009 14:50:25 +0000 (UTC) (envelope-from af300wsm@gmail.com) Received: by rv-out-0304.google.com with SMTP id c6so667478rvf.31 for ; Sat, 21 Feb 2009 06:50:25 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <57200BF94E69E54880C9BB1AF714BBCB5DE58B@w2003s01.double-l.local> Received: by 10.114.185.8 with SMTP id i8mr342270waf.6.1235227825235; Sat, 21 Feb 2009 06:50:25 -0800 (PST) Message-ID: <00163646d5f0bd6c9004636ee3e1@google.com> Date: Sat, 21 Feb 2009 14:50:25 +0000 From: af300wsm@gmail.com To: Johan Hendriks , Doug Poland , freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Re: 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: Sat, 21 Feb 2009 14:50:26 -0000 On Feb 20, 2009 7:56am, Johan Hendriks wrote: > >> 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 all for the fast and usefull response. > Regards, > Johan Hendriks As if you haven't already gotten enough help and such, I'd like to give you another alternative that will be handy in the future too. Please note however that this only applies if you're using VIM. 1) Place your cursor on top of the first character you want to put the comment in front of (in your example, which I left above, that would on top of the 'd' in "define") 2) Hit Ctrl-v (this places the editor in visual mode) 3) Hit 'j', or use the down arrows, until your highlighted section is on top of the last character you want the comment in front of (in your example, it is the closing '}') 4) Hit Shift-I 5) Type a single '#' 6) Hit escape After hitting escape, you'll have a new column of '#' characters in front of every character in that vertical column. Also, one of your first respondents mentioned a mailing list at vim.org (I believe, going off memory), you can also get great vi/vim advice from comp.editors. They discuss all kinds of editors there, but the group is mainly vi dominated. Hope this helps, Andy