3

If I go to scratch, M-x web-mode RET, type in this snippet:

<script type="text/x-dust-template">
    {#obj_to_iterate}
    {prop} <----- this should indent
    {/obj_to_iterate}
</script>

What am I doing wrong here? I see bugs with Dust.js have been solved and I can't be the only one doing simple stuff like this without noticing this indentation behaviour.

Also having problems with the general indentation of HTML, sometimes I get a TAB, sometimes I get two spaces, sometimes one space, who knows what else I can get but it is at least consistent so TAB or spaces are always the same for every line that I indent.

I just want one TAB per identation and properly indented Dust, can somebody help me?

user12968
  • 31
  • 2

1 Answers1

1

I had a similar problem getting web-mode to play nice with Django templates. For me the fix was as simple as adding the following to my init file:

(setq web-mode-engines-alist
  '(("django"    . "\\.html\\'"))
  )

For you, try adding something like:

(setq web-mode-engines-alist
  '(("dust"    . "\\.html\\'"))
  )

For more details, see the section Associate an engine in the web-mode docs.

elethan
  • 4,755
  • 3
  • 29
  • 56