New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React 0.12 will remove the pragma. #19
Comments
👍 |
I gave it a try on my own fork: https://github.com/ruyadorno/vim-jsx/tree/detect-filetype I'm not 100% sure about the implementation but I got it working for my projects :) |
Are you just using jsx ext? |
yeah... is it bad? 😊 like very, very bad? now that you mentioned I just saw that in your first message you did stated |
I had a bunch of compatibility problems using jsx ext and my vim setup. If I can't figure out how to get this to work I will add a custom pragma. |
The way I got around this was to set |
@jkimbo Good idea. I will try that. |
Presumably grepping for React may not work for files that, e.g., just contain functions which return React components, without defining any? The extension support has been added with the most recent commit. |
Is there an harm in having it always on? |
@BerkeleyTrue—The syntax regexes are fairly simple and will highlight the latter portion of, e.g., It's easy enough to always-enable vim-jsx by just adding |
Here's what I am using for jsx detection (borrowed mostly from @wincent): https://github.com/lencioni/dotfiles/blob/891897374e096b3f250840f3283033f2b7d8310a/.vim/ftdetect/jsx.vim Similarly to the ftdetect that comes with vim-jsx, it assumes that
What do you think about using this approach? It would allow you to change all of the files in this package from |
Facebook is recommending .jsx and are using it internally. I am going to spend a couple of hours getting my vimrc working right with jsx. facebook/react#832 |
React 0.12 will remove the jsx pragma.
react 0.12-rc
I think possible solutions to detecting a jsx file without the jsx ext should be discussed.
One possible solution is to grep the doc for
React
. I am not the greatest at vimscript so I don't know how feasible this would be.The text was updated successfully, but these errors were encountered: