Fra*_*ini 13 language-comparisons code-snippets sublimetext atom-editor
我想将我为Sublime Text 3编辑器编写的一些片段转换为atom.io编辑器.
由于我有一个对任何类型的文件(任何文件扩展名)都有效的"许可证"片段,因此在licence.sublime-snippet文件中我没有指定范围:
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
Run Code Online (Sandbox Code Playgroud)
现在,我在atom/snippets中看到上面的例子.
'.source.js':
'console.log':
'prefix': 'log'
'body': 'console.log(${1:"crash"});$2'
Run Code Online (Sandbox Code Playgroud)
最外面的键是这些片段应该处于活动状态的选择器.
但是我无法弄清楚如何指定一个全局范围或者更好,但是根本不像我所做的那样完全指定它.sublime-snippet.任何帮助表示赞赏; 特别是还没有找到详细的操作片段原子的综合文档,因此也欢迎这种文档的一些链接.
小智 24
这是你在找什么?
'*':
'console.log':
'prefix': 'log'
'body': 'console.log(${1:"crash"});$2'
Run Code Online (Sandbox Code Playgroud)