Visual Studio Style Hotkeys for Block Comment/Uncomment Code

Since I write terrible code this is the Visual Studio hotkey I miss the most in the ROBLOX Lua editor.

With a block of code selected Ctrl+K+C will comment out the entire block.

Ctrl+K+U will remove one level of comments from the selected block

Kind of funky choice of hotkeys but I think they exhausted the namespace for simpler combos and it becomes second nature over time.

This would be especially nice since the block comment notation in Lua is so funky I have to look it up every time.

Ctrl+Shift+C to toggle already exists (and is really useful). Each and every program seems to invent another hotkey for doing this though :stuck_out_tongue: .

3 Likes

Wow! Lua tip of the day!

That’s awesome!

:slight_smile::grinning::123:

1 Like

That’s half of what he asked for, the other one isn’t currently a feature on ROBLOX.

Also you can change your hotkey for commenting by going to File > Advanced > Customize Shortcuts and search for “Toggle Comment Selection” and change it from there. I use CMD (CTRL) + / for commenting, since that’s what Sublime Text 3 uses.

Ctrl + Shift + C toggles it.

Having one key combo to toggle is arguably better than having two key combos since double nesting comments isn’t a common use case. I mean. My code isn’t that bad.

Oh that’s pretty cool.

I think other editors do this too, but I love Sublime Text’s comment feature. You just kinda highlight parts of each line you want to comment out and do ctrl+/

1 Like

I made a similar post about shortcuts I miss (from Eclipse) 2 years ago, that just so happened to get a response on it today as well. Not sure if that’s a coincidence or related to this. Here’s the post: