Skip to content

Instantly share code, notes, and snippets.

@zealot128
Last active December 24, 2015 18:19
Show Gist options
  • Save zealot128/6842500 to your computer and use it in GitHub Desktop.
Save zealot128/6842500 to your computer and use it in GitHub Desktop.
vim ansible specific yaml highlightings
augroup ansible_yaml
autocmd!
au BufRead playbook.yml,roles/*yml,ansible*yml call SetAnsibleOpts()
augroup END
function SetAnsibleOpts()
syntax match yamlInterpolate '$\w\+\|{{[^}]\+}}'
syntax match yamlInterpolate '$\w\+\|{{[^}]\+}}' contained containedin=yamlString
syntax match yamlConstant '\(with_items\|when\|name\|notify\|ignore_errors\|changed_when\|register\|with_password\):'
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment