""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Vim ftdetect file " " Language: JSX (JavaScript) " Maintainer: Max Wang " """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" exec 'source '.fnameescape(expand(':p:h:h').'/jsx-config.vim') fu! EnableJSX() if g:jsx_pragma_required && !b:jsx_pragma_found | return 0 | endif if g:jsx_ext_required && !exists('b:jsx_ext_found') | return 0 | endif return 1 endfu autocmd BufNewFile,BufRead *.jsx let b:jsx_ext_found = 1 autocmd BufNewFile,BufRead *.jsx set filetype=javascript.jsx autocmd BufNewFile,BufRead *.js \ if EnableJSX() | set filetype=javascript.jsx | endif