Lit-html: Syntax Highlighting for vim

Created on 4 Mar 2018  路  8Comments  路  Source: Polymer/lit-html

Hello i found syntax highlighters for visual studio code and atom but non for vim does anyone know of any projects?

Low

Most helpful comment

Update that may be relevant to anyone paying attention to this thread. I forked another plugin and created one that can support arbitrary syntaxes inside of tagged template strings. Check it out here: https://github.com/cdata/vim-tagged-template

Demo of what it can achieve:

taggedtemplates

It's probably super buggy. Feedback would be appreciated if you use it!

All 8 comments

I'm not really sure, since I'm not a regular vim user. @cdata or @aomarks?

Not that I am aware of. As a long-time Vim user, I have found mixed-mode syntax highlighting to be one of Vim's weak spots. Let us know if you learn anything on this topic!

I'll close this for now as I don't think there's much we can do from this end right now.

I copied mxw/vim-jsx and got xml syntax highlighting inside html`...`. It's a start (doesn't support autoindent or nested css). See ~jonsmithers/experimental-vim-javascript-with-lit-html~ jonsmithers/experimental-lit-html-vim

Update that may be relevant to anyone paying attention to this thread. I forked another plugin and created one that can support arbitrary syntaxes inside of tagged template strings. Check it out here: https://github.com/cdata/vim-tagged-template

Demo of what it can achieve:

taggedtemplates

It's probably super buggy. Feedback would be appreciated if you use it!

I tried it and for Polymer 3 it is not highlighting. I will post a bug on there with a screen shot.

Please keep Polymer decoupled from Microsoft. After Angular and typescript and now this, there a legitimate concern.. After years of using Polymer, I will switch to React if it goes down this road.

@cdata Why didn't you fork https://github.com/pangloss/vim-javascript instead of vim-js-pretty-template? The former is the de facto in the VIM with JS community.

The vim-javascript plugin is a lot better because it parses more and has more syntax objects for custom highlighting.

As a long-time Vim user, I have found mixed-mode syntax highlighting to be one of Vim's weak spots.

While I have issues with mixing the two on .js files, on Polymer 1 .html files I never had any issues mixing both vim-javascript and html5.vim. Because of this, I don't think that statement is correct.

At this point I am hoping vim-html-template-literals gets it's indention fixed so I can use that. There's no way I want to use vim-js-pretty-template on my node files...and I can't use both vim-javascript with it.

Whoever marked the status as available, can that be removed and this issue reopen? Tech. I can't use ether one of these....the cost is to high.

Also, the priority on this should be high. The fact that it works in VS in typescript sends a message that there is a MS investment and I have to use MS products to use Polymer.

UPDATE

For anyone reading this using VIM, use https://github.com/jonsmithers/vim-html-template-literals. It is now fully working and works great!

Was this page helpful?
0 / 5 - 0 ratings