How to show custom taglist in window like :tag or :ptag

14 views
Skip to first unread message

stevenfrog

unread,
May 29, 2012, 10:38:16 PM5/29/12
to vim_use
I use taglist() to get a tag list. Then I did some filter, just leave
some useful one like this:

let tttlist = taglist("^List$")
let newtttlist = []
for item in tttlist
if item['kind'] == 'i' || item['kind'] == 'c'
call add(newtttlist, item)
endif
endfor
echo newtttlist

But how to show them like :tag and :ptag in vim?

Ben Fritz

unread,
May 31, 2012, 2:01:28 PM5/31/12
to vim...@googlegroups.com

I don't understand what you're trying to achieve.

Assuming your taglist contains tags named "List" your code will echo them to the screen. Which tag do you wish to jump to? If you have the tag name in a variable, like tag_i_want_to_jump_to, you can jump to it with something like:

:exec "tag" tag_i_want_to_jump_to

If you want to do something else, please try to tell us SPECIFICALLY what you are trying to do, what you tried, what you expected to happen, and what happened instead.

Reply all
Reply to author
Forward
0 new messages