Atom Snippets

Copy and paste this text into your Atom Editor File  Snippets…​ page to add some useful shortcuts. Feel free to contribute any changes so other editors can benifit by selecting the “Edit this Page” link in the header of this page and submitting a pull request in the wiki repo.

# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
# '.source.coffee':
#   'Console log':
#     'prefix': 'log'
#     'body': 'console.log $1'
#
# Each scope (e.g. '.source.coffee' above) can only be declared once.
#
# This file uses CoffeeScript Object Notation (CSON).
# If you are unfamiliar with CSON, you can read more about it in the
# Atom Flight Manual:
# http://flight-manual.atom.io/using-atom/sections/basic-customization/#_cson
'.source.asciidoc':
  'Cross reference internal element, same page':
    'prefix': 'xrefI'
    'body': '<<${1:reference-a-section-in-the-same-page},${2:label text}>>'
  'Cross reference internal element, same module':
    'prefix': 'xrefIsm'
    'body': '<<${1:target-page-filename}.adoc#${2:reference-section},${3:label text}>>'
  'Cross reference internal element, named module':
    'prefix': 'xrefInm'
    'body': '<<${1:module-name}:${2:target-page-filename}.adoc#${3:reference-section},${4:label text}>>'
  'Cross reference page, same module':
    'prefix': 'xrefPsm'
    'body': 'xref:${1:target-page-filename}.adoc[${2:link text}]'
  'Cross reference page, named module':
    'prefix': 'xrefPnm'
    'body': 'xref:${1:module-name}:${2:target-page-filename}.adoc[${3:link text}]'
  'Cross reference page, ROOT module':
    'prefix': 'xrefPrm'
    'body': 'xref:ROOT:${1:target-page-filename}.adoc[${2:link text}]'
  'Admonition Block':
    'prefix': 'admonB'
    'body': """
    [${1:NOTE}${2:TIP}${3:IMPORTANT}${4:CAUTION}${5:WARNING}]
    ====
    $6
    ====
    $7
    """
  'Admonition Block with Title':
    'prefix': 'admonBwT'
    'body': """
    [${1:NOTE}${2:TIP}${3:IMPORTANT}${4:CAUTION}${5:WARNING}]
    .${6:Optional Title}
    ====
    $7
    ====
    $8
    """
  'Admonition Paragraph':
    'prefix': 'admonP'
    'body': """
    ${1:NOTE}${2:TIP}${3:IMPORTANT}${4:CAUTION}${5:WARNING}: $6
    """
  'Admonition Paragraph with Title':
    'prefix': 'admonPwT'
    'body': """
    .${1:Optional Title}
    ${2:NOTE}${3:TIP}${4:IMPORTANT}${5:CAUTION}${6:WARNING}: $7
    """
  'Include partial same module':
    'prefix': 'part'
    'body': 'include::partial$${1:partial-filename}.adoc[${3:line=}${4:tag=}${5:tags=}]'
  'Include partial different module':
    'prefix': 'partM'
    'body': 'include::${1:module}:partial$${2:partial-filename}.adoc[${3:line=}${4:tag=}${5:tags=}]'
  'Include partial ROOT':
    'prefix': 'partR'
    'body': 'include::ROOT:partial$${1:partial-filename}.adoc[${2:line=}${3:tag=}${4:tags=}]'
  'Module inline image':
    'prefix': 'imgMI'
    'body': 'image:${1:module}:${2:target-resource-filename.ext}[${3:}]'
  'Module block image':
    'prefix': 'imgMB'
    'body': 'image::${1:module}:${2:target-resource-filename.ext}[${3:}]'
  'ROOT inline image':
    'prefix': 'imgRI'
    'body': 'image:ROOT:${1:target-resource-filename.ext}[${2:}]'
  'ROOT block image':
    'prefix': 'imgRB'
    'body': 'image::ROOT:${1:target-resource-filename.ext}[${2:}]'