nim.vim icon indicating copy to clipboard operation
nim.vim copied to clipboard

Add syntax highlighting to source code filters

Open gradha opened this issue 12 years ago • 2 comments

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.

gradha avatar Mar 26 '13 22:03 gradha

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:

  1. Using syntax highlighting with nested regions: http://vim.wikia.com/wiki/Different_syntax_highlighting_within_regions_of_a_file

  2. Using multiple filetypes in the same buffer: http://stackoverflow.com/questions/2601403/multiple-file-types-in-vim

zah avatar Mar 27 '13 08:03 zah

Sorry, the previous commit referenced the wrong issue.

zah avatar Dec 09 '13 23:12 zah