A
A
Aramano2020-03-17 17:10:43
atom
Aramano, 2020-03-17 17:10:43

How to add snippets to Atom?

I have never added my snippets before, but now I decided to add them, but I ran into a problem. Editor - Atom. If I add one snippet - it works, if I add others after it - they don't work. I can't understand why. I already put commas at the end of each, and ;

The code -

'.text.html.php':
  'Models':
    'prefix': 'mod'
    'body': """
    protected $table = '';

    protected $fillable = [];
    """

    '.text.html.php':
      'Layouts':
        'prefix': 'lays'
        'body': """
        @extends('layout')

        @section('content')

        @endsection
        """

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex Ozerov, 2020-04-01
@Aramano

Documentation:

'.source.gfm':
  'Hello World':
    'prefix': 'hewo'
    'body': 'Hello World!'

  'Github Hello':
    'prefix': 'gihe'
    'body': 'Octocat says Hi!'

  'Octocat Image Link':
    'prefix': 'octopic'
    'body': '![GitHub Octocat](https://assets-cdn.github.com/images/modules/logos_page/Octocat.png)'

and actually an example of how I did it:
'.source.css':

  'media':
    'prefix': '@'
    'body': "@media (max-width: 968px){}"

  'margin':
    'prefix': 'mm'
    'body': 'margin: 0px 0px 0px 0px;'

  'padding':
    'prefix': 'pp'
    'body': 'padding: 0px 0px 0px 0px;'

Why does it work? Because you need to align the code the same way in a column, as in the example.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question