Emacs: Configure helm-dash-docsets for PHP & Twig
Alan Pearce alan@alanpearce.co.uk
Thu, 07 Aug 2014 20:03:31 +0100
1 files changed, 6 insertions(+), 2 deletions(-)
jump to
M tag-emacs/emacs.d/init.el → tag-emacs/emacs.d/init.el
@@ -334,7 +334,9 @@ (defun ap/create-helm-dash-hook (docsets) (lambda () (when (require 'helm-dash nil :noerror) (setq-local helm-dash-docsets (if (listp docsets) docsets (list docsets)))))) - (add-hook 'ansible-mode-hook (ap/create-helm-dash-hook "Ansible")))) + (add-hook 'ansible-mode-hook (ap/create-helm-dash-hook "Ansible")) + (add-hook 'php-mode-hook (ap/create-helm-dash-hook '("PHP" "Symfony"))) + (add-hook 'twig-mode-hook (ap/create-helm-dash-hook '("Twig"))))) (req-package which-func :init (which-function-mode) @@ -1244,7 +1246,6 @@ (add-hook 'web-mode-hook #'emmet-mode)))) (req-package web-mode :mode (("/views/.*\\.php\\'" . web-mode) - ("\\.html\\.twig\\'" . web-mode) ("/layouts/.*\\.html" . web-mode) ("/templates/.*\\.php\\'" . web-mode)) :config (setq web-mode-code-indent-offset 4 @@ -1254,6 +1255,9 @@ web-mode-style-padding 0 web-mode-script-padding 0 web-mode-comment-style 2 web-mode-disable-auto-pairing t)) + +(define-derived-mode twig-mode web-mode "Twig") +(add-to-list 'auto-mode-alist '("\\.html\\.twig\\'" . twig-mode)) (req-package mmm-auto :config (progn