VS Code extension for toggling block comments in Lua and GLua (Garry's Mod) files.
Features
- Toggle block comments with a single keyboard shortcut
- Uses Lua multi-line comment syntax:
--[[ ... --]]
- Works with Lua and GLua files (sv_, cl_, sh_*)
- Smart detection: automatically comments or uncomments selected code
Usage
- Select one or more lines of Lua code
- Press
Ctrl+Shift+/
- Selected code will be wrapped in block comment:
Before:
print(1)
print(2)
print(3)
After:
--[[
print(1)
print(2)
print(3)
--]]
Press Ctrl+Shift+/ again to remove the block comment.
Keybinding
| Command |
Shortcut |
| Toggle Block Comment |
Ctrl+Shift+/ |
Requirements
- Works only with
.lua files
- Requires text selection (does nothing without selection)
GLua Compatibility
This extension is designed for Garry's Mod Lua development:
- Compatible with GLua syntax
- No Lua 5.4 specific features
- Works with all GMod file conventions (sv_, cl_, sh_)
Commands
lua.toggleBlockComment - Toggle Lua Block Comment
License
MIT
| |