Skip to content

Instantly share code, notes, and snippets.

@yongkangchen
Last active October 29, 2021 11:21
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save yongkangchen/10120546 to your computer and use it in GitHub Desktop.
Save yongkangchen/10120546 to your computer and use it in GitHub Desktop.
ctags lua 规则增强
--regex-LUA=/^.*\s*function[ \t]*([a-zA-Z0-9_]+):([a-zA-Z0-9_]+).*$/\2/f,function/
--regex-LUA=/^.*\s*function[ \t]*([a-zA-Z0-9_]+)\.([a-zA-Z0-9_]+).*$/\2/f,function/
--regex-LUA=/^.*\s*function[ \t]*([a-zA-Z0-9_]+)\s*\(.*$/\1/f,function/
--regex-LUA=/([a-zA-Z0-9_]+) = require[ (]"([^"]+)"/\1/r,require/
--regex-LUA=/[ \t]{1}([a-zA-Z0-9_]+)[ \t]*[=][^=]/\1/v,variable/
--regex-LUA=/[ \t]*([a-zA-Z0-9_]+)[ \t]*=[ \t]*module_define.*$/\1/m,module/
--regex-LUA=/func_table\[ msg\.([A-Z_]+) \].+/\1/
--regex-LUA=/\([ \t]*msg.([A-Z_]+)[ \t]*\)/\1/
ctags lua 规则增强,将以上部分保存至目录:
/ctags.cnf (on MSDOS, MSWindows only)
/etc/ctags.conf
/usr/local/etc/ctags.conf
$HOME/.ctags
$HOME/ctags.cnf (on MSDOS, MSWindows only)
.ctags
ctags.cnf (on MSDOS, MSWindows only)
支持识别:
function xxx.yyy() end
function xxx:yyy() end
modules("xxx",...)
全局变量
已测试系统:
mac os x 10.9
centos 6.4
参考文档:http://ctags.sourceforge.net/ctags.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment