diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2015-12-17 10:48:07 +0100 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2015-12-17 10:49:17 +0100 |
commit | 7679a92627661ef2d6878079a5c53bf3669aabf7 (patch) | |
tree | 1c7d94fce4cf982d2bd57e31b886c6a112bb12c0 /syntax/ansible_hosts.vim | |
parent | ad44c4f7a316e798a9354197b20a80eabf280f1a (diff) | |
download | vim-polyglot-7679a92627661ef2d6878079a5c53bf3669aabf7.tar.gz vim-polyglot-7679a92627661ef2d6878079a5c53bf3669aabf7.zip |
Add ansible support, closes #96
Diffstat (limited to 'syntax/ansible_hosts.vim')
-rw-r--r-- | syntax/ansible_hosts.vim | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/syntax/ansible_hosts.vim b/syntax/ansible_hosts.vim new file mode 100644 index 00000000..fde5bf6f --- /dev/null +++ b/syntax/ansible_hosts.vim @@ -0,0 +1,35 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1 + +" Vim syntax file +" Language: Ansible hosts files +" Maintainer: Dave Honneffer <pearofducks@gmail.com> +" Last Change: 2015.09.23 + +if exists("b:current_syntax") + finish +endif + +syn case ignore +syn match hostsFirstWord "\v^\S+" +syn match hostsAttributes "\v\S*\=" +syn region hostsHeader start="\v^\s*\[" end="\v\]" +syn keyword hostsHeaderSpecials children vars containedin=hostsHeader contained +syn match hostsComment "\v^[#;].*$" + +highlight link hostsFirstWord Label +highlight link hostsHeader Define +highlight link hostsComment Comment +highlight link hostsHeaderSpecials Identifier +highlight link hostsAttributes Structure + +if exists("g:ansible_attribute_highlight") + if g:ansible_attribute_highlight =~ 'n' + highlight link hostsAttributes NONE + elseif g:ansible_attribute_highlight =~ 'd' + highlight link hostsAttributes Comment + endif +endif + +let b:current_syntax = "ansible_hosts" + +endif |