The jinja2 syntax highlighting doesn't automatically pick up on the root filetype. I tried to use backrefs to help with this, but it doesn't seem to work.
let g:ansible_template_syntaxes = { '\(.*\)\.\(.*\)\.j2': '\2' }
I know with vim, you need to escape the parentheses for capturing groups, but I tried 'em unescaped, too. Here's the breakdown:
\(.*\) - Capture Group 1, the filename
\. - A literal dot
\(.*\) - Capture Group 2, the root filetype
\.j2 - The j2 filetype
The value of the setting should be \2, whatever was in Capture Group 2.
The jinja2 syntax highlighting doesn't automatically pick up on the root filetype. I tried to use backrefs to help with this, but it doesn't seem to work.
let g:ansible_template_syntaxes = { '\(.*\)\.\(.*\)\.j2': '\2' }
I know with vim, you need to escape the parentheses for capturing groups, but I tried 'em unescaped, too. Here's the breakdown:
\(.*\)
- Capture Group 1, the filename\.
- A literal dot\(.*\)
- Capture Group 2, the root filetype\.j2
- The j2 filetypeThe value of the setting should be
\2
, whatever was in Capture Group 2.