0

How do I get Emacs to auto-indent Spacebars blocks when coding with Meteor? Right now, Emacs automatically does this:

{{#each player}}
{{name}}
{{/each}}

instead of this:

{{#each player}}
    {{name}}
{{/each}}

Failing that, can I stop Emacs from deleting my indentation when I hit return? If I manually add indentation so that the code looks like the second example above, then hit return after {{name}}, it deletes the indentation so it looks like the first example.

Right now I’m using Emacs 25.2.2. I just use the basic GNU Emacs that I installed in Ubuntu 18.04, so I guess Vanilla Emacs. The major mode when I open html files is HTML.

I got a suggestion here to use web-mode.el, but I couldn't figure out how to set it up for Meteor.

Thanks in advance for any help!

2
  • Find yourself a meteor-mode and if all else fails, there's always fundamental-mode. But clearly using html-mode if you're not editing html won't lead to good results.
    – Stefan
    Commented Jun 20, 2020 at 2:12
  • @Stefan your comment seems to be assuming that I understood modes, even though that lack of understanding was a big part of the problem. It would have been more helpful to share something like the Emacs Manual page on major modes: gnu.org/software/emacs/manual/html_node/emacs/…
    – Frankie
    Commented Jun 21, 2020 at 20:59

1 Answer 1

1

I figured out how to use web-mode to solve my problem. For anyone interested, I explained what I did here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.