Skip to content

Add syntax highlighting to source code filters #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
gradha opened this issue Mar 26, 2013 · 2 comments
Open

Add syntax highlighting to source code filters #6

gradha opened this issue Mar 26, 2013 · 2 comments

Comments

@gradha
Copy link

gradha commented Mar 26, 2013

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.

@ghost ghost assigned zah Mar 27, 2013
@zah
Copy link
Owner

zah commented Mar 27, 2013

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 added a commit that referenced this issue Dec 9, 2013
@zah
Copy link
Owner

zah commented Dec 9, 2013

Sorry, the previous commit referenced the wrong issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants