我昨天才开始使用 Sublime Text 2,我非常喜欢它。但是,我正在尝试设置一个我会一直使用的代码片段。问题是编辑器根本不认识它。我将它保存在我的 Packages/User 文件夹中。片段如下:
<snippet>
<content><![CDATA[echo "<pre>".print_r(${0:var},true)."</pre>";]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>pre</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
<description>print r with pre tags</description>
</snippet>
知道我做错了什么吗?
最佳答案
确保它以 .sublime-snippet
保存延期。您的代码段只会在范围为 php 时扩展。所以它必须在 php 标签中,即使它在一个 php 文件中。
关于sublimetext - Sublime Text 2 代码片段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9499848/