首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ctags不使用我在Mac上的自定义.ctags

ctags不使用我在Mac上的自定义.ctags
EN

Stack Overflow用户
提问于 2014-04-14 17:28:17
回答 2查看 1.4K关注 0票数 4

我正在尝试在Mac OS上使用exuberant ctag。我已经在homebrew上安装了exuberant ctag。以下是我的版本:

代码语言:javascript
复制
$ ctags --version
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert

我的自定义$HOME/.ctags似乎没有被考虑在内。

下面是我的配置:

代码语言:javascript
复制
$ cat ~/.ctags
--verbose=no
--recurse=yes
--tag-relative=yes
--langdef=scala
--langmap=scala:.scala
--regex-scala=/^\s*class\s*([a-zA-Z0-9_]+)/\1/c,classes/
…

当我启动ctags -R时,没有为.scala文件生成标签。

当我使用--options进行测试时

代码语言:javascript
复制
$ctags -R --options=/Users/yamo/.ctags
ctags: cannot open option file "/Users/yamo/.ctags" : No such file or directory

$ll ~/.ctags
lrwxr-xr-x  1 yamo  staff  36 Apr 13 21:29 /Users/yamo/.ctags@ -> /Users/yamo/Projects/dotfiles/.ctags
EN

回答 2

Stack Overflow用户

发布于 2014-04-15 06:04:35

该问题是由于BSD Regex造成的。

我刚刚通过在Vim :%s/\\s/[ \\t]/g中编辑~/.ctags解决了这个问题

票数 3
EN

Stack Overflow用户

发布于 2018-12-18 13:51:18

根据文档,您应该将配置文件放在~/.ctags.d/文件夹下。我也遇到了同样的问题,这样做对我来说也是有效的:

代码语言:javascript
复制
   $HOME/.ctags.d/*.ctags

   $HOMEDRIVE$HOMEPATH/ctags.d/*.ctags (on MSWindows only)

   .ctags.d/*.ctags

   ctags.d/*.ctags
      If any of these configuration files exist, each will be expected to contain a set of default options which are read in the order listed when ctags starts, but before the CTAGS
      environment variable is read or any command line options are read. This makes it possible to set up personal or project-level defaults. It is possible to compile ctags to read
      an  additional  configuration  file  before  any  of those shown above, which will be indicated if the output produced by the --version option lists the "custom-conf" feature.
      Options appearing in the CTAGS environment variable or on the command line will override options specified in these files. Only options will be read  from  these  files.  Note
      that  the  option files are read in line-oriented mode in which spaces are significant (since shell quoting is not possible) but spaces at the beginning of a line are ignored.
      Each line of the file is read as one command line parameter (as if it were quoted with single quotes).  Therefore, use new lines to indicate separate  command-line  arguments.
      A line starting with '#' is treated as a comment.

      *.ctags files in a directory are loaded in alphabetical order.

   tags   The default tag file created by ctags.

   TAGS   The default tag file created by etags.
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23056537

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档