ctags lua protobuf

修改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

本次测试效果如下


posted @ 2015-01-14 00:30  滑板鞋  阅读(775)  评论(0编辑  收藏  举报