Is there a shortcut for commenting out several lines of code at once?

Yes, you can comment out several lines at once by selecting them and pressing Ctrl-/ (slash) (command-/ on a Mac).

If you're familiar with vi or vim editors, you can also enable vi editor mode in writeLaTeX and use the standard vi commands for commenting.

Finally, if you'd like to add a block comment in the source you can also use the comment package to comment out large sections of text. Just add


to your preamble, and then use


in the text to create a block comment.