V
V
Viktor Shubin2017-11-24 17:40:12
HTML
Viktor Shubin, 2017-11-24 17:40:12

Emmet does not work in .slim files, how to set it up?

Good day!
Emmet does not work in atom slim files. How to set it up?
PS in html, css, less works. I ask you to write a universal solution, if possible, if you suddenly need to use emmet in files with a different extension.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rikcon, 2017-11-24
@ViktorS88

Tab key
Currently, Emmet expands abbreviations by Tab key only for HTML, CSS, Sass/SCSS and LESS syntaxes. Tab handler scope is limited because it overrides default snippets.
If you want to make Emmet expand abbreviations with Tab key for other syntaxes, you can do the following:
Use Open Your Keymap menu item to open your custom keymap.cson file.
Add the following section into it:
'atom-text-editor[data-grammar="YOUR GRAMMAR HERE"]:not([mini])':
'tab': 'emmet:expand-abbreviation-with-tab'
Replace YOUR GRAMMAR HERE with actual grammar attribute value. The easiest way to get grammar name of currently opened editor is to open DevTools and find corresponding element: it will contain data-grammar attribute with value you need. For example, for HTML syntax it's a text html basic.
You can add as many sections as you like for different syntaxes. Note that default snippets will no longer work, but you can add your own snippets in Emmet.
https://github.com/emmetio/emmet-atom#tab-key

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question