emacs.d

My Emacs configuration files.
git clone git://soucy.cc/emacs.d.git
Log | Files | Refs | README

webdev.el (3373B)


      1 ;; WEBDEV
      2 ;;
      3 ;;; Code
      4 
      5 (use-package js2-refactor
      6     ;; A JavaScript refactoring library for emacs.
      7     :after js2-mode
      8     :ensure t
      9     :pin melpa)
     10 
     11 (use-package xref-js2
     12     ;; Jump to references/definitions using ag & js2-mode's AST
     13     :after js2-mode
     14     :ensure t
     15     :pin melpa)
     16 
     17 (use-package js2-mode
     18     ;;; Improved JavaScript editing mode.
     19     :ensure t
     20     :pin melpa
     21     :config
     22     (add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
     23     (add-hook 'js2-mode-hook #'js2-imenu-extras-mode)
     24     (add-hook 'js2-mode-hook #'js2-refactor-mode)
     25     (add-hook 'js2-mode-hook (lambda ()
     26                                  (add-hook 'xref-backend-functions #'xref-js2-xref-backend nil t)))
     27     (js2r-add-keybindings-with-prefix "C-c C-r")
     28     (add-hook 'js2-mode-hook (lambda ()
     29                                  ;;(tern-mode)
     30                                  (company-mode))))
     31 
     32 (use-package js2-highlight-vars
     33     ;; highlight occurrences of the variable under cursor
     34     :after js2-mode
     35     :ensure t
     36     :pin melpa
     37     :config
     38     (eval-after-load "js2-highlight-vars-autoloads"
     39         '(add-hook 'js2-mode-hook (lambda () (js2-highlight-vars-mode))))
     40     )
     41 
     42 (use-package web-mode
     43     ;; major mode for editing web templates.
     44     ;; To set engine on the fly :
     45     ;; `M-x web-mode-set-engine`
     46     ;; Then indicate the name of the engine
     47     :ensure t
     48     :pin melpa
     49     :config
     50     (add-to-list 'auto-mode-alist '("\\.html\\'" . web-mode))
     51     (add-to-list 'auto-mode-alist '("\\.xhtml\\'" . web-mode))
     52     (add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode))
     53     (add-to-list 'auto-mode-alist '("\\.tpl\\.php\\'" . web-mode))
     54     (add-to-list 'auto-mode-alist '("\\.tpl\\'" . web-mode))
     55     (add-to-list 'auto-mode-alist '("\\.ftl\\'" . web-mode))
     56     (add-to-list 'auto-mode-alist '("\\.jsp\\'" . web-mode))
     57     (add-to-list 'auto-mode-alist '("\\.vm\\'" . web-mode))
     58     (add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode))
     59     (add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode))
     60     (add-to-list 'auto-mode-alist '("\\.mustache\\'" . web-mode))
     61     (add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode))
     62     (add-to-list 'auto-mode-alist '("\\.twig\\'" . web-mode))
     63     (add-to-list 'auto-mode-alist '("\\.jsx\\'" . web-mode))
     64     (add-to-list 'auto-mode-alist '("\\.tsx\\'" . web-mode))
     65     (add-to-list 'auto-mode-alist '("\\.njk\\'" . web-mode))
     66 
     67     (defadvice web-mode-highlight-part (around tweak-jsx activate)
     68         (if (equal web-mode-content-type "jsx")
     69             (let ((web-mode-enable-part-face nil))
     70                 ad-do-it)
     71             ad-do-it)))
     72 
     73 (use-package web-mode-edit-element
     74     ;; Helper-functions for attribute- and element-handling
     75     :ensure t
     76     :pin melpa)
     77 
     78 (use-package markdown-mode
     79     ;; Major mode for Markdown-formatted text.
     80     :ensure t
     81     :pin melpa)
     82 
     83 (use-package emmet-mode
     84     ;; Unofficial Emmet's support for emacs.
     85     :ensure t
     86     :pin melpa
     87     :config
     88     (add-hook 'sgml-mode-hook 'emmet-mode)
     89     (add-hook 'html-mode-hook 'emmet-mode)
     90     (add-hook 'web-mode-hook  'emmet-mode)
     91     (add-hook 'css-mode-hook  'emmet-mode)
     92     (add-hook 'scss-mode-hook  'emmet-mode))
     93 
     94 (use-package tagedit
     95     ;; Some paredit-like features for html-mode
     96     :ensure t
     97     :pin melpa)
     98 
     99 (use-package json-mode
    100     ;; Major mode for editing JSON files
    101     :ensure t
    102     )
    103 
    104 ;;; webdev.el ends here