• Stars
    star
    169
  • Rank 217,357 (Top 5 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 8 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Auto Close Tag for Visual Studio Code

Auto Close Tag

Marketplace Version Installs Rating Build Status

Automatically add HTML/XML close tag, same as Visual Studio IDE or Sublime Text does.

Sponsors

Tabnine
Increase your coding productivity with Tabnine’s AI code completions! Tabnine is a free powerful Artificial Intelligence assistant designed to help you code faster, reduce mistakes, and discover best coding practices - without ever leaving the comfort of VS Code.
Tabnine is trusted by more than a million developers worldwide. Get it now.


Eliminate context switching and costly distractions. Create and merge PRs and perform code reviews from inside your IDE while using jump-to-definition, your keybindings, and other IDE favorites.
Learn more

Stepsize
Track and prioritise tech debt and maintenance issues, straight from your IDE. Bookmark code while you work, organise TODOs and share codebase knowledge with your team. Try it out for free today.

Bloop
Bored of trawling through the docs? Get JS and TS code examples from documentation and Open Source right in your IDE. Learn more.

Duckly
Easy pair programming with any IDE. Duckly enables you to talk, share your code in real-time, server and terminal with people using different IDEs. Try it out for free.

Book for VS Code

《Visual Studio Code 权威指南》:带你深入浅出 VS Code!

Book

Note

From VS Code 1.16, it has built-in close tag support for HTML, Handlebars and Razor files. This extension is enabled for other languages like XML, PHP, Vue, JavaScript, TypeScript, JSX, TSX and so on. It is configurable.

Features

  • Automatically add closing tag when you type in the closing bracket of the opening tag
  • After closing tag is inserted, the cursor is between the opening and closing tag
  • Set the tag list that would not be auto closed
  • Automatically close self-closing tag
  • Support auto close tag as Sublime Text 3
  • Use Keyboard Shortcut or Command Palette to add close tag manually

Usages

After typing in the closing bracket of the opening tag, the closing tag will be inserted automatically.

Usage

To add close tag manually, use shortcut Alt+. (Command+Alt+. for Mac), or press F1 and then select/type Close Tag

Usage

Sublime Text 3 Mode

To automatically add close tag when </ is typed (same as Sublime Text 3 does), set the below config as true:

{
    "auto-close-tag.SublimeText3Mode": true
}

The setting is false by default.

Sublime Text 3

Configuration

Use auto-close-tag.enableAutoCloseTag to set whether to insert close tag automatically (it is true by default):

{
    "auto-close-tag.enableAutoCloseTag": true
}

To set whether to close self-closing tag automatically (e.g. type <br, then type /, > will be added automatically) (it is true by default):

{
    "auto-close-tag.enableAutoCloseSelfClosingTag": true
}

Whether to insert a space before the forward slash in a self-closing tag (it is false by default):

{
    "auto-close-tag.insertSpaceBeforeSelfClosingTag": false
}

Add entry into auto-close-tag.activationOnLanguage to set the languages that the extension will be activated. Use ["*"] to activate for all languages. Below are the default settings:

{
    "auto-close-tag.activationOnLanguage": [
        "xml",
        "php",
        "blade",
        "ejs",
        "jinja",
        "javascript",
        "javascriptreact",
        "typescript",
        "typescriptreact",
        "plaintext",
        "markdown",
        "vue",
        "liquid",
        "erb",
        "lang-cfml",
        "cfml",
        "HTML (Eex)"
    ]
}

Note: The setting should be set with language id defined in VS Code. Taking javascript definition as an example, we need to use javascript for .js and .es6, use javascriptreact for .jsx. So, if you want to enable this extension on .js file, you need to add javascript in settings.json.

Alternatively you could also exlude the languages where you don't want the extension to be activated. Below is an example:

{
    "auto-close-tag.disableOnLanguage": [
        "php",
        "python"
    ]
}

You could also set the tag list that would not be auto closed. Below are the default settings for void elements in HTML per W3C spec, and you could overwrite it:

{
    "auto-close-tag.excludedTags": [
        "area",
        "base",
        "br",
        "col",
        "command",
        "embed",
        "hr",
        "img",
        "input",
        "keygen",
        "link",
        "meta",
        "param",
        "source",
        "track",
        "wbr"
    ]
}

auto-close-tag.fullMode: Whether to enable both Visual Studio and Sublime Text mode. (Default is false)

Change Log

See Change Log here

Issues

Submit the issues if you find any bug or have any suggestion.

Contribution

Fork the repo and submit pull requests.

Blog

Visit the blog or the post for more detailed info

More Repositories

1

955.WLB

955 不加班的公司名单 - 工作 955,work–life balance (工作与生活的平衡)
33,386
star
2

vscode-code-runner

Code Runner for Visual Studio Code
TypeScript
2,016
star
3

944.Life

996.ICU 的反向 repo: 944 工作制 - 工作 944,生活为先
976
star
4

awesome-gpt

A curated list of awesome projects and resources related to GPT, ChatGPT, OpenAI, LLM, and more.
873
star
5

awesome-vscode-cn

中文版 Awesome VS Code
778
star
6

vscode-ycy

超越鼓励师 for VS Code
TypeScript
287
star
7

vscode-auto-rename-tag

Automatically rename paired HTML/XML tag
TypeScript
243
star
8

vscode-mysql

MySQL management tool for Visual Studio Code
TypeScript
212
star
9

vscode-dotnet-test-explorer

.NET Core Test Explorer for Visual Studio Code
TypeScript
202
star
10

chatgpt-teams-bot

A ChatGPT Teams Bot app to let you chat with ChatGPT in Microsoft Teams
TypeScript
200
star
11

awesome-azure-iot

A curated list of awesome Azure Internet of Things projects and resources.
127
star
12

openai-teams-bot

An OpenAI Teams Bot app to let you chat with OpenAI API in Microsoft Teams, similar to ChatGPT Teams Bot app
TypeScript
116
star
13

weapp-955-wlb

955WLB 微信小程序
JavaScript
102
star
14

semantic-kernel-vs-langchain

Compare Semantic Kernel and LangChain
64
star
15

vscode-iot-utility

IoT Utility for Visual Studio Code: Arduino, Espressif, Raspberry Pi, mbed and more
TypeScript
64
star
16

vscode-code-runner-for-web

Run code in browser version of VS Code
TypeScript
49
star
17

vscode-terminal

Terminal for Visual Studio Code
TypeScript
43
star
18

vscode-docker-explorer

Docker Explorer for Visual Studio Code
TypeScript
42
star
19

chatgpt-wechat-bot

ChatGPT 微信机器人,基于 ChatGPT API 和 Wechaty
JavaScript
29
star
20

vscode-translator

VS Code extension to translate between English and Chinese.
TypeScript
25
star
21

vscode-node-red

Node-RED for Visual Studio Code
TypeScript
18
star
22

openai-examples

Code Samples for OpenAI & ChatGPT API
JavaScript
16
star
23

vscode-github-actions

GitHub Actions for VS Code
TypeScript
14
star
24

CodeRunnerVS

Code Runner for Visual Studio
C#
10
star
25

vscode-955-wlb

955.WLB extension for Visual Studio Code
TypeScript
10
star
26

vscode-dotnet

.NET Core Tools for Visual Studio Code
TypeScript
10
star
27

chatgpt-wechat-public-account

把 ChatGPT 接入微信公众号
Python
9
star
28

vscode-azure-storage-explorer

Manage Azure Storage in Visual Studio Code
TypeScript
7
star
29

vscode-azure-iot-toolkit

This extension is now maintained in the Microsoft repo
TypeScript
6
star
30

vscode-extension-leaderboard

Data insight for popular extensions, history of download count and extension leaderboard
TypeScript
6
star
31

vsce-website

Source Code for Visual Studio Code Extension Download Count
JavaScript
6
star
32

vscode-auto-complete-tag

Extension Pack to add close tag and rename paired tag automatically for HTML/XML
6
star
33

formulahendry.github.io.source

Source repo for personal blog
JavaScript
5
star
34

azure-iot-toolkit-for-mobile

Azure IoT Toolkit for Android, iOS and Windows Phone
JavaScript
4
star
35

vscode-iot-extension-pack

Build IoT Solutions on top of awesome technology stacks
4
star
36

weapp-garbage-classification

JavaScript
3
star
37

azure-iot-webclient

Azure IoT Web Client
JavaScript
3
star
38

vscode-chat-room

Chat Room & Chat Bot for VS Code
TypeScript
3
star
39

teams-bot-langchain

A Teams Bot app integrated with LangChain
TypeScript
2
star
40

teams-bot-semantic-kernel

A Teams Bot app integrated with Semantic Kernel and its Microsoft Graph Plugin
C#
2
star
41

vscode-azure-virtual-machine-explorer

Manage Azure Virtual Machine in VS Code
TypeScript
2
star
42

my-first-static-web-app

HTML
1
star
43

azure-cli-content-test

1
star
44

vscode-docker-extension-pack

Docker Extension Pack for Visual Studio Code
1
star
45

intro-html

A robot powered training repository 🤖
1
star
46

uwp-vsce

UWP for Visual Studio Code Extension Marketplace
HTML
1
star
47

awesome-azure-for-java

A curated list of awesome Azure projects and resources for Java
1
star
48

vscode-azure-iot-toolkit-1

TypeScript
1
star