From cfcb2c0c123e72937a20f4894ba67bd7c33ccb51 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Thu, 19 Feb 2026 12:00:05 +0100 Subject: [PATCH] match the whole path when detecting ansible files 1. the `.` is not interpreted as "any char" like in a regex, so replace it with a `/` to match roles/handlers/tasks directories 2. sometimes the roles/handlers/tasks are in a sub-directory, so add a `*/` in front of those --- autoload/polyglot/init.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/polyglot/init.vim b/autoload/polyglot/init.vim index 9e991f36..a9c5d3d6 100644 --- a/autoload/polyglot/init.vim +++ b/autoload/polyglot/init.vim @@ -1827,7 +1827,7 @@ if !has_key(g:polyglot_is_disabled, 'smarty') endif if !has_key(g:polyglot_is_disabled, 'ansible') - au BufNewFile,BufRead handlers.*.y{a,}ml,local.y{a,}ml,main.y{a,}ml,playbook.y{a,}ml,requirements.y{a,}ml,roles.*.y{a,}ml,site.y{a,}ml,tasks.*.y{a,}ml setf yaml.ansible + au BufNewFile,BufRead */handlers/*.y{a,}ml,local.y{a,}ml,main.y{a,}ml,playbook.y{a,}ml,requirements.y{a,}ml,*/roles/*.y{a,}ml,site.y{a,}ml,*/tasks/*.y{a,}ml setf yaml.ansible au BufNewFile,BufRead host_vars/* call s:StarSetf('yaml.ansible') au BufNewFile,BufRead group_vars/* call s:StarSetf('yaml.ansible') endif