how to make vim ctags works for modern javascript

前端 未结 4 430
猫巷女王i
猫巷女王i 2021-01-31 02:51

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

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

MyClass.pr         


        
4条回答
  •  一向
    一向 (楼主)
    2021-01-31 03:34

    As @Benoit answered, you can always setup a new languages for ctags; however in the case of JavaScript, you may want to try DoctorJS (formerly jsctags). From the author it is a limited JS environment that records all the functions and objects your script made and turns them into vim-compatible tags file. Here is the original post http://pcwalton.blogspot.com/2010/05/introducing-jsctags.html and its website: http://doctorjs.org/.

    To use it with ctags I have to rename the ctags file to smt like ex-ctags and write a wrapper script named ctags which will switch the tool depending on --language.

提交回复
热议问题