A lightweight and smart Visual Studio Code extension that automatically inserts closing HTML-like tags and CSS/SCSS/LESS code blocks.
- Automatically inserts closing tags when typing
>
after an opening tag. - Cursor is placed between the opening and closing tag.
- Works with:
- HTML
- Vue
- Astro
- React (JSX/TSX)
- Skips self-closing tags like
<img />
,<input />
, etc. - Skips custom tags specified in settings.
- Automatically inserts closing
}
with proper indentation after typing{
. - Cursor is placed inside the block:
.selector { | ← cursor here }
- Command Palette:
Insert Closing Tag
- Keybinding:
Ctrl + Alt + .
You can customize excluded tags in your settings.json
:
"autoCloseTags.excludedTags": [
"MyComponent",
"Fragment"
]
Language | Tag Auto-Close | Brace Auto-Close |
---|---|---|
HTML | ✅ | ❌ |
Vue | ✅ | ❌ |
Astro | ✅ | ❌ |
JavaScript (JSX) | ✅ | ❌ |
TypeScript (TSX) | ✅ | ❌ |
CSS | ❌ | ✅ |
SCSS | ❌ | ✅ |
LESS | ❌ | ✅ |
- Open any supported file (e.g.
.html
,.jsx
,.css
, etc.). - Type an opening tag like
<div>
→ closing</div>
is inserted automatically. - Type
{
in a.css/.scss/.less
file → block with closing brace is inserted.
- Clone this repo
- Run
vsce package
(requiresvsce
) - Install
.vsix
file via VS Code:
Extensions → ... → Install from VSIX...
Pull requests and suggestions are welcome!
MIT