Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code - enable autoClosingTags option in .vue files

The html.autoClosingTags option in VS code lets me type '' - and voila, '' is now inserted with the cursor inside those two tags. But this only works in .html files. I´m working on a vue project, and would like this feature to also be available in my .vue files (and any other files with html content actually).

Is this possible?

VS code options

like image 267
Farsen Avatar asked Jun 08 '19 20:06

Farsen


1 Answers

Use the Auto Close Tag extension:

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

like image 84
amirali Avatar answered Oct 27 '22 16:10

amirali