From: Ken Bloom Date: 2006-08-15T08:50:03+09:00 Subject: Re: block commenting-out On Mon, 14 Aug 2006 14:05:11 +0000, Jeffrey Schwab wrote: > newyorkdolluk wrote: > >> can anyone tell me how to bulk comment-out lines of code rather than >> #'ing each line? > > I don't think there's a multi-line comment character, although I'm sure > someone on this list will come up with a neat hack. At the very least, > you could embed the code in a string: > > def begin_comment(s) > # Ignore it. It's a comment. > end > > begin_comment < This is a string that's actually serving > as a multi-line comment. > end_comment > > If you're using vim, though: > > Go to the beginning of the first line to be commented. > Hit ^V to begin block selection. > Use j to get down to the last line to be commented. > Enter capital I to begin inserting. > Enter #, since it's the Ruby comment character. > Hit Esc. If you're going to take this approach (and =begin =end is probably better) then there's no need to define a method. simply use a heredoc that won't get used: <