Add syntax highlighting to source code filters
Presuming source code filters use the .tmpl extension it would be nice if the syntax highlighting could be applied despite all the actual nimrod code being behind a first column of hashes styling everything else as comment. Though it would be even more useful if there was a keyboard mapping to invert the syntax highlighting to the nimrod code or to the other code, using some default for C/HTML/JS syntax.
With this keyboard mapping you could decide what part of the code you want to focus on and the highlighting would follow.
The first part is rather easy. A small change to the ftdetect plugin will suffice: https://github.com/zah/nimrod.vim/blob/master/ftdetect/nimrod.vim
There are couple of options for the more advanced version that can be explored:
-
Using syntax highlighting with nested regions: http://vim.wikia.com/wiki/Different_syntax_highlighting_within_regions_of_a_file
-
Using multiple filetypes in the same buffer: http://stackoverflow.com/questions/2601403/multiple-file-types-in-vim
Sorry, the previous commit referenced the wrong issue.