Creating a Multiline Comment in the GitHub Web Editor #133557
joshjohanning
started this conversation in
Discover
Replies: 3 comments 1 reply
-
thanks for useful information |
Beta Was this translation helpful? Give feedback.
1 reply
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Introduction
I'm embarrassed to say that every time I was editing a GitHub Actions workflow file in GitHub's web editor, and if I needed to make a multiline comment, I either:
#
to each line manually (painful!).
shortcut and created the multiline comment thereI knew one way to create a multiline comment in VS Code (and the github.dev web-based editor) was (
Cmd ⌘
+k
,Cmd ⌘
+c
), but I didn't know how to do it in the GitHub web editor, or if it was even possible.Well, TIL!
The Shortcut
That shortcut is simply
Cmd ⌘
+/
on macOS (orCtrl
+/
on Windows). It's that easy! This comments and uncomments the selected lines.It seems as if
Cmd ⌘
+/
is a standard keyboard shortcut for commenting/uncommenting in many editors, including VS Code, Atom, and Sublime Text. I'm probably just used toCmd ⌘
+k
,Cmd ⌘
+c
from my Visual Studio days.This works for GitHub Actions workflow files, of course, but I found it also works when editing other code-based files such as JavaScript, Go, Python, C#, Java, Ruby, and I'm sure many others.
Happy editing! 🚀
Beta Was this translation helpful? Give feedback.
All reactions