首页 > 其他 > 详细

ctags lua protobuf

时间:2015-01-14 00:51:23      阅读:557      评论:0      收藏:0      [点我收藏+]

修改ctags对lua的支持

增加对protobuf的支持


将下面代码保存到~/.ctags文件,然后重新使用ctags,就会使用该文件中注册语言处理对应文件


--langdef=MYLUA
--langmap=MYLUA:.lua
--regex-MYLUA=/^local[ \t]+([a-zA-Z0-9_]+)[ \t]*=[ \t]*\{/\1/v,var/
--regex-MYLUA=/[ \t]*([a-zA-Z0-9_]+)[ \t]*=[ \t]*function[ \t]*\(/\1/f,function/
--regex-MYLUA=/function[ \t]+([a-zA-Z0-9_]+)[\.:]([a-zA-Z0-9_]+)[ \t]*\(/\2/f,function/

--langdef=PROTO
--langmap=PROTO:.proto
--regex-PROTO=/^[ \t]*message[ \t]+([a-zA-Z0-9_\.]+)/\1/m,message/
--regex-PROTO=/^[ \t]*(required|repeated|optional)[ \t]+[a-zA-Z0-9_\.]+[ \t]+([a-zA-Z0-9_]+)[ \t]*=/\2/f,field/

只要按照上列格式的正则表达式匹配,即可重新注册自定义的任意语言,具体使用规范参加:

http://ctags.sourceforge.net/ctags.html

本次测试效果如下

技术分享

ctags lua protobuf

原文:http://blog.csdn.net/jncpp/article/details/42691421

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!