Skip to content

Instantly share code, notes, and snippets.

@db0company
Created April 3, 2017 04:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save db0company/40970d37b8f2e1180f60e2e9fcfd27f7 to your computer and use it in GitHub Desktop.
Save db0company/40970d37b8f2e1180f60e2e9fcfd27f7 to your computer and use it in GitHub Desktop.
(add-to-list 'load-path "~/.emacs.d/installed/")
(when (fboundp 'electric-indent-mode) (electric-indent-mode -1))
(require 'web-mode)
(add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.tpl\\.php\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.[agj]sp\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.mustache\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.js[x]?\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.json\\'" . web-mode))
(setq-default indent-tabs-mode nil)
(setq-default web-mode-markup-indent-offset 2)
(add-hook 'web-mode
(function (lambda ()
(setq indent-tabs-mode nil
tab-width 2
space-width 2))))
(defun my-web-mode-hook ()
"Hooks for Web mode."
(setq web-mode-markup-indent-offset 2)
)
(add-hook 'web-mode-hook 'my-web-mode-hook)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment