kirbysayshi/vash

Recommended way to edit Vash views?

Closed this issue · 7 comments

Hi,

I am trying to use Visual Studio for Node.js web project. Project uses Express and default view template is Jade.

Since I usually work with ASP.NET, Vash looks as ideal choice.

Please let me know is there any way I could achieve syntax highlighting of .vash files and intellisense? In other words, what is recommended way to edit .vash files to get max efficiency?

The best I got is to go Tools -> Options -> Text Editor -> File Extension and add Html Editor as Editing Experience for .vash extension.

Do you know anything smarter than that? :)

Thanks!

Hey boris!

I currently don't know of a better way. Intellisense will likely be very difficult, since it would require writing at least some sort of visual studio syntax plugin (editor?). One thing that might be worth looking into is if someone has written a VS plugin/syntax for Knockout or Angular, which both have some "custom" mode switches that are slightly similar to Vash.

Please let me know if you find something!

One way around, for syntax highlighting, would be to keep two files:
index.vash.html and index.vash (I know, not a bright idea, but it works for now...)

I would edit the index.vash.html file with syntax highlighting and once I am happy with it, I just copy and paste the content into the index.vash file.

It would have been nice if vash itself had the default extension as *.vash.html instead of just *.vash, or an overridable setting for the extension...

HTH

@kshetty If you're using express, it's easy to override the default extension (http://expressjs.com/4x/api.html#app.engine):

app.engine('vash.html', require('vash').__express);

This would cause express to load up filename.vash.html automatically when loading views.

But I'm confused, is there no way to just set a filetype, like .vash as using a particular syntax mode?

@kirbysayshi Thanks for pointing out the override setting for default extension in express.

Maybe there is a way to set a filetype for syntax mode in VS, but is not a priority for me anymore, now that you mention the override setting! ;)

No problem, glad to help!

I've always wanted to provide proper syntax highlighting for various
editors, but the nature of vash's syntax means it's really hard to do with
just regexes.
On Fri, Jul 10, 2015 at 12:26 PM Kaush notifications@github.com wrote:

@kirbysayshi https://github.com/kirbysayshi Thanks for pointing out the
override setting for default extension in express.

Maybe there is a way to set a filetype for syntax mode in VS, but is not a
priority for me anymore, now that you mention the override setting! ;)


Reply to this email directly or view it on GitHub
#69 (comment).

And you've done a good job mate, keep up the good work!

I come from a .Net background, so it is always welcome to use the same razor syntax.
I've probably just scratched the surface of vash and it already seems good, will definitely be sticking to it.

Closing, feel free to reopen if needed!