This repository has been archived by the owner on Feb 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
packages.el
58 lines (47 loc) · 1.76 KB
/
packages.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
;;; packages.el --- react layer packages file for Spacemacs. -*- lexical-binding: t -*-
;;
;; Copyright (c) 2012-2019 Sylvain Benner & Contributors
;;
;; Author: Thanh Vuong <[email protected]>
;; URL: https://github.com/thanhvg
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(defconst vue-packages
'(web-mode
add-node-modules-path
company
emmet-mode
evil-matchit
flycheck
prettier-js
smartparens
yasnippet))
(defun vue/post-init-web-mode ()
(define-derived-mode vue-mode web-mode "Vue")
(add-to-list 'auto-mode-alist '("\\.vue\\'" . vue-mode))
(spacemacs/add-to-hook 'vue-mode-hook '(spacemacs//vue-setup-editor-style
spacemacs//vue-setup-keybindings))
(add-hook 'vue-mode-local-vars-hook #'spacemacs//vue-setup-backend))
(defun vue/post-init-add-node-modules-path ()
(add-hook 'vue-mode-hook #'add-node-modules-path))
(defun vue/post-init-company ()
(add-hook 'vue-mode-local-vars-hook #'spacemacs//vue-setup-company))
(defun vue/post-init-emmet-mode ()
(add-hook 'vue-mode-hook #'emmet-mode))
(defun vue/post-init-evil-matchit ()
(evilmi-load-plugin-rules '(vue-mode) '(template simple html))
(add-hook 'vue-mode-hook 'turn-on-evil-matchit-mode))
(defun vue/post-init-flycheck ()
(with-eval-after-load 'flycheck
(flycheck-add-mode 'javascript-eslint 'vue-mode))
(spacemacs/enable-flycheck 'vue-mode))
(defun vue/pre-init-prettier-js ()
(add-to-list 'spacemacs--prettier-modes 'vue-mode))
(defun vue/post-init-smartparens ()
(if dotspacemacs-smartparens-strict-mode
(add-hook 'vue-mode-hook #'smartparens-strict-mode)
(add-hook 'vue-mode-hook #'smartparens-mode)))
(defun vue/post-init-yasnippet ()
(add-hook 'vue-mode-hook #'spacemacs//vue-setup-yasnippet))