2

when I type html tag name in VS Code the IntelliSense suggests code snippet. For example if I type "form" snippet generates:

<form action=""></form>

How can I configure this snippet (I'd like to get rid of "action" attribute)? Which component is responsible for those snippets? Is it Emmet?

Thanks.

1

1 Answer 1

3

Yes, it is Emmet.

Generic snippets are defined in /usr/share/code/resources/app/extensions/html-language-features/server/node_modules/vscode-emmet-helper/out/expand/expand-full.js

Simply change:

"form": "form[action]",

to snippet of your choice, for example:

"form": "form[\[formGroup\]]",

Another approach:

  • create directory for your private emmet snippets e.g: ~/.config/emmet
  • open VS Code settings (Ctrl + ,)
  • search for emmet.extensionPath and set it to ~/.config/emmet
  • create ~/.config/emmet/snippets.json file with
{
    "html": {
        "snippets": {
            "form": "ju-hu"
        }
    }
}

more details https://code.visualstudio.com/docs/editor/emmet#_using-custom-emmet-snippets

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.