HTML snippets for JSX

Asked

Viewed 154 times

0

Does anyone know where I can get HTML Snippets to use in Javascript?

Example:

input: h1 + tab

output: <h1></h1>

  • Which text editor is using?

  • Visual Studio Code

  • You can install this -> https://marketplace.visualstudio.com/items?itemName=abusaidm.html-snippets

  • I already downloaded this, but it only works for . html files

  • 1

    It works for javascript you also need to configure: https://github.com/abusaidm/html-snippets/issues/27#issuecomment-282512411

  • 1

    It worked! Thanks man.

Show 1 more comment

1 answer

1

You first need to download the plugin that makes available the snippets HTML, Examples to download here.

Then you need to set up the VS Code and/or the snippet so that it works also in other extensions.

To configure (tutorial for configuration):

Go to the directory extensions, usually located in:

Windows %USERPROFILE%\.vscode\extensions
Mac ~/.vscode/extensions
Linux ~/.vscode/extensions

Find the directory of the extension you want, example abusaidm.html-snippets-x.x.x, where x.x.x is the version.

Open the file package.json within it.

Add the section below within the snippets, configuring the extension/language you want.

,{
     "language": "NOVA LINGUAGEM / EXTENSÃO",
     "path": "./snippets/snippets.json"
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.