summaryrefslogtreecommitdiffstats
path: root/syntax/ansible_template.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2015-12-17 10:48:07 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2015-12-17 10:48:07 +0100
commitde3110b733880502b23faf9af4d450f22a4b15f7 (patch)
treedd18074c197a91640abb246ec158dc1895d980be /syntax/ansible_template.vim
parent7cbd509b6ca5522b33c8bf299468ec1be9052416 (diff)
downloadvim-polyglot-2.4.0.tar.gz
vim-polyglot-2.4.0.zip
Add ansible support, closes #96v2.4.0
Diffstat (limited to 'syntax/ansible_template.vim')
-rw-r--r--syntax/ansible_template.vim31
1 files changed, 31 insertions, 0 deletions
diff --git a/syntax/ansible_template.vim b/syntax/ansible_template.vim
new file mode 100644
index 00000000..31ca4b24
--- /dev/null
+++ b/syntax/ansible_template.vim
@@ -0,0 +1,31 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1
+
+" Vim syntax file
+" Language: Ansible YAML/Jinja templates
+" Maintainer: Dave Honneffer <pearofducks@gmail.com>
+" Last Change: 2015.09.06
+
+if exists("b:current_syntax")
+ finish
+endif
+
+if !exists("main_syntax")
+ let main_syntax = 'jinja2'
+endif
+
+let b:current_syntax = ''
+unlet b:current_syntax
+runtime! syntax/jinja2.vim
+
+if exists("g:ansible_extra_syntaxes")
+ let s:extra_syntax = split(g:ansible_extra_syntaxes)
+ for syntax_name in s:extra_syntax
+ let b:current_syntax = ''
+ unlet b:current_syntax
+ execute 'runtime!' "syntax/" . syntax_name
+ endfor
+endif
+
+let b:current_syntax = "ansible_template"
+
+endif