sublime text ctags exclude 正则 没效果

折腾 sublime text 2 + ctags 为php项目添加代码跳转,生成出来的.tags文件600M多。

查看下.tags多数是压缩成单行的js霸占

ctags 可以用 exclude参数排除指定路径下或者用正则

ctags --help 
....
  --append=[yes|no]
       Should tags should be appended to existing tag file [no]?
  --etags-include=file
      Include reference to 'file' in Emacs-style tag file (requires -e).
  --exclude=pattern
      Exclude files and directories matching 'pattern'.
....

对应到sublime就修改下 CTags.sublime-settings:

    // Additional options to pass to ctags.
    //
    // Any addition options you may wish to pass to the ctags executable. For
    // example:
    //
    //     ["--exclude=some/path", "--exclude=some/other/path", ...]
    "opts" : ["--exclude=*.js"],

但重新生成 tags,还是把js文件包含进来。 :(  :(

原来 ctags 有特殊编译选项,需要 +wildcards 。

http://ctags.sourceforge.net 下载的win32版本, 是不支持+wildcards的。

$ ./ctags.exe --version
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
  Compiled: Mar 13 2015, 10:35:58
  Addresses: <dhiebert@users.sourceforge.net>, http://ctags.sourceforge.net
  Optional compiled features: +win32, +regex, +internal-sort

 

不就一个小小的选项嘛,重新编译下ctags,但windows我安装的两个编译平台 vs、mingw 目前不能,

看源码 wildcards 功能依赖 fnmatch 函数库,而fnmatch又偏偏不支持mingw。天无绝人之路,还有cygwin。

进cygwin官网下载 https://cygwin.com/install.html  ,

安装方法 http://www.cygwin.cn/site/install/

折腾最后安装好了

$ ctags --version
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
  Compiled: Apr 16 2013, 08:42:49
  Addresses: <dhiebert@users.sourceforge.net>, http://ctags.sourceforge.net
  Optional compiled features: +wildcards, +regex, +internal-sort

看着 +wildcards 选项。

用sublime text 重新生成 项目的.tags文件, 从原来 600变成19M。

转载于:https://my.oschina.net/jszhang/blog/753403

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值