Fix react laye: make evil matchit work

with evil-matchit % will work on jsx tags
also correct rjsx-rename-tag-at-point keybinding
This commit is contained in:
Thanh Vuong 2019-02-05 14:26:50 -07:00 committed by smile13241324
parent 6e404256e2
commit 4f765f4a3f
2 changed files with 3 additions and 6 deletions

View File

@ -1893,6 +1893,7 @@ Other:
- Added variable =rcirc-enable-late-fix= (thanks to Miciah Masters)
**** React
- Improvements:
- Made % work on jsx tags (thanks to Thanh Vuong)
- Use rjsx-mode for react framework (thanks to Ting Zhou)
- Prompt user to install the =react= layer if a =.jsx= file is opened
(thanks to Jon Hermansen)

View File

@ -36,11 +36,7 @@
(add-hook 'rjsx-mode-hook 'spacemacs/react-emmet-mode))
(defun react/post-init-evil-matchit ()
(with-eval-after-load 'evil-matchit
(plist-put evilmi-plugins 'rjsx-mode
'((evilmi-simple-get-tag evilmi-simple-jump)
(evilmi-javascript-get-tag evilmi-javascript-jump)
(evilmi-html-get-tag evilmi-html-jump)))))
(add-hook 'rjsx-mode-hook 'turn-on-evil-matchit-mode))
(defun react/post-init-flycheck ()
(with-eval-after-load 'flycheck
@ -82,7 +78,7 @@
(spacemacs/declare-prefix-for-mode 'rjsx-mode "mh" "documentation")
(spacemacs/declare-prefix-for-mode 'rjsx-mode "mg" "goto")
(spacemacs/set-leader-keys-for-major-mode 'rjsx-mode "rrt" 'rjsx-rename-tag-at-point)
(spacemacs/set-leader-keys-for-major-mode 'rjsx-mode "rt" 'rjsx-rename-tag-at-point)
(with-eval-after-load 'rjsx-mode
(define-key rjsx-mode-map (kbd "C-d") nil))))