File: puppet_tagbar.vim

package info (click to toggle)
vim-puppet 4~20181115%2Bgit4793b074-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 164 kB
  • sloc: sh: 28; makefile: 2
file content (44 lines) | stat: -rw-r--r-- 953 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
" 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()