Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions syntax/ansible.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: Ansible YAML/Jinja templates
" Maintainer: Dave Honneffer <[email protected]>
" Last Change: 2018.02.08
" Last Change: 2023.10.18

if !exists("main_syntax")
let main_syntax = 'yaml'
Expand Down Expand Up @@ -79,7 +79,7 @@ if exists("g:ansible_name_highlight")
endif
endif

execute 'syn keyword ansible_debug_keywords debug containedin='.s:yamlKey.' contained'
execute 'syn match ansible_debug_keywords "\%(ansible\.builtin\.\)\?debug" containedin='.s:yamlKey.' contained'
highlight default link ansible_debug_keywords Debug

if exists("g:ansible_extra_keywords_highlight")
Expand All @@ -99,11 +99,12 @@ if exists("g:ansible_extra_keywords_highlight")
endif
endif

execute 'syn keyword ansible_normal_keywords
\ include include_role include_tasks include_vars import_role import_playbook import_tasks
\ when changed_when failed_when block rescue always notify listen register
\ action local_action post_tasks pre_tasks tasks handlers roles collections
\ containedin='.s:yamlKey.' contained'
execute 'syn match ansible_normal_keywords "'.
\ '\%(ansible\.builtin\.\)\?'.
\ '\%(include\|include_role\|include_tasks\|include_vars\|import_role\|import_playbook\|import_tasks\|'.
\ 'when\|changed_when\|failed_when\|block\|rescue\|always\|notify\|listen\|register\|'.
\ 'action\|local_action\|post_tasks\|pre_tasks\|tasks\|handlers\|roles\|collections\)'.
\ ':" containedin='.s:yamlKey.' contained'
if exists("g:ansible_normal_keywords_highlight")
execute 'highlight link ansible_normal_keywords '.g:ansible_normal_keywords_highlight
else
Expand Down