Skip to content

Instantly share code, notes, and snippets.

@mmriis
Created December 22, 2016 09:00
Show Gist options
  • Save mmriis/5930d2d6766deb40c3019ce9336efdce to your computer and use it in GitHub Desktop.
Save mmriis/5930d2d6766deb40c3019ce9336efdce to your computer and use it in GitHub Desktop.
au BufNewFile,BufRead *.yml,*.yaml call s:DetectAnsibleVault()
fun! s:DetectAnsibleVault()
let n=1
while n<10 && n < line("$")
if getline(n) =~ 'ANSIBLE_VAULT'
set filetype=ansible-vault
endif
let n = n + 1
endwhile
endfun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment