Deeply? Look at the API, and the source code behind the API. The flight manual walks you through several examples of making a package. Other packages are also a good guide. For anything you’re still not sure about, there is this forum or slack.
If there is something in particular, I’ll do my best to help. I know a decent amount about snippets and autocomplete.
Pasting that into your snippets.cson file will make a snippet with prefix dc that will expand to a bunch of new lines and tabs (the equivalent length in spaces will be used if soft tabs is your setting). The cursor will be placed after the tabs on the second line.
To activate the snippet, just press tab after typing the prefix.
I meant that there is a setting at the bottom of the Editor section called Tab Type. This allows you to use ‘soft tabs’ which means instead of placing an actual tab character when you press tab, it puts in the equivalent length of spaces (according to the tab length setting)
But, in ‘Tab Type’ there are 3 options (auto, soft, hard). Wich iis the good one, i’ve tried ech one, same resutl.
The fact i have replace Sublime by Atom, is that Sublime has a bug (each() function is depecated when using a PHP version >= 7.2.0), or the version i use is PHP-7.2.2.
I don’t find a good tuorial for Atom, the snippets example show only a ‘.souece.js’, i try it and it works fine.
I want that it works for a PHP an HTML source.
It may behave the same, but there is a difference. If you turn on invisibles, you will see that hard tabs look like a guillemet, while spaces are dots.
Hard tabs are literal tab characters (the \t kind). Soft tabs are just spaces, so they appear as such when invisibles are turned on. Auto decides which to use based on what’s already been used in the file. There is yet another setting in Atom though, called Atomic soft tabs which is causing the soft-tab spaces to behave like real tabs when moving the cursor and such.
The best one to pick depends. I find most people use spaces, so I stick to soft tabs. TO be consistent with other people, you may want auto. I strongly advise against hard tabs.
Like this? To get the expansion, I pressed tab. If this isn’t what you are getting, I’m going to need more description about what’s happening for you.
Scope syntax is kind of mentioned in the flight manual, but it’s pretty bad and uninformative. I found the best way of learning what you can do with it is looking at the first-mate specs. For this purpose though, you don’t need to worry about it. It’s only when you want more complicated behaviour that is is necessary to worry about it.
Thanks, it works fine now in a php file like index.php.
I have modified for that in keymap.cson as followws:
#'atom-text-editor[data-grammar="text html php"]:not([mini])':
# 'tab': 'emmet:expand-abbreviation-with-tab'
But now, the html tags don’t work, example:
h1.text-center + tab
In an html file, it works, but not in a php file. I want that it works the same in html or php file.
dc+tab don’t work in html file.
Sorry for the inconvenience, but your help is welcome.
Thanks very much.