Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Something is wrong with Emmet in Visual Studio Code

After the last update, Emmet is working in some different (incorrect) way.

If I'm typing usual code in Emmet syntax like:

.row>.col*2

and press Tab it's not working.

If I type:

h1{Some title}

and press Tab it's also not working, but if I put the cursor inside brackets, and then press Tab — in this case it's going to work.

This is my Visual Studio Code configuration:

"editor.fontSize": 12,
"editor.wordWrap": "on",
"editor.wrappingIndent": "indent",
"editor.minimap.enabled": true,
"workbench.iconTheme": "material-icon-theme",
"window.zoomLevel": 0,
"window.openFilesInNewWindow": "off",
"window.openFoldersInNewWindow": "on",
"workbench.welcome.enabled": false,
"workbench.colorTheme": "Default Light+",
"[stylus]": {
    "editor.quickSuggestions": {
        "other": false,
        "comments": false,
        "strings": false
    }
},
"emmet.preferences": {
    "stylus.valueSeparator": ": "
},
"git.enableSmartCommit": true

How can I fix it?

like image 867
LuVR Avatar asked Aug 14 '17 10:08

LuVR


People also ask

How do you fix Emmet on VS Code?

Click on the Settings or press Ctrl+, to open the VS Code Settings. Step 2: Click on the Extensions tab on the left side of the settings. Click on HTML. Step 3: Click on the “Edit in settings:json” hyperlink to edit the settings in JSON format.

Why is my Emmet abbreviation not working?

If abbreviations are still failing to expand: Check the builtin extensions to see if Emmet has been disabled. Try restarting the extension host by running the Developer: Restart Extension Host ( workbench.

How do I fix Emmet not working after Django extension installation in VS Code?

its simple just go to settings-> Emmets and in emmets you will find include library option just click on that in language write django-html and in value add html BOOM IT IS DONE.

How do I enable Emmet in VS Code JSX?

You know what🤔 Let me just show you how to enable it in VS Code. Go to settings > extensions > emmet > include languages and add javascript as the item and javascriptreact as the value.


2 Answers

As of version 1.15.1 this worked for me:

Open up your preferences and add in

"emmet.triggerExpansionOnTab": true

It seems Tab is no longer associated with Emmet.

If you are on v1.33.0 or newer, you can also open up the preferences and type in something like trigger expansion and it's just a simple toggle now. Of course, you can still do the above in the settings.json file as well.

like image 196
Simon Avatar answered Oct 31 '22 11:10

Simon


I just ran into this same problem, but I have a slightly different reason for it. Not only did I need to set triggerExpansionOnTab to true, but I also needed to set the included languages in the settings.json file.

In my case, Emmet was not activated for blade.php files. So, I needed to add "blade":"html" within the includedLanguages section.

Full example:

"emmet.triggerExpansionOnTab": true,
"emmet.includeLanguages": {
    "javascript": "javascript",
    "vue-html": "html",
    "php": "html",
    "blade": "html",
}

Adding this might also help:

"emmet.useNewEmmet": true,
like image 39
Brad Ahrens Avatar answered Oct 31 '22 11:10

Brad Ahrens