问题
I have the following snippet that I would like to work in a plain text file, specifically before the file has been saved with an extension or having set a syntax.
<snippet>
<content><![CDATA[
/* yay this is your generic test snippet */
]]></content>
<tabTrigger>generic</tabTrigger>
<scope>text.plain</scope>
<description>Generic any scope snippet</description>
</snippet>
However it doesn't work when I type generic
in a new file. I have already made this change to sublime user settings:
"auto_complete_selector": "source, text, source - comment"
Follow-up note
Omitting the <scope>
from the snippet definition should make it available in all scopes, it worked for me with the above snippet in sql
and markdown
scopes.
回答1:
I was able to fix by doing the following, but I'll accept any other better answer.
In syntax-specific (plain text) user settings I made added the ""
to the extensions field:
"extensions":
[
"txt", ""
],
Now the snippet works in newly created unsaved files, or files without an extension.
来源:https://stackoverflow.com/questions/34793613/sublime-text-3-snippet-not-working-in-plain-text-file-with-no-extension