Emacs, Django templates and script blocks
I use emacs when working with Dj开发者_JS百科ango. .py files work great with Python-mode, .js files work great with js2-mode, .djhtml (templates) work great with django-html-mode -- except for Javascript blocks which aren't auto-indented nor highlighted.
Does anyone know of a way to get syntax-highlighting for Javascript blocks in Django templates in emacs?
You can use django-nxhtml-mumamo-mode
. It is part of the nXhtml package. (It is shipped with Emacs Starter Kit, too.) For JavaScript, it uses javascript-mode
instead of js2-mode
.
精彩评论