Configure js2-mode with use-package

This commit is contained in:
Tom Willemse 2016-05-09 21:54:10 +02:00
parent 7c5344d179
commit c721929078
2 changed files with 12 additions and 7 deletions

View file

@ -274,7 +274,7 @@ MODE1 is enabled and vice-versa."
(append '(("/PKGBUILD$" . sh-mode)
(".install$" . sh-mode)
("\\.jl$" . sawfish-mode)
("\\.js\\(on\\)?$" . js2-mode)
("\\.json$" . js-mode)
("\\.m\\(ark\\)?d\\(?:o?wn\\)?$" . markdown-mode)
("\\.php[345]?$" . php-mode)
("\\.tm?pl$" . html-mode)
@ -477,6 +477,17 @@ MODE1 is enabled and vice-versa."
(use-package apache-mode :ensure t :defer t)
(use-package js2-mode
:ensure t
:mode (("\\.js\\'" . js2-mode)
("\\.jsx\\'" . js2-jsx-mode))
:config
(add-hook 'js2-mode-hook 'tern-mode)
(add-hook 'js2-mode-hook 'moz-minor-mode)
(add-hook 'js2-mode-hook 'electric-pair-local-mode)
(add-hook 'js2-mode-hook 'electric-indent-local-mode)
(add-hook 'js2-mode-hook 'flycheck-mode))
;;;; Hooks
(add-hook 'eshell-first-time-mode-hook 'oni-eshell-set-prompt)
@ -600,9 +611,6 @@ MODE1 is enabled and vice-versa."
;; Reset the `default-directory' to my $HOME in jabber chat buffers.
(add-hook 'jabber-chat-mode-hook 'oni:reset-default-directory)
(oni:add-hooks 'js2-mode-hook
#'tern-mode 'moz-minor-mode)
(oni:add-hooks 'lisp-mode-hook
'oni:set-emacs-lisp-symbols 'paredit-mode)

View file

@ -1450,7 +1450,6 @@
(add-hook 'css-mode-hook #'electric-pair-local-mode)
(add-hook 'haml-mode-hook #'electric-pair-local-mode)
(add-hook 'java-mode-hook #'electric-pair-local-mode)
(add-hook 'js2-mode-hook #'electric-pair-local-mode)
(add-hook 'lua-mode-hook #'electric-pair-local-mode)
(add-hook 'python-mode-hook #'electric-pair-local-mode)
(add-hook 'scss-mode-hook #'electric-pair-local-mode)
@ -1494,7 +1493,6 @@
#+BEGIN_SRC emacs-lisp
(add-hook 'css-mode-hook #'electric-indent-local-mode)
(add-hook 'js2-mode-hook #'electric-indent-local-mode)
(add-hook 'php-mode-hook #'electric-indent-local-mode)
(add-hook 'scss-mode-hook #'electric-indent-local-mode)
(add-hook 'sh-mode-hook #'electric-indent-local-mode)
@ -1649,7 +1647,6 @@
(add-hook 'git-commit-mode-hook 'flycheck-mode)
(add-hook 'go-mode-hook 'flycheck-mode)
(add-hook 'html-mode-hook 'flycheck-mode)
(add-hook 'js2-mode-hook 'flycheck-mode)
(add-hook 'lua-mode-hook 'flycheck-mode)
(add-hook 'perl-mode-hook 'flycheck-mode)
(add-hook 'php-mode-hook 'flycheck-mode)