ctags: 提示错误ctags: unrecognized option '--format=2'

ctags: 提示错误ctags: unrecognized option '--format=2'

  原来的 taglist 插件用的好好的,自从安装了 emacs 之后,每次触发 taglist 都提示以下错误:

Taglist: Failed to generate tags for ....(a file)
ctags: unrecognized option '--format=2'^@^ITry `ctags --help' for a complete list of options.^@

  原因是我系统中有两个 ctags。其中一个是 exuberant-ctags,另一个则是 GNU 的 ctags,taglist 需要使用的 exuberant-ctags

 1 $whereis ctags
 2 ctags: /usr/bin/ctags /usr/local/bin/ctags /usr/share/man/man1/ctags.1.gz
 3 /usr/bin/ctags --version
 4 Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
 5   Compiled: Mar  6 2010, 20:04:06
 6   Addresses: <dhiebert@users.sourceforge.net>, http://ctags.sourceforge.net
 7   Optional compiled features: +wildcards, +regex
 8 $/usr/local/bin/ctags --version
 9 ctags (GNU Emacs 24.2)
10 Copyright (C) 2012 Free Software Foundation, Inc.
11 This program is distributed under the terms in ETAGS.README

  解决的办法就是在 $HOME/.vimrc 中指定要哪个 ctags 。

let g:Tlist_Ctags_Cmd='/usr/bin/ctags'

  参考资料:

  [1]. http://www.cnblogs.com/chenchenluo/archive/2012/07/01/2571659.html

posted @ 2012-11-17 14:04  Eddy_He  阅读(2549)  评论(1编辑  收藏  举报