0

I have created sample snippet for txt extension, but it does not working. I cant able to find out the issue.

I am using ST3

I am using the sample.

<snippet>
    <content><![CDATA[
Hello, ${1:this} is a ${2:snippet}.
]]></content>
    <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
    <tabTrigger>hello</tabTrigger>
    <!-- Optional: Set a scope to limit where the snippet will trigger -->
    <scope>source.txt</scope>
</snippet>

I saved the file in

AppData\Roaming\Sublime Text 3\Packages\User

saved file as

hello.sublime-snippet

1 Answer 1

1

If you want the snippet to work in the text-scope, you need to set it to text not source.txt.

Also, I think snippets and completions don't work in the text-scope by default. In that case you have to add the scope to auto_complete_selector in your user settings.

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

1 Comment

If you just want the snippet to work in plain text files, the scope needs to be text.plain, as text will also trigger the snippet in HTML, Markdown, and other syntaxes. Also, you don't need to alter auto_complete_selector.

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.