As far as I know, there's no way to get good NVelocity syntax highlighting for Visual Studio 2010 that preserves html, css and javascript highlighting as well, so the way I do it is to go to Tools > Options > Text Editor > File Extension and add vm to HTML Editor.
This works fine, I don't really need syntax highlighting for #if #else etc, but if the document begins with #, it will break the HTML Editor syntax.
## Some comment, or anything with #NVelocity syntax
<div>this will not have syntax highlighting</div>
However, it WILL work if I put any first, like this
<!-- Unwanted comment -->
## Some comment, or anything with #NVelocity syntax
Anyone have any idea how to make it work with # in the beginning of the document?
Related
Im new to ZURB Foundation 6 and its Foundation CLI. Using the template engine works like a charm though, except for the syntax highlighting so far.
Here is a screenshot:
https://imgur.com/P1MCv3X
As you can see, highlighting the beginning and end of an HTML Element doesnt work anymore when Im using the template engine syntax with the double brackets. The site works perfectly, so this erroneous interpretation of the HTML structure is a problem of the editor.
Is there any way to work around this issue in ATOM? Or do I have to live with it?
When you're using a templating engine such as Handlebars (which ZURB seems to use), you need to install a language syntax for that. There are several available, you need to find out for yourself which one works best for you.
Once installed, you either need to work with .hbs files for automatic detection, or you have to specify the syntax manually by clicking on the dialog that reads "HTML" on your screenshot (in the bottom right).
GoLand has syntax support on Go html files with the file extension of .gohtml
So what about Go text files? Does GoLand support that as well? .tmpl is supported by vim-go but not GoLand.
As mkopriva has already hinted and you have described as well in the comments, you can go to Preferences/Editor/File Types and add your custom ending as Registered pattern to the Go Template. But imo the real game changer is that you can also set Go as Template data language there. This way even the Go syntax gets validated, not just the template syntax. It's still wonky, but definitly better than nothing.
Still, autoformatting does not work properly and can screw up your code. Therefore, you might also want to make sure the Reformat code in the commit dialog is unchecked. Same with Optimize Imports ... better keep it unchecked.
there are two parts to this answer to get both html highlighting and go template highlighting
go template highlighting:
settings > editor > file types > select Go template files from the list > update pattern to the file ending you use for your go templates. I used *.go.html
html highlighting
settings > template data languages > project language (dropdown at the top) > set to html
now you have both html highlighting and go template completion
I'm using Kate as the editor of my Node.js projects. In the Node.js projects, I sometimes prefer to code whole index.html in a single file. At that time, I need to use:
html
css (<style>...</style>)
livescript (<script type="text/ls">...</script>)
javascript (<script [type="text/javascript"]>...</script>)
at the same time. Kate can highlight these codes if they are in their separate files.
How can I make the code highlighted correctly when they are mixed in a single file (preferably in Kate, or any other editor that would run on Linux)?
Kate can do this, too. It is supported in e.g. HTML/PHP highlighting and similar. Just have a look into the respective highlighting xml files to get an idea how to implement a highlighting for this. More information about how to write syntax highlighting files can be found in the KatePart Handbook.
I'm experimenting with BEM syntax on a project that uses SCSS. My editor is Sublime Text 3 and I'm using SCSS syntax highlighting.
The problem I'm experiencing is that when I nest using the & parent selector as per this article by Mike Fowler, Sublime highlights it red. Here is an example:
The code compiles fine, I'd just prefer that Sublime not flag these as errors.
Can anyone help config Sublime to do just that?
I suggest using the Syntax Highlighting for Sass package for syntax highlighting. Using it and the Neon Color Scheme, which fully supports all the scopes in the Syntax Highlighting for Sass package (disclaimer: I'm the theme's maintainer), your code looks like this:
with no errors (green is a class name, and & is recognized as a special SASS/SCSS symbol). I'm not sure what package you're currently using for SCSS highlighting, but it obviously doesn't recognize the leading -- characters, or anything following leading __ characters, as valid. Switching over to the new syntax highlighting package should help.
I fixed this when I had this issue by selecting View>Syntax>SASS>SCSS This is apparently caused by downloading the original SASS package Sublime.
I have a lot of templates that are enclosed within script tags. They are pure html, but Visual Studio grays them out. I don't have any in-line Javascript so if Visual Studio simply ignored the script tag and treated the contents inside as it would a normal html document would be really nice. I've grown accustomed to CSS class intellisense and nice code formatting.
This is a long shot, anyway this is possible? Right now I'm marking up my HTML then putting it within the script tag, but was hoping for a better solution.
You can insert a space after the opening bracket of the opening SCRIPT tag to enable HTML IDE support and when your done, just remove the space.
< script>
^leave space
<div>HTML is supported</div>
</script>
<script>
^no space
<div>HTML is NOT supported here</div>
</script>