Loading

Paste #p0bmwxueh

  1. (use-package web-mode
  2.   :ensure t
  3.   :config
  4.   (add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode))
  5.   (add-to-list 'auto-mode-alist '("\\.tpl\\.php\\'" . web-mode))
  6.   (add-to-list 'auto-mode-alist '("\\.[agj]sp\\'" . web-mode))
  7.   (add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode))
  8.   (add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode))
  9.   (add-to-list 'auto-mode-alist '("\\.mustache\\'" . web-mode))
  10.   (add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode))
  11.   (add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode)))
  12.  
  13. (use-package company-web
  14.   :ensure t
  15.   :config
  16.   (add-to-list 'auto-mode-alist '("\\.mustache\\'" . company-web-mode)))
  17.  
  18.  
  19. (use-package js2-mode
  20.   :ensure t
  21.   :config
  22.   ;; (add-hook 'js-mode-hook 'js2-minor-mode)
  23.   ;; (add-hook 'js-mode-hook 'js2-mode)
  24.   (add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
  25.   (add-hook 'js2-mode-hook #'js2-imenu-extras-mode))
  26.  
  27.  
  28. (use-package js2-refactor
  29.   :ensure t
  30.   :config
  31.   (add-hook 'js2-mode-hook #'js2-refactor-mode)
  32.   (js2r-add-keybindings-with-prefix "C-c C-r")
  33.   (define-key js2-mode-map (kbd "C-k") #'js2r-kill))
  34.  
  35.  
  36. (use-package xref-js2
  37.   :ensure t
  38.   :config
  39.   (add-hook 'js2-mode-hook
  40.             (lambda ()
  41.               (add-hook 'xref-backend-functions #'xref-js2-xref-backend nil t)))
  42.   (add-hook 'js-mode-hook 'js2-refactor-mode)
  43.   (add-hook 'js2-mode-hook 'js2-refactor-mode))
  44.  
  45.  
  46. ;; tern.el
  47. (add-to-list 'load-path "/home/user/.emacs.d/git/tern/emacs/")
  48. (autoload 'tern-mode "tern.el" nil t)
  49. (add-hook 'js-mode-hook (lambda () (tern-mode t)))
  50.  
  51. (use-package company-tern
  52.   :ensure t
  53.   :bind
  54.   :config
  55.   (add-to-list 'company-backends 'company-tern)
  56.   (add-hook 'js2-mode-hook (lambda ()
  57.                              (tern-mode t))))