Currently an Emacs user, but trying out Vim for a change. :)
I'm really enjoying the quick keystrokes and the overall philosophy of Vim, however I've been running into some issues with the more advanced features. One problem I'm having is with indenting, specifically when using the =
command.
Take a look at this JS snippet. This is how Emacs' js2-mode indents it, which I prefer:
var MyClass = declare([], {
constructor: function(params) {
if(!params) {
params = {};
}
Now compare that to what Vim does. It's a mess:
var MyClass = declare([], {
constructor: function(params) {
if(!params) {
params = {};
}
All the code above this block gets indented correctly, but from there on it's a disaster. And I have blocks like this all over my code. I've checked the :filetype
settings and tried toggling those switches. I've experimented with plugins as well. Still can't seem to get it right. I'm using gVim 7.4, downloaded just a few days ago. I came across this question where the snippet shown there is perfectly indented straight away.
Does anyone have any suggestions on what I could try next? Appreciate any advice!