how to make vim ctags works for modern javascript

guilin 桂林 picture guilin 桂林 · Dec 18, 2010 · Viewed 20.9k times · Source

I am using vim and ctags to get taglist. but for javascript, it does not works for this convention

MyClass.extend({
  xxx: function(){
  },
   ...
})

MyClass.prototype = {
    method : function(){ }

}

MyClass.prototype.method  = function () {
}

Answer

Ory Band picture Ory Band · May 5, 2011

Like the others had said: DoctorJS (formerly jsctags) is the best option.

However, integrating it with Vim by writing custom wrappers or using Vim-taglist-plus plugin, which isn't currently working, aren't good solutions.

The easiest way I've found is to install the TagBar Vim plugin (NOTE: It's TagBar, not the old infamous TagList!).

See my other answer for more info.

Edit:

There's a new project called tern.js which should replace the dead doctor.js. See the link above for more info.