mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-13 05:53:50 -05:00
Change provider for puppet, closes #424
This commit is contained in:
48
ftplugin/puppet_tagbar.vim
Normal file
48
ftplugin/puppet_tagbar.vim
Normal file
@@ -0,0 +1,48 @@
|
||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'puppet') != -1
|
||||
finish
|
||||
endif
|
||||
|
||||
" Puppet set up for Tagbar plugin
|
||||
" (https://github.com/majutsushi/tagbar).
|
||||
|
||||
if !exists(':Tagbar')
|
||||
finish
|
||||
endif
|
||||
|
||||
let g:tagbar_type_puppet = {
|
||||
\ 'ctagstype': 'puppet',
|
||||
\ 'kinds': [
|
||||
\ 'c:Classes',
|
||||
\ 's:Sites',
|
||||
\ 'n:Nodes',
|
||||
\ 'v:Variables',
|
||||
\ 'i:Includes',
|
||||
\ 'd:Definitions',
|
||||
\ 'r:Resources',
|
||||
\ 'f:Defaults',
|
||||
\ 't:Types',
|
||||
\ 'u:Functions',
|
||||
\],
|
||||
\}
|
||||
|
||||
if puppet#ctags#Type() == 'universal'
|
||||
" There no sense to split objects by colon
|
||||
let g:tagbar_type_puppet.sro = '__'
|
||||
let g:tagbar_type_puppet.kind2scope = {
|
||||
\ 'd': 'definition',
|
||||
\ 'c': 'class',
|
||||
\ 'r': 'resource',
|
||||
\ 'i': 'include',
|
||||
\ 'v': 'variable',
|
||||
\}
|
||||
let g:tagbar_type_puppet.scope2kind = {
|
||||
\ 'definition' : 'd',
|
||||
\ 'class' : 'c',
|
||||
\ 'resource' : 'r',
|
||||
\ 'include' : 'i',
|
||||
\ 'variable' : 'v',
|
||||
\}
|
||||
endif
|
||||
|
||||
let g:tagbar_type_puppet.deffile = puppet#ctags#OptionFile()
|
||||
|
||||
Reference in New Issue
Block a user