preservim / tagbar

Vim plugin that displays tags in a window, ordered by scope
https://preservim.github.io/tagbar
Other
6.09k stars 484 forks source link

Support secondary filetypes #839

Open fenuks opened 1 year ago

fenuks commented 1 year ago

I would like to add support for openapi in my configuration. I've found this snippet

let g:tagbar_type_yaml = {
                    \  'ctagstype': 'openapi',
                    \  'kinds': [
                    \          'p:path',
                    \          'd:schema',
                    \          'P:parameter',
                    \          'R:response',
                    \          ]
                    \ }

It works, but I don't want to define it for all yaml files. I would rather prefer to use additional filetype openapi to specify configuration, so filetype would be yaml.openapi. It seems that tagbar ignores additional filetypes on purpose, here. Can this limitation be lifted, that is, could tagbar iterate over all filetypes, and perhaps merge configuration, or there could be option to tell tagbar to use last filetype instead of main?