taglist 适用于 gvim 而不是 vim

taglist works with gvim not with vim

我可以将 taglist 与 gvim(从 xterm 启动)一起使用,但不能在 vim(在 putty 中打开)中使用。当我尝试使用来自 vim Taglist: Failed to generate tags for /home/abbcd/abcd/XXXX.c ctags: unrecognized option '--format=2'^@^ITry 'ctags --help' for a complete list of options.^@ 的 taglist 时出现以下错误 想知道为什么它适用于 gvim 而不是 vim.

根据评论,不同之处在于 $PATH 的设置方式取决于您的连接方式。

taglist.vim 插件文件有一条注释:

  1. If the exuberant ctags utility is not present in your PATH, then set the Tlist_Ctags_Cmd variable to point to the location of the exuberant ctags utility (not to the directory) in the .vimrc file.

因此,在您的 .vimrc 文件中添加一行,例如:

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

使用正确工作的 ctags 二进制文件的路径。 (由 which ctags 在 xterm 中返回的那个。)