lundi 17 septembre 2018

Trailing backlash error web-mode content type

I get this error when trying to set content type in web-mode: File mode specification error: (invalid-regexp Trailing backslash) I have had a hard time debuggin this. I'm very new to emacs so I need some help setting web-mode. I have been following the documentation in web-mode.org but it has been difficult to decypher. Thanks.

(use-package web-mode
  :defer 2
  :ensure t
  :mode
  (
  "\\.html?\\"
  "\\.hbs$\\"
  "\\.vue$\\"
  "\\.css?\\"
  "components/.*\\.js[x]?\\'"
  "containers/.*\\.js[x]?\\'"
  )
  :config
  (progn
  (setq
  web-mode-enable-auto-closing t
  web-mode-enable-auto-opening t
  web-mode-enable-auto-pairing t
  web-mode-enable-auto-indentation t
  web-mode-enable-auto-quoting t
  ;; right now paired with AutoComplete
  web-mode-ac-sources-alist
  '(("css" . (ac-source-css-property))
  ("vue" . (ac-source-words-in-buffer ac-source-abbrev))
  ("html" . (ac-source-words-in-buffer ac-source-abbrev)))
  web-mode-content-types-alist
  '(("jsx"  . "components/.*\\.js[x]?\\'")
  ("jsx"  . "containers/.*\\.js[x]?\\'"))
  )
  )
  )
    ;; usually I set them in containers/ or components/ directorie
    ;; and to keep seperate from plain JS


    ;; adjust indents for web-mode to 2 spaces
    (defun my-web-mode-hook ()
    "Hooks for Web mode. Adjust indents"
    ;;; http://web-mode.org/
    (setq web-mode-markup-indent-offset 2)
    (setq web-mode-css-indent-offset 2)
    (setq web-mode-code-indent-offset 2))
    (add-hook 'web-mode-hook  'my-web-mode-hook)




Aucun commentaire:

Enregistrer un commentaire