Has vim built-in functions which can return a list of tab files? like :tabs command
You'll have to do some parsing, but you can use let myVar = execute('tabs')
for this.
How to get tag's filename under the cursor?
I don't think there's a built in way to do this but here's a quick and dirty first stab at a function that will do it:
function! ReturnTagFileUnderCursor()
try
let tag = expand('<cword>')
let tagString = split(execute("tselect ".tag), "\n")[1]
let tagString = matchstr(tagString, '[^/\\]*$')
return tagString
catch /^Vim\%((\a\+)\)\=:E426/
echohl ERROR
echo "Tag not found!"
echohl NORMAL
return ""
endtry
endfunction
Note: This will always take the first result if there are duplicate tags. Also it returns just the filename, but you can adjust the regex to get the whole path if desired.
See :h execute()
and :h tselect
for more info.