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:48:07 +0100 |
commit | de3110b733880502b23faf9af4d450f22a4b15f7 (patch) | |
tree | dd18074c197a91640abb246ec158dc1895d980be /ftdetect | |
parent | 7cbd509b6ca5522b33c8bf299468ec1be9052416 (diff) | |
download | vim-polyglot-2.4.0.tar.gz vim-polyglot-2.4.0.zip |
Add ansible support, closes #96v2.4.0
Diffstat (limited to 'ftdetect')
-rw-r--r-- | ftdetect/polyglot.vim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index fdb540e2..ee6cd63a 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -1,3 +1,18 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1 + +function! DetectAnsible() + let filepath = expand("%:p") + let filename = expand("%:t") + if filepath =~ '\v/(tasks|roles)/.*\.ya?ml$' || filepath =~ '\v/(group|host)_vars/' || filename =~ '\v(playbook|site)\.ya?ml$' + set ft=ansible + endif + unlet filepath + unlet filename +endfunction +:au BufNewFile,BufRead *.yml,*yaml,*/{group,host}_vars/* call DetectAnsible() +:au BufNewFile,BufRead *.j2 set ft=ansible_template +:au BufNewFile,BufRead hosts set ft=ansible_hosts +endif if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'arduino') == -1 au BufRead,BufNewFile *.ino,*.pde set filetype=arduino |