我正在尝试在Mac OS上使用exuberant ctag。我已经在homebrew上安装了exuberant ctag。以下是我的版本:
$ ctags --version
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert我的自定义$HOME/.ctags似乎没有被考虑在内。
下面是我的配置:
$ 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进行测试时
$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发布于 2014-04-15 06:04:35
该问题是由于BSD Regex造成的。
我刚刚通过在Vim :%s/\\s/[ \\t]/g中编辑~/.ctags解决了这个问题
发布于 2018-12-18 13:51:18
根据文档,您应该将配置文件放在~/.ctags.d/文件夹下。我也遇到了同样的问题,这样做对我来说也是有效的:
$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.https://stackoverflow.com/questions/23056537
复制相似问题