Skip to content

Commit

Permalink
add 'loop' to highlighted keywords (#103)
Browse files Browse the repository at this point in the history
* add 'loop' to highlighted keywords

Just add highlight for the keyword `loop` which can be used instead of `with_<lookup> since ansible 2.5 : https://docs.ansible.com/ansible/latest/user_guide/playbooks_loops.html

Co-authored-by: masao77
  • Loading branch information
masao77 committed Jul 12, 2020
1 parent fa0192f commit 30f307f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -113,7 +113,7 @@ Accepts any syntax group-name from `:help E669` - e.g. _Comment_, _Constant_, an

*Note:* Defaults to 'Statement' when not set.

This option changes the highlight of all `with_.+` keywords in playbooks.
This option changes the highlight of all `with_.+` keywords and `loop` in playbooks.

##### g:ansible_template_syntaxes
`let g:ansible_template_syntaxes = { '*.rb.j2': 'ruby' }`
Expand Down
7 changes: 7 additions & 0 deletions syntax/ansible.vim
Expand Up @@ -101,4 +101,11 @@ else
highlight default link ansible_with_keywords Statement
endif

execute 'syn keyword ansible_with_keywords loop containedin='.s:yamlKey.' contained'
if exists("g:ansible_with_keywords_highlight")
execute 'highlight link ansible_with_keywords '.g:ansible_with_keywords_highlight
else
highlight default link ansible_with_keywords Statement
endif

let b:current_syntax = "ansible"

0 comments on commit 30f307f

Please sign in to comment.