为 txt 范围创建片段 [英] create snippet for txt scope

查看:18
本文介绍了为 txt 范围创建片段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为 txt 扩展名创建了示例代码段,但它不起作用.我无法找出问题所在.

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

我正在使用 ST3

我正在使用样本.

<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>

我把文件保存在

AppData\Roaming\Sublime Text 3\Packages\User

AppData\Roaming\Sublime Text 3\Packages\User

另存为

hello.sublime-snippet

hello.sublime-snippet

推荐答案

如果您希望代码段在文本范围内工作,则需要将其设置为 text 而不是 source.txt.

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

此外,我认为片段和完成在默认情况下在文本范围内不起作用.在这种情况下,您必须在用户设置中将范围添加到 auto_complete_selector.

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.

这篇关于为 txt 范围创建片段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆