#emacs on Freenode, I got the advice to use
instead. Already having that installed, I switched over, and
immediately ran into a similar frustration: indentation was all wonky.
- it was using tabs instead of spaces
- indentation level was set to 8
- it didn’t know how to deal with React’s JSX code
First problem I tackled, tab indentation. Running into the code, I found this:
So, I just need to set this variable, right? Wrong. It was already set to 4, which is what I at least wanted to start with. (Work projects use 2 spaces as standard.)
I looked in the wee test file I was using and found that the value had been changed to 8 locally. Global value was still 4. Okay, what’s changing it locally?
web-mode.el, I found it was being set in
web-mode-use-tabs, which was a little strange.
Why would it be using
tabs? Sure enough, searching for that function, I found a little
further where the mode is actually defined (
web-mode) it calls
web-mode-use-tabs when the variable
indent-tabs-mode is not
Voila. I then set
nil in my global settings,
reloaded emacs, and now
web-mode uses the setting of 4 for indents.
I’m hoping this will actually help, now.
What I’ve been using instead is JetBrain’s WebStorm, which is actually a really wonderful alternative, but I don’t want to fire it up if I just have to tweak a couple