RusAlex
RusAlex

Reputation: 8585

how to teach vim indent like this

var Comments = new Schema({
    title     : String
  , body      : String
  , date      : Date
});

var BlogPost = new Schema({
    author    : ObjectId
  , title     : String
  , body      : String
  , date      : Date
  , comments  : [Comments]
  , meta      : {
        votes : Number
      , favs  : Number
    }
});

my vim now indents like this:

Offer = new Schema({
          'title': {type: String},
          'discount': {type: String},
});

Upvotes: 1

Views: 575

Answers (1)

RusAlex
RusAlex

Reputation: 8585

thanks guys, i've installed new indent file for javascript from this github repo: JavaScript Indent : Javascript indenter (HTML indent is included)

Upvotes: 2

Related Questions