Sublime Text 3 snippet not working in plain text file with no extension

一曲冷凌霜 提交于 2019-12-08 09:46:17

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!