mxw / vim-jsx

React JSX syntax highlighting and indenting for vim.
1.59k stars 95 forks source link

How to enable the plugin for .es6 files? #101

Closed markvincze closed 8 years ago

markvincze commented 8 years ago

I see that by setting let g:jsx_ext_required = 0 I can enable vim-jsx for .js files.

Is there a way to enable the plugin for .es6 files as well?

markvincze commented 8 years ago

With quite a lot a googling I found one solution, adding this to .vimrc:

au BufRead,BufNewFile *.es6 setfiletype javascript

It's working, though I don't know if this is the canonical solution.

mxw commented 8 years ago

You probably want javascript.jsx. This is the standard method of doing ftdetect; it's not specific to vim-jsx or any other language of package.

markvincze commented 8 years ago

@mxw Umm, what is javascript.jsx? Is it a vim plugin? I didn't find anything with Google.

mxw commented 8 years ago

It's the concatenation of two different filetypes—that's just how you separate them.

markvincze commented 8 years ago

Ah, so the command should be

au BufRead,BufNewFile *.es6 setfiletype javascript.jsx

right? Thanks for the clarification!

mxw commented 8 years ago

Yes.