Open lucas-clemente opened 10 years ago
:+1:
Got the same behavior in handlebars (.hbs
) files. Is there a way to activate emmet for additional file extensions other than html/css?
You can use ⌘E to expand abbreviations anywhere: https://github.com/emmetio/emmet-atom#default-keybindings Tab key requires additional logic to not interfere with default snippets
Is there a reason why syntax detection is based on grammar, not on scope? That should allow it to work in anything that resembles HTML.
You may want to use default snippets in HTML scope of ERB-files to create ERB-structs like <%= ... %>
Ah, I see. Do you know how this problem is solved e.g. in the sublime plugin? Do they have expansion priorities or sth?
In ST it’s impossible to properly solve this issue (e.g. make distinction between static built-in snippets and dynamic Emmet abbreviations) due to lack of API.
But it quite possible in Atom due to its open-source nature: it’s possible to contribute some API points to default Atom’s snippets package to retrieve all matched snippets for given scope
Sounds neat. Is this something that is being worked on, or should I have a look?
No, I’m not working on it
You can use ⌘E to expand abbreviations anywhere
thanks, ⌘E
is working fine.
The shortcut seems to be shift + ⌘ + e
now.
Edit: Ahh, of course. Nothing has changed. ⌘ + E
== shift + ⌘ + e
.
I'd really like tab expansion in handlebars files. ⌘E
sucks. Doen anyone know a way how to get this to work?
From v2.3.0 you can easily enable the Tab key for any language. Read this for more info.
Thanks @silvenon :+1: Works!
File -> Open Your Keymap
'atom-text-editor[data-grammar="text html mustache"]:not([mini])':
'tab': 'emmet:expand-abbreviation-with-tab'
@silvenon @brunowego Thank you, exactly what I was looking for!
add this to keymap.cson
'atom-text-editor[data-grammar="text html erb"]:not([mini])':
'tab': 'emmet:expand-abbreviation-with-tab'
data-grammar for erb is
text html erb
I just can not find the keymap.cson
file in st2,there is no open your keymap
menu item, who can tell me?
ST2 as in Sublime Text 2? This is an Atom plugin :grin:
I'm a ST3 user and I'm trying to enable erb snippets within Emmet as well @weekeight. I'm not so hopeful after seeing @sergeche's post haha
@adeyahya I show the data-grammar as text html ruby
and the functionality reflects this. Can anyone else confirm?
Try with this: It's working for me.
'atom-text-editor[data-grammar="text erb basic"]:not([mini])': 'tab': 'emmet:expand-abbreviation-with-tab'
my keymap.cson is:
'atom-text-editor[data-grammar="text html basic"]:not([mini]), atom-text-editor[data-grammar~="text erb basic"]:not([mini])': 'tab': 'emmet:expand-abbreviation-with-tab'
This one works for me (Atom 1.14.2):
'atom-text-editor[data-grammar="text html ruby"]:not([mini])':
'tab': 'emmet:expand-abbreviation-with-tab'
@brunowego's comment should be in the docs.
Tab expansion doesn't work in ERB files. I had this working through #43 some time ago, but since then the code got replaced and I don't know what's going on now.