summaryrefslogtreecommitdiffstats
path: root/ftplugin
diff options
context:
space:
mode:
Diffstat (limited to 'ftplugin')
-rw-r--r--ftplugin/puppet_tagbar.vim48
1 files changed, 48 insertions, 0 deletions
diff --git a/ftplugin/puppet_tagbar.vim b/ftplugin/puppet_tagbar.vim
new file mode 100644
index 00000000..b607ccb0
--- /dev/null
+++ b/ftplugin/puppet_tagbar.vim
@@ -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()
+