summaryrefslogtreecommitdiffstats
path: root/emacs
diff options
context:
space:
mode:
authorGravatar Tom Willemse2015-11-21 20:08:08 +0100
committerGravatar Tom Willemse2015-11-21 20:08:08 +0100
commitcd286eb7ee9b31acd5854bfefb09402dbc18b14e (patch)
tree9eaf6beb329e6bc75a5449fd0f4be8969baf8060 /emacs
parent7dbde2b56da1928f344d8be9e2ea0d60cc74d828 (diff)
downloaddotfiles-cd286eb7ee9b31acd5854bfefb09402dbc18b14e.tar.gz
dotfiles-cd286eb7ee9b31acd5854bfefb09402dbc18b14e.zip
Add Twig configuration
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/init.org26
1 files changed, 26 insertions, 0 deletions
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.