I've got a kind of polyglot filetype that can have embedded C, python, ruby, etc in it (think 'wiki page' if it helps). Is there a way to execute the autocommands for a known filetype on a region of the file?
For example, I might have:
#!bash
if [ a = b ]; then
echo 'equal'
fi
#!python
if a = b:
print('equal')
And I want to apply bash filetype autocommands to the first part and python filetype autocommands to the latter part.
I can get just syntax hilighting by defining a region using this method, but I don't understand autocommands enough to be able to apply them in a similar way.