I use taglist() to get a tag list. Then I did some filter, just leave some useful one like this:
let tttlist = taglist("^List$")
"echo ttt
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?
I see no way to show tags using one of the commands you mentioned so solution is to use
:execute
with:ptag
/:tag
on the first item in the list:. More, you don’t need to process tags list after you have found one of the tags:
. If you mean something else please post here how you are going to make
:ptag
/:tag
show you a list of tags: according to the documentation and observed behavior all they do is jumping to the first match.Also note: if key of the dictionary contains nothing more then latin letters, digits and underscores then you can access it as
dict.key
instead ofdict['key']
. When dictionary is used to pass structured data it is almost always true.