I was looking for a less-complicated alternative to nxhtml/mumamo and html5.el (which requires xhtml syntax). I've played with web-mode for a few minutes, and it seems great. Handles html, css, js nicely.
Only concern so far: javascript variables with underscores do not highlight correctly.
There are still some bugs, but the author is fast at fixing bugs. I have been working on razor code, and found a bug on Thursday, he fixed it on Friday.
What I like the most is the speed. nxhtml/mumamo is too slow and sometimes it is even unusable.
Something I was looking for for a time! For now I used html-mode with mmm-mode (to encode largish javascript chunks in javascript mode.) Looks like I won't be needing it anymore
whenever I try to indent into a <script> tag. I also don't see any highlighting on the HTML, it's all grey. I guess installation failed for me. (I used marmalade.)
I was super excited as xhtml has a large set of problems and I've been looking for a replacement. Did anyone else have similar issues?
edit:
html is suppose to be grey (I'm not a fan.) and the indentation failure on a script tag still remains. There's a work around, add a newline after the <script> and then indent.
It might be a problem with othere modes:
"Syntax coloring does not work
Do not enable rainbow-mode or whitespace-mode with web-mode (see above).
Moreover, some users might report issues when using themes that not play nicely with web-mode.
Tip: when using emacs in a terminal, always try to enable 256 colors compatibility (xterm-256color)."
I've been using multi-web-mode for HTML, CSS and JS recently. This simply switches to a nominated mode when you're inside a block of HTML, CSS, JS, etc.
I keep meaning to figure out why this isn't working for me, because trying to use nxhtml-mode along with any sort of templating or embedded script tags is an exercise in frustration.
But web-mode (installed via ELPA) doesn't seem to be working at all, and any number of bits of my .emacs.d/ cruft could be to blame. Time for some -Q next reboot, perhaps.
I use this almost every day, and I love it. It really does "just work", even when you throw it files that can be a hideous mix of PHP, HTML, Javascript, inline CSS and whatever else. I actually wrote a quick script that uses Emacs and web-mode to auto-indent collections of files, and it does a much better job than any of the alternatives I've tried previously (even if it can be a little slow on larger directories).
It's also now included in bbatsov's Prelude[1] by default, which is nice since it eliminated the needs for the little hacks I was using to disable whitespace mode.
All in all, awesome project, and thanks so much for all the work you've put into it!
26 comments
[ 3.5 ms ] story [ 87.2 ms ] threadOnly concern so far: javascript variables with underscores do not highlight correctly.
What I like the most is the speed. nxhtml/mumamo is too slow and sometimes it is even unusable.
It seems to be getting confused with the braces in the scala bits and the javascript code.
Search failed: "<"
whenever I try to indent into a <script> tag. I also don't see any highlighting on the HTML, it's all grey. I guess installation failed for me. (I used marmalade.)
I was super excited as xhtml has a large set of problems and I've been looking for a replacement. Did anyone else have similar issues?
edit: html is suppose to be grey (I'm not a fan.) and the indentation failure on a script tag still remains. There's a work around, add a newline after the <script> and then indent.
It might be a problem with othere modes: "Syntax coloring does not work
Do not enable rainbow-mode or whitespace-mode with web-mode (see above). Moreover, some users might report issues when using themes that not play nicely with web-mode. Tip: when using emacs in a terminal, always try to enable 256 colors compatibility (xterm-256color)."
Update: Fixed some typos.
https://github.com/fgallina/multi-web-mode
Quite simple and elegant. But something that can work well with Jinja2 would be welcome. I'll take a look at web-mode.
I'd love to hear about how you made it, did you generate any of the elisp with another program?
But web-mode (installed via ELPA) doesn't seem to be working at all, and any number of bits of my .emacs.d/ cruft could be to blame. Time for some -Q next reboot, perhaps.
It's a wiki, go for it ;)
It's also now included in bbatsov's Prelude[1] by default, which is nice since it eliminated the needs for the little hacks I was using to disable whitespace mode.
All in all, awesome project, and thanks so much for all the work you've put into it!
[1] https://github.com/bbatsov/prelude