tagbar
tagbar copied to clipboard
Allow addition of new language types (#789)
This is an attempt to resolve #789 and re-enable support for addition of a new language definition from within vim configuration without having to edit ~/.ctags
.
With this patch, if you need to define a language that is unknown to ctags and provide a custom file with deffile
as documented in doc/tagbar.txt
, you can use deflang
as follows:
let g:tagbar_type_asciidoc = {
\ 'ctagstype': 'asciidoc',
\ 'deflang': 'asciidoc',
\ 'deffile': expand('<sfile>:p:h:h') . '/ctags/asciidoc.cnf',
\ 'sort': 0,
\ 'kinds': [
\ 's:Table of Contents',
\ 'i:Included Files',
\ 'I:Images',
\ 'v:Videos',
\ 'a:Set Attributes',
\ 'A:Unset Attributes'
\ ]
\}
On the off chance this solution gets approved, I'd be of course happy to update docs/tagbar.txt
as well.