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 on Overleaf 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
\usepackage{comment}
to your preamble, and then use
\begin{comment}
...
\end{comment}
in the text to create a block comment.