jsx mode updated

This commit is contained in:
Sameer Rahmani 2015-12-27 16:18:48 +03:30
parent 02eb071b8c
commit 26b1e5efcf
2 changed files with 16 additions and 11 deletions

View File

@ -1,5 +1,5 @@
(add-to-list 'load-path (concat (getenv "FG42_HOME") "/lib")) (add-to-list 'load-path (concat (getenv "FG42_HOME") "/lib"))
(toggle-debug-on-error) ;(toggle-debug-on-error)
(require 'fg42) (require 'fg42)
;; Load the default theme ;; Load the default theme
@ -14,9 +14,9 @@
'web 'web
'editor-theme 'editor-theme
'javascript 'javascript
'php ;'php
'clojure ;'clojure
'python ;'python
'ruby) 'ruby)
;; Load user config file in ~/.fg42 ;; Load user config file in ~/.fg42

View File

@ -41,19 +41,24 @@
:modes (web-mode)) :modes (web-mode))
(add-hook 'web-mode-hook (add-hook 'web-mode-hook
(lambda () (lambda ()
(when (equal web-mode-content-type "jsx") (when (equal web-mode-content-type "jsx")
;; enable flycheck ;; enable flycheck
(flycheck-select-checker 'jsxhint-checker) (flycheck-select-checker 'jsxhint-checker)
(flycheck-mode)))) (flycheck-mode))))
(defadvice web-mode-highlight-part (around tweak-jsx activate) (defadvice web-mode-highlight-part (around tweak-jsx activate)
(if (equal web-mode-content-type "jsx") (if (equal web-mode-content-type "jsx")
(let ((web-mode-enable-part-face nil)) (let ((web-mode-enable-part-face nil))
ad-do-it) ad-do-it)
ad-do-it)) ad-do-it))
(setq web-mode-markup-indent-offset 2)
(setq web-mode-code-indent-offset 2)
(setq web-mode-content-types-alist (setq web-mode-content-types-alist
'(("jsx" . "\\.js[x]?\\'"))) '(("jsx" . "\\.js[x]?\\'")))
(web-mode)) (web-mode))
;;;###autoload ;;;###autoload
@ -74,7 +79,7 @@
(add-to-list 'auto-mode-alist '("\\.handlebars\\'" . web-mode)) (add-to-list 'auto-mode-alist '("\\.handlebars\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode)) (add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.html$" . web-mode)) (add-to-list 'auto-mode-alist '("\\.html$" . web-mode))
(add-to-list 'auto-mode-alist '("\\.jsx$" . jsx))
(add-hook 'web-mode-hook 'web-mode-hook-func) (add-hook 'web-mode-hook 'web-mode-hook-func)
(add-hook 'web-mode-hook 'emmet-mode) (add-hook 'web-mode-hook 'emmet-mode)