From cd286eb7ee9b31acd5854bfefb09402dbc18b14e Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sat, 21 Nov 2015 20:08:08 +0100 Subject: [PATCH] Add Twig configuration --- emacs/.emacs.d/init.org | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index ea1c053..5a830f8 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -1305,6 +1305,32 @@ #+INCLUDE: init-circe.org :minlevel 3 +** Twig + + Since twig is essentially a HTML template language, many tags must + be edited. Tagedit is good for restructuring existing tag + structures and adding single tags, whereas emmet mode is good when + you know more about the HTML hierarchy you're going to add. + + #+BEGIN_SRC emacs-lisp + (add-hook 'twig-mode-hook 'tagedit-mode) + (add-hook 'twig-mode-hook 'emmet-mode) + #+END_SRC + + Since Twig is a /template/ language, and thus not just HTML, electric + pairing is a blessing. + + #+BEGIN_SRC emacs-lisp + (add-hook 'twig-mode-hook 'electric-pair-local-mode) + #+END_SRC + + Both HTML and Twig mode aren't traditional text modes, so + =auto-fill-mode= doesn't make sense. + + #+BEGIN_SRC emacs-lisp + (add-hook 'twig-mode-hook (turn-off auto-fill-mode)) + #+END_SRC + * Minor mode customization Many minor modes also offer a bit of customization possibilities.