I\'m using jinja template language to generate html and javascript for a website. How can I make vim understand that everything between \'{{\'/\'}}\' and
For the syntax, my SyntaxRange plugin makes the setup as simple as a single function call.
For different filetype settings like indentation options, you have to install an :autocmd CursorMoved,CursorMovedI that checks into which region the current line falls (maybe using the syntax for hints, e.g. with synID()), and then swaps the option values depending on the result.
Edit: For your particular use case, that would be something like:
:call SyntaxRange#Include('{{', '}}', 'jinja')
:call SyntaxRange#Include('{%', '%}', 'jinja')
which you could put into ~/.vim/after/syntax/javascript.vim to apply it automatically to all JavaScript files.