From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA14919; Tue, 8 Apr 2003 17:45:53 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA15053 for ; Tue, 8 Apr 2003 17:45:52 +0200 (MET DST) Received: from mailhost.trusted-logic.fr (mailhost.trusted-logic.fr [194.250.150.5]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h38FjlX23277 for ; Tue, 8 Apr 2003 17:45:51 +0200 (MET DST) Received: from ouessant.trusted-logic.fr (ouessant.trusted-logic.fr [192.168.1.201]) by mailhost.trusted-logic.fr (Postfix) with ESMTP id 78810F8198 for ; Tue, 8 Apr 2003 17:45:46 +0200 (CEST) Received: (from lacas@localhost) by ouessant.trusted-logic.fr (8.9.3/8.9.3) id RAA06512 for caml-list@inria.fr; Tue, 8 Apr 2003 17:45:46 +0200 Date: Tue, 8 Apr 2003 17:45:46 +0200 From: Samuel Lacas To: caml-list@inria.fr Subject: Re: [Caml-list] single-line comment request Message-ID: <20030408174546.B3382@ouessant.trusted-logic.fr> References: <200304081756.05304.snob@snob.spb.ru> <20030408172805.164bcf63.Damien.Pous@ens-lyon.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Mailer: Mutt 1.0pre3us In-Reply-To: <20030408172805.164bcf63.Damien.Pous@ens-lyon.fr> X-Send-From: ouessant.trusted-logic.fr X-Operating-System: Linux ouessant.trusted-logic.fr 2.2.19 X-Spam: no; 0.00; samuel:01 lacas:01 caml-list:01 damien:01 c-c:01 uncomment:01 toggle:01 regexp:01 ecrit:01 lisp:01 vim:01 readable:01 emacs:01 suppose:03 08,:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Damien a écrit 0.7K le Tue, Apr 08, 2003 at 05:28:05PM +0200: # maybe some emacs/vi guru could write a shortcut that [un]comment a # single line... # I am not used to Lisp, but I guess it shouldn't be difficult. Well, I suppose I'm now a VIM guru :) nmap :s/^.*$/(* & *)/ maps (Control-C) (which is the meaning of "") in normal mode (thus the "nmap") to a readable regexp substitution. This comments the whole line. mapping another key to :s/(\* \| \*)//g uncomment the line. If one wants to have the same key to toggle the comment/uncomment, or comment from the cursor's position up to the end of the line, it will cost you more... sL ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners