vim taglist 解決ctags: unrecognized option '--format

本文是好久之前整理的。

將系統由fedora換爲mint,使用原vim配置文件,使用taglist時候出現如下錯誤:
Taglist: Failed to generate tags for ....(a file)
ctags: unrecognized option '--format=2'^@^ITry `ctags --help' for a complete list of options.^@
並且沒法生成tag(已經安裝了ctags、etags).
解決方案:
如下摘自:http://vim-taglist.sourceforge.net/manual.html。
Q. When I try to open the taglist window, I am seeing the following error
   message. How do I fix this problem?


   Taglist: Failed to generate tags for /my/path/to/file
   ctags: illegal option -- -^@usage: ctags [-BFadtuwvx] [-f tagsfile] file ...


A. The taglist plugin will work only with the exuberant ctags tool. You
   cannot use the GNU ctags or the Unix ctags program with the taglist plugin.
   You will see an error message similar to the one shown above, if you try
   use a non-exuberant ctags program with Vim. To fix this problem, either add
   the exuberant ctags tool location to the PATH environment variable or set
   the 'Tlist_Ctags_Cmd'
 variable.
http://vim-taglist.sourceforge.net/manual.html#%27Tlist_Ctags_Cmd%27
If exuberant ctags is not present in one of the directories specified in the
PATH environment variable, then set this variable to point to the location of
the ctags utility in your system. Note that this variable should point to the
fully qualified exuberant ctags location and NOT to the directory in which
exuberant ctags is installed. If the exuberant ctags tool is not found in
either PATH or in the specified location, then the taglist plugin will not be
loaded. Examples:


        let Tlist_Ctags_Cmd = 'd:\tools\ctags.exe'
        let Tlist_Ctags_Cmd = '/usr/local/bin/ctags'
 
sudo apt-get install exuberant-ctags
相關文章
相關標籤/搜索