Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Atom.io: Emmet and jsx

It seems Emmet is supposed to work with .jsx files too, but I cant get it to work in atom. My divs are not expanding, nothing happens when i press tab. I've tried restarting Atom, disabled all other user packages and it works perfectly with html documents. Should Emmet work with .jsx out of the box or are there configurations needed?

like image 238
swelet Avatar asked Aug 13 '15 18:08

swelet


People also ask

How do you use Emmet in JSX Atom?

Show activity on this post. I want my tags to expand when pressing tab. Building on your answer to achieve this: go to Atom/Open your keymap and paste this: 'atom-text-editor[data-grammar="source js jsx"]:not([mini])': 'tab': 'emmet:expand-abbreviation-with-tab' Now you'll be able to expand with tab.

Does Atom have Emmet?

Installation. In Atom, open Preferences > Packages, search for the emmet-simplified package. Once found, click install to install package. Alternatively, you could run apm install emmet-simplified .


1 Answers

Open Atom -> Preferences -> Packages -> Emmet

Scroll down a bit and you'll see a note about this particular issue. From there you just need to grab the correct context, which in my case was source js jsx and add it to your Keymap configuration.

 # Auto expanding for emmet @
 'atom-text-editor[data-grammar="source js jsx"]':
     'tab': 'emmet:expand-abbreviation-with-tab'

OR (with a more relaxed selector)

# Auto expanding for emmet @
'atom-text-editor[data-grammar*="js"].not:[mini]':
  'tab': 'emmet:expand-abbreviation-with-tab'
like image 194
visormatt Avatar answered Oct 04 '22 16:10

visormatt