Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

Not working in erb files #83

Open
lucas-clemente opened this issue May 18, 2014 · 25 comments
Open

Not working in erb files #83

lucas-clemente opened this issue May 18, 2014 · 25 comments

Comments

@lucas-clemente
Copy link
Contributor

lucas-clemente commented May 18, 2014

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.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/2215723-not-working-in-erb-files?utm_campaign=plugin&utm_content=tracker%2F535900&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F535900&utm_medium=issues&utm_source=github).
@brandonweiss
Copy link

👍

@pulse00
Copy link

pulse00 commented May 19, 2014

Got the same behavior in handlebars (.hbs) files. Is there a way to activate emmet for additional file extensions other than html/css?

@sergeche
Copy link
Member

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

@lucas-clemente
Copy link
Contributor Author

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.

@sergeche
Copy link
Member

You may want to use default snippets in HTML scope of ERB-files to create ERB-structs like <%= ... %>

@lucas-clemente
Copy link
Contributor Author

Ah, I see. Do you know how this problem is solved e.g. in the sublime plugin? Do they have expansion priorities or sth?

@sergeche
Copy link
Member

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

@lucas-clemente
Copy link
Contributor Author

Sounds neat. Is this something that is being worked on, or should I have a look?

@sergeche
Copy link
Member

No, I’m not working on it

@pulse00
Copy link

pulse00 commented May 20, 2014

You can use ⌘E to expand abbreviations anywhere

thanks, ⌘E is working fine.

@davidrunger
Copy link

The shortcut seems to be shift + ⌘ + e now.

Edit: Ahh, of course. Nothing has changed. ⌘ + E == shift + ⌘ + e.

@timohofmeijer
Copy link

I'd really like tab expansion in handlebars files. ⌘E sucks. Doen anyone know a way how to get this to work?

@silvenon
Copy link

From v2.3.0 you can easily enable the Tab key for any language. Read this for more info.

@brunowego
Copy link

Thanks @silvenon 👍 Works!

File -> Open Your Keymap

'atom-text-editor[data-grammar="text html mustache"]:not([mini])':
    'tab': 'emmet:expand-abbreviation-with-tab'

@natecox
Copy link

natecox commented Mar 11, 2015

@silvenon @brunowego Thank you, exactly what I was looking for!

@adeyahya
Copy link

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

@weekeight
Copy link

I just can not find the keymap.cson file in st2,there is no open your keymap menu item, who can tell me?

@silvenon
Copy link

ST2 as in Sublime Text 2? This is an Atom plugin 😁

@Swelly
Copy link

Swelly commented Sep 9, 2015

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

@weekeight
Copy link

@OneHoopyFrood
Copy link

@adeyahya I show the data-grammar as text html ruby and the functionality reflects this. Can anyone else confirm?

@alobintechnologies
Copy link

Try with this: It's working for me.

'atom-text-editor[data-grammar="text erb basic"]:not([mini])':
'tab': 'emmet:expand-abbreviation-with-tab'

@alobintechnologies
Copy link

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'

@samuelpismel
Copy link

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'

@louwers
Copy link

louwers commented Dec 18, 2017

@brunowego's comment should be in the docs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests