Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Global scope for user snippet in Atom.io editor

I would like to transform some snippets that I wrote for the Sublime Text 3 editor to the atom.io editor.

Since I have a "license" snippet that is valid for any type of file (any file extension) then in the licence.sublime-snippet file I did'n specify a scope:

<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->

Now, i see the above example in atom/snippets.

'.source.js':
  'console.log':
    'prefix': 'log'
    'body': 'console.log(${1:"crash"});$2'

The outermost keys are the selectors where this snippets should be active.

but I can't figure out how can I specify a global scope or better yet do not specify it at all as well as I did in .sublime-snippet. Any help is appreciated; in particular still have not found the comprehensive documentation of detailed operation snippet atom therefore also some links to this kind of docs are welcome.

like image 981
Franco Rondini Avatar asked Apr 10 '14 20:04

Franco Rondini


People also ask

How do you use a snippet in an Atom?

Under each snippet name is a prefix that should trigger the snippet and a body to insert when the snippet is triggered. Each $ followed by a number is a tab stop. Tab stops are cycled through by pressing Tab once a snippet has been triggered. Tab stops with the same number will create multiple cursors.

Where is config CSON?

Global Configuration Settings cson file in your ~/. atom. directory. The configuration is grouped into global settings under the * key and language-specific settings under scope named keys like .


1 Answers

Is this what you're looking for?

'*':
  'console.log':
    'prefix': 'log'
    'body': 'console.log(${1:"crash"});$2'
like image 66
madikarizma Avatar answered Oct 05 '22 01:10

madikarizma