Skip to content

Commit 30f307f

Browse files
authored
add 'loop' to highlighted keywords (#103)
* 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
1 parent fa0192f commit 30f307f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Accepts any syntax group-name from `:help E669` - e.g. _Comment_, _Constant_, an
113113

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

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

118118
##### g:ansible_template_syntaxes
119119
`let g:ansible_template_syntaxes = { '*.rb.j2': 'ruby' }`

syntax/ansible.vim

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,11 @@ else
101101
highlight default link ansible_with_keywords Statement
102102
endif
103103

104+
execute 'syn keyword ansible_with_keywords loop containedin='.s:yamlKey.' contained'
105+
if exists("g:ansible_with_keywords_highlight")
106+
execute 'highlight link ansible_with_keywords '.g:ansible_with_keywords_highlight
107+
else
108+
highlight default link ansible_with_keywords Statement
109+
endif
110+
104111
let b:current_syntax = "ansible"

0 commit comments

Comments
 (0)