我正在使用 vim 和 ctags 来获取 taglist。但对于 javascript,它不适用于此约定
MyClass.extend({
xxx: function(){
},
...
})
MyClass.prototype = {
method : function(){ }
}
MyClass.prototype.method = function () {
}
我正在使用 vim 和 ctags 来获取 taglist。但对于 javascript,它不适用于此约定
MyClass.extend({
xxx: function(){
},
...
})
MyClass.prototype = {
method : function(){ }
}
MyClass.prototype.method = function () {
}
就像其他人所说:DoctorJS(以前的jsctags)是最好的选择。
但是,通过编写自定义包装器或使用当前不工作的 Vim-taglist-plus 插件将其与 Vim 集成并不是好的解决方案。
我发现最简单的方法是安装TagBar Vim 插件(注意:它是 TagBar,而不是旧的臭名昭著的 TagList!)。
有一个名为 tern.js 的新项目应该替换死去的医生.js。有关更多信息,请参阅上面的链接。
正如@Benoit 回答的那样,您始终可以为 ctags 设置新语言;但是对于 JavaScript,您可能想尝试 DoctorJS(以前称为jsctags)。从作者看来,这是一个有限的 JS 环境,它记录了您的脚本创建的所有函数和对象,并将它们转换为与 vim 兼容的标签文件。这是原始帖子http://pcwalton.blogspot.com/2010/05/introducing-jsctags.html及其网站:http ://doctorjs.org/ 。
要将它与 ctags 一起使用,我必须将 ctags 文件重命名为 smt likeex-ctags
并编写一个名为 ctags 的包装脚本,该脚本将根据--language
.
provided you install doctorjs, you can use the vim-taglist-plus plugin, which is a fork of the vim-taglist plugin with jsctags (doctorjs) support : https://github.com/int3/vim-taglist-plus