create snippet for txt scope

纵然是瞬间 提交于 2019-12-11 20:18:32

问题


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:


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.



来源:https://stackoverflow.com/questions/27675067/create-snippet-for-txt-scope

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