钢构cad注册机:How to display variables in Taglist window in...
来源:百度文库 编辑:九乡新闻网 时间:2024/03/29 22:18:03
I am using Taglist plugin in vim. In the taglist window i can see tags like namespaces, classes, struct, function but not variables. I saw a screenshot(attached below) on Taglist website which had this info. I am using Vim 7 and Exuberant Ctags 5.8, and i have generated my ctags using this command
ctags --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++
vim taglist link|improve this question asked Mar 5 '10 at 18:46 Yogesh Arora501314
89% accept rate this question was helpful
2 Answers
active oldest votes up vote 1 down vote acceptedThere is a variable s:tlist_def_cpp_settings
in Taglist plugin (.vim/plugin/taglist.vim) that defines which elements are shown by default.
I extended it to:
let s:tlist_def_cpp_settings = 'c++;n:namespace;v:variable;d:macro;t:typedef;' . \ 'c:class;g:enum;s:struct;u:union;f:function;m:member;' . \ 'p:prototype'
According to taglist manual you can also define tlist_cpp_settings
in your .vimrc
with similar value.
For other languages different variables exist.
link|improve this answer answered Jun 9 at 21:41 boro313 this answer was helpful up vote 1 down vote +100
As far as I know, the Taglist plugin shows only the variables which have file scope. It does not show variables which have only function scope.
For a quick test just add a variable of any type at the start of your source file, save the source file, set cursor into the taglist window and press u to update taglist. Now this variable should appear in the taglist window. This works for my C files.
By the way:
... and i have generated my ctags using this command
ctags --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++
Do you mean that you generate your own tags file for the taglist plugin using these ctags options? To my knowledge taglist uses its own ctags options and generates a temporary tag file. The user has no influence on the ctags options and the tags file.
link|improve this answer edited Mar 8 '10 at 22:45answered Mar 8 '10 at 21:59 Habi
75637 Does it show the class variables – Yogesh Arora Mar 9 '10 at 2:29 Use let tlist_cpp_options to set options on how taglist executes ctags. (:help taglist-extend) As answered, it executes ctags itself on the fly and shows results that way. It doesn't use a ctags file. – Bazman Nov 17 '10 at 1:53