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"))
(toggle-debug-on-error)
;(toggle-debug-on-error)
(require 'fg42)
;; Load the default theme
@ -14,9 +14,9 @@
'web
'editor-theme
'javascript
'php
'clojure
'python
;'php
;'clojure
;'python
'ruby)
;; Load user config file in ~/.fg42

View File

@ -41,19 +41,24 @@
:modes (web-mode))
(add-hook 'web-mode-hook
(lambda ()
(when (equal web-mode-content-type "jsx")
;; enable flycheck
(flycheck-select-checker 'jsxhint-checker)
(flycheck-mode))))
(lambda ()
(when (equal web-mode-content-type "jsx")
;; enable flycheck
(flycheck-select-checker 'jsxhint-checker)
(flycheck-mode))))
(defadvice web-mode-highlight-part (around tweak-jsx activate)
(if (equal web-mode-content-type "jsx")
(let ((web-mode-enable-part-face nil))
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
'(("jsx" . "\\.js[x]?\\'")))
'(("jsx" . "\\.js[x]?\\'")))
(web-mode))
;;;###autoload
@ -74,7 +79,7 @@
(add-to-list 'auto-mode-alist '("\\.handlebars\\'" . 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 '("\\.jsx$" . jsx))
(add-hook 'web-mode-hook 'web-mode-hook-func)
(add-hook 'web-mode-hook 'emmet-mode)