1

I have an html snippet in my snippets.cson file in my atom text editor for windows, it doesn't give me any errors but when I open my index.html file and begin to type the prefix nothing appears.

My expectation is that I should type <!DOC and then see the start page snippet pop up, hitting tab will auto generate my page template.

What am I doing wrong, right now nothing happens.

# Snippet for opening a new html page
 'text.html.basic':
    'start page':
        'prefix': '<!DOC'
        'body': """
            <!DOCTYPE html>
            <html>
                <head>
                    <title></title>
                    <link rel='stylesheet' type = 'text/css' href='css/' />
                </head>
                <body>
                    <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
                               integrity="sha256-k2WSCIexGzOj3Euiig+TlR8gA0EmPjuc79OEeY5L45g="
                               crossorigin="anonymous"></script>
                    <script src = 'javascript/'></script>
                </body>
             </html>
                """

1 Answer 1

1

If you want the snippet to be relevant for .html files you should use

.text.html.basic

In the first line (and not .html).

Update from the comments:

Note that you can't use <! in the prefix. You can change the prefix to DOC and it will work.

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

4 Comments

Did you restart Atom after the change?
Yep, just did same thing
I can't have <! in the prefix, it doesn't throw an error but it doesn't work. Changing my prefix to DOC works fine. Please modify your answer to reflect this so that I can give you proper credit, you did half fix :-)

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.