Skip to content

Instantly share code, notes, and snippets.

@yongkangchen
Last active October 29, 2021 11:21
Show Gist options
  • Save yongkangchen/10120546 to your computer and use it in GitHub Desktop.
Save yongkangchen/10120546 to your computer and use it in GitHub Desktop.

Revisions

  1. yongkangchen revised this gist Oct 7, 2015. 1 changed file with 11 additions and 7 deletions.
    18 changes: 11 additions & 7 deletions ctags lua 规则增强
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,14 @@
    --langdef=MYLUA
    --langmap=MYLUA:.lua
    --regex-MYLUA=/^.*\s*function[ \t]*([a-zA-Z0-9_]+):([a-zA-Z0-9_]+).*$/\2/f/
    --regex-MYLUA=/^.*\s*function[ \t]*([a-zA-Z0-9_]+)\.([a-zA-Z0-9_]+).*$/\2/f/
    --regex-MYLUA=/^.*\s*function[ \t]*([a-zA-Z0-9_]+)\s*\(.*$/\1/f/
    --regex-MYLUA=/^[ \t]*([a-zA-Z0-9_]+)[ \t]*=.*$/\1/e/
    --regex-MYLUA=/^[ \t]*module[ \t\(]*\"([a-zA-Z0-9_]+)\".*$/\1/m,module/
    --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 规则增强,将以上部分保存至目录:
  2. yongkangchen revised this gist Oct 10, 2014. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion ctags lua 规则增强
    Original file line number Diff line number Diff line change
    @@ -24,4 +24,6 @@ modules("xxx",...)

    已测试系统:
    mac os x 10.9
    centos 6.4
    centos 6.4

    参考文档:http://ctags.sourceforge.net/ctags.html
  3. yongkangchen revised this gist Apr 8, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions ctags lua 规则增强
    Original file line number Diff line number Diff line change
    @@ -20,6 +20,7 @@ ctags.cnf (on MSDOS, MSWindows only)
    function xxx.yyy() end
    function xxx:yyy() end
    modules("xxx",...)
    全局变量

    已测试系统:
    mac os x 10.9
  4. yongkangchen created this gist Apr 8, 2014.
    26 changes: 26 additions & 0 deletions ctags lua 规则增强
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    --langdef=MYLUA
    --langmap=MYLUA:.lua
    --regex-MYLUA=/^.*\s*function[ \t]*([a-zA-Z0-9_]+):([a-zA-Z0-9_]+).*$/\2/f/
    --regex-MYLUA=/^.*\s*function[ \t]*([a-zA-Z0-9_]+)\.([a-zA-Z0-9_]+).*$/\2/f/
    --regex-MYLUA=/^.*\s*function[ \t]*([a-zA-Z0-9_]+)\s*\(.*$/\1/f/
    --regex-MYLUA=/^[ \t]*([a-zA-Z0-9_]+)[ \t]*=.*$/\1/e/
    --regex-MYLUA=/^[ \t]*module[ \t\(]*\"([a-zA-Z0-9_]+)\".*$/\1/m,module/


    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