Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] single-line comment request
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Samuel Lacas <Samuel.Lacas@t...>
Subject: Re: [Caml-list] single-line comment request
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 <C-C> :s/^.*$/(* & *)/<CR>

maps (Control-C) (which is the meaning of "<C-c>") in normal mode
(thus the "nmap") to a readable regexp substitution.
This comments the whole line.

mapping another key to :s/(\* \| \*)//g<CR> 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